@hanzo/ui 0.5.24 → 0.6.15
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/.eslintrc.js +4 -0
- package/.prettierrc +22 -0
- package/.rush/temp/chunked-rush-logs/ui._phase_build.chunks.jsonl +2 -0
- package/.rush/temp/chunked-rush-logs/ui._phase_validate.chunks.jsonl +11 -0
- package/.rush/temp/hcengineering+ui-_phase_build-16380278e5d28b32a6666092bd103ddbd2c66a56.tar.log +12 -0
- package/.rush/temp/hcengineering+ui-_phase_build-16380278e5d28b32a6666092bd103ddbd2c66a56.untar.log +10 -0
- package/.rush/temp/hcengineering+ui-_phase_validate-8f047ca66e6a4a177eee65782e723a7dc128d73e.tar.log +65 -0
- package/.rush/temp/hcengineering+ui-_phase_validate-8f047ca66e6a4a177eee65782e723a7dc128d73e.untar.log +10 -0
- package/.rush/temp/operation/_phase_build/all.log +2 -0
- package/.rush/temp/operation/_phase_build/log-chunks.jsonl +2 -0
- package/.rush/temp/operation/_phase_build/state.json +3 -0
- package/.rush/temp/operation/_phase_validate/all.log +11 -0
- package/.rush/temp/operation/_phase_validate/log-chunks.jsonl +11 -0
- package/.rush/temp/operation/_phase_validate/state.json +3 -0
- package/.rush/temp/shrinkwrap-deps.json +585 -0
- package/.validate/tsBuildInfoFile.info +1 -0
- package/.validate/validate-err.log +0 -0
- package/.validate/validate.log +0 -0
- package/CHANGELOG.json +17 -0
- package/CHANGELOG.md +9 -0
- package/config/rig.json +5 -0
- package/jest.config.js +5 -0
- package/lang/cs.json +119 -0
- package/lang/de.json +119 -0
- package/lang/en.json +120 -0
- package/lang/es.json +120 -0
- package/lang/fr.json +120 -0
- package/lang/it.json +120 -0
- package/lang/pt.json +120 -0
- package/lang/ru.json +120 -0
- package/lang/zh.json +120 -0
- package/package.json +52 -100
- package/postcss.config.js +5 -0
- package/rush-logs/ui._phase_build.cache.log +4 -0
- package/rush-logs/ui._phase_build.log +2 -0
- package/rush-logs/ui._phase_validate.cache.log +4 -0
- package/rush-logs/ui._phase_validate.log +11 -0
- package/src/__test__/location.test.ts +12 -0
- package/src/colors.ts +552 -0
- package/src/components/AccordionItem.svelte +132 -0
- package/src/components/ActionIcon.svelte +88 -0
- package/src/components/BarDashboard.svelte +47 -0
- package/src/components/BooleanIcon.svelte +31 -0
- package/src/components/Breadcrumb.svelte +102 -0
- package/src/components/Breadcrumbs.svelte +73 -0
- package/src/components/Button.svelte +196 -0
- package/src/components/ButtonBase.svelte +117 -0
- package/src/components/ButtonGroup.svelte +48 -0
- package/src/components/ButtonIcon.svelte +63 -0
- package/src/components/ButtonMenu.svelte +103 -0
- package/src/components/ButtonWithDropdown.svelte +120 -0
- package/src/components/CheckBox.svelte +239 -0
- package/src/components/CheckBoxList.svelte.txt +88 -0
- package/src/components/CheckBoxWithLabel.svelte.txt +147 -0
- package/src/components/Chevron.svelte +85 -0
- package/src/components/Chip.svelte +109 -0
- package/src/components/CircleButton.svelte +165 -0
- package/src/components/CodeForm.svelte +164 -0
- package/src/components/CodeInput.svelte +86 -0
- package/src/components/ColorPopup.svelte +119 -0
- package/src/components/Component.svelte +152 -0
- package/src/components/Dialog.svelte +105 -0
- package/src/components/Dock.svelte +53 -0
- package/src/components/Dropdown.svelte +91 -0
- package/src/components/DropdownLabels.svelte +156 -0
- package/src/components/DropdownLabelsIntl.svelte +108 -0
- package/src/components/DropdownLabelsPopup.svelte +148 -0
- package/src/components/DropdownLabelsPopupIntl.svelte +72 -0
- package/src/components/DropdownPopup.svelte +146 -0
- package/src/components/DropdownRecord.svelte +50 -0
- package/src/components/DropdownRecordPopup.svelte +82 -0
- package/src/components/EditBox.svelte +211 -0
- package/src/components/EditWithIcon.svelte +130 -0
- package/src/components/EmbeddedPDF.svelte +88 -0
- package/src/components/ErrorPopup.svelte +27 -0
- package/src/components/ErrorPresenter.svelte +32 -0
- package/src/components/ExpandCollapse.svelte +42 -0
- package/src/components/Expandable.svelte +90 -0
- package/src/components/FocusHandler.svelte +21 -0
- package/src/components/Fold.svelte +52 -0
- package/src/components/Grid.svelte +39 -0
- package/src/components/Header.svelte +260 -0
- package/src/components/HlsVideo.svelte +170 -0
- package/src/components/Hotkey.svelte +50 -0
- package/src/components/HotkeyGroup.svelte +25 -0
- package/src/components/Html.svelte +24 -0
- package/src/components/Icon.svelte +45 -0
- package/src/components/IconWithEmoji.svelte +74 -0
- package/src/components/Image.svelte +71 -0
- package/src/components/Label.svelte +38 -0
- package/src/components/Lazy.svelte +29 -0
- package/src/components/Like.svelte +73 -0
- package/src/components/Link.svelte +75 -0
- package/src/components/LinkWrapper.svelte +35 -0
- package/src/components/ListView.svelte +153 -0
- package/src/components/ListViewItem.svelte +84 -0
- package/src/components/Loading.svelte +88 -0
- package/src/components/Menu.svelte +205 -0
- package/src/components/MiniToggle.svelte +125 -0
- package/src/components/Modal.svelte +117 -0
- package/src/components/ModeSelector.svelte +37 -0
- package/src/components/ModernButton.svelte +61 -0
- package/src/components/ModernCheckbox.svelte +123 -0
- package/src/components/ModernDialog.svelte +258 -0
- package/src/components/ModernEditbox.svelte +256 -0
- package/src/components/ModernPopup.svelte +105 -0
- package/src/components/ModernRadioButton.svelte +111 -0
- package/src/components/ModernTab.svelte +184 -0
- package/src/components/ModernToggle.svelte +153 -0
- package/src/components/MouseSpeedTracker.svelte +74 -0
- package/src/components/MultiProgress.svelte +97 -0
- package/src/components/NavGroup.svelte +160 -0
- package/src/components/NavItem.svelte +346 -0
- package/src/components/NestedDropdown.svelte +62 -0
- package/src/components/NestedMenu.svelte +119 -0
- package/src/components/NotificationToast.svelte +112 -0
- package/src/components/NumberInput.svelte +200 -0
- package/src/components/Panel.svelte +324 -0
- package/src/components/PanelInstance.svelte +254 -0
- package/src/components/PlainTextEditor.svelte +100 -0
- package/src/components/Popup.svelte +50 -0
- package/src/components/PopupInstance.svelte +390 -0
- package/src/components/PopupMenu.svelte +120 -0
- package/src/components/Progress.svelte +124 -0
- package/src/components/ProgressCircle.svelte +71 -0
- package/src/components/RadioButton.svelte +69 -0
- package/src/components/RadioGroup.svelte +42 -0
- package/src/components/RootStatusComponent.svelte +65 -0
- package/src/components/Row.svelte +25 -0
- package/src/components/ScrollBox.svelte +98 -0
- package/src/components/Scroller.svelte +1063 -0
- package/src/components/ScrollerBar.svelte +181 -0
- package/src/components/SearchEdit.svelte +46 -0
- package/src/components/SearchInput.svelte +213 -0
- package/src/components/SearchPicker.svelte +114 -0
- package/src/components/Section.svelte +49 -0
- package/src/components/SectionEmpty.svelte +38 -0
- package/src/components/SelectBox.svelte +76 -0
- package/src/components/SelectPopup.svelte +217 -0
- package/src/components/Separator.svelte +736 -0
- package/src/components/ShowMore.svelte +99 -0
- package/src/components/Spinner.svelte +72 -0
- package/src/components/SplitButton.svelte +100 -0
- package/src/components/StateTag.svelte +79 -0
- package/src/components/Status.svelte +33 -0
- package/src/components/StepsDialog.svelte +290 -0
- package/src/components/StylishEdit.svelte +127 -0
- package/src/components/Submenu.svelte +68 -0
- package/src/components/Switcher.svelte +55 -0
- package/src/components/SwitcherBase.svelte +116 -0
- package/src/components/TabList.svelte +290 -0
- package/src/components/Tabs.svelte +45 -0
- package/src/components/TabsControl.svelte +113 -0
- package/src/components/TextArea.svelte +110 -0
- package/src/components/TextAreaEditor.svelte +78 -0
- package/src/components/TimeLeft.svelte +66 -0
- package/src/components/TimeShiftPicker.svelte +84 -0
- package/src/components/TimeShiftPopup.svelte +64 -0
- package/src/components/TimeShiftPresenter.svelte +59 -0
- package/src/components/TimeSince.svelte +86 -0
- package/src/components/TimeZonesPopup.svelte +185 -0
- package/src/components/Timeline.svelte +754 -0
- package/src/components/Toggle.svelte +116 -0
- package/src/components/ToggleButton.svelte +176 -0
- package/src/components/ToggleWithLabel.svelte +58 -0
- package/src/components/TooltipInstance.svelte +613 -0
- package/src/components/Video.svelte +40 -0
- package/src/components/calendar/DateInputBox.svelte +430 -0
- package/src/components/calendar/DatePicker.svelte +46 -0
- package/src/components/calendar/DatePopup.svelte +274 -0
- package/src/components/calendar/DatePresenter.svelte +392 -0
- package/src/components/calendar/DateRangePicker.svelte +50 -0
- package/src/components/calendar/DateRangePopup.svelte +76 -0
- package/src/components/calendar/DateRangePresenter.svelte +779 -0
- package/src/components/calendar/DateTimePresenter.svelte +23 -0
- package/src/components/calendar/DateTimeRangePresenter.svelte +28 -0
- package/src/components/calendar/DueDatePopup.svelte +93 -0
- package/src/components/calendar/DueDatePresenter.svelte +83 -0
- package/src/components/calendar/Month.svelte +243 -0
- package/src/components/calendar/MonthCalendar.svelte +138 -0
- package/src/components/calendar/MonthSquare.svelte +315 -0
- package/src/components/calendar/RangeDatePopup.svelte +231 -0
- package/src/components/calendar/Shifts.svelte +114 -0
- package/src/components/calendar/SimpleDatePopup.svelte +42 -0
- package/src/components/calendar/SimpleTimePopup.svelte +41 -0
- package/src/components/calendar/TimeInputBox.svelte +282 -0
- package/src/components/calendar/TimePopup.svelte +62 -0
- package/src/components/calendar/WeekCalendar.svelte +116 -0
- package/src/components/calendar/YearCalendar.svelte +67 -0
- package/src/components/calendar/icons/DPCalendar.svelte +12 -0
- package/src/components/calendar/icons/DPCalendarOver.svelte +15 -0
- package/src/components/calendar/icons/DPClock.svelte +13 -0
- package/src/components/calendar/icons/DPClockBold.svelte +10 -0
- package/src/components/calendar/icons/DPEnd.svelte +13 -0
- package/src/components/calendar/icons/DPSetCalendar.svelte +10 -0
- package/src/components/calendar/icons/DPStart.svelte +13 -0
- package/src/components/calendar/internal/DateUtils.ts +186 -0
- package/src/components/emoji/ActionsPopup.svelte +116 -0
- package/src/components/emoji/EmojiButton.svelte +146 -0
- package/src/components/emoji/EmojiGroup.svelte +105 -0
- package/src/components/emoji/EmojiGroupPalette.svelte +58 -0
- package/src/components/emoji/EmojiPopup.svelte +430 -0
- package/src/components/emoji/SkinTonePopup.svelte +40 -0
- package/src/components/emoji/SkinToneTooltip.svelte +36 -0
- package/src/components/emoji/icons/Activities.svelte +20 -0
- package/src/components/emoji/icons/AnimalsAndNature.svelte +16 -0
- package/src/components/emoji/icons/Flags.svelte +14 -0
- package/src/components/emoji/icons/FoodAndDrink.svelte +20 -0
- package/src/components/emoji/icons/FrequentlyUsed.svelte +17 -0
- package/src/components/emoji/icons/GettingWorkDone.svelte +14 -0
- package/src/components/emoji/icons/Objects.svelte +15 -0
- package/src/components/emoji/icons/Search.svelte +14 -0
- package/src/components/emoji/icons/SmileysAndPeople.svelte +23 -0
- package/src/components/emoji/icons/Symbols.svelte +23 -0
- package/src/components/emoji/icons/TravelAndPlaces.svelte +17 -0
- package/src/components/emoji/index.ts +97 -0
- package/src/components/emoji/store.ts +44 -0
- package/src/components/emoji/types.ts +34 -0
- package/src/components/emoji/utils.ts +182 -0
- package/src/components/icons/Activity.svelte +16 -0
- package/src/components/icons/ActivityEdit.svelte +25 -0
- package/src/components/icons/Add.svelte +10 -0
- package/src/components/icons/ArrowLeft.svelte +25 -0
- package/src/components/icons/ArrowRight.svelte +25 -0
- package/src/components/icons/Attachment.svelte +29 -0
- package/src/components/icons/Back.svelte +32 -0
- package/src/components/icons/BlueCheck.svelte +11 -0
- package/src/components/icons/Calendar.svelte +10 -0
- package/src/components/icons/Check.svelte +12 -0
- package/src/components/icons/CheckAll.svelte +27 -0
- package/src/components/icons/CheckCircle.svelte +12 -0
- package/src/components/icons/Checkmark.svelte +26 -0
- package/src/components/icons/ChevronDown.svelte +27 -0
- package/src/components/icons/ChevronLeft.svelte +22 -0
- package/src/components/icons/ChevronRight.svelte +22 -0
- package/src/components/icons/CircleAdd.svelte +13 -0
- package/src/components/icons/Circles.svelte +43 -0
- package/src/components/icons/Close.svelte +10 -0
- package/src/components/icons/ColStar.svelte +31 -0
- package/src/components/icons/CollapseArrow.svelte +8 -0
- package/src/components/icons/Copy.svelte +10 -0
- package/src/components/icons/Delete.svelte +18 -0
- package/src/components/icons/Description.svelte +31 -0
- package/src/components/icons/Details.svelte +36 -0
- package/src/components/icons/DetailsFilled.svelte +27 -0
- package/src/components/icons/Down.svelte +8 -0
- package/src/components/icons/DownOutline.svelte +8 -0
- package/src/components/icons/Dropdown.svelte +8 -0
- package/src/components/icons/DropdownDown.svelte +24 -0
- package/src/components/icons/DropdownRight.svelte +24 -0
- package/src/components/icons/Edit.svelte +26 -0
- package/src/components/icons/Emoji.svelte +10 -0
- package/src/components/icons/Error.svelte +27 -0
- package/src/components/icons/Expand.svelte +10 -0
- package/src/components/icons/File.svelte +25 -0
- package/src/components/icons/Filter.svelte +26 -0
- package/src/components/icons/Folder.svelte +13 -0
- package/src/components/icons/FolderCollapsed.svelte +34 -0
- package/src/components/icons/FolderExpanded.svelte +34 -0
- package/src/components/icons/Forward.svelte +8 -0
- package/src/components/icons/HalfUpDown.svelte +7 -0
- package/src/components/icons/History.svelte +10 -0
- package/src/components/icons/Info.svelte +26 -0
- package/src/components/icons/KeyCommand.svelte +12 -0
- package/src/components/icons/KeyOption.svelte +8 -0
- package/src/components/icons/KeyShift.svelte +8 -0
- package/src/components/icons/Left.svelte +10 -0
- package/src/components/icons/Like.svelte +25 -0
- package/src/components/icons/Link.svelte +10 -0
- package/src/components/icons/MaxWidth.svelte +27 -0
- package/src/components/icons/Maximize.svelte +25 -0
- package/src/components/icons/MenuClose.svelte +28 -0
- package/src/components/icons/MenuOpen.svelte +26 -0
- package/src/components/icons/MinWidth.svelte +27 -0
- package/src/components/icons/Minimize.svelte +28 -0
- package/src/components/icons/Mixin.svelte +38 -0
- package/src/components/icons/MoreH.svelte +16 -0
- package/src/components/icons/MoreV.svelte +16 -0
- package/src/components/icons/MoreV2.svelte +29 -0
- package/src/components/icons/NavNext.svelte +10 -0
- package/src/components/icons/NavPrev.svelte +10 -0
- package/src/components/icons/Open.svelte +11 -0
- package/src/components/icons/OpenedArrow.svelte +26 -0
- package/src/components/icons/Options.svelte +12 -0
- package/src/components/icons/Redo.svelte +10 -0
- package/src/components/icons/Right.svelte +26 -0
- package/src/components/icons/Scale.svelte +13 -0
- package/src/components/icons/ScaleFull.svelte +13 -0
- package/src/components/icons/Scribble.svelte +10 -0
- package/src/components/icons/Search.svelte +12 -0
- package/src/components/icons/Send.svelte +10 -0
- package/src/components/icons/Settings.svelte +13 -0
- package/src/components/icons/Share.svelte +13 -0
- package/src/components/icons/SquareExpand.svelte +13 -0
- package/src/components/icons/Start.svelte +10 -0
- package/src/components/icons/Stop.svelte +8 -0
- package/src/components/icons/TableOfContents.svelte +35 -0
- package/src/components/icons/Thread.svelte +29 -0
- package/src/components/icons/ToDetails.svelte +28 -0
- package/src/components/icons/Undo.svelte +10 -0
- package/src/components/icons/Up.svelte +8 -0
- package/src/components/icons/UpOutline.svelte +8 -0
- package/src/components/internal/Clock.svelte +42 -0
- package/src/components/internal/ClockFace.svelte +148 -0
- package/src/components/internal/ClockPopup.svelte +91 -0
- package/src/components/internal/ErrorBoundary.ts +33 -0
- package/src/components/internal/ErrorComponent.svelte +37 -0
- package/src/components/internal/Root.svelte +323 -0
- package/src/components/internal/RootBarExtension.svelte +32 -0
- package/src/components/internal/Settings.svelte +39 -0
- package/src/components/internal/SettingsPopup.svelte +196 -0
- package/src/components/internal/ThemeButton.svelte +151 -0
- package/src/components/internal/icons/CheckCircled.svelte +11 -0
- package/src/components/internal/icons/Computer.svelte +15 -0
- package/src/components/internal/icons/FontSize.svelte +13 -0
- package/src/components/internal/icons/Language.svelte +17 -0
- package/src/components/internal/icons/Phone.svelte +18 -0
- package/src/components/internal/icons/Search.svelte +12 -0
- package/src/components/internal/icons/Settings.svelte +13 -0
- package/src/components/internal/icons/Theme.svelte +9 -0
- package/src/components/internal/icons/WiFi.svelte +21 -0
- package/src/components/notifications/Notification.svelte +34 -0
- package/src/components/notifications/Notification.ts +16 -0
- package/src/components/notifications/NotificationPosition.ts +6 -0
- package/src/components/notifications/NotificationSeverity.ts +6 -0
- package/src/components/notifications/Notifications.svelte +53 -0
- package/src/components/notifications/actions.ts +42 -0
- package/src/components/notifications/store.ts +16 -0
- package/src/components/wizard/ModernWizardBar.svelte +105 -0
- package/src/components/wizard/ModernWizardDialog.svelte +144 -0
- package/src/components/wizard/Wizard.svelte +59 -0
- package/src/components/wizard/WizardStep.svelte +144 -0
- package/src/focus.ts +139 -0
- package/src/index.ts +338 -0
- package/src/lazy.ts +93 -0
- package/src/location.ts +259 -0
- package/src/modals.ts +5 -0
- package/src/panelup.ts +70 -0
- package/src/plugin.ts +156 -0
- package/src/popups.ts +486 -0
- package/src/resize.ts +179 -0
- package/src/svg.d.ts +4 -0
- package/src/tooltips.ts +152 -0
- package/src/types.ts +545 -0
- package/src/utils.ts +420 -0
- package/svelte.config.js +5 -0
- package/tsconfig.json +9 -0
- package/types/__test__/location.test.d.ts +2 -0
- package/types/__test__/location.test.d.ts.map +1 -0
- package/types/colors.d.ts +163 -0
- package/types/colors.d.ts.map +1 -0
- package/types/components/calendar/internal/DateUtils.d.ts +34 -0
- package/types/components/calendar/internal/DateUtils.d.ts.map +1 -0
- package/types/components/emoji/index.d.ts +11 -0
- package/types/components/emoji/index.d.ts.map +1 -0
- package/types/components/emoji/store.d.ts +12 -0
- package/types/components/emoji/store.d.ts.map +1 -0
- package/types/components/emoji/types.d.ts +20 -0
- package/types/components/emoji/types.d.ts.map +1 -0
- package/types/components/emoji/utils.d.ts +17 -0
- package/types/components/emoji/utils.d.ts.map +1 -0
- package/types/components/internal/ErrorBoundary.d.ts +5 -0
- package/types/components/internal/ErrorBoundary.d.ts.map +1 -0
- package/types/components/notifications/Notification.d.ts +16 -0
- package/types/components/notifications/Notification.d.ts.map +1 -0
- package/types/components/notifications/NotificationPosition.d.ts +7 -0
- package/types/components/notifications/NotificationPosition.d.ts.map +1 -0
- package/types/components/notifications/NotificationSeverity.d.ts +7 -0
- package/types/components/notifications/NotificationSeverity.d.ts.map +1 -0
- package/types/components/notifications/actions.d.ts +6 -0
- package/types/components/notifications/actions.d.ts.map +1 -0
- package/types/components/notifications/store.d.ts +9 -0
- package/types/components/notifications/store.d.ts.map +1 -0
- package/types/focus.d.ts +32 -0
- package/types/focus.d.ts.map +1 -0
- package/types/index.d.ts +254 -0
- package/types/index.d.ts.map +1 -0
- package/types/lazy.d.ts +6 -0
- package/types/lazy.d.ts.map +1 -0
- package/types/location.d.ts +38 -0
- package/types/location.d.ts.map +1 -0
- package/types/modals.d.ts +5 -0
- package/types/modals.d.ts.map +1 -0
- package/types/panelup.d.ts +17 -0
- package/types/panelup.d.ts.map +1 -0
- package/types/plugin.d.ts +135 -0
- package/types/plugin.d.ts.map +1 -0
- package/types/popups.d.ts +65 -0
- package/types/popups.d.ts.map +1 -0
- package/types/resize.d.ts +32 -0
- package/types/resize.d.ts.map +1 -0
- package/types/tooltips.d.ts +8 -0
- package/types/tooltips.d.ts.map +1 -0
- package/types/types.d.ts +373 -0
- package/types/types.d.ts.map +1 -0
- package/types/utils.d.ts +125 -0
- package/types/utils.d.ts.map +1 -0
- package/assets/lux-site-icons/android-chrome-192x192.png +0 -0
- package/assets/lux-site-icons/android-chrome-512x512.png +0 -0
- package/assets/lux-site-icons/apple-touch-icon.png +0 -0
- package/assets/lux-site-icons/favicon-16x16.png +0 -0
- package/assets/lux-site-icons/favicon-32x32.png +0 -0
- package/assets/lux-site-icons/favicon.ico +0 -0
- package/assets/standard-docs/LUX-NFT-Terms-and-Conditions.pdf +0 -0
- package/assets/standard-docs/LUX-Privacy-Policy.pdf +0 -0
- package/blocks/components/accordian-block.tsx +0 -48
- package/blocks/components/block-component-props.ts +0 -11
- package/blocks/components/bullet-cards-block.tsx +0 -45
- package/blocks/components/card-block.tsx +0 -213
- package/blocks/components/carte-blanche-block/index.tsx +0 -127
- package/blocks/components/carte-blanche-block/variant-content-left.tsx +0 -49
- package/blocks/components/content.tsx +0 -70
- package/blocks/components/cta-block.tsx +0 -98
- package/blocks/components/enh-heading-block.tsx +0 -205
- package/blocks/components/grid-block/grid-block-mutator.ts +0 -12
- package/blocks/components/grid-block/index.tsx +0 -83
- package/blocks/components/grid-block/mutator-registry.ts +0 -10
- package/blocks/components/grid-block/table-borders.mutator.ts +0 -47
- package/blocks/components/group-block.tsx +0 -83
- package/blocks/components/heading-block.tsx +0 -88
- package/blocks/components/image-block.tsx +0 -108
- package/blocks/components/index.ts +0 -30
- package/blocks/components/screenful-block/content.tsx +0 -120
- package/blocks/components/screenful-block/index.tsx +0 -79
- package/blocks/components/screenful-block/poster-background.tsx +0 -34
- package/blocks/components/screenful-block/video-background.tsx +0 -45
- package/blocks/components/space-block.tsx +0 -66
- package/blocks/components/video-block.tsx +0 -137
- package/blocks/def/accordian-block.ts +0 -14
- package/blocks/def/block.ts +0 -7
- package/blocks/def/bullet-cards-block.ts +0 -21
- package/blocks/def/card-block.ts +0 -24
- package/blocks/def/carte-blanche-block.ts +0 -21
- package/blocks/def/cta-block.ts +0 -19
- package/blocks/def/element-block.ts +0 -11
- package/blocks/def/enh-heading-block.ts +0 -45
- package/blocks/def/grid-block.ts +0 -16
- package/blocks/def/group-block.ts +0 -11
- package/blocks/def/heading-block.ts +0 -15
- package/blocks/def/image-block.ts +0 -31
- package/blocks/def/index.ts +0 -35
- package/blocks/def/screenful-block.ts +0 -54
- package/blocks/def/space-block.ts +0 -64
- package/blocks/def/video-block.ts +0 -28
- package/blocks/index.ts +0 -2
- package/common/chat-widget.tsx +0 -75
- package/common/contact-dialog/contact-form.tsx +0 -111
- package/common/contact-dialog/disclaimer.tsx +0 -13
- package/common/contact-dialog/index.tsx +0 -48
- package/common/copyright.tsx +0 -21
- package/common/drawer-menu.tsx +0 -51
- package/common/footer.tsx +0 -77
- package/common/head-metadata/from-next/metadata-types.ts +0 -158
- package/common/head-metadata/from-next/opengraph-types.ts +0 -267
- package/common/head-metadata/from-next/twitter-types.ts +0 -92
- package/common/head-metadata/index.tsx +0 -208
- package/common/header/index.tsx +0 -57
- package/common/header/mobile-nav.tsx +0 -72
- package/common/header/theme-toggle.tsx +0 -26
- package/common/icons/github.tsx +0 -14
- package/common/icons/index.tsx +0 -34
- package/common/icons/lux-logo.tsx +0 -10
- package/common/icons/secure-delivery.tsx +0 -13
- package/common/icons/social-icon.tsx +0 -35
- package/common/icons/youtube-logo.tsx +0 -59
- package/common/index.ts +0 -14
- package/common/logo.tsx +0 -71
- package/common/mini-chart/index.tsx +0 -8
- package/common/mini-chart/mini-chart-props.ts +0 -44
- package/common/mini-chart/mini-chart.tsx +0 -76
- package/common/mini-chart/wrapper.tsx +0 -23
- package/context-providers/index.ts +0 -1
- package/context-providers/theme-provider.tsx +0 -20
- package/next/README.md +0 -11
- package/next/analytics/fpixel.ts +0 -16
- package/next/analytics/pixel-analytics.tsx +0 -55
- package/next/determine-device-middleware.ts +0 -16
- package/next/fonts/DrukTextWide-Bold-Trial.otf +0 -0
- package/next/fonts/DrukTextWide-Heavy-Trial.otf +0 -0
- package/next/fonts/DrukTextWide-Medium-Trial.otf +0 -0
- package/next/fonts/DrukWide-Bold-Trial.otf +0 -0
- package/next/fonts/DrukWide-Heavy-Trial.otf +0 -0
- package/next/fonts/DrukWide-Medium-Trial.otf +0 -0
- package/next/get-app-router-font-classes.ts +0 -12
- package/next/load-and-return-lux-next-fonts-on-import.ts +0 -94
- package/next/next-font-desc.ts +0 -28
- package/next/not-found-content.mdx +0 -4
- package/next/not-found.tsx +0 -23
- package/next/pages-router-font-vars.tsx +0 -18
- package/next/root-layout.tsx +0 -60
- package/primitives/accordion.tsx +0 -61
- package/primitives/action-button.tsx +0 -46
- package/primitives/apply-typography.tsx +0 -55
- package/primitives/avatar.tsx +0 -49
- package/primitives/badge.tsx +0 -36
- package/primitives/button.tsx +0 -73
- package/primitives/calendar.tsx +0 -72
- package/primitives/card.tsx +0 -83
- package/primitives/checkbox.tsx +0 -32
- package/primitives/command.tsx +0 -155
- package/primitives/dialog-video-controller.tsx +0 -38
- package/primitives/dialog.tsx +0 -152
- package/primitives/form.tsx +0 -179
- package/primitives/index.ts +0 -144
- package/primitives/inline-icon.tsx +0 -37
- package/primitives/input.tsx +0 -30
- package/primitives/label.tsx +0 -28
- package/primitives/link-element.tsx +0 -104
- package/primitives/main.tsx +0 -17
- package/primitives/mdx-link.tsx +0 -22
- package/primitives/nav-items.tsx +0 -48
- package/primitives/popover.tsx +0 -35
- package/primitives/progress.tsx +0 -27
- package/primitives/scroll-area.tsx +0 -47
- package/primitives/select.tsx +0 -169
- package/primitives/separator.tsx +0 -29
- package/primitives/sheet.tsx +0 -175
- package/primitives/skeleton.tsx +0 -15
- package/primitives/switch.tsx +0 -33
- package/primitives/table.tsx +0 -117
- package/primitives/tabs.tsx +0 -60
- package/primitives/tailwind-indicator.tsx +0 -19
- package/primitives/text-area.tsx +0 -26
- package/primitives/toast.tsx +0 -129
- package/primitives/toaster.tsx +0 -37
- package/primitives/use-toast.ts +0 -192
- package/primitives/video-player.tsx +0 -26
- package/primitives/youtube-embed.tsx +0 -83
- package/siteDef/footer/community.tsx +0 -67
- package/siteDef/footer/company.ts +0 -37
- package/siteDef/footer/ecosystem.ts +0 -37
- package/siteDef/footer/index.tsx +0 -26
- package/siteDef/footer/legal.ts +0 -28
- package/siteDef/footer/network.ts +0 -33
- package/siteDef/footer/svg/warpcast-logo.svg +0 -12
- package/siteDef/main-nav.ts +0 -35
- package/style/globals.css +0 -13
- package/style/hanzo-common.css +0 -32
- package/style/hanzo-default-colors.css +0 -79
- package/style/social-svg.css +0 -3
- package/tailwind/colors.tailwind.js +0 -46
- package/tailwind/fonts.tailwind.ts +0 -31
- package/tailwind/index.ts +0 -18
- package/tailwind/lux-tw-fonts.ts +0 -37
- package/tailwind/safelist.tailwind.js +0 -26
- package/tailwind/screens.tailwind.js +0 -8
- package/tailwind/spacing.tailwind.js +0 -65
- package/tailwind/tailwind.config.base.js +0 -906
- package/tailwind/tw-font-desc.ts +0 -15
- package/tailwind/typo-plugin/get-plugin-styles.js +0 -676
- package/tailwind/typo-plugin/index.d.ts +0 -9
- package/tailwind/typo-plugin/index.js +0 -141
- package/tailwind/typo-plugin/utils.js +0 -60
- package/tailwind/typography-test.mdx +0 -36
- package/types/breakpoints.ts +0 -11
- package/types/bullet-item.ts +0 -10
- package/types/button-def.ts +0 -39
- package/types/contact-info.ts +0 -11
- package/types/dimensions.ts +0 -20
- package/types/grid-def.ts +0 -56
- package/types/icon.ts +0 -10
- package/types/image-def.ts +0 -28
- package/types/index.ts +0 -29
- package/types/link-def.ts +0 -59
- package/types/site-def.ts +0 -34
- package/types/t-shirt-size.ts +0 -5
- package/util/index.ts +0 -81
- package/util/specifier.ts +0 -43
package/src/popups.ts
ADDED
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
import { getResource } from '@hanzo/platform'
|
|
2
|
+
import { type ComponentType } from 'svelte'
|
|
3
|
+
import { derived, get } from 'svelte/store'
|
|
4
|
+
import type {
|
|
5
|
+
AnyComponent,
|
|
6
|
+
AnySvelteComponent,
|
|
7
|
+
DeviceOptions,
|
|
8
|
+
HorizontalAlignment,
|
|
9
|
+
PopupAlignment,
|
|
10
|
+
PopupOptions,
|
|
11
|
+
PopupPositionElement,
|
|
12
|
+
VerticalAlignment
|
|
13
|
+
} from './types'
|
|
14
|
+
|
|
15
|
+
import { Analytics } from '@hanzo/analytics'
|
|
16
|
+
import { modalStore } from './modals'
|
|
17
|
+
|
|
18
|
+
export interface CompAndProps {
|
|
19
|
+
type?: 'popup'
|
|
20
|
+
id: string
|
|
21
|
+
is: AnySvelteComponent | ComponentType
|
|
22
|
+
props: any
|
|
23
|
+
element?: PopupAlignment
|
|
24
|
+
onClose?: (result: any) => void
|
|
25
|
+
onUpdate?: (result: any) => void
|
|
26
|
+
close: () => void
|
|
27
|
+
update?: (props: Record<string, any>) => void
|
|
28
|
+
options: {
|
|
29
|
+
category: string
|
|
30
|
+
overlay: boolean
|
|
31
|
+
fixed?: boolean
|
|
32
|
+
refId?: string
|
|
33
|
+
}
|
|
34
|
+
dock?: boolean
|
|
35
|
+
|
|
36
|
+
// Internal
|
|
37
|
+
closing?: boolean
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface PopupResult {
|
|
41
|
+
id: string
|
|
42
|
+
close: () => void
|
|
43
|
+
update: (props: Record<string, any>) => void
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const popupstore = derived(modalStore, (modals) => {
|
|
47
|
+
return modals.filter((m) => m.type === 'popup') as CompAndProps[]
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
export const dockStore = derived(modalStore, (modals) => {
|
|
51
|
+
return (modals.filter((m) => m.type === 'popup') as CompAndProps[]).find((popup: CompAndProps) => popup.dock)
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
export function updatePopup (id: string, props: Partial<CompAndProps>): void {
|
|
55
|
+
modalStore.update((modals) => {
|
|
56
|
+
const popupIndex = (modals.filter((m) => m.type === 'popup') as CompAndProps[]).findIndex(
|
|
57
|
+
(p: CompAndProps) => p.id === id
|
|
58
|
+
)
|
|
59
|
+
if (popupIndex !== -1) {
|
|
60
|
+
;(modals[popupIndex] as CompAndProps).update?.(props.props)
|
|
61
|
+
}
|
|
62
|
+
return modals
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function addPopup (props: CompAndProps): void {
|
|
67
|
+
modalStore.update((modals) => {
|
|
68
|
+
modals.push(props)
|
|
69
|
+
return modals
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function checkDockPosition (refId: string | undefined): boolean {
|
|
74
|
+
if (refId !== undefined && localStorage.getItem('dock-popup') === refId) {
|
|
75
|
+
const docked = get(dockStore)
|
|
76
|
+
if (docked === undefined) {
|
|
77
|
+
return true
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return false
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
let popupId: number = 0
|
|
84
|
+
export function showPopup (
|
|
85
|
+
component: AnySvelteComponent | AnyComponent | ComponentType,
|
|
86
|
+
props: any,
|
|
87
|
+
element?: PopupAlignment,
|
|
88
|
+
onClose?: (result: any) => void | Promise<void>,
|
|
89
|
+
onUpdate?: (result: any) => void | Promise<void>,
|
|
90
|
+
options: {
|
|
91
|
+
category: string
|
|
92
|
+
overlay: boolean
|
|
93
|
+
fixed?: boolean
|
|
94
|
+
refId?: string
|
|
95
|
+
} = {
|
|
96
|
+
category: 'popup',
|
|
97
|
+
overlay: true
|
|
98
|
+
}
|
|
99
|
+
): PopupResult {
|
|
100
|
+
const id = `${popupId++}`
|
|
101
|
+
const closePopupOp = (): void => {
|
|
102
|
+
modalStore.update((popups) => {
|
|
103
|
+
const pos = popups.findIndex((p) => (p as CompAndProps).id === id && p.type === 'popup')
|
|
104
|
+
if (pos !== -1) {
|
|
105
|
+
popups.splice(pos, 1)
|
|
106
|
+
}
|
|
107
|
+
return popups
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
const _element = element instanceof HTMLElement ? getPopupPositionElement(element) : element
|
|
111
|
+
const data: Omit<CompAndProps, 'is'> = {
|
|
112
|
+
id,
|
|
113
|
+
props,
|
|
114
|
+
element: _element,
|
|
115
|
+
onClose,
|
|
116
|
+
onUpdate,
|
|
117
|
+
close: closePopupOp,
|
|
118
|
+
options,
|
|
119
|
+
type: 'popup'
|
|
120
|
+
}
|
|
121
|
+
if (checkDockPosition(options.refId)) {
|
|
122
|
+
data.dock = true
|
|
123
|
+
}
|
|
124
|
+
if (typeof component === 'string') {
|
|
125
|
+
getResource(component)
|
|
126
|
+
.then((resolved) => {
|
|
127
|
+
addPopup({ ...data, is: resolved })
|
|
128
|
+
})
|
|
129
|
+
.catch((err) => {
|
|
130
|
+
Analytics.handleError(err)
|
|
131
|
+
console.error(err)
|
|
132
|
+
})
|
|
133
|
+
} else {
|
|
134
|
+
addPopup({ ...data, is: component })
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
id,
|
|
138
|
+
close: closePopupOp,
|
|
139
|
+
update: (props) => {
|
|
140
|
+
updatePopup(id, props)
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function closePopup (category?: string): void {
|
|
146
|
+
modalStore.update((popups) => {
|
|
147
|
+
if (category !== undefined) {
|
|
148
|
+
popups = popups.filter((p) => p.type === 'popup' && p.options.category !== category)
|
|
149
|
+
} else {
|
|
150
|
+
for (let i = popups.length - 1; i >= 0; i--) {
|
|
151
|
+
if (popups[i].type !== 'popup') continue
|
|
152
|
+
const popi = popups[i] as CompAndProps
|
|
153
|
+
if (popi.options.fixed !== true) {
|
|
154
|
+
const isClosing = popi.closing ?? false
|
|
155
|
+
if (popups[i].type === 'popup') {
|
|
156
|
+
popi.closing = true
|
|
157
|
+
}
|
|
158
|
+
if (!isClosing) {
|
|
159
|
+
// To prevent possible recursion, we need to check if we call some code from popup close, to do close.
|
|
160
|
+
popi.onClose?.(undefined)
|
|
161
|
+
}
|
|
162
|
+
popi.closing = false
|
|
163
|
+
popups.splice(i, 1)
|
|
164
|
+
break
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return popups
|
|
169
|
+
})
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @public
|
|
174
|
+
*
|
|
175
|
+
* Place element based on position and element.
|
|
176
|
+
*
|
|
177
|
+
* return boolean to show or not modal overlay.
|
|
178
|
+
*/
|
|
179
|
+
export function fitPopupPositionedElement (
|
|
180
|
+
modalHTML: HTMLElement,
|
|
181
|
+
alignment: PopupPositionElement,
|
|
182
|
+
newProps: Record<string, string | number>
|
|
183
|
+
): PopupOptions {
|
|
184
|
+
let direction: string = ''
|
|
185
|
+
const rect = alignment.getBoundingClientRect()
|
|
186
|
+
const rectPopup = modalHTML.getBoundingClientRect()
|
|
187
|
+
const docWidth = document.body.clientWidth
|
|
188
|
+
const docHeight = document.body.clientHeight
|
|
189
|
+
newProps.left = newProps.right = newProps.top = newProps.bottom = ''
|
|
190
|
+
newProps.maxHeight = newProps.height = ''
|
|
191
|
+
newProps.maxWidth = newProps.width = ''
|
|
192
|
+
if (alignment?.kind === 'submenu') {
|
|
193
|
+
const dirH =
|
|
194
|
+
docWidth - rect.right - rectPopup.width - 12 > 0 ? 'right' : rect.left > docWidth - rect.left ? 'left' : 'inside'
|
|
195
|
+
const dirV =
|
|
196
|
+
docHeight - rect.top - rectPopup.height - 20 > 0
|
|
197
|
+
? 'bottom'
|
|
198
|
+
: rect.bottom > rectPopup.height + 20
|
|
199
|
+
? 'top'
|
|
200
|
+
: 'bottom'
|
|
201
|
+
if (dirH === 'right') newProps.left = `${rect.right - 4}px`
|
|
202
|
+
else if (dirH === 'inside') newProps.right = '1rem'
|
|
203
|
+
else newProps.right = `${docWidth - rect.left - 4}px`
|
|
204
|
+
if (dirV === 'bottom') newProps.top = `${rect.top - 4}px`
|
|
205
|
+
else newProps.bottom = `${docHeight - rect.bottom - 4}px`
|
|
206
|
+
direction = `${dirV}|${dirH}`
|
|
207
|
+
} else if (alignment.position !== undefined) {
|
|
208
|
+
if (alignment.position.v === 'top') {
|
|
209
|
+
newProps.top = `${rect.top}px`
|
|
210
|
+
} else if (alignment.position.v === 'bottom') {
|
|
211
|
+
newProps.top = `${rect.bottom - rectPopup.height}px`
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if (alignment.position.h === 'right') {
|
|
215
|
+
newProps.left = `${rect.right + 4}px`
|
|
216
|
+
} else if (alignment.position.h === 'left') {
|
|
217
|
+
newProps.left = `${rect.left - rectPopup.width - 4}px`
|
|
218
|
+
}
|
|
219
|
+
direction = alignment.position.v + '|' + alignment.position.h
|
|
220
|
+
} else {
|
|
221
|
+
// Vertical
|
|
222
|
+
if (rect.bottom + rectPopup.height + 28 <= docHeight) {
|
|
223
|
+
newProps.top = `${rect.bottom + 16}px`
|
|
224
|
+
direction = 'bottom'
|
|
225
|
+
} else if (rectPopup.height + 28 < rect.top) {
|
|
226
|
+
newProps.bottom = `${docHeight - rect.top + 16}px`
|
|
227
|
+
direction = 'top'
|
|
228
|
+
} else {
|
|
229
|
+
newProps.top = newProps.bottom = '16px'
|
|
230
|
+
direction = 'top'
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Horizontal
|
|
234
|
+
if (rect.left + rectPopup.width + 16 <= docWidth) {
|
|
235
|
+
newProps.left = `${rect.left}px`
|
|
236
|
+
direction += '|right'
|
|
237
|
+
} else if (rect.right - rectPopup.width - 16 >= 0) {
|
|
238
|
+
newProps.right = `${docWidth - rect.right}px`
|
|
239
|
+
direction += '|left'
|
|
240
|
+
} else {
|
|
241
|
+
newProps.left = '16px'
|
|
242
|
+
direction += '|center'
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return { props: newProps, showOverlay: false, direction }
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* @public
|
|
250
|
+
*
|
|
251
|
+
* Place element based on position and underline content element.
|
|
252
|
+
*
|
|
253
|
+
* return boolean to show or not modal overlay.
|
|
254
|
+
*/
|
|
255
|
+
export function fitPopupElement (
|
|
256
|
+
modalHTML: HTMLElement,
|
|
257
|
+
device: DeviceOptions,
|
|
258
|
+
element?: PopupAlignment,
|
|
259
|
+
contentPanel?: HTMLElement,
|
|
260
|
+
clientWidth?: number,
|
|
261
|
+
clientHeight?: number
|
|
262
|
+
): PopupOptions {
|
|
263
|
+
let show = true
|
|
264
|
+
const newProps: Record<string, string | number> = {}
|
|
265
|
+
if (element != null) {
|
|
266
|
+
show = false
|
|
267
|
+
newProps.left = newProps.right = newProps.top = newProps.bottom = ''
|
|
268
|
+
newProps.maxHeight = newProps.height = ''
|
|
269
|
+
newProps.maxWidth = newProps.width = newProps.minWidth = ''
|
|
270
|
+
if (typeof element !== 'string') {
|
|
271
|
+
const result = fitPopupPositionedElement(modalHTML, element, newProps)
|
|
272
|
+
// applyStyle(newProps, modalHTML)
|
|
273
|
+
return result
|
|
274
|
+
} else if (element === 'right' && contentPanel !== undefined) {
|
|
275
|
+
const rect = contentPanel.getBoundingClientRect()
|
|
276
|
+
newProps.top = `calc(${rect.top}px + 8px)`
|
|
277
|
+
newProps.bottom = '0.75rem'
|
|
278
|
+
newProps.right = '0.75rem'
|
|
279
|
+
newProps.maxWidth = '50%'
|
|
280
|
+
show = true
|
|
281
|
+
} else if (element === 'top') {
|
|
282
|
+
const fullHeight = clientHeight !== undefined && clientHeight / device.docHeight > 0.745
|
|
283
|
+
if (clientWidth !== undefined && clientHeight !== undefined) {
|
|
284
|
+
newProps.left = `calc(50% - ${clientWidth / 2}px`
|
|
285
|
+
} else {
|
|
286
|
+
newProps.left = '50%'
|
|
287
|
+
newProps.transform = 'translateX(-50%)'
|
|
288
|
+
}
|
|
289
|
+
newProps.top = fullHeight ? `${(device.docHeight - clientHeight) / 2}px` : '15vh'
|
|
290
|
+
newProps.maxHeight = fullHeight ? 'calc(100vh - 2rem)' : '75vh'
|
|
291
|
+
show = true
|
|
292
|
+
} else if (element === 'float') {
|
|
293
|
+
newProps.top = 'calc(var(--status-bar-height) + 4px)'
|
|
294
|
+
newProps.bottom = '4px'
|
|
295
|
+
newProps.left = '60%'
|
|
296
|
+
newProps.right = '4px'
|
|
297
|
+
show = true
|
|
298
|
+
} else if (element === 'center') {
|
|
299
|
+
if (clientWidth !== undefined && clientHeight !== undefined) {
|
|
300
|
+
newProps.top = `calc(50% - ${clientHeight / 2}px`
|
|
301
|
+
newProps.left = `calc(50% - ${clientWidth / 2}px`
|
|
302
|
+
} else {
|
|
303
|
+
newProps.top = '50%'
|
|
304
|
+
newProps.left = '50%'
|
|
305
|
+
newProps.transform = 'translate(-50%, -50%)'
|
|
306
|
+
}
|
|
307
|
+
show = true
|
|
308
|
+
} else if (element === 'centered') {
|
|
309
|
+
newProps.top = newProps.bottom = '15%'
|
|
310
|
+
newProps.left = newProps.right = '25%'
|
|
311
|
+
show = true
|
|
312
|
+
} else if (element === 'logo') {
|
|
313
|
+
newProps.top = '2.75rem'
|
|
314
|
+
newProps.left = '5rem'
|
|
315
|
+
newProps.maxWidth = '42rem'
|
|
316
|
+
newProps.maxHeight = 'calc(100vh - 5.5rem)'
|
|
317
|
+
show = true
|
|
318
|
+
} else if (element === 'logo-mini') {
|
|
319
|
+
newProps.top = '2.5rem'
|
|
320
|
+
newProps.left = '.5rem'
|
|
321
|
+
newProps.maxWidth = '42rem'
|
|
322
|
+
newProps.maxHeight = 'calc(100vh - 5.5rem)'
|
|
323
|
+
show = true
|
|
324
|
+
} else if (element === 'logo-portrait') {
|
|
325
|
+
newProps.bottom = 'calc(var(--app-panel-width) + .75rem)'
|
|
326
|
+
newProps.left = '.5rem'
|
|
327
|
+
newProps.maxWidth = 'calc(100vw - 1rem)'
|
|
328
|
+
newProps.maxHeight = 'calc(100vh - var(--app-panel-width) - 1.5rem)'
|
|
329
|
+
show = true
|
|
330
|
+
} else if (element === 'account') {
|
|
331
|
+
newProps.bottom = '2.75rem'
|
|
332
|
+
newProps.left = '5rem'
|
|
333
|
+
newProps.maxWidth = '42rem'
|
|
334
|
+
newProps.maxHeight = 'calc(100vh - 5.5rem)'
|
|
335
|
+
show = true
|
|
336
|
+
} else if (element === 'account-portrait') {
|
|
337
|
+
newProps.bottom = 'calc(var(--app-panel-width) + .75rem)'
|
|
338
|
+
newProps.right = '.5rem'
|
|
339
|
+
newProps.maxWidth = 'calc(100vw - 1rem)'
|
|
340
|
+
newProps.maxHeight = 'calc(100vh - var(--app-panel-width) - 1.5rem)'
|
|
341
|
+
show = true
|
|
342
|
+
} else if (element === 'account-mobile') {
|
|
343
|
+
newProps.bottom = '.5rem'
|
|
344
|
+
newProps.left = 'calc(var(--app-panel-width) + .5rem)'
|
|
345
|
+
newProps.maxWidth = 'calc(100vw - var(--app-panel-width) - 1rem)'
|
|
346
|
+
newProps.maxHeight = 'calc(100vh - 1rem)'
|
|
347
|
+
show = true
|
|
348
|
+
} else if (element === 'notify') {
|
|
349
|
+
newProps.top = '2.5rem'
|
|
350
|
+
newProps.left = '4.75rem'
|
|
351
|
+
newProps.maxWidth = '42rem'
|
|
352
|
+
newProps.maxHeight = 'calc(100vh - 5rem)'
|
|
353
|
+
show = true
|
|
354
|
+
} else if (element === 'notify-mobile') {
|
|
355
|
+
newProps.bottom = 'calc(var(--app-panel-width) + .75rem)'
|
|
356
|
+
newProps.left = '.5rem'
|
|
357
|
+
newProps.maxWidth = 'calc(100vw - 1rem)'
|
|
358
|
+
newProps.maxHeight = 'calc(100vh - var(--app-panel-width) - 1.5rem)'
|
|
359
|
+
show = true
|
|
360
|
+
} else if (element === 'full' && contentPanel === undefined) {
|
|
361
|
+
newProps.top = '0'
|
|
362
|
+
newProps.bottom = '0'
|
|
363
|
+
newProps.left = '0'
|
|
364
|
+
newProps.right = '0'
|
|
365
|
+
// newProps.width = '100vw'
|
|
366
|
+
newProps.height = '100vh'
|
|
367
|
+
show = false
|
|
368
|
+
} else if (element === 'full' && contentPanel !== undefined) {
|
|
369
|
+
const rect = contentPanel.getBoundingClientRect()
|
|
370
|
+
newProps.top = `${rect.top + 1}px`
|
|
371
|
+
newProps.bottom = '1px'
|
|
372
|
+
newProps.left = '1px'
|
|
373
|
+
newProps.right = '1px'
|
|
374
|
+
show = true
|
|
375
|
+
} else if (element === 'full-centered') {
|
|
376
|
+
const rect = contentPanel !== undefined ? contentPanel.getBoundingClientRect() : { top: 0 }
|
|
377
|
+
newProps.top = `${Math.max(20, rect.top + 1)}px`
|
|
378
|
+
newProps.bottom = '.5rem'
|
|
379
|
+
newProps.left = '.5rem'
|
|
380
|
+
newProps.right = '.5rem'
|
|
381
|
+
show = true
|
|
382
|
+
} else if (element === 'content' && contentPanel !== undefined) {
|
|
383
|
+
const rect = contentPanel.getBoundingClientRect()
|
|
384
|
+
newProps.top = `${rect.top}px`
|
|
385
|
+
// newProps.bottom = `${Math.min(document.body.clientHeight - rect.bottom + 1, window.innerHeight - rect.top - 1)}px`
|
|
386
|
+
newProps.height = `${Math.min(rect.height, window.innerHeight - rect.top)}px`
|
|
387
|
+
newProps.left = `${rect.left}px`
|
|
388
|
+
// newProps.right = `${Math.min(document.body.clientWidth - rect.right, window.innerWidth - rect.left - 5)}px`
|
|
389
|
+
newProps.width = `${Math.min(rect.width, window.innerWidth - rect.left)}px`
|
|
390
|
+
} else if (element === 'middle') {
|
|
391
|
+
if (contentPanel !== undefined) {
|
|
392
|
+
const rect = contentPanel.getBoundingClientRect()
|
|
393
|
+
newProps.top = `calc(${rect.top}px)`
|
|
394
|
+
} else {
|
|
395
|
+
newProps.top = '15%'
|
|
396
|
+
}
|
|
397
|
+
newProps.bottom = '12px'
|
|
398
|
+
|
|
399
|
+
if (clientWidth !== undefined && clientHeight !== undefined) {
|
|
400
|
+
newProps.left = `calc(50% - ${clientWidth / 2}px`
|
|
401
|
+
} else {
|
|
402
|
+
newProps.left = '50%'
|
|
403
|
+
newProps.transform = 'translateX(-50%)'
|
|
404
|
+
}
|
|
405
|
+
} else if (element === 'help-center') {
|
|
406
|
+
newProps.top = 'calc(var(--status-bar-height) + 12px)'
|
|
407
|
+
newProps.bottom = '12px'
|
|
408
|
+
newProps.right = '12px'
|
|
409
|
+
show = true
|
|
410
|
+
} else if (element === 'status') {
|
|
411
|
+
newProps.top = 'calc(var(--status-bar-height) + 7.5px)'
|
|
412
|
+
newProps.right = '12px'
|
|
413
|
+
} else if (element === 'movable') {
|
|
414
|
+
newProps.top = 'calc(var(--status-bar-height) + 4px)'
|
|
415
|
+
newProps.right = '1rem'
|
|
416
|
+
}
|
|
417
|
+
} else {
|
|
418
|
+
if (clientWidth !== undefined && clientHeight !== undefined) {
|
|
419
|
+
newProps.top = `calc(50% - ${clientHeight / 2}px`
|
|
420
|
+
newProps.left = `calc(50% - ${clientWidth / 2}px`
|
|
421
|
+
} else {
|
|
422
|
+
newProps.top = '50%'
|
|
423
|
+
newProps.left = '50%'
|
|
424
|
+
newProps.transform = 'translate(-50%, -50%)'
|
|
425
|
+
}
|
|
426
|
+
show = true
|
|
427
|
+
}
|
|
428
|
+
// applyStyle(newProps, modalHTML)
|
|
429
|
+
return { props: newProps, showOverlay: show, direction: '' }
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export function eventToHTMLElement (evt: MouseEvent | TouchEvent): HTMLElement {
|
|
433
|
+
return evt.target as HTMLElement
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export function getEventPopupPositionElement (
|
|
437
|
+
e?: Event,
|
|
438
|
+
position?: { v: VerticalAlignment, h: HorizontalAlignment }
|
|
439
|
+
): PopupAlignment | undefined {
|
|
440
|
+
if (e?.target == null) {
|
|
441
|
+
return undefined
|
|
442
|
+
}
|
|
443
|
+
const target = e.target as HTMLElement
|
|
444
|
+
return getPopupPositionElement(target, position)
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
export function getPopupPositionElement (
|
|
448
|
+
el: HTMLElement | undefined,
|
|
449
|
+
position?: { v: VerticalAlignment, h: HorizontalAlignment }
|
|
450
|
+
): PopupAlignment | undefined {
|
|
451
|
+
if (el?.getBoundingClientRect != null) {
|
|
452
|
+
const result = el.getBoundingClientRect()
|
|
453
|
+
return {
|
|
454
|
+
getBoundingClientRect: () => result,
|
|
455
|
+
position
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
return undefined
|
|
460
|
+
}
|
|
461
|
+
export function getEventPositionElement (evt: MouseEvent): PopupAlignment | undefined {
|
|
462
|
+
const rect = DOMRect.fromRect({ width: 1, height: 1, x: evt.clientX, y: evt.clientY })
|
|
463
|
+
return {
|
|
464
|
+
getBoundingClientRect: () => rect
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export function pin (id: string): void {
|
|
469
|
+
modalStore.update((popups) => {
|
|
470
|
+
const currentPopups = popups.filter((m) => m.type === 'popup') as CompAndProps[]
|
|
471
|
+
const current = currentPopups.find((p) => p.id === id) as CompAndProps
|
|
472
|
+
;(popups.filter((m) => m.type === 'popup') as CompAndProps[]).forEach((p) => (p.dock = p.id === id))
|
|
473
|
+
if (current?.options.refId !== undefined) {
|
|
474
|
+
localStorage.setItem('dock-popup', current.options.refId)
|
|
475
|
+
}
|
|
476
|
+
return popups
|
|
477
|
+
})
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
export function unpin (): void {
|
|
481
|
+
modalStore.update((popups) => {
|
|
482
|
+
;(popups.filter((m) => m.type === 'popup') as CompAndProps[]).forEach((p) => (p.dock = false))
|
|
483
|
+
return popups
|
|
484
|
+
})
|
|
485
|
+
localStorage.removeItem('dock-popup')
|
|
486
|
+
}
|
package/src/resize.ts
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
// Copyright © 2022 Hardcore Engineering Inc.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License. You may
|
|
5
|
+
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
|
|
6
|
+
//
|
|
7
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
//
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
|
|
13
|
+
import { writable } from 'svelte/store'
|
|
14
|
+
import type { DefSeparators, SeparatedItem } from './types'
|
|
15
|
+
import { DelayedCaller } from './utils'
|
|
16
|
+
|
|
17
|
+
// limitations under the License.
|
|
18
|
+
let observer: ResizeObserver
|
|
19
|
+
let callbacks: WeakMap<Element, (element: Element) => any>
|
|
20
|
+
|
|
21
|
+
const delayedCaller = new DelayedCaller(10)
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export function resizeObserver (element: Element, onResize: (element: Element) => any): { destroy: () => void } {
|
|
27
|
+
if (observer === undefined) {
|
|
28
|
+
callbacks = new WeakMap()
|
|
29
|
+
const entriesPending = new Set<Element>()
|
|
30
|
+
|
|
31
|
+
const notifyObservers = (): void => {
|
|
32
|
+
window.requestAnimationFrame(() => {
|
|
33
|
+
for (const target of entriesPending.values()) {
|
|
34
|
+
const onResize = callbacks.get(target)
|
|
35
|
+
if (onResize != null) {
|
|
36
|
+
onResize(target)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
entriesPending.clear()
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
observer = new ResizeObserver((entries) => {
|
|
44
|
+
for (const entry of entries) {
|
|
45
|
+
entriesPending.add(entry.target)
|
|
46
|
+
}
|
|
47
|
+
delayedCaller.call(notifyObservers)
|
|
48
|
+
})
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
callbacks.set(element, onResize)
|
|
52
|
+
observer.observe(element)
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
destroy: () => {
|
|
56
|
+
callbacks.delete(element)
|
|
57
|
+
observer.unobserve(element)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
export const separatorsKeyId = 'separators'
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
70
|
+
export enum SeparatorState {
|
|
71
|
+
FLOAT = 'float',
|
|
72
|
+
HIDDEN = 'hidden',
|
|
73
|
+
NORMAL = 'normal'
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export const nullSeparatedItem: SeparatedItem = {
|
|
77
|
+
size: 'auto',
|
|
78
|
+
minSize: 20,
|
|
79
|
+
maxSize: 'auto',
|
|
80
|
+
float: undefined
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const compareSeparators = (a: SeparatedItem[] | SeparatedItem, b: SeparatedItem[] | SeparatedItem): boolean => {
|
|
84
|
+
if (!Array.isArray(a) && !Array.isArray(b)) {
|
|
85
|
+
return a.minSize === b.minSize && a.maxSize === b.maxSize && a.float === b.float
|
|
86
|
+
}
|
|
87
|
+
if (!Array.isArray(a) || !Array.isArray(b)) return false
|
|
88
|
+
if (a.length !== b.length) return false
|
|
89
|
+
return a.every(
|
|
90
|
+
(sep, index) => sep.minSize === b[index].minSize && sep.maxSize === b[index].maxSize && sep.float === b[index].float
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const generateSeparatorsId = (name: string, float: string | boolean): string => {
|
|
95
|
+
return separatorsKeyId + '_' + name + (typeof float === 'string' ? '-float-' + float : '')
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function defineSeparators (name: string, items: DefSeparators): void {
|
|
99
|
+
const id = generateSeparatorsId(name, false)
|
|
100
|
+
const income = items.map((it) => it ?? nullSeparatedItem)
|
|
101
|
+
let needAdd = true
|
|
102
|
+
const saved = localStorage.getItem(id)
|
|
103
|
+
if (typeof saved === 'string') {
|
|
104
|
+
if (saved === 'undefined') localStorage.removeItem(id)
|
|
105
|
+
else {
|
|
106
|
+
const loaded: SeparatedItem[] = JSON.parse(saved)
|
|
107
|
+
if (!compareSeparators(loaded, income)) localStorage.removeItem(id)
|
|
108
|
+
else needAdd = false
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (needAdd) localStorage.setItem(id, JSON.stringify(income))
|
|
112
|
+
items.forEach((it) => {
|
|
113
|
+
if (typeof it?.float === 'string') {
|
|
114
|
+
const idF = generateSeparatorsId(name, it.float)
|
|
115
|
+
let needAdd = true
|
|
116
|
+
const savedF = localStorage.getItem(idF)
|
|
117
|
+
if (typeof savedF === 'string') {
|
|
118
|
+
if (savedF === 'undefined') localStorage.removeItem(idF)
|
|
119
|
+
else {
|
|
120
|
+
const loadedF: SeparatedItem = JSON.parse(savedF)
|
|
121
|
+
if (!compareSeparators(loadedF, it)) localStorage.removeItem(idF)
|
|
122
|
+
else needAdd = false
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (needAdd) localStorage.setItem(idF, JSON.stringify(it))
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function getSeparators (name: string, float: string | boolean): SeparatedItem[] | SeparatedItem | null {
|
|
131
|
+
const id = generateSeparatorsId(name, float)
|
|
132
|
+
const saved = localStorage.getItem(id)
|
|
133
|
+
if (saved === null) return null
|
|
134
|
+
const result = JSON.parse(saved)
|
|
135
|
+
return Array.isArray(result) ? (result as SeparatedItem[]) : (result as SeparatedItem)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export function saveSeparator (
|
|
139
|
+
name: string,
|
|
140
|
+
float: string | boolean,
|
|
141
|
+
separators: SeparatedItem | SeparatedItem[]
|
|
142
|
+
): void {
|
|
143
|
+
const id = generateSeparatorsId(name, float)
|
|
144
|
+
localStorage.setItem(
|
|
145
|
+
id,
|
|
146
|
+
Array.isArray(separators) && typeof float === 'string' ? JSON.stringify(separators[0]) : JSON.stringify(separators)
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export const panelSeparators: DefSeparators = [
|
|
151
|
+
{ minSize: 20, size: 'auto', maxSize: 'auto' },
|
|
152
|
+
{ minSize: 17, size: 25, maxSize: 35, float: 'aside' }
|
|
153
|
+
]
|
|
154
|
+
|
|
155
|
+
export const workbenchSeparators: DefSeparators = [
|
|
156
|
+
{ minSize: 12.5, size: 17.5, maxSize: 40, float: 'navigator' },
|
|
157
|
+
null,
|
|
158
|
+
{ minSize: 20, size: 30, maxSize: 50, float: 'aside' }
|
|
159
|
+
]
|
|
160
|
+
|
|
161
|
+
export const settingsSeparators: DefSeparators = [
|
|
162
|
+
{ minSize: 12.5, size: 17.5, maxSize: 22.5, float: 'navigator' },
|
|
163
|
+
null,
|
|
164
|
+
{ minSize: 19, size: 30, maxSize: 32, float: 'aside' }
|
|
165
|
+
]
|
|
166
|
+
|
|
167
|
+
export const twoPanelsSeparators: DefSeparators = [
|
|
168
|
+
{ minSize: 12.5, size: 17.5, maxSize: 22.5, float: 'navigator' },
|
|
169
|
+
null
|
|
170
|
+
]
|
|
171
|
+
|
|
172
|
+
export const mainSeparators: DefSeparators = [
|
|
173
|
+
{ minSize: 20, size: 'auto', maxSize: 'auto' },
|
|
174
|
+
{ minSize: 25, size: 30, maxSize: 80, float: 'sidebar' }
|
|
175
|
+
]
|
|
176
|
+
|
|
177
|
+
export const secondNavSeparators: DefSeparators = [{ minSize: 7, size: 7.5, maxSize: 15, float: 'navigator' }, null]
|
|
178
|
+
|
|
179
|
+
export const separatorsStore = writable<string[]>([])
|
package/src/svg.d.ts
ADDED