@finsweet/webflow-apps-utils 1.0.1
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/README.md +45 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/router/Link.svelte +166 -0
- package/dist/router/Link.svelte.d.ts +26 -0
- package/dist/router/README.md +397 -0
- package/dist/router/Route.svelte +82 -0
- package/dist/router/Route.svelte.d.ts +24 -0
- package/dist/router/Router.svelte +71 -0
- package/dist/router/Router.svelte.d.ts +20 -0
- package/dist/router/hooks.svelte.d.ts +77 -0
- package/dist/router/hooks.svelte.js +148 -0
- package/dist/router/index.svelte.d.ts +107 -0
- package/dist/router/index.svelte.js +400 -0
- package/dist/stores/breakpoints.d.ts +10 -0
- package/dist/stores/breakpoints.js +2 -0
- package/dist/stores/componentInjectErrors.d.ts +1 -0
- package/dist/stores/componentInjectErrors.js +2 -0
- package/dist/stores/forms.d.ts +110 -0
- package/dist/stores/forms.js +307 -0
- package/dist/stores/globalStore.d.ts +10 -0
- package/dist/stores/globalStore.js +10 -0
- package/dist/stores/index.d.ts +7 -0
- package/dist/stores/index.js +7 -0
- package/dist/stores/router.d.ts +4 -0
- package/dist/stores/router.js +5 -0
- package/dist/stores/showConfirmActionModal.d.ts +1 -0
- package/dist/stores/showConfirmActionModal.js +2 -0
- package/dist/stores/siteInfo.d.ts +13 -0
- package/dist/stores/siteInfo.js +2 -0
- package/dist/types/auth.d.ts +40 -0
- package/dist/types/auth.js +1 -0
- package/dist/types/customCode.d.ts +16 -0
- package/dist/types/customCode.js +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +5 -0
- package/dist/types/license.d.ts +5 -0
- package/dist/types/license.js +1 -0
- package/dist/types/webflow.d.ts +125 -0
- package/dist/types/webflow.js +1 -0
- package/dist/types/window.d.ts +14 -0
- package/dist/types/window.js +1 -0
- package/dist/ui/components/ButtonGroup.svelte +106 -0
- package/dist/ui/components/ButtonGroup.svelte.d.ts +28 -0
- package/dist/ui/components/Checkbox.svelte +94 -0
- package/dist/ui/components/Checkbox.svelte.d.ts +36 -0
- package/dist/ui/components/Copy.svelte +329 -0
- package/dist/ui/components/Copy.svelte.d.ts +35 -0
- package/dist/ui/components/CustomModal.svelte +192 -0
- package/dist/ui/components/CustomModal.svelte.d.ts +45 -0
- package/dist/ui/components/DisableInEditMode.svelte +66 -0
- package/dist/ui/components/DisableInEditMode.svelte.d.ts +33 -0
- package/dist/ui/components/Divider.svelte +31 -0
- package/dist/ui/components/Divider.svelte.d.ts +31 -0
- package/dist/ui/components/Header.svelte +30 -0
- package/dist/ui/components/Header.svelte.d.ts +20 -0
- package/dist/ui/components/Iframe.svelte +89 -0
- package/dist/ui/components/Iframe.svelte.d.ts +40 -0
- package/dist/ui/components/ImageUpload.svelte +213 -0
- package/dist/ui/components/ImageUpload.svelte.d.ts +42 -0
- package/dist/ui/components/InjectComponent.svelte +297 -0
- package/dist/ui/components/InjectComponent.svelte.d.ts +27 -0
- package/dist/ui/components/Loader.svelte +68 -0
- package/dist/ui/components/Loader.svelte.d.ts +24 -0
- package/dist/ui/components/LoadingScreen.svelte +71 -0
- package/dist/ui/components/LoadingScreen.svelte.d.ts +26 -0
- package/dist/ui/components/Modal.svelte +139 -0
- package/dist/ui/components/Modal.svelte.d.ts +42 -0
- package/dist/ui/components/Navbar.svelte +132 -0
- package/dist/ui/components/Navbar.svelte.d.ts +29 -0
- package/dist/ui/components/NoSettingsNeeded.svelte +31 -0
- package/dist/ui/components/NoSettingsNeeded.svelte.d.ts +18 -0
- package/dist/ui/components/Notification.svelte +193 -0
- package/dist/ui/components/Notification.svelte.d.ts +64 -0
- package/dist/ui/components/PlusMinusButton.svelte +91 -0
- package/dist/ui/components/PlusMinusButton.svelte.d.ts +22 -0
- package/dist/ui/components/PreviewBar.svelte +40 -0
- package/dist/ui/components/PreviewBar.svelte.d.ts +20 -0
- package/dist/ui/components/ScrollableContent.svelte +18 -0
- package/dist/ui/components/ScrollableContent.svelte.d.ts +31 -0
- package/dist/ui/components/Section.svelte +97 -0
- package/dist/ui/components/Section.svelte.d.ts +50 -0
- package/dist/ui/components/SelectBodyOrDivBlock.svelte +26 -0
- package/dist/ui/components/SelectBodyOrDivBlock.svelte.d.ts +26 -0
- package/dist/ui/components/Spacer.svelte +9 -0
- package/dist/ui/components/Spacer.svelte.d.ts +22 -0
- package/dist/ui/components/SpinnerPlusMinus.svelte +75 -0
- package/dist/ui/components/SpinnerPlusMinus.svelte.d.ts +23 -0
- package/dist/ui/components/SpinnerUpDown.svelte +194 -0
- package/dist/ui/components/SpinnerUpDown.svelte.d.ts +31 -0
- package/dist/ui/components/Tabs.svelte +71 -0
- package/dist/ui/components/Tabs.svelte.d.ts +26 -0
- package/dist/ui/components/ToggleItem.svelte +29 -0
- package/dist/ui/components/ToggleItem.svelte.d.ts +28 -0
- package/dist/ui/components/ToggleList.svelte +57 -0
- package/dist/ui/components/ToggleList.svelte.d.ts +39 -0
- package/dist/ui/components/breakpoints/BreakpointItem.svelte +84 -0
- package/dist/ui/components/breakpoints/BreakpointItem.svelte.d.ts +37 -0
- package/dist/ui/components/breakpoints/breakpointOptions.d.ts +12 -0
- package/dist/ui/components/breakpoints/breakpointOptions.js +38 -0
- package/dist/ui/components/breakpoints/index.d.ts +3 -0
- package/dist/ui/components/breakpoints/index.js +3 -0
- package/dist/ui/components/button/Button.stories.svelte +275 -0
- package/dist/ui/components/button/Button.stories.svelte.d.ts +27 -0
- package/dist/ui/components/button/Button.svelte +389 -0
- package/dist/ui/components/button/Button.svelte.d.ts +84 -0
- package/dist/ui/components/button/index.d.ts +2 -0
- package/dist/ui/components/button/index.js +1 -0
- package/dist/ui/components/button/types.d.ts +23 -0
- package/dist/ui/components/button/types.js +1 -0
- package/dist/ui/components/buttons/FooterButton.svelte +277 -0
- package/dist/ui/components/buttons/FooterButton.svelte.d.ts +10 -0
- package/dist/ui/components/buttons/index.d.ts +5 -0
- package/dist/ui/components/buttons/index.js +5 -0
- package/dist/ui/components/buttons/types.d.ts +28 -0
- package/dist/ui/components/buttons/types.js +1 -0
- package/dist/ui/components/clickable/Clickable.stories.svelte +213 -0
- package/dist/ui/components/clickable/Clickable.stories.svelte.d.ts +27 -0
- package/dist/ui/components/clickable/Clickable.svelte +93 -0
- package/dist/ui/components/clickable/Clickable.svelte.d.ts +4 -0
- package/dist/ui/components/clickable/index.d.ts +2 -0
- package/dist/ui/components/clickable/index.js +1 -0
- package/dist/ui/components/clickable/types.d.ts +17 -0
- package/dist/ui/components/clickable/types.js +1 -0
- package/dist/ui/components/index.d.ts +46 -0
- package/dist/ui/components/index.js +46 -0
- package/dist/ui/components/input/Input.stories.d.ts +109 -0
- package/dist/ui/components/input/Input.stories.js +337 -0
- package/dist/ui/components/input/Input.svelte +422 -0
- package/dist/ui/components/input/Input.svelte.d.ts +4 -0
- package/dist/ui/components/input/index.d.ts +2 -0
- package/dist/ui/components/input/index.js +1 -0
- package/dist/ui/components/input/types.d.ts +109 -0
- package/dist/ui/components/input/types.js +1 -0
- package/dist/ui/components/layout/ExampleLayout.svelte +538 -0
- package/dist/ui/components/layout/ExampleLayout.svelte.d.ts +3 -0
- package/dist/ui/components/layout/Layout.stories.svelte +24 -0
- package/dist/ui/components/layout/Layout.stories.svelte.d.ts +18 -0
- package/dist/ui/components/layout/Layout.svelte +551 -0
- package/dist/ui/components/layout/Layout.svelte.d.ts +30 -0
- package/dist/ui/components/layout/common/EditModeMessage.svelte +59 -0
- package/dist/ui/components/layout/common/EditModeMessage.svelte.d.ts +3 -0
- package/dist/ui/components/layout/common/index.d.ts +1 -0
- package/dist/ui/components/layout/common/index.js +1 -0
- package/dist/ui/components/layout/index.d.ts +3 -0
- package/dist/ui/components/layout/index.js +2 -0
- package/dist/ui/components/layout/types.d.ts +59 -0
- package/dist/ui/components/layout/types.js +1 -0
- package/dist/ui/components/select/Select.stories.d.ts +94 -0
- package/dist/ui/components/select/Select.stories.js +396 -0
- package/dist/ui/components/select/Select.svelte +705 -0
- package/dist/ui/components/select/Select.svelte.d.ts +11 -0
- package/dist/ui/components/select/index.d.ts +2 -0
- package/dist/ui/components/select/index.js +1 -0
- package/dist/ui/components/select/types.d.ts +94 -0
- package/dist/ui/components/select/types.js +1 -0
- package/dist/ui/components/switch/Switch.stories.d.ts +58 -0
- package/dist/ui/components/switch/Switch.stories.js +198 -0
- package/dist/ui/components/switch/Switch.svelte +220 -0
- package/dist/ui/components/switch/Switch.svelte.d.ts +4 -0
- package/dist/ui/components/switch/index.d.ts +2 -0
- package/dist/ui/components/switch/index.js +1 -0
- package/dist/ui/components/switch/types.d.ts +47 -0
- package/dist/ui/components/switch/types.js +1 -0
- package/dist/ui/components/text/README.md +73 -0
- package/dist/ui/components/text/Text.stories.svelte +203 -0
- package/dist/ui/components/text/Text.stories.svelte.d.ts +27 -0
- package/dist/ui/components/text/Text.svelte +778 -0
- package/dist/ui/components/text/Text.svelte.d.ts +8 -0
- package/dist/ui/components/text/index.d.ts +3 -0
- package/dist/ui/components/text/index.js +2 -0
- package/dist/ui/components/text/types.d.ts +46 -0
- package/dist/ui/components/text/types.js +1 -0
- package/dist/ui/components/tooltip/Tooltip.stories.svelte +128 -0
- package/dist/ui/components/tooltip/Tooltip.stories.svelte.d.ts +27 -0
- package/dist/ui/components/tooltip/Tooltip.svelte +463 -0
- package/dist/ui/components/tooltip/Tooltip.svelte.d.ts +7 -0
- package/dist/ui/components/tooltip/index.d.ts +2 -0
- package/dist/ui/components/tooltip/index.js +1 -0
- package/dist/ui/components/tooltip/types.d.ts +114 -0
- package/dist/ui/components/tooltip/types.js +1 -0
- package/dist/ui/icons/AccordionDownArrow.svelte +8 -0
- package/dist/ui/icons/AccordionDownArrow.svelte.d.ts +26 -0
- package/dist/ui/icons/AccordionUpArrow.svelte +8 -0
- package/dist/ui/icons/AccordionUpArrow.svelte.d.ts +26 -0
- package/dist/ui/icons/AccountIcon.svelte +14 -0
- package/dist/ui/icons/AccountIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ArrowIcon.svelte +6 -0
- package/dist/ui/icons/ArrowIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/BackIcon.svelte +8 -0
- package/dist/ui/icons/BackIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/BodyIcon.svelte +8 -0
- package/dist/ui/icons/BodyIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/BookmarkIcon.svelte +13 -0
- package/dist/ui/icons/BookmarkIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/BoxAddIcon.svelte +8 -0
- package/dist/ui/icons/BoxAddIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/BrushIcon.svelte +10 -0
- package/dist/ui/icons/BrushIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/BuilderEditIcon.svelte +12 -0
- package/dist/ui/icons/BuilderEditIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/BuilderIcon.svelte +14 -0
- package/dist/ui/icons/BuilderIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CMSIcon.svelte +8 -0
- package/dist/ui/icons/CMSIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CheckCircleIcon.svelte +8 -0
- package/dist/ui/icons/CheckCircleIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CheckCircleOutlinedIcon.svelte +15 -0
- package/dist/ui/icons/CheckCircleOutlinedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CheckIcon.svelte +9 -0
- package/dist/ui/icons/CheckIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CheckboxCheckedIcon.svelte +15 -0
- package/dist/ui/icons/CheckboxCheckedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ChevronIcon.svelte +8 -0
- package/dist/ui/icons/ChevronIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ChevronRightIcon.svelte +8 -0
- package/dist/ui/icons/ChevronRightIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CircleIcon.svelte +3 -0
- package/dist/ui/icons/CircleIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CloseCircleIcon.svelte +6 -0
- package/dist/ui/icons/CloseCircleIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CloseIcon.svelte +8 -0
- package/dist/ui/icons/CloseIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CodeIcon.svelte +8 -0
- package/dist/ui/icons/CodeIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ComponentsIcon.svelte +7 -0
- package/dist/ui/icons/ComponentsIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CookieIcon.svelte +15 -0
- package/dist/ui/icons/CookieIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/CopyIcon.svelte +19 -0
- package/dist/ui/icons/CopyIcon.svelte.d.ts +20 -0
- package/dist/ui/icons/CrossIcon.svelte +4 -0
- package/dist/ui/icons/CrossIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/DOMElement.svelte +19 -0
- package/dist/ui/icons/DOMElement.svelte.d.ts +28 -0
- package/dist/ui/icons/DeleteIcon.svelte +8 -0
- package/dist/ui/icons/DeleteIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/DeleteOutlinedIcon.svelte +8 -0
- package/dist/ui/icons/DeleteOutlinedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/Desktop.svelte +19 -0
- package/dist/ui/icons/Desktop.svelte.d.ts +21 -0
- package/dist/ui/icons/DesktopWithStar.svelte +21 -0
- package/dist/ui/icons/DesktopWithStar.svelte.d.ts +21 -0
- package/dist/ui/icons/DivBlock.svelte +14 -0
- package/dist/ui/icons/DivBlock.svelte.d.ts +28 -0
- package/dist/ui/icons/EditIcon.svelte +15 -0
- package/dist/ui/icons/EditIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ExpertIcon.svelte +16 -0
- package/dist/ui/icons/ExpertIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/EyeCancelIcon.svelte +12 -0
- package/dist/ui/icons/EyeCancelIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/EyeIcon.svelte +12 -0
- package/dist/ui/icons/EyeIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FavouriteIcon.svelte +6 -0
- package/dist/ui/icons/FavouriteIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FileUploadIcon.svelte +18 -0
- package/dist/ui/icons/FileUploadIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FilterIcon.svelte +8 -0
- package/dist/ui/icons/FilterIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FinsweetLibraryIcon.svelte +21 -0
- package/dist/ui/icons/FinsweetLibraryIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FinsweetLogoIcon.svelte +20 -0
- package/dist/ui/icons/FinsweetLogoIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FolderIcon.svelte +6 -0
- package/dist/ui/icons/FolderIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FolderOutlinedIcon.svelte +8 -0
- package/dist/ui/icons/FolderOutlinedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FolderPlusIcon.svelte +10 -0
- package/dist/ui/icons/FolderPlusIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/FreeComponentIcon.svelte +8 -0
- package/dist/ui/icons/FreeComponentIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/GlobeIcon.svelte +14 -0
- package/dist/ui/icons/GlobeIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/HandPointUpIcon.svelte +9 -0
- package/dist/ui/icons/HandPointUpIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/HeartIcon.svelte +8 -0
- package/dist/ui/icons/HeartIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/HeartIconOutlined.svelte +8 -0
- package/dist/ui/icons/HeartIconOutlined.svelte.d.ts +26 -0
- package/dist/ui/icons/HelpAltIcon.svelte +23 -0
- package/dist/ui/icons/HelpAltIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/HelpIcon.svelte +16 -0
- package/dist/ui/icons/HelpIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/HomeIcon.svelte +8 -0
- package/dist/ui/icons/HomeIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/InfoIcon.svelte +14 -0
- package/dist/ui/icons/InfoIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ListIcon.svelte +18 -0
- package/dist/ui/icons/ListIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/LockIcon.svelte +13 -0
- package/dist/ui/icons/LockIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/MessageIcon.svelte +10 -0
- package/dist/ui/icons/MessageIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/MobileLandscape.svelte +20 -0
- package/dist/ui/icons/MobileLandscape.svelte.d.ts +21 -0
- package/dist/ui/icons/MobilePortrait.svelte +20 -0
- package/dist/ui/icons/MobilePortrait.svelte.d.ts +21 -0
- package/dist/ui/icons/NavigatorIcon.svelte +8 -0
- package/dist/ui/icons/NavigatorIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/OpenBookIcon.svelte +8 -0
- package/dist/ui/icons/OpenBookIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PageDraftIcon.svelte +8 -0
- package/dist/ui/icons/PageDraftIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PageIcon.svelte +9 -0
- package/dist/ui/icons/PageIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PageLockedIcon.svelte +8 -0
- package/dist/ui/icons/PageLockedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PageOutlinedIcon.svelte +8 -0
- package/dist/ui/icons/PageOutlinedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PageSectionIcon.svelte +10 -0
- package/dist/ui/icons/PageSectionIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/Pencil.svelte +12 -0
- package/dist/ui/icons/Pencil.svelte.d.ts +20 -0
- package/dist/ui/icons/PencilOutlinedIcon.svelte +15 -0
- package/dist/ui/icons/PencilOutlinedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PinIcon.svelte +8 -0
- package/dist/ui/icons/PinIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PlayIcon.svelte +8 -0
- package/dist/ui/icons/PlayIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PlusIcon.svelte +8 -0
- package/dist/ui/icons/PlusIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PreviewEyeIcon.svelte +12 -0
- package/dist/ui/icons/PreviewEyeIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ProfileIcon.svelte +12 -0
- package/dist/ui/icons/ProfileIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PublishCancelIcon.svelte +8 -0
- package/dist/ui/icons/PublishCancelIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/PublishIcon.svelte +12 -0
- package/dist/ui/icons/PublishIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/RefreshIcon.svelte +10 -0
- package/dist/ui/icons/RefreshIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/RepairIcon.svelte +10 -0
- package/dist/ui/icons/RepairIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/SaveIcon.svelte +14 -0
- package/dist/ui/icons/SaveIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/SearchIcon.svelte +8 -0
- package/dist/ui/icons/SearchIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/SelectIcon.svelte +7 -0
- package/dist/ui/icons/SelectIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/SettingsIcon.svelte +8 -0
- package/dist/ui/icons/SettingsIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/SidebarToggleIcon.svelte +28 -0
- package/dist/ui/icons/SidebarToggleIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/SliderAppIcon.svelte +14 -0
- package/dist/ui/icons/SliderAppIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/SquareCheckIcon.svelte +3 -0
- package/dist/ui/icons/SquareCheckIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/StarIcon.svelte +6 -0
- package/dist/ui/icons/StarIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/StarOutlinedIcon.svelte +6 -0
- package/dist/ui/icons/StarOutlinedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/StaticContentIcon.svelte +8 -0
- package/dist/ui/icons/StaticContentIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/SubtractIcon.svelte +9 -0
- package/dist/ui/icons/SubtractIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/TabNewIcon.svelte +6 -0
- package/dist/ui/icons/TabNewIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/TableAppIcon.svelte +19 -0
- package/dist/ui/icons/TableAppIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/Tablet.svelte +20 -0
- package/dist/ui/icons/Tablet.svelte.d.ts +21 -0
- package/dist/ui/icons/TabletPreview.svelte +20 -0
- package/dist/ui/icons/TabletPreview.svelte.d.ts +21 -0
- package/dist/ui/icons/TabsIcon.svelte +17 -0
- package/dist/ui/icons/TabsIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ThreeDotsIcon.svelte +14 -0
- package/dist/ui/icons/ThreeDotsIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/TimesIcon.svelte +4 -0
- package/dist/ui/icons/TimesIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/ToolTipInfoCircleIcon.svelte +11 -0
- package/dist/ui/icons/ToolTipInfoCircleIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/TooltipInfoCircleFilled.svelte +13 -0
- package/dist/ui/icons/TooltipInfoCircleFilled.svelte.d.ts +26 -0
- package/dist/ui/icons/TooltipInfoSquaredIcon.svelte +16 -0
- package/dist/ui/icons/TooltipInfoSquaredIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/TriangleDownIcon.svelte +7 -0
- package/dist/ui/icons/TriangleDownIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/TriangleDownIconToggle.svelte +21 -0
- package/dist/ui/icons/TriangleDownIconToggle.svelte.d.ts +20 -0
- package/dist/ui/icons/UndoIcon.svelte +6 -0
- package/dist/ui/icons/UndoIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/UploadFileIcon.svelte +10 -0
- package/dist/ui/icons/UploadFileIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/WarningCircleIcon.svelte +7 -0
- package/dist/ui/icons/WarningCircleIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/WarningCircleOutlineIcon.svelte +14 -0
- package/dist/ui/icons/WarningCircleOutlineIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/WarningTriangleIcon.svelte +6 -0
- package/dist/ui/icons/WarningTriangleIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/WarningTriangleOutlineIcon.svelte +14 -0
- package/dist/ui/icons/WarningTriangleOutlineIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/WebflowComponentIcon.svelte +14 -0
- package/dist/ui/icons/WebflowComponentIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/WebflowComponentOutlinedIcon.svelte +10 -0
- package/dist/ui/icons/WebflowComponentOutlinedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/WebflowInsightsIcon.svelte +6 -0
- package/dist/ui/icons/WebflowInsightsIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/WizedLogoIcon.svelte +39 -0
- package/dist/ui/icons/WizedLogoIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/XL.svelte +19 -0
- package/dist/ui/icons/XL.svelte.d.ts +21 -0
- package/dist/ui/icons/XXL.svelte +19 -0
- package/dist/ui/icons/XXL.svelte.d.ts +21 -0
- package/dist/ui/icons/XXXL.svelte +19 -0
- package/dist/ui/icons/XXXL.svelte.d.ts +21 -0
- package/dist/ui/icons/apps/FsConsentIcon.svelte +22 -0
- package/dist/ui/icons/apps/FsConsentIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsCursorIcon.svelte +12 -0
- package/dist/ui/icons/apps/FsCursorIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsExampleIcon.svelte +10 -0
- package/dist/ui/icons/apps/FsExampleIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsInstagramFeedIcon.svelte +27 -0
- package/dist/ui/icons/apps/FsInstagramFeedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsMarqueeIcon.svelte +13 -0
- package/dist/ui/icons/apps/FsMarqueeIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsNumberCountIcon.svelte +46 -0
- package/dist/ui/icons/apps/FsNumberCountIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsSliderIcon.svelte +13 -0
- package/dist/ui/icons/apps/FsSliderIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsTablesIcon.svelte +19 -0
- package/dist/ui/icons/apps/FsTablesIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsTabsIcon.svelte +24 -0
- package/dist/ui/icons/apps/FsTabsIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsTooltipIcon.svelte +12 -0
- package/dist/ui/icons/apps/FsTooltipIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/FsYouTubeFeedIcon.svelte +43 -0
- package/dist/ui/icons/apps/FsYouTubeFeedIcon.svelte.d.ts +26 -0
- package/dist/ui/icons/apps/index.d.ts +15 -0
- package/dist/ui/icons/apps/index.js +15 -0
- package/dist/ui/icons/index.d.ts +120 -0
- package/dist/ui/icons/index.js +120 -0
- package/dist/ui/index.css +494 -0
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +2 -0
- package/dist/utils/api/checkIfAppModeIsDesign.d.ts +5 -0
- package/dist/utils/api/checkIfAppModeIsDesign.js +20 -0
- package/dist/utils/api/clipboard/handlePaste.d.ts +46 -0
- package/dist/utils/api/clipboard/handlePaste.js +53 -0
- package/dist/utils/api/clipboard/index.d.ts +1 -0
- package/dist/utils/api/clipboard/index.js +1 -0
- package/dist/utils/api/copyPaste/index.d.ts +18 -0
- package/dist/utils/api/copyPaste/index.js +1 -0
- package/dist/utils/api/getAllAssets.d.ts +12 -0
- package/dist/utils/api/getAllAssets.js +21 -0
- package/dist/utils/api/getFinsweetComponentsEnvironment.d.ts +9 -0
- package/dist/utils/api/getFinsweetComponentsEnvironment.js +70 -0
- package/dist/utils/api/index.d.ts +6 -0
- package/dist/utils/api/index.js +6 -0
- package/dist/utils/api/insertWithXSCP.d.ts +5 -0
- package/dist/utils/api/insertWithXSCP.js +13 -0
- package/dist/utils/auth/crossWindowLogin.d.ts +2 -0
- package/dist/utils/auth/crossWindowLogin.js +49 -0
- package/dist/utils/auth/index.d.ts +61 -0
- package/dist/utils/auth/index.js +196 -0
- package/dist/utils/browser-storage/index.d.ts +2 -0
- package/dist/utils/browser-storage/index.js +2 -0
- package/dist/utils/browser-storage/localStorage.d.ts +24 -0
- package/dist/utils/browser-storage/localStorage.js +56 -0
- package/dist/utils/browser-storage/sessionStorage.d.ts +24 -0
- package/dist/utils/browser-storage/sessionStorage.js +56 -0
- package/dist/utils/constants.d.ts +61 -0
- package/dist/utils/constants.js +73 -0
- package/dist/utils/custom-code/api.d.ts +17 -0
- package/dist/utils/custom-code/api.js +41 -0
- package/dist/utils/custom-code/index.d.ts +1 -0
- package/dist/utils/custom-code/index.js +1 -0
- package/dist/utils/helpers/cleanupTooltipMessage.d.ts +5 -0
- package/dist/utils/helpers/cleanupTooltipMessage.js +25 -0
- package/dist/utils/helpers/goto.d.ts +7 -0
- package/dist/utils/helpers/goto.js +35 -0
- package/dist/utils/helpers/index.d.ts +5 -0
- package/dist/utils/helpers/index.js +5 -0
- package/dist/utils/helpers/noop.d.ts +4 -0
- package/dist/utils/helpers/noop.js +7 -0
- package/dist/utils/helpers/numbers.d.ts +27 -0
- package/dist/utils/helpers/numbers.js +61 -0
- package/dist/utils/helpers/objectsToModuleExports.d.ts +9 -0
- package/dist/utils/helpers/objectsToModuleExports.js +13 -0
- package/dist/utils/helpers/trimText.d.ts +15 -0
- package/dist/utils/helpers/trimText.js +33 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/logger/index.d.ts +19 -0
- package/dist/utils/logger/index.js +41 -0
- package/dist/utils/webflow-canvas/attributes/getAllWebflowElementAttributes.d.ts +6 -0
- package/dist/utils/webflow-canvas/attributes/getAllWebflowElementAttributes.js +19 -0
- package/dist/utils/webflow-canvas/attributes/getInstanceNamesFromObject.d.ts +8 -0
- package/dist/utils/webflow-canvas/attributes/getInstanceNamesFromObject.js +21 -0
- package/dist/utils/webflow-canvas/attributes/getWebflowElementAttribute.d.ts +7 -0
- package/dist/utils/webflow-canvas/attributes/getWebflowElementAttribute.js +25 -0
- package/dist/utils/webflow-canvas/attributes/getWebflowElementTextContent.d.ts +6 -0
- package/dist/utils/webflow-canvas/attributes/getWebflowElementTextContent.js +26 -0
- package/dist/utils/webflow-canvas/attributes/index.d.ts +7 -0
- package/dist/utils/webflow-canvas/attributes/index.js +7 -0
- package/dist/utils/webflow-canvas/attributes/removeWebflowElementAttribute.d.ts +7 -0
- package/dist/utils/webflow-canvas/attributes/removeWebflowElementAttribute.js +37 -0
- package/dist/utils/webflow-canvas/attributes/setStyles.d.ts +10 -0
- package/dist/utils/webflow-canvas/attributes/setStyles.js +36 -0
- package/dist/utils/webflow-canvas/attributes/setWebflowElementAttribute.d.ts +11 -0
- package/dist/utils/webflow-canvas/attributes/setWebflowElementAttribute.js +61 -0
- package/dist/utils/webflow-canvas/findInstanceElement.d.ts +32 -0
- package/dist/utils/webflow-canvas/findInstanceElement.js +144 -0
- package/dist/utils/webflow-canvas/getAllPages.d.ts +29 -0
- package/dist/utils/webflow-canvas/getAllPages.js +93 -0
- package/dist/utils/webflow-canvas/getSiteStagingUrl.d.ts +7 -0
- package/dist/utils/webflow-canvas/getSiteStagingUrl.js +14 -0
- package/dist/utils/webflow-canvas/index.d.ts +3 -0
- package/dist/utils/webflow-canvas/index.js +3 -0
- package/package.json +107 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createEventDispatcher } from 'svelte';
|
|
3
|
+
import { onDestroy } from 'svelte';
|
|
4
|
+
|
|
5
|
+
import { DeleteOutlinedIcon, FileUploadIcon, RefreshIcon } from '../icons';
|
|
6
|
+
import { Button } from './button';
|
|
7
|
+
import { Text } from './text';
|
|
8
|
+
|
|
9
|
+
type FileChangeEvent = {
|
|
10
|
+
file: File | null;
|
|
11
|
+
error: string | null;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export let id: string = crypto.randomUUID();
|
|
15
|
+
export let name: string = 'image';
|
|
16
|
+
export let label: string = '';
|
|
17
|
+
export let invalidFileTypeMessage: string;
|
|
18
|
+
export let required: boolean = false;
|
|
19
|
+
export let showPreview: boolean = false;
|
|
20
|
+
export let error: string = '';
|
|
21
|
+
export let buttonText: string;
|
|
22
|
+
export let acceptedTypes: string[];
|
|
23
|
+
export let maxFileSize: number;
|
|
24
|
+
export let invalidFileSizeMessage: string;
|
|
25
|
+
|
|
26
|
+
let input: HTMLInputElement;
|
|
27
|
+
let previewUrl = '';
|
|
28
|
+
let showImage = false;
|
|
29
|
+
let localError = '';
|
|
30
|
+
|
|
31
|
+
const dispatch = createEventDispatcher<{
|
|
32
|
+
change: FileChangeEvent;
|
|
33
|
+
}>();
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Validate the file type and size
|
|
37
|
+
* @param file
|
|
38
|
+
*/
|
|
39
|
+
const validateFile = (file: File): string | null => {
|
|
40
|
+
if (!acceptedTypes.includes(file.type)) {
|
|
41
|
+
return invalidFileTypeMessage;
|
|
42
|
+
}
|
|
43
|
+
if (file.size > maxFileSize) {
|
|
44
|
+
return invalidFileSizeMessage;
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Handle the file change event
|
|
51
|
+
*/
|
|
52
|
+
const handleChange = (): void => {
|
|
53
|
+
const file = input.files?.[0];
|
|
54
|
+
localError = '';
|
|
55
|
+
|
|
56
|
+
if (previewUrl) {
|
|
57
|
+
URL.revokeObjectURL(previewUrl);
|
|
58
|
+
previewUrl = '';
|
|
59
|
+
}
|
|
60
|
+
showImage = false;
|
|
61
|
+
|
|
62
|
+
if (!file) {
|
|
63
|
+
dispatch('change', { file: null, error: null });
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const validationError = validateFile(file);
|
|
68
|
+
if (validationError) {
|
|
69
|
+
localError = validationError;
|
|
70
|
+
input.value = '';
|
|
71
|
+
dispatch('change', { file: null, error: validationError });
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Create preview
|
|
76
|
+
previewUrl = URL.createObjectURL(file);
|
|
77
|
+
showImage = true;
|
|
78
|
+
|
|
79
|
+
dispatch('change', { file, error: null });
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Trigger the file input
|
|
84
|
+
*/
|
|
85
|
+
const triggerFileInput = () => {
|
|
86
|
+
input.click();
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Delete the file input
|
|
91
|
+
*/
|
|
92
|
+
export const reset = () => {
|
|
93
|
+
input.value = '';
|
|
94
|
+
previewUrl = '';
|
|
95
|
+
showImage = false;
|
|
96
|
+
dispatch('change', { file: null, error: null });
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
onDestroy(() => {
|
|
100
|
+
if (previewUrl) {
|
|
101
|
+
URL.revokeObjectURL(previewUrl);
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
</script>
|
|
105
|
+
|
|
106
|
+
<div class="image-upload">
|
|
107
|
+
{#if label}
|
|
108
|
+
<label for={id} class="label">
|
|
109
|
+
<Text {label} />
|
|
110
|
+
{#if required}<span class="required">*</span>{/if}
|
|
111
|
+
</label>
|
|
112
|
+
{/if}
|
|
113
|
+
|
|
114
|
+
<div class="upload-container" class:hidden={!!previewUrl}>
|
|
115
|
+
<input
|
|
116
|
+
{id}
|
|
117
|
+
{name}
|
|
118
|
+
{required}
|
|
119
|
+
accept=".jpg,.jpeg,.png"
|
|
120
|
+
bind:this={input}
|
|
121
|
+
on:change={handleChange}
|
|
122
|
+
type="file"
|
|
123
|
+
class="file-input"
|
|
124
|
+
/>
|
|
125
|
+
|
|
126
|
+
<Button text={buttonText} onclick={triggerFileInput} icon={FileUploadIcon} />
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
{#if showImage && previewUrl && showPreview}
|
|
130
|
+
<div class="preview-container">
|
|
131
|
+
<div class="file-preview" style="background-image: url({previewUrl})"></div>
|
|
132
|
+
</div>
|
|
133
|
+
{/if}
|
|
134
|
+
{#if previewUrl}
|
|
135
|
+
<div class="action-buttons">
|
|
136
|
+
<Button text="Replace" variant="secondary" onclick={triggerFileInput} icon={RefreshIcon} />
|
|
137
|
+
<Button text="Delete" variant="secondary" onclick={reset} icon={DeleteOutlinedIcon} />
|
|
138
|
+
</div>
|
|
139
|
+
{/if}
|
|
140
|
+
|
|
141
|
+
{#if error || localError}
|
|
142
|
+
<Text label={error || localError} fontColor="var(--redText)" />
|
|
143
|
+
{/if}
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<style>
|
|
147
|
+
.action-buttons {
|
|
148
|
+
display: flex;
|
|
149
|
+
padding-top: 4px;
|
|
150
|
+
align-items: flex-start;
|
|
151
|
+
gap: var(--Spacing-8, 8px);
|
|
152
|
+
}
|
|
153
|
+
.file-preview {
|
|
154
|
+
width: 222px;
|
|
155
|
+
aspect-ratio: 16/9;
|
|
156
|
+
border-radius: 2.553px;
|
|
157
|
+
background: var(--background3);
|
|
158
|
+
display: flex;
|
|
159
|
+
justify-content: center;
|
|
160
|
+
align-items: center;
|
|
161
|
+
background-size: cover !important;
|
|
162
|
+
background-repeat: no-repeat !important;
|
|
163
|
+
background-position: center !important;
|
|
164
|
+
}
|
|
165
|
+
.image-upload {
|
|
166
|
+
display: flex;
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
gap: 4px;
|
|
169
|
+
width: 100%;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.label {
|
|
173
|
+
display: flex;
|
|
174
|
+
gap: 4px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.required {
|
|
178
|
+
color: #dc2626;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.upload-container :global(.button-left-icon) {
|
|
182
|
+
display: flex;
|
|
183
|
+
align-items: center;
|
|
184
|
+
}
|
|
185
|
+
.upload-container {
|
|
186
|
+
position: relative;
|
|
187
|
+
display: inline-block;
|
|
188
|
+
}
|
|
189
|
+
.upload-container.hidden {
|
|
190
|
+
display: none;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.file-input {
|
|
194
|
+
position: absolute;
|
|
195
|
+
width: 1px;
|
|
196
|
+
height: 1px;
|
|
197
|
+
padding: 0;
|
|
198
|
+
margin: -1px;
|
|
199
|
+
overflow: hidden;
|
|
200
|
+
clip: rect(0, 0, 0, 0);
|
|
201
|
+
border: 0;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.preview-container {
|
|
205
|
+
display: flex;
|
|
206
|
+
width: 240px;
|
|
207
|
+
padding: 7.66px;
|
|
208
|
+
flex-direction: column;
|
|
209
|
+
align-items: flex-start;
|
|
210
|
+
border-radius: 2.553px;
|
|
211
|
+
border: 0.638px solid var(--border1);
|
|
212
|
+
}
|
|
213
|
+
</style>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const ImageUpload: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
id?: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
invalidFileTypeMessage: string;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
showPreview?: boolean;
|
|
21
|
+
error?: string;
|
|
22
|
+
buttonText: string;
|
|
23
|
+
acceptedTypes: string[];
|
|
24
|
+
maxFileSize: number;
|
|
25
|
+
invalidFileSizeMessage: string;
|
|
26
|
+
/**
|
|
27
|
+
* Delete the file input
|
|
28
|
+
*/ reset?: () => void;
|
|
29
|
+
}, {
|
|
30
|
+
change: CustomEvent<{
|
|
31
|
+
file: File | null;
|
|
32
|
+
error: string | null;
|
|
33
|
+
}>;
|
|
34
|
+
} & {
|
|
35
|
+
[evt: string]: CustomEvent<any>;
|
|
36
|
+
}, {}, {
|
|
37
|
+
/**
|
|
38
|
+
* Delete the file input
|
|
39
|
+
*/ reset: () => void;
|
|
40
|
+
}, string>;
|
|
41
|
+
type ImageUpload = InstanceType<typeof ImageUpload>;
|
|
42
|
+
export default ImageUpload;
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createEventDispatcher, onMount } from 'svelte';
|
|
3
|
+
import { writable } from 'svelte/store';
|
|
4
|
+
|
|
5
|
+
import { componentInjectErrors } from '../../stores';
|
|
6
|
+
import { FINSWEET_REVERSE_PROXY_URL } from '../../utils';
|
|
7
|
+
|
|
8
|
+
import LoadingScreen from './LoadingScreen.svelte';
|
|
9
|
+
|
|
10
|
+
export let sourceUrl: string;
|
|
11
|
+
export let elementId: string;
|
|
12
|
+
const targetId = 'target-content';
|
|
13
|
+
|
|
14
|
+
const loadingStore = writable(true);
|
|
15
|
+
const dispatch = createEventDispatcher<{
|
|
16
|
+
error: { message: string; error: unknown };
|
|
17
|
+
ready: boolean;
|
|
18
|
+
}>();
|
|
19
|
+
|
|
20
|
+
let errorMessage = '';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Handle errors when injecting a component
|
|
24
|
+
*/
|
|
25
|
+
function handleError(message: string, error: unknown, consoleDetails?: unknown) {
|
|
26
|
+
componentInjectErrors.set(true);
|
|
27
|
+
|
|
28
|
+
dispatch('error', {
|
|
29
|
+
message,
|
|
30
|
+
error
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Update local state
|
|
34
|
+
errorMessage = message;
|
|
35
|
+
loadingStore.set(false);
|
|
36
|
+
|
|
37
|
+
// Dispatch ready event with false to indicate error state
|
|
38
|
+
dispatch('ready', false);
|
|
39
|
+
|
|
40
|
+
throw new Error('Failed to load Component preview, please try again or contact support');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Imports and renders a component from Webflow
|
|
45
|
+
*/
|
|
46
|
+
async function importFromWebflow() {
|
|
47
|
+
try {
|
|
48
|
+
const url = `${FINSWEET_REVERSE_PROXY_URL}${sourceUrl}`;
|
|
49
|
+
const response = await fetch(url);
|
|
50
|
+
if (!response.ok) {
|
|
51
|
+
handleError(
|
|
52
|
+
`Failed to fetch: ${response.statusText}`,
|
|
53
|
+
new Error(`Failed to fetch: ${response.statusText}`),
|
|
54
|
+
response
|
|
55
|
+
);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const html = await response.text();
|
|
59
|
+
|
|
60
|
+
const parser = new DOMParser();
|
|
61
|
+
const doc = parser.parseFromString(html, 'text/html');
|
|
62
|
+
|
|
63
|
+
const sourceElement = doc.getElementById(elementId);
|
|
64
|
+
if (!sourceElement) {
|
|
65
|
+
handleError(
|
|
66
|
+
`Element with ID "${elementId}" not found`,
|
|
67
|
+
new Error(`Element with ID "${elementId}" not found`)
|
|
68
|
+
);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const styles = Array.from(doc.querySelectorAll('style, link[rel="stylesheet"]'))
|
|
73
|
+
.map((el) => el.outerHTML)
|
|
74
|
+
.join('\n');
|
|
75
|
+
|
|
76
|
+
const headScripts = Array.from(doc.head.querySelectorAll('script'))
|
|
77
|
+
.map((el) => el.outerHTML)
|
|
78
|
+
.join('\n');
|
|
79
|
+
|
|
80
|
+
const bodyScripts = Array.from(doc.body.querySelectorAll('script'))
|
|
81
|
+
.map((el) => el.outerHTML)
|
|
82
|
+
.join('\n');
|
|
83
|
+
|
|
84
|
+
const targetElement = document.getElementById(targetId);
|
|
85
|
+
if (!targetElement) {
|
|
86
|
+
handleError(
|
|
87
|
+
`Target element with ID "${targetId}" not found`,
|
|
88
|
+
new Error(`Target element with ID "${targetId}" not found`)
|
|
89
|
+
);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
targetElement.innerHTML = '';
|
|
94
|
+
|
|
95
|
+
const shadowContainer = document.createElement('div');
|
|
96
|
+
shadowContainer.style.display = 'contents';
|
|
97
|
+
const shadowRoot = shadowContainer.attachShadow({ mode: 'open' });
|
|
98
|
+
|
|
99
|
+
const iframe = document.createElement('iframe');
|
|
100
|
+
iframe.style.width = '1280px';
|
|
101
|
+
iframe.style.height = '720px';
|
|
102
|
+
iframe.style.border = 'none';
|
|
103
|
+
iframe.style.display = 'block';
|
|
104
|
+
iframe.style.transform = 'scale(calc(100% / 1280))';
|
|
105
|
+
iframe.style.transformOrigin = 'top left';
|
|
106
|
+
iframe.setAttribute('scrolling', 'no');
|
|
107
|
+
|
|
108
|
+
const iframeWrapper = document.createElement('div');
|
|
109
|
+
iframeWrapper.style.width = '100%';
|
|
110
|
+
iframeWrapper.style.height = '100%';
|
|
111
|
+
iframeWrapper.style.overflow = 'hidden';
|
|
112
|
+
iframeWrapper.style.position = 'relative';
|
|
113
|
+
iframeWrapper.appendChild(iframe);
|
|
114
|
+
|
|
115
|
+
shadowRoot.appendChild(iframeWrapper);
|
|
116
|
+
|
|
117
|
+
let lastWidth = 0;
|
|
118
|
+
const updateIframeScale = () => {
|
|
119
|
+
const containerWidth = iframeWrapper.clientWidth;
|
|
120
|
+
if (containerWidth === lastWidth || containerWidth === 0) return;
|
|
121
|
+
lastWidth = containerWidth;
|
|
122
|
+
|
|
123
|
+
const scale = containerWidth / 1280;
|
|
124
|
+
iframe.style.transform = `scale(${scale})`;
|
|
125
|
+
|
|
126
|
+
const scaledHeight = Math.ceil(720 * scale);
|
|
127
|
+
iframeWrapper.style.height = `${scaledHeight}px`;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
window.addEventListener('resize', () => {
|
|
131
|
+
requestAnimationFrame(updateIframeScale);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
setTimeout(updateIframeScale, 100);
|
|
135
|
+
|
|
136
|
+
const htmlAttrs = Array.from(doc.documentElement.attributes)
|
|
137
|
+
.map((attr) => `${attr.name}="${attr.value}"`)
|
|
138
|
+
.join(' ');
|
|
139
|
+
|
|
140
|
+
const bodyAttrs = Array.from(doc.body.attributes)
|
|
141
|
+
.map((attr) => `${attr.name}="${attr.value}"`)
|
|
142
|
+
.join(' ');
|
|
143
|
+
|
|
144
|
+
const iframeContent = `
|
|
145
|
+
<!DOCTYPE html>
|
|
146
|
+
<html ${htmlAttrs}>
|
|
147
|
+
<head>
|
|
148
|
+
<meta charset="UTF-8">
|
|
149
|
+
<meta name="viewport" content="width=1280, height=720, initial-scale=1.0">
|
|
150
|
+
<base href="${new URL('/', sourceUrl).href}">
|
|
151
|
+
${styles}
|
|
152
|
+
${headScripts}
|
|
153
|
+
<style>
|
|
154
|
+
html, body {
|
|
155
|
+
width: 1280px;
|
|
156
|
+
height: 720px;
|
|
157
|
+
margin: 0;
|
|
158
|
+
padding: 0;
|
|
159
|
+
border-radius: 4px;
|
|
160
|
+
overflow: hidden;
|
|
161
|
+
background-color: #353535;
|
|
162
|
+
}
|
|
163
|
+
</style>
|
|
164
|
+
</head>
|
|
165
|
+
<body ${bodyAttrs} data-source-url="${sourceUrl}" data-element-id="${elementId}">
|
|
166
|
+
${sourceElement.outerHTML}
|
|
167
|
+
${bodyScripts}
|
|
168
|
+
</body>
|
|
169
|
+
</html>
|
|
170
|
+
`;
|
|
171
|
+
|
|
172
|
+
iframe.srcdoc = iframeContent;
|
|
173
|
+
|
|
174
|
+
iframe.onload = () => {
|
|
175
|
+
updateIframeScale();
|
|
176
|
+
|
|
177
|
+
try {
|
|
178
|
+
const iframeDoc = iframe.contentDocument || iframe.contentWindow?.document;
|
|
179
|
+
|
|
180
|
+
if (!iframeDoc) return;
|
|
181
|
+
|
|
182
|
+
const existingBadges = iframeDoc.querySelectorAll('a.w-webflow-badge');
|
|
183
|
+
existingBadges.forEach((badge) => badge.remove());
|
|
184
|
+
|
|
185
|
+
const script = iframeDoc.createElement('script');
|
|
186
|
+
script.textContent = `
|
|
187
|
+
(function() {
|
|
188
|
+
|
|
189
|
+
function removeBadge() {
|
|
190
|
+
const badges = document.querySelectorAll('a.w-webflow-badge');
|
|
191
|
+
if (badges.length > 0) {
|
|
192
|
+
badges.forEach(badge => badge.remove());
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
removeBadge();
|
|
197
|
+
|
|
198
|
+
const observer = new MutationObserver(mutations => {
|
|
199
|
+
mutations.forEach(mutation => {
|
|
200
|
+
if (mutation.addedNodes && mutation.addedNodes.length > 0) {
|
|
201
|
+
for (let i = 0; i < mutation.addedNodes.length; i++) {
|
|
202
|
+
const node = mutation.addedNodes[i];
|
|
203
|
+
|
|
204
|
+
if (node.nodeType === 1) {
|
|
205
|
+
if (node.matches && node.matches('a.w-webflow-badge')) {
|
|
206
|
+
node.remove();
|
|
207
|
+
} else if (node.querySelectorAll) {
|
|
208
|
+
const badges = node.querySelectorAll('a.w-webflow-badge');
|
|
209
|
+
badges.forEach(badge => badge.remove());
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
observer.observe(document.body, {
|
|
218
|
+
childList: true,
|
|
219
|
+
subtree: true
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
setInterval(removeBadge, 1000);
|
|
223
|
+
})();
|
|
224
|
+
`;
|
|
225
|
+
|
|
226
|
+
iframeDoc.body.appendChild(script);
|
|
227
|
+
} catch (err) {
|
|
228
|
+
handleError('Failed to inject badge removal script', err);
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
targetElement.appendChild(shadowContainer);
|
|
233
|
+
|
|
234
|
+
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
235
|
+
|
|
236
|
+
loadingStore.set(false);
|
|
237
|
+
|
|
238
|
+
// Dispatch ready event with true to indicate successful loading
|
|
239
|
+
dispatch('ready', true);
|
|
240
|
+
} catch (error) {
|
|
241
|
+
const message = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
242
|
+
handleError(`Import failed: ${message}`, error);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
onMount(() => {
|
|
247
|
+
importFromWebflow();
|
|
248
|
+
});
|
|
249
|
+
</script>
|
|
250
|
+
|
|
251
|
+
<div class="inject-wrapper">
|
|
252
|
+
<LoadingScreen
|
|
253
|
+
backgroundColor="var(--background1)"
|
|
254
|
+
active={$loadingStore || !!errorMessage}
|
|
255
|
+
spinnerSize={30}
|
|
256
|
+
message={errorMessage ? errorMessage : 'Loading Component preview...'}
|
|
257
|
+
position="absolute"
|
|
258
|
+
error={!!errorMessage}
|
|
259
|
+
/>
|
|
260
|
+
|
|
261
|
+
<div
|
|
262
|
+
class="inject-target"
|
|
263
|
+
id={targetId}
|
|
264
|
+
data-target-href={sourceUrl}
|
|
265
|
+
data-target-id={elementId}
|
|
266
|
+
></div>
|
|
267
|
+
</div>
|
|
268
|
+
|
|
269
|
+
<style>
|
|
270
|
+
.inject-wrapper {
|
|
271
|
+
width: 100%;
|
|
272
|
+
position: relative;
|
|
273
|
+
overflow: hidden;
|
|
274
|
+
height: 420px;
|
|
275
|
+
background-color: var(--background1);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.inject-target {
|
|
279
|
+
height: 420px;
|
|
280
|
+
background-color: var(--background1);
|
|
281
|
+
width: 100%;
|
|
282
|
+
border-radius: 4px;
|
|
283
|
+
overflow: hidden;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
#target-content {
|
|
287
|
+
width: 100%;
|
|
288
|
+
height: 100%;
|
|
289
|
+
transition: all 0.3s ease;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
@keyframes spin {
|
|
293
|
+
to {
|
|
294
|
+
transform: rotate(360deg);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const InjectComponent: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
sourceUrl: string;
|
|
16
|
+
elementId: string;
|
|
17
|
+
}, {
|
|
18
|
+
error: CustomEvent<{
|
|
19
|
+
message: string;
|
|
20
|
+
error: unknown;
|
|
21
|
+
}>;
|
|
22
|
+
ready: CustomEvent<boolean>;
|
|
23
|
+
} & {
|
|
24
|
+
[evt: string]: CustomEvent<any>;
|
|
25
|
+
}, {}, {}, string>;
|
|
26
|
+
type InjectComponent = InstanceType<typeof InjectComponent>;
|
|
27
|
+
export default InjectComponent;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
export let size: number = 48;
|
|
3
|
+
export let color: string = 'white';
|
|
4
|
+
export let speed: number = 1;
|
|
5
|
+
export let margin: string = '0';
|
|
6
|
+
export let trackColor: string = 'var(--text2)';
|
|
7
|
+
|
|
8
|
+
// Calculate proportional values based on the original design (24px size, 9px radius, 2px stroke)
|
|
9
|
+
$: radius = (size * 9) / 24; // Original radius was 9 for 24px size
|
|
10
|
+
$: strokeWidth = (size * 2) / 24; // Original stroke was 2 for 24px size
|
|
11
|
+
$: center = size / 2;
|
|
12
|
+
$: circumference = 2 * Math.PI * radius;
|
|
13
|
+
$: dashLength = circumference / 4; // Quarter circle
|
|
14
|
+
$: gapLength = circumference - dashLength;
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div class="wrapper" style={`margin: ${margin};`}>
|
|
18
|
+
<svg class="loader-svg" width={size} height={size} viewBox={`0 0 ${size} ${size}`}>
|
|
19
|
+
<!-- Background track circle with opacity -->
|
|
20
|
+
<circle
|
|
21
|
+
cx={center}
|
|
22
|
+
cy={center}
|
|
23
|
+
r={radius}
|
|
24
|
+
fill="none"
|
|
25
|
+
stroke={trackColor}
|
|
26
|
+
stroke-width={strokeWidth}
|
|
27
|
+
opacity="0.2"
|
|
28
|
+
/>
|
|
29
|
+
|
|
30
|
+
<!-- Animated quarter arc -->
|
|
31
|
+
<circle
|
|
32
|
+
cx={center}
|
|
33
|
+
cy={center}
|
|
34
|
+
r={radius}
|
|
35
|
+
fill="none"
|
|
36
|
+
stroke={color}
|
|
37
|
+
stroke-width={strokeWidth}
|
|
38
|
+
stroke-dasharray={`${dashLength} ${gapLength}`}
|
|
39
|
+
stroke-linecap="round"
|
|
40
|
+
class="loader-arc"
|
|
41
|
+
style={`animation-duration: ${speed}s; transform-origin: ${center}px ${center}px;`}
|
|
42
|
+
/>
|
|
43
|
+
</svg>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<style>
|
|
47
|
+
.wrapper {
|
|
48
|
+
height: 100%;
|
|
49
|
+
width: 100%;
|
|
50
|
+
display: flex;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
align-items: center;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.loader-arc {
|
|
56
|
+
animation: rotation linear infinite;
|
|
57
|
+
transform-origin: center;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@keyframes rotation {
|
|
61
|
+
0% {
|
|
62
|
+
transform: rotate(0deg);
|
|
63
|
+
}
|
|
64
|
+
100% {
|
|
65
|
+
transform: rotate(360deg);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const Loader: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
size?: number;
|
|
16
|
+
color?: string;
|
|
17
|
+
speed?: number;
|
|
18
|
+
margin?: string;
|
|
19
|
+
trackColor?: string;
|
|
20
|
+
}, {
|
|
21
|
+
[evt: string]: CustomEvent<any>;
|
|
22
|
+
}, {}, {}, string>;
|
|
23
|
+
type Loader = InstanceType<typeof Loader>;
|
|
24
|
+
export default Loader;
|