@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,400 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { routerStore } from '../stores';
|
|
3
|
+
/**
|
|
4
|
+
* Custom Client-Side Router for Svelte 5
|
|
5
|
+
*/
|
|
6
|
+
// Browser detection utility
|
|
7
|
+
const browser = typeof window !== 'undefined';
|
|
8
|
+
/** Custom Router Class for Svelte 5 */
|
|
9
|
+
export class Router {
|
|
10
|
+
// Reactive state using Svelte 5 runes
|
|
11
|
+
#currentLocation = $state();
|
|
12
|
+
#currentRoute = $state(null);
|
|
13
|
+
#isNavigating = $state(false);
|
|
14
|
+
#history = $state([]);
|
|
15
|
+
// Configuration
|
|
16
|
+
#config;
|
|
17
|
+
#routes = [];
|
|
18
|
+
#isInitialized = false;
|
|
19
|
+
#appVersionPath = '';
|
|
20
|
+
// Event listeners cleanup
|
|
21
|
+
#cleanup = [];
|
|
22
|
+
/** Creates a new Router instance */
|
|
23
|
+
constructor(config = {}) {
|
|
24
|
+
this.#config = {
|
|
25
|
+
basePath: config.basePath || '',
|
|
26
|
+
hashMode: config.hashMode || false,
|
|
27
|
+
fallbackRoute: config.fallbackRoute || '/',
|
|
28
|
+
autoInit: config.autoInit !== false // Default to true
|
|
29
|
+
};
|
|
30
|
+
// Initialize location with current browser location
|
|
31
|
+
this.#initializeLocation();
|
|
32
|
+
// Auto-initialize if in browser and autoInit is enabled
|
|
33
|
+
if (browser && this.#config.autoInit) {
|
|
34
|
+
this.init();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/** Initialize the router and start listening to navigation events */
|
|
38
|
+
init() {
|
|
39
|
+
if (!browser || this.#isInitialized)
|
|
40
|
+
return;
|
|
41
|
+
this.#isInitialized = true;
|
|
42
|
+
this.#setupEventListeners();
|
|
43
|
+
this.#handleCurrentLocation();
|
|
44
|
+
}
|
|
45
|
+
/** Navigate to the root path */
|
|
46
|
+
gotoRootPath() {
|
|
47
|
+
const currentFullPath = this.getFullPathname();
|
|
48
|
+
const rootPath = this.#appVersionPath || '/';
|
|
49
|
+
if (currentFullPath === rootPath) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
// Navigate to the app version path (e.g., /test) or root (/)
|
|
53
|
+
if (this.#appVersionPath) {
|
|
54
|
+
// Navigate to app version root (e.g., /test)
|
|
55
|
+
window.history.replaceState(null, '', this.#appVersionPath);
|
|
56
|
+
const url = new URL(window.location.href);
|
|
57
|
+
this.#updateLocation(url);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
// Navigate to regular root
|
|
61
|
+
this.navigate('/', { replace: true });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/** Initialize the app version path that will be persisted across all routes */
|
|
65
|
+
initAppVersion(appVersionPath) {
|
|
66
|
+
// Ensure the path starts with / and doesn't end with /
|
|
67
|
+
this.#appVersionPath = appVersionPath.startsWith('/') ? appVersionPath : `/${appVersionPath}`;
|
|
68
|
+
if (this.#appVersionPath.endsWith('/') && this.#appVersionPath.length > 1) {
|
|
69
|
+
this.#appVersionPath = this.#appVersionPath.slice(0, -1);
|
|
70
|
+
}
|
|
71
|
+
// Update current location to include app version path
|
|
72
|
+
if (browser) {
|
|
73
|
+
const currentURL = new URL(window.location.href);
|
|
74
|
+
const pathname = currentURL.pathname;
|
|
75
|
+
// If current path doesn't include the app version path, navigate to it
|
|
76
|
+
if (!pathname.startsWith(this.#appVersionPath)) {
|
|
77
|
+
const newPath = this.#appVersionPath + (pathname === '/' ? '' : pathname);
|
|
78
|
+
this.navigate(newPath, { replace: true });
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
// Update internal state with current location
|
|
82
|
+
this.#updateLocation(currentURL);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/** Clean up event listeners and stop the router */
|
|
87
|
+
destroy() {
|
|
88
|
+
this.#cleanup.forEach((cleanup) => cleanup());
|
|
89
|
+
this.#cleanup = [];
|
|
90
|
+
this.#isInitialized = false;
|
|
91
|
+
}
|
|
92
|
+
/** Register a route with the router */
|
|
93
|
+
addRoute(route) {
|
|
94
|
+
this.#routes.push(route);
|
|
95
|
+
}
|
|
96
|
+
/** Register multiple routes at once */
|
|
97
|
+
addRoutes(routes) {
|
|
98
|
+
this.#routes.push(...routes);
|
|
99
|
+
}
|
|
100
|
+
/** Navigate to a specified pathname */
|
|
101
|
+
navigate(pathname, options = {}) {
|
|
102
|
+
if (!browser)
|
|
103
|
+
return;
|
|
104
|
+
this.#isNavigating = true;
|
|
105
|
+
try {
|
|
106
|
+
// Prepend app version path if it's set and not already included
|
|
107
|
+
let fullPath = pathname;
|
|
108
|
+
if (this.#appVersionPath && !pathname.startsWith(this.#appVersionPath)) {
|
|
109
|
+
// Handle root path specially
|
|
110
|
+
if (pathname === '/') {
|
|
111
|
+
fullPath = this.#appVersionPath;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
fullPath = this.#appVersionPath + pathname;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const url = this.#createURL(fullPath);
|
|
118
|
+
// Update browser history
|
|
119
|
+
if (options.replace) {
|
|
120
|
+
window.history.replaceState(options.state || null, '', url.toString());
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
window.history.pushState(options.state || null, '', url.toString());
|
|
124
|
+
}
|
|
125
|
+
// Update internal state
|
|
126
|
+
this.#updateLocation(url, options.state);
|
|
127
|
+
}
|
|
128
|
+
finally {
|
|
129
|
+
this.#isNavigating = false;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
/** Navigate back in history */
|
|
133
|
+
back() {
|
|
134
|
+
if (!browser)
|
|
135
|
+
return;
|
|
136
|
+
window.history.back();
|
|
137
|
+
}
|
|
138
|
+
/** Navigate forward in history */
|
|
139
|
+
forward() {
|
|
140
|
+
if (!browser)
|
|
141
|
+
return;
|
|
142
|
+
window.history.forward();
|
|
143
|
+
}
|
|
144
|
+
/** Get reactive location information */
|
|
145
|
+
useLocation() {
|
|
146
|
+
return this.#currentLocation;
|
|
147
|
+
}
|
|
148
|
+
/** Get reactive current route information */
|
|
149
|
+
useRoute() {
|
|
150
|
+
return this.#currentRoute;
|
|
151
|
+
}
|
|
152
|
+
/** Get reactive navigation history */
|
|
153
|
+
useHistory() {
|
|
154
|
+
return this.#history;
|
|
155
|
+
}
|
|
156
|
+
/** Get reactive navigation state */
|
|
157
|
+
useNavigating() {
|
|
158
|
+
return this.#isNavigating;
|
|
159
|
+
}
|
|
160
|
+
/** Check if a path matches the current location */
|
|
161
|
+
isActive(path, exact = false) {
|
|
162
|
+
const currentPath = this.#normalizePath(this.#currentLocation.pathname);
|
|
163
|
+
const checkPath = this.#normalizePath(path);
|
|
164
|
+
if (exact) {
|
|
165
|
+
return currentPath === checkPath;
|
|
166
|
+
}
|
|
167
|
+
if (checkPath === '/') {
|
|
168
|
+
return currentPath === '/';
|
|
169
|
+
}
|
|
170
|
+
return currentPath === checkPath || currentPath.startsWith(checkPath + '/');
|
|
171
|
+
}
|
|
172
|
+
/** Get the current app version path */
|
|
173
|
+
getAppVersionPath() {
|
|
174
|
+
return this.#appVersionPath;
|
|
175
|
+
}
|
|
176
|
+
/** Get the full pathname including app version path */
|
|
177
|
+
getFullPathname() {
|
|
178
|
+
if (!browser)
|
|
179
|
+
return '/';
|
|
180
|
+
return window.location.pathname;
|
|
181
|
+
}
|
|
182
|
+
/** Get the current active path */
|
|
183
|
+
getActivePath() {
|
|
184
|
+
// include the app version path
|
|
185
|
+
return this.#appVersionPath + this.#currentLocation.pathname;
|
|
186
|
+
}
|
|
187
|
+
/** Get the current route parameters */
|
|
188
|
+
getParams() {
|
|
189
|
+
return this.#currentLocation.params;
|
|
190
|
+
}
|
|
191
|
+
/** Get current query parameters */
|
|
192
|
+
getQuery() {
|
|
193
|
+
return this.#currentLocation.query;
|
|
194
|
+
}
|
|
195
|
+
/** Initialize location state from current browser location */
|
|
196
|
+
#initializeLocation() {
|
|
197
|
+
if (!browser) {
|
|
198
|
+
// Provide default values for SSR
|
|
199
|
+
this.#currentLocation = {
|
|
200
|
+
pathname: '/',
|
|
201
|
+
search: '',
|
|
202
|
+
hash: '',
|
|
203
|
+
url: new URL('http://localhost/'),
|
|
204
|
+
params: {},
|
|
205
|
+
query: new URLSearchParams()
|
|
206
|
+
};
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
const url = new URL(window.location.href);
|
|
210
|
+
this.#updateLocation(url);
|
|
211
|
+
}
|
|
212
|
+
/** Setup event listeners for navigation */
|
|
213
|
+
#setupEventListeners() {
|
|
214
|
+
if (!browser)
|
|
215
|
+
return;
|
|
216
|
+
// Listen for popstate events (back/forward navigation)
|
|
217
|
+
const handlePopState = (event) => {
|
|
218
|
+
const url = new URL(window.location.href);
|
|
219
|
+
this.#updateLocation(url, event.state);
|
|
220
|
+
};
|
|
221
|
+
// Listen for hash changes if in hash mode
|
|
222
|
+
const handleHashChange = () => {
|
|
223
|
+
if (this.#config.hashMode) {
|
|
224
|
+
const url = new URL(window.location.href);
|
|
225
|
+
this.#updateLocation(url);
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
window.addEventListener('popstate', handlePopState);
|
|
229
|
+
window.addEventListener('hashchange', handleHashChange);
|
|
230
|
+
// Store cleanup functions
|
|
231
|
+
this.#cleanup.push(() => window.removeEventListener('popstate', handlePopState), () => window.removeEventListener('hashchange', handleHashChange));
|
|
232
|
+
}
|
|
233
|
+
/** Create a URL object from a pathname */
|
|
234
|
+
#createURL(pathname) {
|
|
235
|
+
if (!browser)
|
|
236
|
+
return new URL('http://localhost/');
|
|
237
|
+
const baseURL = window.location.origin;
|
|
238
|
+
let fullPath = pathname;
|
|
239
|
+
// Handle base path
|
|
240
|
+
if (this.#config.basePath && !pathname.startsWith(this.#config.basePath)) {
|
|
241
|
+
fullPath = this.#config.basePath + pathname;
|
|
242
|
+
}
|
|
243
|
+
// Handle hash mode
|
|
244
|
+
if (this.#config.hashMode) {
|
|
245
|
+
fullPath = window.location.pathname + '#' + pathname;
|
|
246
|
+
}
|
|
247
|
+
return new URL(fullPath, baseURL);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Update internal location state
|
|
251
|
+
* @private
|
|
252
|
+
*/
|
|
253
|
+
#updateLocation(url, state) {
|
|
254
|
+
let pathname = url.pathname;
|
|
255
|
+
// Remove base path for internal routing
|
|
256
|
+
if (this.#config.basePath && pathname.startsWith(this.#config.basePath)) {
|
|
257
|
+
pathname = pathname.slice(this.#config.basePath.length) || '/';
|
|
258
|
+
}
|
|
259
|
+
// Remove app version path for internal routing
|
|
260
|
+
if (this.#appVersionPath && pathname.startsWith(this.#appVersionPath)) {
|
|
261
|
+
pathname = pathname.slice(this.#appVersionPath.length) || '/';
|
|
262
|
+
}
|
|
263
|
+
// Handle hash mode
|
|
264
|
+
if (this.#config.hashMode) {
|
|
265
|
+
pathname = url.hash.slice(1) || '/';
|
|
266
|
+
}
|
|
267
|
+
// Find matching route and extract parameters
|
|
268
|
+
const match = this.#findMatchingRoute(pathname);
|
|
269
|
+
// Update current location (store the clean pathname without app version)
|
|
270
|
+
this.#currentLocation = {
|
|
271
|
+
pathname,
|
|
272
|
+
search: url.search,
|
|
273
|
+
hash: url.hash,
|
|
274
|
+
url,
|
|
275
|
+
params: match?.params || {},
|
|
276
|
+
query: new URLSearchParams(url.search)
|
|
277
|
+
};
|
|
278
|
+
// Update current route
|
|
279
|
+
this.#currentRoute = match?.route || null;
|
|
280
|
+
// Add to history
|
|
281
|
+
this.#addToHistory(pathname, state);
|
|
282
|
+
// Update the external routerStore whenever route changes
|
|
283
|
+
this.#updateRouterStore(url);
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Update the external routerStore with current route information
|
|
287
|
+
* @private
|
|
288
|
+
*/
|
|
289
|
+
#updateRouterStore(url) {
|
|
290
|
+
// Extract the app version ID (hash) from the app version path
|
|
291
|
+
const hash = this.#appVersionPath ? this.#appVersionPath.slice(1) : ''; // Remove leading slash
|
|
292
|
+
routerStore.set({
|
|
293
|
+
hash,
|
|
294
|
+
url
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Find a route that matches the given pathname
|
|
299
|
+
* @private
|
|
300
|
+
*/
|
|
301
|
+
#findMatchingRoute(pathname) {
|
|
302
|
+
for (const route of this.#routes) {
|
|
303
|
+
const match = this.#matchRoute(route.path, pathname);
|
|
304
|
+
if (match) {
|
|
305
|
+
return {
|
|
306
|
+
route,
|
|
307
|
+
params: match.params,
|
|
308
|
+
isExact: match.isExact
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Normalize path by removing trailing slashes (except for root)
|
|
316
|
+
* @private
|
|
317
|
+
*/
|
|
318
|
+
#normalizePath(path) {
|
|
319
|
+
if (path === '/')
|
|
320
|
+
return path;
|
|
321
|
+
return path.replace(/\/+$/, '');
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Match a route pattern against a pathname
|
|
325
|
+
* @private
|
|
326
|
+
*/
|
|
327
|
+
#matchRoute(pattern, pathname) {
|
|
328
|
+
// Normalize both paths to handle trailing slashes
|
|
329
|
+
const normalizedPattern = this.#normalizePath(pattern);
|
|
330
|
+
const normalizedPathname = this.#normalizePath(pathname);
|
|
331
|
+
// Simple exact match
|
|
332
|
+
if (normalizedPattern === normalizedPathname) {
|
|
333
|
+
return { params: {}, isExact: true };
|
|
334
|
+
}
|
|
335
|
+
// Parameter matching
|
|
336
|
+
const patternParts = normalizedPattern.split('/').filter(Boolean);
|
|
337
|
+
const pathnameParts = normalizedPathname.split('/').filter(Boolean);
|
|
338
|
+
// Must have same number of parts for exact match
|
|
339
|
+
if (patternParts.length !== pathnameParts.length) {
|
|
340
|
+
return null;
|
|
341
|
+
}
|
|
342
|
+
const params = {};
|
|
343
|
+
for (let i = 0; i < patternParts.length; i++) {
|
|
344
|
+
const patternPart = patternParts[i];
|
|
345
|
+
const pathnamePart = pathnameParts[i];
|
|
346
|
+
if (patternPart.startsWith(':')) {
|
|
347
|
+
// This is a parameter
|
|
348
|
+
const paramName = patternPart.slice(1);
|
|
349
|
+
params[paramName] = decodeURIComponent(pathnamePart);
|
|
350
|
+
}
|
|
351
|
+
else if (patternPart !== pathnamePart) {
|
|
352
|
+
// Not a match
|
|
353
|
+
return null;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
return { params, isExact: true };
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Add entry to navigation history
|
|
360
|
+
* @private
|
|
361
|
+
*/
|
|
362
|
+
#addToHistory(pathname, state) {
|
|
363
|
+
const entry = {
|
|
364
|
+
pathname,
|
|
365
|
+
timestamp: Date.now(),
|
|
366
|
+
state
|
|
367
|
+
};
|
|
368
|
+
// Limit history size to prevent memory issues
|
|
369
|
+
if (this.#history.length >= 100) {
|
|
370
|
+
this.#history.shift();
|
|
371
|
+
}
|
|
372
|
+
this.#history.push(entry);
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Handle current location on initialization
|
|
376
|
+
* @private
|
|
377
|
+
*/
|
|
378
|
+
#handleCurrentLocation() {
|
|
379
|
+
if (!browser)
|
|
380
|
+
return;
|
|
381
|
+
const url = new URL(window.location.href);
|
|
382
|
+
this.#updateLocation(url);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Create a router instance with the given configuration
|
|
387
|
+
*/
|
|
388
|
+
export function createRouter(config) {
|
|
389
|
+
return new Router(config);
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Default router instance for convenience
|
|
393
|
+
*/
|
|
394
|
+
export const router = createRouter();
|
|
395
|
+
// Export components
|
|
396
|
+
export { default as Link } from './Link.svelte';
|
|
397
|
+
export { default as Route } from './Route.svelte';
|
|
398
|
+
export { default as RouterComponent } from './Router.svelte';
|
|
399
|
+
// Export hooks and utilities
|
|
400
|
+
export * from './hooks.svelte.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type Breakpoint = {
|
|
2
|
+
name: string;
|
|
3
|
+
value: number;
|
|
4
|
+
duration: number;
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
};
|
|
7
|
+
export type BreakpointOutput = {
|
|
8
|
+
[breakpoint: number]: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const breakpointsStore: import("svelte/store").Writable<BreakpointOutput>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const componentInjectErrors: import("svelte/store").Writable<boolean>;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { derived } from 'svelte/store';
|
|
2
|
+
interface FormState<T> {
|
|
3
|
+
values: T;
|
|
4
|
+
errors: Record<keyof T, string[]>;
|
|
5
|
+
touched: Record<keyof T, boolean>;
|
|
6
|
+
isValid: boolean;
|
|
7
|
+
isDirty: boolean;
|
|
8
|
+
isSubmitting: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Creates a form validation utility with Zod
|
|
12
|
+
* @param identifier - Unique identifier for the form
|
|
13
|
+
* @param options - Configuration options
|
|
14
|
+
*/
|
|
15
|
+
export declare class FormValidator<T extends {
|
|
16
|
+
name: string;
|
|
17
|
+
instance: string;
|
|
18
|
+
class: string;
|
|
19
|
+
}> {
|
|
20
|
+
private schema;
|
|
21
|
+
private store;
|
|
22
|
+
form: ReturnType<typeof derived<typeof this.store, FormState<T>>>;
|
|
23
|
+
private instancesSet;
|
|
24
|
+
private initialValues;
|
|
25
|
+
private identifier;
|
|
26
|
+
private currentInstanceToIgnore;
|
|
27
|
+
/**
|
|
28
|
+
* Generates unique name, instance, and class based on solution name and existing instances
|
|
29
|
+
* @param existingInstances - Array of existing instance names
|
|
30
|
+
* @param solution - The base solution name
|
|
31
|
+
* @returns Object containing name, instance, and class values
|
|
32
|
+
*/
|
|
33
|
+
static generateNames(existingInstances: string[], solution: string, name: string): {
|
|
34
|
+
name: string;
|
|
35
|
+
instance: string;
|
|
36
|
+
class: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Cleans up the class name to ensure it's valid
|
|
40
|
+
* @param className - The class name to clean up
|
|
41
|
+
* @returns The cleaned up class name
|
|
42
|
+
*/
|
|
43
|
+
static sanitizeClassName(className: string): string;
|
|
44
|
+
constructor(identifier: string, initialValues: T, options?: {
|
|
45
|
+
existingInstances?: string[];
|
|
46
|
+
});
|
|
47
|
+
/**
|
|
48
|
+
* Set a specific instance to ignore during validation
|
|
49
|
+
* Used in edit mode to prevent the current instance from being flagged as invalid
|
|
50
|
+
*/
|
|
51
|
+
ignoreInstanceValidation(instanceValue: string, existingInstances: string[]): void;
|
|
52
|
+
/**
|
|
53
|
+
* Set the value of a specific field
|
|
54
|
+
*/
|
|
55
|
+
setField<K extends keyof T>(field: K, value: T[K]): void;
|
|
56
|
+
/**
|
|
57
|
+
* Set multiple field values at once
|
|
58
|
+
*/
|
|
59
|
+
setFields(values: Partial<T>): void;
|
|
60
|
+
/**
|
|
61
|
+
* Handle instance field validation with uniqueness check
|
|
62
|
+
*/
|
|
63
|
+
validateWithInstances(existingInstances: string[]): void;
|
|
64
|
+
/**
|
|
65
|
+
* Reset the form to initial values
|
|
66
|
+
*/
|
|
67
|
+
reset(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Validate the form values
|
|
70
|
+
*/
|
|
71
|
+
private validate;
|
|
72
|
+
/**
|
|
73
|
+
* Set the form as submitting
|
|
74
|
+
*/
|
|
75
|
+
setSubmitting(isSubmitting: boolean): void;
|
|
76
|
+
/**
|
|
77
|
+
* Get the current state of the form
|
|
78
|
+
*/
|
|
79
|
+
getState(): FormState<T>;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get a form by its identifier
|
|
83
|
+
*/
|
|
84
|
+
export declare function getFormById(identifier: string): FormValidator<any> | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Check if a form with a specific identifier is valid
|
|
87
|
+
*/
|
|
88
|
+
export declare function isFormValid(identifier: string): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Get error messages for a specific form
|
|
91
|
+
*/
|
|
92
|
+
export declare function getFormErrors(identifier: string): Record<string, string[]> | null;
|
|
93
|
+
/**
|
|
94
|
+
* Reset a form by its identifier
|
|
95
|
+
*/
|
|
96
|
+
export declare function resetForm(identifier: string): boolean;
|
|
97
|
+
export declare function createFormSubscription(identifier: string): import("svelte/store").Writable<{
|
|
98
|
+
isValid: boolean;
|
|
99
|
+
errors: {};
|
|
100
|
+
values: {};
|
|
101
|
+
}> | {
|
|
102
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<FormState<any>>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
103
|
+
destroy: () => void;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Store to track if the form is adding or updating to the Canvas
|
|
107
|
+
*/
|
|
108
|
+
export declare const isAddingOrUpdating: import("svelte/store").Writable<boolean>;
|
|
109
|
+
export declare const loadingSelectedElement: import("svelte/store").Writable<boolean>;
|
|
110
|
+
export {};
|