@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,307 @@
|
|
|
1
|
+
import { derived, get, writable } from 'svelte/store';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
// Registry to track all form states by identifier
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
+
const formsRegistry = writable({});
|
|
6
|
+
// Validates class name according to HTML class name rules
|
|
7
|
+
const classNameRegex = /^[a-zA-Z0-9_-]+$/;
|
|
8
|
+
/**
|
|
9
|
+
* Creates a form validation utility with Zod
|
|
10
|
+
* @param identifier - Unique identifier for the form
|
|
11
|
+
* @param options - Configuration options
|
|
12
|
+
*/
|
|
13
|
+
export class FormValidator {
|
|
14
|
+
schema;
|
|
15
|
+
store;
|
|
16
|
+
form;
|
|
17
|
+
instancesSet = new Set();
|
|
18
|
+
initialValues;
|
|
19
|
+
identifier;
|
|
20
|
+
currentInstanceToIgnore = null;
|
|
21
|
+
/**
|
|
22
|
+
* Generates unique name, instance, and class based on solution name and existing instances
|
|
23
|
+
* @param existingInstances - Array of existing instance names
|
|
24
|
+
* @param solution - The base solution name
|
|
25
|
+
* @returns Object containing name, instance, and class values
|
|
26
|
+
*/
|
|
27
|
+
static generateNames(existingInstances, solution, name) {
|
|
28
|
+
const instanceSet = new Set(existingInstances.map((inst) => inst.toLowerCase()));
|
|
29
|
+
// First try without suffix
|
|
30
|
+
let instance = `fs-${solution}`.toLowerCase();
|
|
31
|
+
let finalName = name;
|
|
32
|
+
// If the base instance is available, use it
|
|
33
|
+
if (!instanceSet.has(instance)) {
|
|
34
|
+
const className = instance.replace(/[^a-zA-Z0-9_-]/g, '-');
|
|
35
|
+
return {
|
|
36
|
+
name: finalName,
|
|
37
|
+
instance,
|
|
38
|
+
class: className
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
// If base is taken, find the next available suffix number starting from 1
|
|
42
|
+
let suffixNumber = 1;
|
|
43
|
+
do {
|
|
44
|
+
instance = `fs-${solution}-${suffixNumber}`.toLowerCase();
|
|
45
|
+
finalName = `${name} ${suffixNumber}`;
|
|
46
|
+
suffixNumber++;
|
|
47
|
+
} while (instanceSet.has(instance));
|
|
48
|
+
// Create class name (ensure it's valid)
|
|
49
|
+
const className = instance.replace(/[^a-zA-Z0-9_-]/g, '-');
|
|
50
|
+
return {
|
|
51
|
+
name: finalName,
|
|
52
|
+
instance,
|
|
53
|
+
class: className
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Cleans up the class name to ensure it's valid
|
|
58
|
+
* @param className - The class name to clean up
|
|
59
|
+
* @returns The cleaned up class name
|
|
60
|
+
*/
|
|
61
|
+
static sanitizeClassName(className) {
|
|
62
|
+
if (!className)
|
|
63
|
+
return '';
|
|
64
|
+
// Remove leading/trailing spaces and slashes
|
|
65
|
+
let sanitized = className.trim().replace(/^\/+|\/+$/g, '');
|
|
66
|
+
// Replace invalid characters with hyphens (keep only letters, numbers, underscores, hyphens)
|
|
67
|
+
sanitized = sanitized.replace(/[^a-zA-Z0-9_-]/g, '-');
|
|
68
|
+
// Remove leading/trailing hyphens and underscores
|
|
69
|
+
sanitized = sanitized.replace(/^[-_]+|[-_]+$/g, '');
|
|
70
|
+
// Collapse multiple consecutive hyphens into single hyphens
|
|
71
|
+
sanitized = sanitized.replace(/-+/g, '-');
|
|
72
|
+
return sanitized;
|
|
73
|
+
}
|
|
74
|
+
constructor(identifier, initialValues, options) {
|
|
75
|
+
this.identifier = identifier;
|
|
76
|
+
this.initialValues = initialValues;
|
|
77
|
+
// Initialize base schema
|
|
78
|
+
this.schema = z.object({
|
|
79
|
+
name: z.string().min(1, { message: 'Name is required' }),
|
|
80
|
+
instance: z.string().min(1, { message: 'Instance is required' }),
|
|
81
|
+
class: z.string().min(1, { message: 'Class is required' }).regex(classNameRegex, {
|
|
82
|
+
message: 'Class must contain only letters, numbers, underscores, and hyphens'
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
// Add existing instances to the set for uniqueness validation
|
|
86
|
+
if (options?.existingInstances) {
|
|
87
|
+
options.existingInstances.forEach((instance) => this.instancesSet.add(instance.toLowerCase()));
|
|
88
|
+
}
|
|
89
|
+
// Create the form state store
|
|
90
|
+
this.store = writable({
|
|
91
|
+
values: initialValues,
|
|
92
|
+
errors: {},
|
|
93
|
+
touched: {},
|
|
94
|
+
isValid: false,
|
|
95
|
+
isDirty: false,
|
|
96
|
+
isSubmitting: false
|
|
97
|
+
});
|
|
98
|
+
// Create a derived store that's the primary interface to the form
|
|
99
|
+
this.form = derived(this.store, ($store) => $store);
|
|
100
|
+
// Register this form with the global registry
|
|
101
|
+
formsRegistry.update((registry) => {
|
|
102
|
+
registry[identifier] = this;
|
|
103
|
+
return registry;
|
|
104
|
+
});
|
|
105
|
+
// Initial validation
|
|
106
|
+
this.validate();
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Set a specific instance to ignore during validation
|
|
110
|
+
* Used in edit mode to prevent the current instance from being flagged as invalid
|
|
111
|
+
*/
|
|
112
|
+
ignoreInstanceValidation(instanceValue, existingInstances) {
|
|
113
|
+
// update instanceset from existingInstances
|
|
114
|
+
this.instancesSet = new Set(existingInstances.map((inst) => inst.toLowerCase()?.trim()));
|
|
115
|
+
this.currentInstanceToIgnore = instanceValue?.toLowerCase() || null;
|
|
116
|
+
// Re-validate with the new ignored instance
|
|
117
|
+
this.validate();
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Set the value of a specific field
|
|
121
|
+
*/
|
|
122
|
+
setField(field, value) {
|
|
123
|
+
this.store.update((state) => {
|
|
124
|
+
const newState = {
|
|
125
|
+
...state,
|
|
126
|
+
values: {
|
|
127
|
+
...state.values,
|
|
128
|
+
[field]: value
|
|
129
|
+
},
|
|
130
|
+
touched: {
|
|
131
|
+
...state.touched,
|
|
132
|
+
[field]: true
|
|
133
|
+
},
|
|
134
|
+
isDirty: true
|
|
135
|
+
};
|
|
136
|
+
return newState;
|
|
137
|
+
});
|
|
138
|
+
this.validate();
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Set multiple field values at once
|
|
142
|
+
*/
|
|
143
|
+
setFields(values) {
|
|
144
|
+
this.store.update((state) => {
|
|
145
|
+
const newTouched = { ...state.touched };
|
|
146
|
+
// Mark all updated fields as touched
|
|
147
|
+
Object.keys(values).forEach((key) => {
|
|
148
|
+
newTouched[key] = true;
|
|
149
|
+
});
|
|
150
|
+
return {
|
|
151
|
+
...state,
|
|
152
|
+
values: {
|
|
153
|
+
...state.values,
|
|
154
|
+
...values
|
|
155
|
+
},
|
|
156
|
+
touched: newTouched,
|
|
157
|
+
isDirty: true
|
|
158
|
+
};
|
|
159
|
+
});
|
|
160
|
+
this.validate();
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Handle instance field validation with uniqueness check
|
|
164
|
+
*/
|
|
165
|
+
validateWithInstances(existingInstances) {
|
|
166
|
+
// Update the instance set
|
|
167
|
+
this.instancesSet = new Set(existingInstances.map((inst) => inst.toLowerCase()));
|
|
168
|
+
this.validate();
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Reset the form to initial values
|
|
172
|
+
*/
|
|
173
|
+
reset() {
|
|
174
|
+
this.store.set({
|
|
175
|
+
values: { ...this.initialValues },
|
|
176
|
+
errors: {},
|
|
177
|
+
touched: {},
|
|
178
|
+
isValid: false,
|
|
179
|
+
isDirty: false,
|
|
180
|
+
isSubmitting: false
|
|
181
|
+
});
|
|
182
|
+
this.validate();
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Validate the form values
|
|
186
|
+
*/
|
|
187
|
+
validate() {
|
|
188
|
+
this.store.update((state) => {
|
|
189
|
+
// Create a custom schema for validation that includes instance uniqueness
|
|
190
|
+
const currentSchema = z.object({
|
|
191
|
+
name: z.string().min(1, { message: 'Name is required' }),
|
|
192
|
+
instance: z
|
|
193
|
+
.string()
|
|
194
|
+
.min(1, { message: 'Instance is required' })
|
|
195
|
+
.refine((value) => {
|
|
196
|
+
// Skip if empty (handled by min(1) above)
|
|
197
|
+
if (!value)
|
|
198
|
+
return true;
|
|
199
|
+
// If we're in edit mode and this is the current instance, skip duplicate validation
|
|
200
|
+
if (this.currentInstanceToIgnore &&
|
|
201
|
+
value.toLowerCase() === this.currentInstanceToIgnore) {
|
|
202
|
+
return true;
|
|
203
|
+
}
|
|
204
|
+
// Check for uniqueness against the set of existing instances
|
|
205
|
+
return !this.instancesSet.has(value.toLowerCase());
|
|
206
|
+
}, { message: 'Instance name must be unique' }),
|
|
207
|
+
class: z.string().min(1, { message: 'Class is required' }).regex(classNameRegex, {
|
|
208
|
+
message: 'Class must contain only letters, numbers, underscores, and hyphens'
|
|
209
|
+
})
|
|
210
|
+
});
|
|
211
|
+
// Validate the current values against the schema
|
|
212
|
+
const result = currentSchema.safeParse(state.values);
|
|
213
|
+
const errors = {};
|
|
214
|
+
let isValid = true;
|
|
215
|
+
if (!result.success) {
|
|
216
|
+
isValid = false;
|
|
217
|
+
// Convert Zod errors to our error format
|
|
218
|
+
Object.keys(state.values).forEach((key) => {
|
|
219
|
+
const fieldKey = key;
|
|
220
|
+
// @ts-expect-error - Zod typing issue
|
|
221
|
+
const fieldErrors = result.error.format()[fieldKey]?._errors || [];
|
|
222
|
+
errors[fieldKey] = fieldErrors;
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
return {
|
|
226
|
+
...state,
|
|
227
|
+
errors,
|
|
228
|
+
isValid
|
|
229
|
+
};
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Set the form as submitting
|
|
234
|
+
*/
|
|
235
|
+
setSubmitting(isSubmitting) {
|
|
236
|
+
this.store.update((state) => ({
|
|
237
|
+
...state,
|
|
238
|
+
isSubmitting
|
|
239
|
+
}));
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Get the current state of the form
|
|
243
|
+
*/
|
|
244
|
+
getState() {
|
|
245
|
+
return get(this.store);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Get a form by its identifier
|
|
250
|
+
*/
|
|
251
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
252
|
+
export function getFormById(identifier) {
|
|
253
|
+
const registry = get(formsRegistry);
|
|
254
|
+
return registry[identifier];
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Check if a form with a specific identifier is valid
|
|
258
|
+
*/
|
|
259
|
+
export function isFormValid(identifier) {
|
|
260
|
+
const form = getFormById(identifier);
|
|
261
|
+
if (!form)
|
|
262
|
+
return false;
|
|
263
|
+
return form.getState().isValid;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Get error messages for a specific form
|
|
267
|
+
*/
|
|
268
|
+
export function getFormErrors(identifier) {
|
|
269
|
+
const form = getFormById(identifier);
|
|
270
|
+
if (!form)
|
|
271
|
+
return null;
|
|
272
|
+
return form.getState().errors;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Reset a form by its identifier
|
|
276
|
+
*/
|
|
277
|
+
export function resetForm(identifier) {
|
|
278
|
+
const form = getFormById(identifier);
|
|
279
|
+
if (!form)
|
|
280
|
+
return false;
|
|
281
|
+
form.reset();
|
|
282
|
+
return true;
|
|
283
|
+
}
|
|
284
|
+
// Add a store for each form that other components can subscribe to
|
|
285
|
+
export function createFormSubscription(identifier) {
|
|
286
|
+
const form = getFormById(identifier);
|
|
287
|
+
if (!form) {
|
|
288
|
+
return writable({ isValid: false, errors: {}, values: {} });
|
|
289
|
+
}
|
|
290
|
+
// Create a store that reflects the current form state
|
|
291
|
+
const formStore = writable(form.getState());
|
|
292
|
+
// Set up interval to update the store
|
|
293
|
+
const intervalId = setInterval(() => {
|
|
294
|
+
const currentState = form.getState();
|
|
295
|
+
formStore.set(currentState);
|
|
296
|
+
}, 100);
|
|
297
|
+
// Return store with cleanup function
|
|
298
|
+
return {
|
|
299
|
+
subscribe: formStore.subscribe,
|
|
300
|
+
destroy: () => clearInterval(intervalId)
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Store to track if the form is adding or updating to the Canvas
|
|
305
|
+
*/
|
|
306
|
+
export const isAddingOrUpdating = writable(false);
|
|
307
|
+
export const loadingSelectedElement = writable(false);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type GlobalStoreState = {
|
|
2
|
+
componentKey: string | null;
|
|
3
|
+
editMode: boolean;
|
|
4
|
+
state: Record<string, any> | null;
|
|
5
|
+
repairMode: boolean;
|
|
6
|
+
formKey: string | null;
|
|
7
|
+
formUpdateKey: string | null;
|
|
8
|
+
title: string | null;
|
|
9
|
+
};
|
|
10
|
+
export declare const globalStore: import("svelte/store").Writable<GlobalStoreState>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const showConfirmActionModal: import("svelte/store").Writable<boolean>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const siteInfo: import("svelte/store").Writable<{
|
|
2
|
+
siteId: string;
|
|
3
|
+
siteName: string;
|
|
4
|
+
shortName: string;
|
|
5
|
+
isPasswordProtected: boolean;
|
|
6
|
+
isPrivateStaging: boolean;
|
|
7
|
+
domains: Array<{
|
|
8
|
+
url: string;
|
|
9
|
+
lastPublished: string | null;
|
|
10
|
+
default: boolean;
|
|
11
|
+
stage: "staging" | "production";
|
|
12
|
+
}>;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface Subscription {
|
|
2
|
+
id: string;
|
|
3
|
+
product_id: string;
|
|
4
|
+
price_id: string;
|
|
5
|
+
status: string;
|
|
6
|
+
canceled_at: number | null;
|
|
7
|
+
current_period_end: number | null;
|
|
8
|
+
current_period_start: number | null;
|
|
9
|
+
metadata: SubscriptionMetadata;
|
|
10
|
+
}
|
|
11
|
+
export interface SubscriptionMetadata {
|
|
12
|
+
siteId: string;
|
|
13
|
+
rewardful: string;
|
|
14
|
+
siteUrl: string;
|
|
15
|
+
siteHostname: string;
|
|
16
|
+
}
|
|
17
|
+
export interface FinsweetAuth {
|
|
18
|
+
access_token: string;
|
|
19
|
+
expires_in: number;
|
|
20
|
+
id_token: string;
|
|
21
|
+
refresh_token: string;
|
|
22
|
+
scope: string;
|
|
23
|
+
token_type: string;
|
|
24
|
+
expires: number;
|
|
25
|
+
user: {
|
|
26
|
+
userId: string;
|
|
27
|
+
firstname: string;
|
|
28
|
+
admin: boolean;
|
|
29
|
+
auth0Id: string;
|
|
30
|
+
premium: boolean;
|
|
31
|
+
role: string;
|
|
32
|
+
libraryAccess: ('canFavourite' | 'canManageLibrary')[] | null;
|
|
33
|
+
folders: {
|
|
34
|
+
favourites: number;
|
|
35
|
+
configs: number;
|
|
36
|
+
savedComponents: number;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
subscriptions: Subscription[];
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface CustomCodeAttributes {
|
|
2
|
+
async: string;
|
|
3
|
+
type: string;
|
|
4
|
+
siteId: string;
|
|
5
|
+
finsweet: 'components';
|
|
6
|
+
}
|
|
7
|
+
export interface CustomCodeBlock {
|
|
8
|
+
id?: string;
|
|
9
|
+
displayName?: string;
|
|
10
|
+
location: string;
|
|
11
|
+
hostedLocation?: string;
|
|
12
|
+
sourceCode?: string;
|
|
13
|
+
attributes: CustomCodeAttributes;
|
|
14
|
+
canCopy: boolean;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Callback type for the Webflow.push() method.
|
|
3
|
+
*/
|
|
4
|
+
export type WebflowCallback = (value?: unknown) => unknown;
|
|
5
|
+
export type WebflowModule = 'ix2' | 'commerce' | 'lottie' | 'lightbox' | 'slider' | 'tabs';
|
|
6
|
+
interface WebflowCommerce {
|
|
7
|
+
destroy: () => void;
|
|
8
|
+
init: (params: {
|
|
9
|
+
siteId: string;
|
|
10
|
+
apiUrl: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
}
|
|
13
|
+
interface WebflowLightbox {
|
|
14
|
+
preview: () => void;
|
|
15
|
+
design: () => void;
|
|
16
|
+
ready: () => void;
|
|
17
|
+
}
|
|
18
|
+
interface WebflowSlider {
|
|
19
|
+
preview: () => void;
|
|
20
|
+
design: () => void;
|
|
21
|
+
ready: () => void;
|
|
22
|
+
destroy: () => void;
|
|
23
|
+
redraw: () => void;
|
|
24
|
+
}
|
|
25
|
+
type WebflowTabs = WebflowSlider;
|
|
26
|
+
interface WebflowIx2 {
|
|
27
|
+
destroy: () => void;
|
|
28
|
+
init: () => void;
|
|
29
|
+
actions: {
|
|
30
|
+
[key: string]: (...params: unknown[]) => unknown;
|
|
31
|
+
};
|
|
32
|
+
store: {
|
|
33
|
+
dispatch: (param: unknown) => void;
|
|
34
|
+
getState: () => {
|
|
35
|
+
ixData: {
|
|
36
|
+
actionLists: unknown;
|
|
37
|
+
eventTypeMap: unknown;
|
|
38
|
+
events: unknown;
|
|
39
|
+
mediaQueries: unknown;
|
|
40
|
+
mediaQueryKeys: unknown;
|
|
41
|
+
};
|
|
42
|
+
ixElements: {
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
};
|
|
45
|
+
ixInstances: {
|
|
46
|
+
[key: string]: unknown;
|
|
47
|
+
};
|
|
48
|
+
ixRequest: {
|
|
49
|
+
[key: string]: unknown;
|
|
50
|
+
};
|
|
51
|
+
ixSession: {
|
|
52
|
+
eventState: {
|
|
53
|
+
[key: string]: unknown;
|
|
54
|
+
};
|
|
55
|
+
[key: string]: unknown;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Includes methods of the Webflow.js object
|
|
62
|
+
*/
|
|
63
|
+
export interface Webflow extends Pick<WebflowCallback[], 'push'> {
|
|
64
|
+
destroy: () => void;
|
|
65
|
+
ready: () => void;
|
|
66
|
+
env: () => boolean;
|
|
67
|
+
analytics: {
|
|
68
|
+
optIn: ({ reload }: {
|
|
69
|
+
reload?: boolean;
|
|
70
|
+
}) => void;
|
|
71
|
+
optOut: ({ reload }: {
|
|
72
|
+
reload?: boolean;
|
|
73
|
+
}) => void;
|
|
74
|
+
getIsOptedOut: () => 'true' | null;
|
|
75
|
+
};
|
|
76
|
+
require: <Key extends WebflowModule>(key: Key) => (Key extends 'commerce' ? WebflowCommerce : Key extends 'lightbox' ? WebflowLightbox : Key extends 'slider' ? WebflowSlider : Key extends 'tabs' ? WebflowTabs : WebflowIx2) | undefined;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* CMS
|
|
80
|
+
*/
|
|
81
|
+
export type CollectionListWrapperElement = HTMLDivElement;
|
|
82
|
+
export type CollectionListElement = HTMLDivElement;
|
|
83
|
+
export type CollectionItemElement = HTMLDivElement;
|
|
84
|
+
export type CollectionEmptyElement = HTMLDivElement;
|
|
85
|
+
export type PaginationWrapperElement = HTMLDivElement;
|
|
86
|
+
export type PaginationButtonElement = HTMLAnchorElement;
|
|
87
|
+
export type PageCountElement = HTMLDivElement;
|
|
88
|
+
/**
|
|
89
|
+
* Forms
|
|
90
|
+
*/
|
|
91
|
+
export type FormBlockElement = HTMLDivElement;
|
|
92
|
+
export type FormSuccessElement = HTMLDivElement;
|
|
93
|
+
export type FormErrorElement = HTMLDivElement;
|
|
94
|
+
/**
|
|
95
|
+
* Sliders
|
|
96
|
+
*/
|
|
97
|
+
export type SliderElement = HTMLDivElement;
|
|
98
|
+
export type SliderMaskElement = HTMLDivElement;
|
|
99
|
+
export type SlideElement = HTMLDivElement;
|
|
100
|
+
export type SliderArrowElement = HTMLDivElement;
|
|
101
|
+
export type SliderNavElement = HTMLDivElement;
|
|
102
|
+
export type SliderDotElement = HTMLDivElement;
|
|
103
|
+
/**
|
|
104
|
+
* Tabs
|
|
105
|
+
*/
|
|
106
|
+
export type TabsElement = HTMLDivElement;
|
|
107
|
+
export type TabsMenuElement = HTMLDivElement;
|
|
108
|
+
export type TabLinkElement = HTMLLinkElement;
|
|
109
|
+
export type TabsContentElement = HTMLDivElement;
|
|
110
|
+
export type TabPaneElement = HTMLDivElement;
|
|
111
|
+
/**
|
|
112
|
+
* Rich Text Block
|
|
113
|
+
*/
|
|
114
|
+
export type RichTextBlockElement = HTMLDivElement;
|
|
115
|
+
/**
|
|
116
|
+
* Dropdowns
|
|
117
|
+
*/
|
|
118
|
+
export type DropdownElement = HTMLDivElement;
|
|
119
|
+
export type DropdownToggle = HTMLDivElement;
|
|
120
|
+
export type DropdownList = HTMLElement;
|
|
121
|
+
/**
|
|
122
|
+
* The default Webflow Breakpoint names.
|
|
123
|
+
*/
|
|
124
|
+
export type WebflowBreakpoint = 'main' | 'medium' | 'small' | 'tiny';
|
|
125
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Webflow, WebflowCallback } from './webflow';
|
|
2
|
+
/**
|
|
3
|
+
* Window object.
|
|
4
|
+
*/
|
|
5
|
+
declare global {
|
|
6
|
+
interface Window {
|
|
7
|
+
doNotTrack: string | null;
|
|
8
|
+
dataLayer: Array<{
|
|
9
|
+
event: string;
|
|
10
|
+
} | IArguments>;
|
|
11
|
+
Webflow?: Webflow | WebflowCallback[];
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export type ALLOWED_BREAKPOINTS = '320' | '480' | '768' | '991' | '1280' | '1440' | '1920';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|