@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,82 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { getContext, onMount, type Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
import type { RouteConfig, Router } from './index.svelte.js';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
/** The path pattern for this route (supports parameters like :id) */
|
|
8
|
+
path: string;
|
|
9
|
+
/** Optional component to render when route matches */
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
component?: any;
|
|
12
|
+
/** Additional metadata for this route */
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
|
+
meta?: Record<string, any>;
|
|
15
|
+
/** Whether this route should match exactly (default: true) */
|
|
16
|
+
exact?: boolean;
|
|
17
|
+
/** Children snippet */
|
|
18
|
+
|
|
19
|
+
children?: Snippet<
|
|
20
|
+
[
|
|
21
|
+
{
|
|
22
|
+
params: Record<string, string>;
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
+
location: any;
|
|
25
|
+
router: Router;
|
|
26
|
+
isActive: boolean;
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let { path, component, meta = {}, exact = true, children }: Props = $props();
|
|
33
|
+
|
|
34
|
+
// Get router from context
|
|
35
|
+
const router = getContext<Router>('router');
|
|
36
|
+
|
|
37
|
+
if (!router) {
|
|
38
|
+
throw new Error('Route component must be used within a Router component');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Reactive state
|
|
42
|
+
let isActive = $state(false);
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
44
|
+
let currentLocation = $state<any>(null);
|
|
45
|
+
let routeParams = $state<Record<string, string>>({});
|
|
46
|
+
|
|
47
|
+
// Route configuration
|
|
48
|
+
const routeConfig: RouteConfig = {
|
|
49
|
+
path,
|
|
50
|
+
component,
|
|
51
|
+
meta: { ...meta, exact }
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// Register route with router
|
|
55
|
+
onMount(() => {
|
|
56
|
+
router.addRoute(routeConfig);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// Update reactive state when router changes
|
|
60
|
+
$effect(() => {
|
|
61
|
+
currentLocation = router.useLocation();
|
|
62
|
+
routeParams = router.getParams();
|
|
63
|
+
isActive = router.isActive(path, exact);
|
|
64
|
+
});
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<!-- Render content only if route is active -->
|
|
68
|
+
{#if isActive}
|
|
69
|
+
{#if component}
|
|
70
|
+
<!-- Render provided component with route props -->
|
|
71
|
+
{@const Component = component}
|
|
72
|
+
<Component params={routeParams} location={currentLocation} {router} />
|
|
73
|
+
{:else if children}
|
|
74
|
+
<!-- Render children snippet with route data -->
|
|
75
|
+
{@render children({
|
|
76
|
+
params: routeParams,
|
|
77
|
+
location: currentLocation,
|
|
78
|
+
router,
|
|
79
|
+
isActive
|
|
80
|
+
})}
|
|
81
|
+
{/if}
|
|
82
|
+
{/if}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Snippet } from 'svelte';
|
|
2
|
+
import type { Router } from './index.svelte.js';
|
|
3
|
+
interface Props {
|
|
4
|
+
/** The path pattern for this route (supports parameters like :id) */
|
|
5
|
+
path: string;
|
|
6
|
+
/** Optional component to render when route matches */
|
|
7
|
+
component?: any;
|
|
8
|
+
/** Additional metadata for this route */
|
|
9
|
+
meta?: Record<string, any>;
|
|
10
|
+
/** Whether this route should match exactly (default: true) */
|
|
11
|
+
exact?: boolean;
|
|
12
|
+
/** Children snippet */
|
|
13
|
+
children?: Snippet<[
|
|
14
|
+
{
|
|
15
|
+
params: Record<string, string>;
|
|
16
|
+
location: any;
|
|
17
|
+
router: Router;
|
|
18
|
+
isActive: boolean;
|
|
19
|
+
}
|
|
20
|
+
]>;
|
|
21
|
+
}
|
|
22
|
+
declare const Route: import("svelte").Component<Props, {}, "">;
|
|
23
|
+
type Route = ReturnType<typeof Route>;
|
|
24
|
+
export default Route;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onDestroy, onMount, setContext, type Snippet } from 'svelte';
|
|
3
|
+
|
|
4
|
+
import type { RouteConfig, Router } from './index.svelte';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
/** Router instance to use for routing */
|
|
8
|
+
router: Router;
|
|
9
|
+
/** Whether to automatically initialize the router */
|
|
10
|
+
autoInit?: boolean;
|
|
11
|
+
/** Children snippet */
|
|
12
|
+
children?: Snippet<
|
|
13
|
+
[
|
|
14
|
+
{
|
|
15
|
+
router: Router;
|
|
16
|
+
currentRoute: RouteConfig | null;
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
+
currentLocation: any;
|
|
19
|
+
isNavigating: boolean;
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let { router, autoInit = true, children }: Props = $props();
|
|
26
|
+
|
|
27
|
+
// Reactive state from router
|
|
28
|
+
let currentRoute = $state<RouteConfig | null>(null);
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
+
let currentLocation = $state<any>(null);
|
|
31
|
+
let isNavigating = $state(false);
|
|
32
|
+
|
|
33
|
+
// Provide router context for child components
|
|
34
|
+
setContext('router', router);
|
|
35
|
+
|
|
36
|
+
// Update reactive state when router changes
|
|
37
|
+
$effect(() => {
|
|
38
|
+
currentRoute = router.useRoute();
|
|
39
|
+
currentLocation = router.useLocation();
|
|
40
|
+
isNavigating = router.useNavigating();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
onMount(() => {
|
|
44
|
+
if (autoInit) {
|
|
45
|
+
router.init();
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
onDestroy(() => {
|
|
50
|
+
router.destroy();
|
|
51
|
+
});
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<div class="router-container" class:navigating={isNavigating}>
|
|
55
|
+
{#if children}
|
|
56
|
+
{@render children({ router, currentRoute, currentLocation, isNavigating })}
|
|
57
|
+
{/if}
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<style>
|
|
61
|
+
.router-container {
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 100%;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.router-container.navigating {
|
|
67
|
+
/* Optional loading styles during navigation */
|
|
68
|
+
opacity: 0.9;
|
|
69
|
+
transition: opacity 0.1s ease;
|
|
70
|
+
}
|
|
71
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type Snippet } from 'svelte';
|
|
2
|
+
import type { RouteConfig, Router } from './index.svelte';
|
|
3
|
+
interface Props {
|
|
4
|
+
/** Router instance to use for routing */
|
|
5
|
+
router: Router;
|
|
6
|
+
/** Whether to automatically initialize the router */
|
|
7
|
+
autoInit?: boolean;
|
|
8
|
+
/** Children snippet */
|
|
9
|
+
children?: Snippet<[
|
|
10
|
+
{
|
|
11
|
+
router: Router;
|
|
12
|
+
currentRoute: RouteConfig | null;
|
|
13
|
+
currentLocation: any;
|
|
14
|
+
isNavigating: boolean;
|
|
15
|
+
}
|
|
16
|
+
]>;
|
|
17
|
+
}
|
|
18
|
+
declare const Router: import("svelte").Component<Props, {}, "">;
|
|
19
|
+
type Router = ReturnType<typeof Router>;
|
|
20
|
+
export default Router;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { LocationInfo, RouteConfig, RouteParams, Router } from './index.svelte';
|
|
2
|
+
/**
|
|
3
|
+
* Get the router instance from context
|
|
4
|
+
*/
|
|
5
|
+
export declare function useRouter(): Router;
|
|
6
|
+
/**
|
|
7
|
+
* Get reactive location information
|
|
8
|
+
*/
|
|
9
|
+
export declare function useLocation(): LocationInfo;
|
|
10
|
+
/**
|
|
11
|
+
* Get reactive current route information
|
|
12
|
+
*/
|
|
13
|
+
export declare function useRoute(): RouteConfig | null;
|
|
14
|
+
/**
|
|
15
|
+
* Get reactive route parameters
|
|
16
|
+
*/
|
|
17
|
+
export declare function useParams(): RouteParams;
|
|
18
|
+
/**
|
|
19
|
+
* Get reactive query parameters
|
|
20
|
+
*/
|
|
21
|
+
export declare function useQuery(): URLSearchParams;
|
|
22
|
+
/**
|
|
23
|
+
* Get reactive navigation state
|
|
24
|
+
*/
|
|
25
|
+
export declare function useNavigating(): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Get reactive navigation history
|
|
28
|
+
*/
|
|
29
|
+
export declare function useHistory(): import("./index.svelte").HistoryEntry[];
|
|
30
|
+
/**
|
|
31
|
+
* Get a navigation function
|
|
32
|
+
*/
|
|
33
|
+
export declare function useNavigate(): (pathname: string, options?: {
|
|
34
|
+
replace?: boolean;
|
|
35
|
+
state?: any;
|
|
36
|
+
}) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Check if a path is currently active
|
|
39
|
+
*/
|
|
40
|
+
export declare function useIsActiveRoute(): (path: string, exact?: boolean) => boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Get a function to go back in history
|
|
43
|
+
*/
|
|
44
|
+
export declare function useGoBack(): () => void;
|
|
45
|
+
/**
|
|
46
|
+
* Get a function to go forward in history
|
|
47
|
+
*/
|
|
48
|
+
export declare function useGoForward(): () => void;
|
|
49
|
+
/**
|
|
50
|
+
* Watch for route changes and execute a callback
|
|
51
|
+
*/
|
|
52
|
+
export declare function useRouteWatcher(callback: (location: LocationInfo, route: RouteConfig | null) => void, immediate?: boolean): void;
|
|
53
|
+
/**
|
|
54
|
+
* Get current route metadata
|
|
55
|
+
*/
|
|
56
|
+
export declare function useRouteMeta(): Record<string, any> | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Create a search params helper with reactive updates
|
|
59
|
+
*/
|
|
60
|
+
export declare function useSearchParams(): {
|
|
61
|
+
get: (key: string) => string | null;
|
|
62
|
+
set: (key: string, value: string) => void;
|
|
63
|
+
delete: (key: string) => void;
|
|
64
|
+
has: (key: string) => boolean;
|
|
65
|
+
toString: () => string;
|
|
66
|
+
getAll: () => {
|
|
67
|
+
[k: string]: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Hook to get the current app version path
|
|
72
|
+
*/
|
|
73
|
+
export declare function useAppVersion(): string;
|
|
74
|
+
/**
|
|
75
|
+
* Hook to get the full pathname including app version
|
|
76
|
+
*/
|
|
77
|
+
export declare function useFullPathname(): string;
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { getContext } from 'svelte';
|
|
2
|
+
/**
|
|
3
|
+
* Get the router instance from context
|
|
4
|
+
*/
|
|
5
|
+
export function useRouter() {
|
|
6
|
+
const router = getContext('router');
|
|
7
|
+
if (!router) {
|
|
8
|
+
throw new Error('useRouter must be used within a Router component');
|
|
9
|
+
}
|
|
10
|
+
return router;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get reactive location information
|
|
14
|
+
*/
|
|
15
|
+
export function useLocation() {
|
|
16
|
+
const router = useRouter();
|
|
17
|
+
return router.useLocation();
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get reactive current route information
|
|
21
|
+
*/
|
|
22
|
+
export function useRoute() {
|
|
23
|
+
const router = useRouter();
|
|
24
|
+
return router.useRoute();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get reactive route parameters
|
|
28
|
+
*/
|
|
29
|
+
export function useParams() {
|
|
30
|
+
const router = useRouter();
|
|
31
|
+
return router.getParams();
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get reactive query parameters
|
|
35
|
+
*/
|
|
36
|
+
export function useQuery() {
|
|
37
|
+
const router = useRouter();
|
|
38
|
+
return router.getQuery();
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get reactive navigation state
|
|
42
|
+
*/
|
|
43
|
+
export function useNavigating() {
|
|
44
|
+
const router = useRouter();
|
|
45
|
+
return router.useNavigating();
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get reactive navigation history
|
|
49
|
+
*/
|
|
50
|
+
export function useHistory() {
|
|
51
|
+
const router = useRouter();
|
|
52
|
+
return router.useHistory();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Get a navigation function
|
|
56
|
+
*/
|
|
57
|
+
export function useNavigate() {
|
|
58
|
+
const router = useRouter();
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60
|
+
return (pathname, options) => {
|
|
61
|
+
router.navigate(pathname, { ...options, replace: true });
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Check if a path is currently active
|
|
66
|
+
*/
|
|
67
|
+
export function useIsActiveRoute() {
|
|
68
|
+
const router = useRouter();
|
|
69
|
+
return (path, exact = false) => router.isActive(path, exact);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get a function to go back in history
|
|
73
|
+
*/
|
|
74
|
+
export function useGoBack() {
|
|
75
|
+
const router = useRouter();
|
|
76
|
+
return () => router.back();
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Get a function to go forward in history
|
|
80
|
+
*/
|
|
81
|
+
export function useGoForward() {
|
|
82
|
+
const router = useRouter();
|
|
83
|
+
return () => router.forward();
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Watch for route changes and execute a callback
|
|
87
|
+
*/
|
|
88
|
+
export function useRouteWatcher(callback, immediate = false) {
|
|
89
|
+
const router = useRouter();
|
|
90
|
+
let previousPathname = null;
|
|
91
|
+
$effect(() => {
|
|
92
|
+
const location = router.useLocation();
|
|
93
|
+
const route = router.useRoute();
|
|
94
|
+
// Only call if pathname actually changed (or immediate is true)
|
|
95
|
+
if (immediate || location.pathname !== previousPathname) {
|
|
96
|
+
callback(location, route);
|
|
97
|
+
previousPathname = location.pathname;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Get current route metadata
|
|
103
|
+
*/
|
|
104
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
105
|
+
export function useRouteMeta() {
|
|
106
|
+
const route = useRoute();
|
|
107
|
+
return route?.meta;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Create a search params helper with reactive updates
|
|
111
|
+
*/
|
|
112
|
+
export function useSearchParams() {
|
|
113
|
+
const navigate = useNavigate();
|
|
114
|
+
const location = useLocation();
|
|
115
|
+
return {
|
|
116
|
+
get: (key) => location.query.get(key),
|
|
117
|
+
set: (key, value) => {
|
|
118
|
+
const newQuery = new URLSearchParams(location.search);
|
|
119
|
+
newQuery.set(key, value);
|
|
120
|
+
const newPath = location.pathname + '?' + newQuery.toString();
|
|
121
|
+
navigate(newPath, { replace: true });
|
|
122
|
+
},
|
|
123
|
+
delete: (key) => {
|
|
124
|
+
const newQuery = new URLSearchParams(location.search);
|
|
125
|
+
newQuery.delete(key);
|
|
126
|
+
const search = newQuery.toString();
|
|
127
|
+
const newPath = location.pathname + (search ? '?' + search : '');
|
|
128
|
+
navigate(newPath, { replace: true });
|
|
129
|
+
},
|
|
130
|
+
has: (key) => location.query.has(key),
|
|
131
|
+
toString: () => location.query.toString(),
|
|
132
|
+
getAll: () => Object.fromEntries(location.query.entries())
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Hook to get the current app version path
|
|
137
|
+
*/
|
|
138
|
+
export function useAppVersion() {
|
|
139
|
+
const router = useRouter();
|
|
140
|
+
return router.getAppVersionPath();
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Hook to get the full pathname including app version
|
|
144
|
+
*/
|
|
145
|
+
export function useFullPathname() {
|
|
146
|
+
const router = useRouter();
|
|
147
|
+
return router.getFullPathname();
|
|
148
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/** Route configuration object */
|
|
2
|
+
export interface RouteConfig {
|
|
3
|
+
/** The path pattern to match (supports parameters like /users/:id) */
|
|
4
|
+
path: string;
|
|
5
|
+
/** Optional component to render when route matches */
|
|
6
|
+
component?: any;
|
|
7
|
+
/** Additional metadata for the route */
|
|
8
|
+
meta?: Record<string, any>;
|
|
9
|
+
}
|
|
10
|
+
/** Parsed route parameters from URL */
|
|
11
|
+
export interface RouteParams {
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
}
|
|
14
|
+
/** Current location information */
|
|
15
|
+
export interface LocationInfo {
|
|
16
|
+
/** Current pathname (e.g., '/users/123') */
|
|
17
|
+
pathname: string;
|
|
18
|
+
/** Current search string (e.g., '?page=1') */
|
|
19
|
+
search: string;
|
|
20
|
+
/** Current hash (e.g., '#section') */
|
|
21
|
+
hash: string;
|
|
22
|
+
/** Complete URL object */
|
|
23
|
+
url: URL;
|
|
24
|
+
/** Parsed route parameters */
|
|
25
|
+
params: RouteParams;
|
|
26
|
+
/** Current query parameters */
|
|
27
|
+
query: URLSearchParams;
|
|
28
|
+
}
|
|
29
|
+
/** History entry for navigation tracking */
|
|
30
|
+
export interface HistoryEntry {
|
|
31
|
+
/** The pathname of the history entry */
|
|
32
|
+
pathname: string;
|
|
33
|
+
/** Timestamp when entry was created */
|
|
34
|
+
timestamp: number;
|
|
35
|
+
/** Optional state data */
|
|
36
|
+
state?: any;
|
|
37
|
+
}
|
|
38
|
+
/** Router configuration options */
|
|
39
|
+
export interface RouterConfig {
|
|
40
|
+
/** Base path for all routes (default: '') */
|
|
41
|
+
basePath?: string;
|
|
42
|
+
/** Whether to use hash-based routing (default: false) */
|
|
43
|
+
hashMode?: boolean;
|
|
44
|
+
/** Initial route to navigate to if no route matches */
|
|
45
|
+
fallbackRoute?: string;
|
|
46
|
+
/** Whether to automatically initialize on browser load */
|
|
47
|
+
autoInit?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/** Custom Router Class for Svelte 5 */
|
|
50
|
+
export declare class Router {
|
|
51
|
+
#private;
|
|
52
|
+
/** Creates a new Router instance */
|
|
53
|
+
constructor(config?: RouterConfig);
|
|
54
|
+
/** Initialize the router and start listening to navigation events */
|
|
55
|
+
init(): void;
|
|
56
|
+
/** Navigate to the root path */
|
|
57
|
+
gotoRootPath(): void;
|
|
58
|
+
/** Initialize the app version path that will be persisted across all routes */
|
|
59
|
+
initAppVersion(appVersionPath: string): void;
|
|
60
|
+
/** Clean up event listeners and stop the router */
|
|
61
|
+
destroy(): void;
|
|
62
|
+
/** Register a route with the router */
|
|
63
|
+
addRoute(route: RouteConfig): void;
|
|
64
|
+
/** Register multiple routes at once */
|
|
65
|
+
addRoutes(routes: RouteConfig[]): void;
|
|
66
|
+
/** Navigate to a specified pathname */
|
|
67
|
+
navigate(pathname: string, options?: {
|
|
68
|
+
replace?: boolean;
|
|
69
|
+
state?: any;
|
|
70
|
+
}): void;
|
|
71
|
+
/** Navigate back in history */
|
|
72
|
+
back(): void;
|
|
73
|
+
/** Navigate forward in history */
|
|
74
|
+
forward(): void;
|
|
75
|
+
/** Get reactive location information */
|
|
76
|
+
useLocation(): LocationInfo;
|
|
77
|
+
/** Get reactive current route information */
|
|
78
|
+
useRoute(): RouteConfig | null;
|
|
79
|
+
/** Get reactive navigation history */
|
|
80
|
+
useHistory(): HistoryEntry[];
|
|
81
|
+
/** Get reactive navigation state */
|
|
82
|
+
useNavigating(): boolean;
|
|
83
|
+
/** Check if a path matches the current location */
|
|
84
|
+
isActive(path: string, exact?: boolean): boolean;
|
|
85
|
+
/** Get the current app version path */
|
|
86
|
+
getAppVersionPath(): string;
|
|
87
|
+
/** Get the full pathname including app version path */
|
|
88
|
+
getFullPathname(): string;
|
|
89
|
+
/** Get the current active path */
|
|
90
|
+
getActivePath(): string;
|
|
91
|
+
/** Get the current route parameters */
|
|
92
|
+
getParams(): RouteParams;
|
|
93
|
+
/** Get current query parameters */
|
|
94
|
+
getQuery(): URLSearchParams;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Create a router instance with the given configuration
|
|
98
|
+
*/
|
|
99
|
+
export declare function createRouter(config?: RouterConfig): Router;
|
|
100
|
+
/**
|
|
101
|
+
* Default router instance for convenience
|
|
102
|
+
*/
|
|
103
|
+
export declare const router: Router;
|
|
104
|
+
export { default as Link } from './Link.svelte';
|
|
105
|
+
export { default as Route } from './Route.svelte';
|
|
106
|
+
export { default as RouterComponent } from './Router.svelte';
|
|
107
|
+
export * from './hooks.svelte.js';
|