@widgetic/editor 3.11.3 → 4.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 +245 -0
- package/dist/assets/fonts.json +331 -0
- package/dist/assets/icons/ic-browser/audio.svg +7 -0
- package/dist/assets/icons/ic-browser/document.svg +11 -0
- package/dist/assets/icons/ic-browser/error.svg +5 -0
- package/dist/assets/icons/ic-browser/folder.svg +28 -0
- package/dist/assets/icons/ic-browser/player-pause.svg +1 -0
- package/dist/assets/icons/ic-browser/player-play.svg +1 -0
- package/dist/assets/icons/ic-browser/trash.svg +1 -0
- package/dist/assets/icons/ic-fixed-position/background-deselected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/background-selected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/bottom-left-background-deselected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/bottom-left-background-selected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/bottom-left-icon.svg +4 -0
- package/dist/assets/icons/ic-fixed-position/bottom-right-background-deselected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/bottom-right-background-selected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/bottom-right-icon.svg +4 -0
- package/dist/assets/icons/ic-fixed-position/center-bottom-icon.svg +5 -0
- package/dist/assets/icons/ic-fixed-position/center-center-icon.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/center-left-icon.svg +5 -0
- package/dist/assets/icons/ic-fixed-position/center-right-icon.svg +5 -0
- package/dist/assets/icons/ic-fixed-position/center-top-icon.svg +5 -0
- package/dist/assets/icons/ic-fixed-position/top-left-background-deselected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/top-left-background-selected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/top-left-icon.svg +4 -0
- package/dist/assets/icons/ic-fixed-position/top-right-background-deselected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/top-right-background-selected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/top-right-icon.svg +4 -0
- package/dist/assets/icons/trash.svg +1 -0
- package/dist/components/MockWidget.svelte +108 -0
- package/dist/components/MockWidget.svelte.d.ts +22 -0
- package/dist/components/WidgetPreview.svelte +852 -0
- package/dist/components/WidgetPreview.svelte.d.ts +100 -0
- package/dist/components/color-select/ColorSelect.svelte +258 -0
- package/dist/components/color-select/ColorSelect.svelte.d.ts +42 -0
- package/dist/components/color-select/color.d.ts +25 -0
- package/dist/components/color-select/color.js +21 -0
- package/dist/components/color-select/constants.d.ts +5 -0
- package/dist/components/color-select/constants.js +5 -0
- package/dist/components/color-select/render.d.ts +5 -0
- package/dist/components/color-select/render.js +77 -0
- package/dist/components/color-select/shaders.d.ts +3 -0
- package/dist/components/color-select/shaders.js +8 -0
- package/dist/components/editors/EmbedEditor.svelte +700 -0
- package/dist/components/editors/EmbedEditor.svelte.d.ts +50 -0
- package/dist/components/editors/PropsEditor.svelte +3952 -0
- package/dist/components/editors/PropsEditor.svelte.d.ts +62 -0
- package/dist/components/editors/props-editor.css +73 -0
- package/dist/components/ic/AngleInputController.svelte +276 -0
- package/dist/components/ic/AngleInputController.svelte.d.ts +26 -0
- package/dist/components/ic/BrowserInputController.svelte +724 -0
- package/dist/components/ic/BrowserInputController.svelte.d.ts +39 -0
- package/dist/components/ic/CheckboxInputController.svelte +203 -0
- package/dist/components/ic/CheckboxInputController.svelte.d.ts +41 -0
- package/dist/components/ic/ColorPickerInputController.svelte +1584 -0
- package/dist/components/ic/ColorPickerInputController.svelte.d.ts +50 -0
- package/dist/components/ic/DateFieldInputController.svelte +453 -0
- package/dist/components/ic/DateFieldInputController.svelte.d.ts +35 -0
- package/dist/components/ic/DatePickerInputController.svelte +364 -0
- package/dist/components/ic/DatePickerInputController.svelte.d.ts +28 -0
- package/dist/components/ic/DropdownInputController.svelte +226 -0
- package/dist/components/ic/DropdownInputController.svelte.d.ts +43 -0
- package/dist/components/ic/FixedPositionInputController.svelte +353 -0
- package/dist/components/ic/FixedPositionInputController.svelte.d.ts +23 -0
- package/dist/components/ic/FontInputController.svelte +2062 -0
- package/dist/components/ic/FontInputController.svelte.d.ts +47 -0
- package/dist/components/ic/InputControllerHeader.svelte +147 -0
- package/dist/components/ic/InputControllerHeader.svelte.d.ts +23 -0
- package/dist/components/ic/NumberControls.svelte +299 -0
- package/dist/components/ic/NumberControls.svelte.d.ts +30 -0
- package/dist/components/ic/NumberInputController.svelte +397 -0
- package/dist/components/ic/NumberInputController.svelte.d.ts +30 -0
- package/dist/components/ic/PositionInputController.svelte +252 -0
- package/dist/components/ic/PositionInputController.svelte.d.ts +37 -0
- package/dist/components/ic/RadioGroupInputController.svelte +162 -0
- package/dist/components/ic/RadioGroupInputController.svelte.d.ts +38 -0
- package/dist/components/ic/RangeCalendarInputController.svelte +262 -0
- package/dist/components/ic/RangeCalendarInputController.svelte.d.ts +32 -0
- package/dist/components/ic/RoundedCornersInputController.svelte +469 -0
- package/dist/components/ic/RoundedCornersInputController.svelte.d.ts +37 -0
- package/dist/components/ic/SliderInputController.svelte +411 -0
- package/dist/components/ic/SliderInputController.svelte.d.ts +46 -0
- package/dist/components/ic/SliderRangeInputController.svelte +155 -0
- package/dist/components/ic/SliderRangeInputController.svelte.d.ts +33 -0
- package/dist/components/ic/SwitchInputController.svelte +107 -0
- package/dist/components/ic/SwitchInputController.svelte.d.ts +24 -0
- package/dist/components/ic/TagsInputController.svelte +125 -0
- package/dist/components/ic/TagsInputController.svelte.d.ts +27 -0
- package/dist/components/ic/TextAreaInputController.svelte +1804 -0
- package/dist/components/ic/TextAreaInputController.svelte.d.ts +13 -0
- package/dist/components/ic/TextAreaPreviewInputController.svelte +476 -0
- package/dist/components/ic/TextAreaPreviewInputController.svelte.d.ts +28 -0
- package/dist/components/ic/TextInputController.svelte +70 -0
- package/dist/components/ic/TextInputController.svelte.d.ts +30 -0
- package/dist/components/ic/TimeInputController.svelte +434 -0
- package/dist/components/ic/TimeInputController.svelte.d.ts +25 -0
- package/dist/components/ic/VectorInputController.svelte +1826 -0
- package/dist/components/ic/VectorInputController.svelte.d.ts +47 -0
- package/dist/components/ic/index.d.ts +39 -0
- package/dist/components/ic/index.js +24 -0
- package/dist/components/ic/shared/CategoryTabs.svelte +40 -0
- package/dist/components/ic/shared/CategoryTabs.svelte.d.ts +25 -0
- package/dist/components/ic/shared/ItemGrid.svelte +181 -0
- package/dist/components/ic/shared/ItemGrid.svelte.d.ts +35 -0
- package/dist/components/ic/shared/RecentItemsSection.svelte +260 -0
- package/dist/components/ic/shared/RecentItemsSection.svelte.d.ts +35 -0
- package/dist/components/ic/shared/index.d.ts +8 -0
- package/dist/components/ic/shared/index.js +9 -0
- package/dist/components/icons/addnew.svelte +21 -0
- package/dist/components/icons/addnew.svelte.d.ts +20 -0
- package/dist/components/icons/drag.svelte +29 -0
- package/dist/components/icons/drag.svelte.d.ts +20 -0
- package/dist/components/icons/drag.svg +1 -0
- package/dist/components/icons/locked.svelte +4 -0
- package/dist/components/icons/locked.svelte.d.ts +26 -0
- package/dist/components/icons/locked.svg +4 -0
- package/dist/components/icons/ok.svelte +20 -0
- package/dist/components/icons/ok.svelte.d.ts +20 -0
- package/dist/components/icons/ok.svg +11 -0
- package/dist/components/icons/unlocked.svelte +4 -0
- package/dist/components/icons/unlocked.svelte.d.ts +26 -0
- package/dist/components/icons/unlocked.svg +4 -0
- package/dist/components/icons/x.svelte +14 -0
- package/dist/components/icons/x.svelte.d.ts +20 -0
- package/dist/components/icons/x.svg +5 -0
- package/dist/components/ui/arrows/OpacitySliderArrows.svelte +43 -0
- package/dist/components/ui/arrows/OpacitySliderArrows.svelte.d.ts +23 -0
- package/dist/components/ui/checkerboard-background/CheckerboardBackground.svelte +15 -0
- package/dist/components/ui/checkerboard-background/CheckerboardBackground.svelte.d.ts +20 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.js +19 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +8 -0
- package/dist/stores/userSession.d.ts +7 -0
- package/dist/stores/userSession.js +28 -0
- package/dist/utils/FontManager.d.ts +276 -0
- package/dist/utils/FontManager.js +1283 -0
- package/dist/utils/MediaManager.d.ts +35 -0
- package/dist/utils/MediaManager.js +59 -0
- package/dist/utils/VectorManager.d.ts +190 -0
- package/dist/utils/VectorManager.js +754 -0
- package/dist/utils/colorAutocomplete.d.ts +10 -0
- package/dist/utils/colorAutocomplete.js +28 -0
- package/dist/utils/colorNames.d.ts +3 -0
- package/dist/utils/colorNames.js +152 -0
- package/dist/utils/colorTransparency.d.ts +52 -0
- package/dist/utils/colorTransparency.js +114 -0
- package/dist/utils/fontUtils.d.ts +34 -0
- package/dist/utils/fontUtils.js +132 -0
- package/dist/utils/passiveEvents.js +20 -0
- package/dist/utils/recentColors.d.ts +10 -0
- package/dist/utils/recentColors.js +63 -0
- package/dist/utils/skipFonts.d.ts +3 -0
- package/dist/utils/skipFonts.js +49 -0
- package/dist/utils/vectorUtils.d.ts +34 -0
- package/dist/utils/vectorUtils.js +71 -0
- package/dist/utils.d.ts +11 -0
- package/dist/utils.js +38 -0
- package/package.json +134 -74
- package/.babelrc +0 -10
- package/.bowerrc +0 -4
- package/.nvmrc +0 -1
- package/Gruntfile.coffee +0 -69
- package/bower.json +0 -28
- package/css/browser/entries/activateable.styl +0 -29
- package/css/browser/entries/audio.styl +0 -39
- package/css/browser/entries/folder.styl +0 -79
- package/css/browser/entries/image.styl +0 -26
- package/css/browser/entries/index.styl +0 -66
- package/css/browser/entries/rss.styl +0 -11
- package/css/browser/entries/video.styl +0 -11
- package/css/browser/index.styl +0 -86
- package/css/browser/intent/index.styl +0 -61
- package/css/browser/nav/index.styl +0 -73
- package/css/browser/social-browser.styl +0 -23
- package/css/controls/clock.styl +0 -110
- package/css/controls/config.styl +0 -6
- package/css/controls/control-audio-details.styl +0 -63
- package/css/controls/control-audio.styl +0 -28
- package/css/controls/control-browser.styl +0 -48
- package/css/controls/control-color.styl +0 -423
- package/css/controls/control-date_time.styl +0 -191
- package/css/controls/control-dropdown.styl +0 -79
- package/css/controls/control-font.styl +0 -147
- package/css/controls/control-image-details.styl +0 -35
- package/css/controls/control-image.styl +0 -43
- package/css/controls/control-order-picker.styl +0 -29
- package/css/controls/control-position.styl +0 -390
- package/css/controls/control-range.styl +0 -68
- package/css/controls/control-scale.styl +0 -30
- package/css/controls/control-slider.styl +0 -38
- package/css/controls/control-spinner.styl +0 -39
- package/css/controls/control-textarea.styl +0 -52
- package/css/controls/control-toggle.styl +0 -34
- package/css/controls/control-url.styl +0 -32
- package/css/controls/control-video-details.styl +0 -85
- package/css/controls/control-video.styl +0 -43
- package/css/controls/general.styl +0 -98
- package/css/controls/index.styl +0 -25
- package/css/editor/colors.styl +0 -7
- package/css/editor/content/directinput.styl +0 -47
- package/css/editor/content/index.styl +0 -111
- package/css/editor/content/message.styl +0 -53
- package/css/editor/content/tabs.styl +0 -75
- package/css/editor/copied-from-old-style.styl +0 -197
- package/css/editor/details/bulk-editor.styl +0 -104
- package/css/editor/details/index.styl +0 -21
- package/css/editor/details/item.styl +0 -153
- package/css/editor/embed.styl +0 -106
- package/css/editor/footer.styl +0 -180
- package/css/editor/full-editor.styl +0 -16
- package/css/editor/index.styl +0 -124
- package/css/editor/login-popup.styl +0 -13
- package/css/editor/preview.styl +0 -257
- package/css/editor/skin/editor/index.styl +0 -54
- package/css/editor/skin/editor/tabs.styl +0 -111
- package/css/editor/skin/index.styl +0 -138
- package/css/editor/skin/popup.styl +0 -152
- package/css/editor/skin/presets/dropdown.styl +0 -61
- package/css/editor/skin/presets/index.styl +0 -86
- package/css/editor/skin/presets/list.styl +0 -244
- package/css/editor/tooltips.styl +0 -85
- package/css/fonts.styl +0 -47
- package/css/icons/BlogvioEditor.dev.svg +0 -112
- package/css/icons.styl +0 -16
- package/css/img/arrow-right-rounded-v-small.png +0 -0
- package/css/img/browser-folder-separator.png +0 -0
- package/css/img/calendar-input-icons.png +0 -0
- package/css/img/check.png +0 -0
- package/css/img/close.png +0 -0
- package/css/img/composition/edit-icon.png +0 -0
- package/css/img/content/audio-icon.png +0 -0
- package/css/img/content/folder-icon.png +0 -0
- package/css/img/content/messages/error-background.png +0 -0
- package/css/img/content/messages/error-icon.png +0 -0
- package/css/img/content/messages/notification-background.png +0 -0
- package/css/img/content/messages/notification-icon.png +0 -0
- package/css/img/content/no-files-audio.png +0 -0
- package/css/img/content/no-files-image.png +0 -0
- package/css/img/content/no-files-video.png +0 -0
- package/css/img/content/no-files.png +0 -0
- package/css/img/content/rss-icon.png +0 -0
- package/css/img/content/selected.png +0 -0
- package/css/img/content/video-icon.png +0 -0
- package/css/img/content/with-control-text.png +0 -0
- package/css/img/control-dropdown-arrow.png +0 -0
- package/css/img/control-image-valid.png +0 -0
- package/css/img/control-position-icon.png +0 -0
- package/css/img/control-scale-lock-icon.png +0 -0
- package/css/img/control-slider-arrows-hover.png +0 -0
- package/css/img/control-slider-arrows.png +0 -0
- package/css/img/control-spinner-buttons-hover.png +0 -0
- package/css/img/control-spinner-buttons.png +0 -0
- package/css/img/control-textarea-bold-active.png +0 -0
- package/css/img/control-textarea-bold.png +0 -0
- package/css/img/control-textarea-italic-active.png +0 -0
- package/css/img/control-textarea-italic.png +0 -0
- package/css/img/control-textarea-underline-active.png +0 -0
- package/css/img/control-textarea-underline.png +0 -0
- package/css/img/custom-checkbox-sprite.png +0 -0
- package/css/img/details/item-collapse-icon.png +0 -0
- package/css/img/details/item-expand-icon.png +0 -0
- package/css/img/details/item-sort-icon.png +0 -0
- package/css/img/done-arrow.png +0 -0
- package/css/img/fb-logo-icon-w.png +0 -0
- package/css/img/grid-icons.png +0 -0
- package/css/img/icon-reference.png +0 -0
- package/css/img/indicator.png +0 -0
- package/css/img/loader.gif +0 -0
- package/css/img/loaders/audio-white.png +0 -0
- package/css/img/loaders/audio.png +0 -0
- package/css/img/loaders/photo-white.png +0 -0
- package/css/img/loaders/photo.png +0 -0
- package/css/img/loaders/util-white.png +0 -0
- package/css/img/loaders/util.png +0 -0
- package/css/img/loaders/video-white.png +0 -0
- package/css/img/loaders/video.png +0 -0
- package/css/img/maximize.png +0 -0
- package/css/img/minimize.png +0 -0
- package/css/img/next-btn.png +0 -0
- package/css/img/search-icon-sprite.png +0 -0
- package/css/img/services/blogvio.png +0 -0
- package/css/img/services/drive.png +0 -0
- package/css/img/services/dropbox-login.png +0 -0
- package/css/img/services/dropbox.png +0 -0
- package/css/img/services/facebook-login.png +0 -0
- package/css/img/services/facebook.png +0 -0
- package/css/img/services/flickr-login.png +0 -0
- package/css/img/services/flickr.png +0 -0
- package/css/img/services/instagram-login.png +0 -0
- package/css/img/services/instagram.png +0 -0
- package/css/img/services/text.png +0 -0
- package/css/img/services/uploads.png +0 -0
- package/css/img/services/uploads.svg +0 -689
- package/css/img/services/webaddress-bw.png +0 -0
- package/css/img/services/webaddress.png +0 -0
- package/css/img/services/webadress.png +0 -0
- package/css/img/services/websearch.png +0 -0
- package/css/img/services/wix.png +0 -0
- package/css/img/skin/item-active-indicator.png +0 -0
- package/css/img/skin/item-hover-icon.png +0 -0
- package/css/img/skin/overwrite.png +0 -0
- package/css/img/skin/popup-name-icon.png +0 -0
- package/css/img/skin/popup-save.png +0 -0
- package/css/img/skin/preset.png +0 -0
- package/css/img/skin/presets-arrow-purple.png +0 -0
- package/css/img/tw-icon-w.png +0 -0
- package/css/img/warning.png +0 -0
- package/css/img/white-rounded-check.png +0 -0
- package/css/index.styl +0 -9
- package/css/mixins.styl +0 -62
- package/css/scrollable.styl +0 -101
- package/karma.conf.js +0 -73
- package/lib/control.js +0 -1
- package/lib/controls.js +0 -1
- package/lib/core.editor.js +0 -4
- package/lib/core.js +0 -1
- package/lib/core.vendor.js +0 -3
- package/lib/dev/control.js +0 -845
- package/lib/dev/controls.js +0 -7774
- package/lib/dev/core.editor.js +0 -6439
- package/lib/dev/core.js +0 -1486
- package/lib/dev/core.vendor.js +0 -10708
- package/lib/dev/editor.css +0 -166
- package/lib/dev/editor.js +0 -29710
- package/lib/dev/editor.vendor.js +0 -15119
- package/lib/dev/jquery.nanoscroller.js.map +0 -10
- package/lib/editor.css +0 -167
- package/lib/editor.js +0 -49
- package/lib/editor.vendor.js +0 -11
- package/src/api/index.coffee +0 -23
- package/src/api/mixin.coffee +0 -89
- package/src/browser/controller/entry/audio.coffee +0 -38
- package/src/browser/controller/entry/button.coffee +0 -16
- package/src/browser/controller/entry/file.coffee +0 -35
- package/src/browser/controller/entry/folder.coffee +0 -14
- package/src/browser/controller/entry/image.coffee +0 -24
- package/src/browser/controller/entry/index.coffee +0 -18
- package/src/browser/controller/entry/rss.coffee +0 -5
- package/src/browser/controller/entry/video.coffee +0 -4
- package/src/browser/controller/index.coffee +0 -289
- package/src/browser/controller/instagram.coffee +0 -129
- package/src/browser/controller/navbar.coffee +0 -48
- package/src/browser/controller/social.coffee +0 -213
- package/src/browser/model/entry.coffee +0 -18
- package/src/browser/model/index.coffee +0 -34
- package/src/core/controller/font-loader.coffee +0 -65
- package/src/core/controller/lazyload.coffee +0 -14
- package/src/core/controller/overlay.coffee +0 -146
- package/src/core/controller/popup.coffee +0 -36
- package/src/core/controller/scrollable.coffee +0 -68
- package/src/core/controls/audio.coffee +0 -56
- package/src/core/controls/browser.coffee +0 -271
- package/src/core/controls/color.coffee +0 -121
- package/src/core/controls/date-time/calendar/index.coffee +0 -99
- package/src/core/controls/date-time/calendar/months.coffee +0 -52
- package/src/core/controls/date-time/calendar/years.coffee +0 -58
- package/src/core/controls/date-time/clock.coffee +0 -62
- package/src/core/controls/date-time/helper.coffee +0 -31
- package/src/core/controls/date-time/index.coffee +0 -62
- package/src/core/controls/date-time/popup.coffee +0 -56
- package/src/core/controls/details/audio.coffee +0 -33
- package/src/core/controls/details/image.coffee +0 -19
- package/src/core/controls/details/video.coffee +0 -14
- package/src/core/controls/dropdown.coffee +0 -100
- package/src/core/controls/font/font-item.coffee +0 -22
- package/src/core/controls/font/font-list.coffee +0 -108
- package/src/core/controls/font/fonts-popup.coffee +0 -91
- package/src/core/controls/font/index.coffee +0 -66
- package/src/core/controls/image.coffee +0 -37
- package/src/core/controls/index.coffee +0 -88
- package/src/core/controls/orderPicker.coffee +0 -93
- package/src/core/controls/position/grid-panel.coffee +0 -75
- package/src/core/controls/position/index.coffee +0 -98
- package/src/core/controls/position/panel.coffee +0 -68
- package/src/core/controls/position/pixel-panel.coffee +0 -54
- package/src/core/controls/position/popup.coffee +0 -63
- package/src/core/controls/position/reference-panel.coffee +0 -26
- package/src/core/controls/range.coffee +0 -191
- package/src/core/controls/rss.coffee +0 -16
- package/src/core/controls/scale.coffee +0 -78
- package/src/core/controls/slider.coffee +0 -122
- package/src/core/controls/stepper.coffee +0 -97
- package/src/core/controls/text.coffee +0 -54
- package/src/core/controls/textarea.coffee +0 -78
- package/src/core/controls/toggle.coffee +0 -29
- package/src/core/controls/url.coffee +0 -88
- package/src/core/controls/video.coffee +0 -9
- package/src/core/embed/api.js +0 -178
- package/src/core/embed/controller.js +0 -331
- package/src/core/models/composition.coffee +0 -178
- package/src/core/models/content.coffee +0 -79
- package/src/core/models/skin.coffee +0 -91
- package/src/core/models/user.coffee +0 -6
- package/src/core/models/widget.coffee +0 -88
- package/src/core/router/index.coffee +0 -44
- package/src/core/services/container/index.js +0 -18
- package/src/core/services/container/instance.js +0 -3
- package/src/core/services/content.js +0 -80
- package/src/core/services/instagram.coffee +0 -47
- package/src/core/services/mixin/events.js +0 -17
- package/src/core/services/service.js +0 -1
- package/src/core/services/sounds.js +0 -81
- package/src/core/services/uploads.js +0 -299
- package/src/core/utils/popup.coffee +0 -67
- package/src/core/utils/should-show.coffee +0 -12
- package/src/core/views/audio-details.pug +0 -9
- package/src/core/views/audio.pug +0 -7
- package/src/core/views/browser.pug +0 -4
- package/src/core/views/color.pug +0 -8
- package/src/core/views/date-time/calendar.pug +0 -3
- package/src/core/views/date-time/clock.pug +0 -12
- package/src/core/views/date-time/grid.pug +0 -6
- package/src/core/views/date-time/input.pug +0 -4
- package/src/core/views/date-time/table.pug +0 -6
- package/src/core/views/dropdown.pug +0 -9
- package/src/core/views/font/font-item.pug +0 -3
- package/src/core/views/font/fonts-list.pug +0 -7
- package/src/core/views/font/fonts-popup.pug +0 -5
- package/src/core/views/font/index.pug +0 -7
- package/src/core/views/image-details.pug +0 -6
- package/src/core/views/image.pug +0 -5
- package/src/core/views/input-layout.pug +0 -15
- package/src/core/views/order-items.pug +0 -7
- package/src/core/views/order-picker.pug +0 -7
- package/src/core/views/pixelpanel.pug +0 -69
- package/src/core/views/position.pug +0 -10
- package/src/core/views/range.pug +0 -9
- package/src/core/views/scale.pug +0 -7
- package/src/core/views/slider.pug +0 -6
- package/src/core/views/stepper.pug +0 -6
- package/src/core/views/text.pug +0 -4
- package/src/core/views/textarea.pug +0 -8
- package/src/core/views/toggle.pug +0 -5
- package/src/core/views/video-details.pug +0 -7
- package/src/core/views/video.pug +0 -4
- package/src/core/widget/index.coffee +0 -66
- package/src/editor/content/browser/dropzone.html +0 -268
- package/src/editor/content/browser/file.html +0 -124
- package/src/editor/content/browser/scroll-pane.html +0 -32
- package/src/editor/content/browser/service.html +0 -53
- package/src/editor/content/browser/upload.coffee +0 -44
- package/src/editor/content/browser/upload.html +0 -439
- package/src/editor/content/index.coffee +0 -294
- package/src/editor/content/input/field.coffee +0 -45
- package/src/editor/content/input/index.coffee +0 -115
- package/src/editor/content/service/base/photoitem.coffee +0 -49
- package/src/editor/content/service/cache.coffee +0 -20
- package/src/editor/content/service/default.coffee +0 -59
- package/src/editor/content/service/dropbox.coffee +0 -71
- package/src/editor/content/service/facebook.coffee +0 -143
- package/src/editor/content/service/flickr.coffee +0 -85
- package/src/editor/content/service/google-drive-sdk.coffee +0 -18
- package/src/editor/content/service/google-drive.coffee +0 -144
- package/src/editor/content/service/instagram-social.coffee +0 -84
- package/src/editor/content/service/instagram.coffee +0 -168
- package/src/editor/content/service/share-popup.coffee +0 -15
- package/src/editor/content/service/soundcloud.coffee +0 -163
- package/src/editor/content/tab.coffee +0 -27
- package/src/editor/details/bulk-editor/attributes-panel.coffee +0 -11
- package/src/editor/details/bulk-editor/index.coffee +0 -86
- package/src/editor/details/index.coffee +0 -156
- package/src/editor/details/item/attributes.coffee +0 -45
- package/src/editor/details/item/index.coffee +0 -82
- package/src/editor/editor.coffee +0 -274
- package/src/editor/footer/breadcrumb.coffee +0 -17
- package/src/editor/footer/index.coffee +0 -36
- package/src/editor/index.coffee +0 -79
- package/src/editor/listeners/embed-listener.coffee +0 -143
- package/src/editor/login-popup.coffee +0 -29
- package/src/editor/notification-controller.coffee +0 -35
- package/src/editor/popup.coffee +0 -68
- package/src/editor/remote-preview.coffee +0 -68
- package/src/editor/save/index.coffee +0 -62
- package/src/editor/skin/delete.coffee +0 -33
- package/src/editor/skin/editor/index.coffee +0 -188
- package/src/editor/skin/editor/panel.coffee +0 -37
- package/src/editor/skin/index.coffee +0 -126
- package/src/editor/skin/save.coffee +0 -58
- package/src/editor/skin/selector/index.coffee +0 -59
- package/src/editor/skin/selector/item.coffee +0 -123
- package/src/editor/skin/selector/list.coffee +0 -97
- package/src/editor/views/embed.pug +0 -10
- package/src/editor/views/loginbutton.pug +0 -8
- package/src/editor/views/popup.pug +0 -17
- package/src/editor/views/presets.pug +0 -8
- package/src/editor/views/presetslist-header.pug +0 -8
- package/src/editor/views/skinitem.pug +0 -13
- package/src/modules/control.js +0 -3
- package/src/modules/controls.js +0 -29
- package/src/modules/core.js +0 -19
- package/src/modules/editor.js +0 -80
- package/test/config.js +0 -3
- package/test/core/models/skin-spec.js +0 -209
- package/webpack.config.js +0 -46
- package/webpack.config.prod.js +0 -9
- /package/{src/core/views/date-time/popup.pug → dist/utils/passiveEvents.d.ts} +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const PositionInputController: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
/**
|
|
16
|
+
* Core state and configuration props
|
|
17
|
+
* value: Current position coordinates
|
|
18
|
+
* onChange: Callback for position updates
|
|
19
|
+
* config: Additional configuration options
|
|
20
|
+
* onFocus: Focus event handler
|
|
21
|
+
* onDragStateChange: Callback for dragging state changes
|
|
22
|
+
*/ value?: {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
} | undefined;
|
|
26
|
+
onChange: (newValue: {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
}) => void;
|
|
30
|
+
onFocus?: () => void;
|
|
31
|
+
maskThumb?: boolean;
|
|
32
|
+
onDragStateChange?: (isDragging: boolean) => void;
|
|
33
|
+
}, {
|
|
34
|
+
[evt: string]: CustomEvent<any>;
|
|
35
|
+
}, {}, {}, string>;
|
|
36
|
+
type PositionInputController = InstanceType<typeof PositionInputController>;
|
|
37
|
+
export default PositionInputController;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
/**
|
|
3
|
+
* RadioGroupInputController Component
|
|
4
|
+
* A reusable radio group input component that handles selection from a list of options.
|
|
5
|
+
* Supports custom styling, external state management, and accessibility features.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Svelte Lifecycle Imports
|
|
10
|
+
* Required for component setup and cleanup
|
|
11
|
+
*/
|
|
12
|
+
import { onMount, onDestroy } from 'svelte';
|
|
13
|
+
import type { InputControllerConfig } from './index';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* UI Components Imports
|
|
17
|
+
* Shadcn UI radio group components for consistent styling and behavior
|
|
18
|
+
*/
|
|
19
|
+
import { Label, RadioGroup } from '@widgetic/design-system/components';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Component Props
|
|
23
|
+
* External properties that configure the radio group's behavior and appearance
|
|
24
|
+
*/
|
|
25
|
+
export let value: string | { value: string; label: string }; // Currently selected value
|
|
26
|
+
export let onChange: (newValue: string) => void; // Callback for value changes
|
|
27
|
+
export let config: InputControllerConfig = {}; // Additional configuration options
|
|
28
|
+
export let description: string | undefined = undefined; // Optional help description text
|
|
29
|
+
export let onFocus: () => void = () => {}; // Focus event handler
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Configuration Options
|
|
33
|
+
* Derived from config prop with fallbacks
|
|
34
|
+
*/
|
|
35
|
+
export let options: { value: string; label: string }[] = config.options || []; // Available options
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Local state
|
|
39
|
+
*/
|
|
40
|
+
let localValue: string = typeof value === 'object' ? value.value : value;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Handles value changes from the radio group
|
|
44
|
+
* @param newValue - The newly selected value
|
|
45
|
+
*/
|
|
46
|
+
function handleValueChange(newValue: string) {
|
|
47
|
+
console.log('RadioGroupInputController: handleValueChange', newValue);
|
|
48
|
+
localValue = newValue;
|
|
49
|
+
onChange(newValue);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Handles click on the entire row
|
|
54
|
+
* @param optionValue - The value to select
|
|
55
|
+
*/
|
|
56
|
+
function handleRowClick(optionValue: string) {
|
|
57
|
+
if (localValue !== optionValue) {
|
|
58
|
+
handleValueChange(optionValue);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Stops event propagation to prevent double-firing of click events
|
|
64
|
+
* @param event - The mouse event
|
|
65
|
+
*/
|
|
66
|
+
function stopPropagation(event: MouseEvent) {
|
|
67
|
+
event.stopPropagation();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Create proper event handlers for shadcn components
|
|
72
|
+
*/
|
|
73
|
+
function createHandlers() {
|
|
74
|
+
return {
|
|
75
|
+
// Use a function that returns a new object with events
|
|
76
|
+
// Note that these are not Svelte event directives but rather
|
|
77
|
+
// props expected by the shadcn components
|
|
78
|
+
onclick: stopPropagation
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Update local value when external value changes
|
|
84
|
+
*/
|
|
85
|
+
$: {
|
|
86
|
+
if (value) {
|
|
87
|
+
localValue = typeof value === 'object' ? value.value : value;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
</script>
|
|
91
|
+
|
|
92
|
+
<div class="flex flex-col gap-2 widgetic-colors">
|
|
93
|
+
<div
|
|
94
|
+
class="px-4 py-2 rounded-large border border-grey2 bg-grey1 transition-colors duration-200 hover:border-forest-green"
|
|
95
|
+
onfocusin={onFocus}
|
|
96
|
+
>
|
|
97
|
+
<RadioGroup.Root
|
|
98
|
+
value={localValue}
|
|
99
|
+
onValueChange={handleValueChange}
|
|
100
|
+
class="flex flex-col gap-2 py-2"
|
|
101
|
+
>
|
|
102
|
+
{#each options as option}
|
|
103
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
104
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
105
|
+
<div class="flex items-center space-x-2 cursor-pointer" onclick={() => handleRowClick(option.value)}>
|
|
106
|
+
<RadioGroup.Item
|
|
107
|
+
value={option.value}
|
|
108
|
+
id={`radio-${option.value}`}
|
|
109
|
+
class="radio-item size-4 rounded-full border border-grey7 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"
|
|
110
|
+
style="width: 20px; height: 20px; border-width: 2px; background-color: white;"
|
|
111
|
+
onclick={stopPropagation}
|
|
112
|
+
/>
|
|
113
|
+
<Label
|
|
114
|
+
for={`radio-${option.value}`}
|
|
115
|
+
class="subtext text-grey7 cursor-pointer select-none w-full"
|
|
116
|
+
onclick={stopPropagation}
|
|
117
|
+
>
|
|
118
|
+
{option.label}
|
|
119
|
+
</Label>
|
|
120
|
+
</div>
|
|
121
|
+
{/each}
|
|
122
|
+
</RadioGroup.Root>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
{#if description}
|
|
126
|
+
<p class="subtext text-grey5">{description}</p>
|
|
127
|
+
{/if}
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<style>
|
|
131
|
+
/* Custom radio styling to match design system */
|
|
132
|
+
:global(.radio-item[data-state="checked"]) {
|
|
133
|
+
border-color: hsl(var(--sage-green));
|
|
134
|
+
background-color: white;
|
|
135
|
+
position: relative;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
:global(.radio-item[data-state="checked"])::after {
|
|
139
|
+
content: "";
|
|
140
|
+
display: block;
|
|
141
|
+
width: 10px;
|
|
142
|
+
height: 10px;
|
|
143
|
+
border-radius: 50%;
|
|
144
|
+
background-color: hsl(var(--sage-green));
|
|
145
|
+
position: absolute;
|
|
146
|
+
top: 50%;
|
|
147
|
+
left: 50%;
|
|
148
|
+
transform: translate(-50%, -50%);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Remove focus outline from container when radio is focused */
|
|
152
|
+
:global(.radio-item:focus-visible),
|
|
153
|
+
:global(.radio-item:focus-within) {
|
|
154
|
+
outline: none;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* Remove pointer events from labels when disabled */
|
|
158
|
+
:global(.radio-item[disabled] + label) {
|
|
159
|
+
pointer-events: none;
|
|
160
|
+
opacity: 0.5;
|
|
161
|
+
}
|
|
162
|
+
</style>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { InputControllerConfig } from './index';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: Props & {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const RadioGroupInputController: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
/**
|
|
17
|
+
* Component Props
|
|
18
|
+
* External properties that configure the radio group's behavior and appearance
|
|
19
|
+
*/ value: string | {
|
|
20
|
+
value: string;
|
|
21
|
+
label: string;
|
|
22
|
+
};
|
|
23
|
+
onChange: (newValue: string) => void;
|
|
24
|
+
config?: InputControllerConfig;
|
|
25
|
+
description?: string | undefined;
|
|
26
|
+
onFocus?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* Configuration Options
|
|
29
|
+
* Derived from config prop with fallbacks
|
|
30
|
+
*/ options?: {
|
|
31
|
+
value: string;
|
|
32
|
+
label: string;
|
|
33
|
+
}[];
|
|
34
|
+
}, {
|
|
35
|
+
[evt: string]: CustomEvent<any>;
|
|
36
|
+
}, {}, {}, string>;
|
|
37
|
+
type RadioGroupInputController = InstanceType<typeof RadioGroupInputController>;
|
|
38
|
+
export default RadioGroupInputController;
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* RangeCalendarInputController
|
|
3
|
+
*
|
|
4
|
+
* A sophisticated date range selector that manages complex date range interactions.
|
|
5
|
+
* Provides visual calendar interface with support for selecting start and end dates.
|
|
6
|
+
*
|
|
7
|
+
* Key Features:
|
|
8
|
+
* - Two-month calendar view
|
|
9
|
+
* - Internationalized date handling
|
|
10
|
+
* - Consistent date range validation
|
|
11
|
+
* - Dropdown state management
|
|
12
|
+
*
|
|
13
|
+
* Edge Cases:
|
|
14
|
+
* - Handles undefined date ranges
|
|
15
|
+
* - Maintains date range integrity
|
|
16
|
+
* - Manages scroll-related UI issues
|
|
17
|
+
* - Preserves timezone consistency
|
|
18
|
+
-->
|
|
19
|
+
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
// Svelte imports
|
|
22
|
+
import { onMount, onDestroy } from 'svelte';
|
|
23
|
+
|
|
24
|
+
// Shadcn UI Components
|
|
25
|
+
import { Button, RangeCalendar } from '@widgetic/design-system/components';
|
|
26
|
+
// Shadcn Compound Components
|
|
27
|
+
import { Popover } from '@widgetic/design-system/components';
|
|
28
|
+
import { InputControllerHeader } from './index';
|
|
29
|
+
|
|
30
|
+
// Shadcn aditional: Internationalized Date
|
|
31
|
+
import { CalendarDate, getLocalTimeZone } from "@internationalized/date";
|
|
32
|
+
import type { DateValue } from "@internationalized/date";
|
|
33
|
+
import type { DateRange as BitsDateRange } from "bits-ui";
|
|
34
|
+
|
|
35
|
+
// Use a more flexible local type
|
|
36
|
+
type DateRange = {
|
|
37
|
+
start?: DateValue;
|
|
38
|
+
end?: DateValue;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Component props
|
|
42
|
+
export let label: string;
|
|
43
|
+
export let value: BitsDateRange | undefined;
|
|
44
|
+
export let onChange: (newValue: DateRange) => void;
|
|
45
|
+
export let helpText: string | undefined = undefined;
|
|
46
|
+
export let controllerId: string;
|
|
47
|
+
export let openDropdowns: any;
|
|
48
|
+
export let toggleDropdown: (id: string) => void;
|
|
49
|
+
export let onFocus: () => void = () => {};
|
|
50
|
+
|
|
51
|
+
let currentValue: DateRange | undefined;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Synchronizes external value with internal state
|
|
55
|
+
* Handles date range conversion and validation
|
|
56
|
+
* Preserves timezone information during conversion
|
|
57
|
+
*/
|
|
58
|
+
function updateCurrentValue() {
|
|
59
|
+
if (!value) {
|
|
60
|
+
currentValue = undefined;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
try {
|
|
65
|
+
const newRange: DateRange = {};
|
|
66
|
+
if (value.start && typeof value.start === 'object' && 'year' in value.start) {
|
|
67
|
+
const start = value.start;
|
|
68
|
+
newRange.start = start instanceof CalendarDate ? start : new CalendarDate(start.year, start.month, start.day);
|
|
69
|
+
}
|
|
70
|
+
if (value.end && typeof value.end === 'object' && 'year' in value.end) {
|
|
71
|
+
const end = value.end;
|
|
72
|
+
newRange.end = end instanceof CalendarDate ? end : new CalendarDate(end.year, end.month, end.day);
|
|
73
|
+
}
|
|
74
|
+
currentValue = (newRange.start || newRange.end) ? newRange : undefined;
|
|
75
|
+
} catch (error) {
|
|
76
|
+
console.error('Error updating range value:', error);
|
|
77
|
+
currentValue = undefined;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Watch for value changes and update internal state
|
|
82
|
+
$: value, updateCurrentValue();
|
|
83
|
+
|
|
84
|
+
// Track dropdown state through store subscription
|
|
85
|
+
$: open = $openDropdowns?.has(controllerId) || false;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Formats a date range for display
|
|
89
|
+
* Handles undefined ranges and invalid dates
|
|
90
|
+
* Provides consistent date formatting across the application
|
|
91
|
+
* @param range - The date range to format
|
|
92
|
+
* @returns Formatted date range string
|
|
93
|
+
*/
|
|
94
|
+
function formatDateRange(range: DateRange | undefined): string {
|
|
95
|
+
if (!range || !range.start || !range.end) return "Pick a date range";
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
const formatDate = (date: DateValue) => {
|
|
99
|
+
if (!(date instanceof CalendarDate)) {
|
|
100
|
+
console.warn('Invalid date object:', date);
|
|
101
|
+
return 'Invalid date';
|
|
102
|
+
}
|
|
103
|
+
// Format as DD/MM/YY
|
|
104
|
+
const day = date.day.toString().padStart(2, '0');
|
|
105
|
+
const month = date.month.toString().padStart(2, '0');
|
|
106
|
+
const year = date.year.toString().slice(-2);
|
|
107
|
+
return `${day}/${month}/${year}`;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
return `${formatDate(range.start)} - ${formatDate(range.end)}`;
|
|
111
|
+
} catch (error) {
|
|
112
|
+
console.error('Error formatting date range:', error);
|
|
113
|
+
return "Pick a date range";
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Handles date range selection from calendar
|
|
119
|
+
* Ensures both start and end dates are valid
|
|
120
|
+
* Closes dropdown after successful selection
|
|
121
|
+
* @param newValue - The newly selected date range
|
|
122
|
+
*/
|
|
123
|
+
function handleSelect(newValue: BitsDateRange | undefined): void {
|
|
124
|
+
if (newValue?.start && newValue?.end) {
|
|
125
|
+
// Create new CalendarDate instances for consistency
|
|
126
|
+
const range: DateRange = {
|
|
127
|
+
start: newValue.start,
|
|
128
|
+
end: newValue.end
|
|
129
|
+
};
|
|
130
|
+
onChange(range);
|
|
131
|
+
// Delay dropdown close for better UX
|
|
132
|
+
setTimeout(() => toggleDropdown(controllerId), 200);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Toggles calendar dropdown visibility
|
|
138
|
+
* Manages dropdown state through provided toggle function
|
|
139
|
+
*/
|
|
140
|
+
function handleToggle() {
|
|
141
|
+
toggleDropdown(controllerId);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Closes dropdown if currently open
|
|
146
|
+
* Used for cleanup and external close triggers
|
|
147
|
+
*/
|
|
148
|
+
function closeDropdown() {
|
|
149
|
+
if (open) {
|
|
150
|
+
toggleDropdown(controllerId);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Handles scroll events to prevent UI issues
|
|
156
|
+
* Closes dropdown when scrolling occurs
|
|
157
|
+
*/
|
|
158
|
+
function handleScroll() {
|
|
159
|
+
closeDropdown();
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// Setup scroll event listener on mount
|
|
163
|
+
onMount(() => {
|
|
164
|
+
window.addEventListener('scroll', handleScroll, true);
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// Cleanup scroll event listener on destroy
|
|
168
|
+
onDestroy(() => {
|
|
169
|
+
window.removeEventListener('scroll', handleScroll, true);
|
|
170
|
+
});
|
|
171
|
+
</script>
|
|
172
|
+
|
|
173
|
+
<!-- Range Calendar Container -->
|
|
174
|
+
<div class="flex flex-col gap-2 widgetic-colors">
|
|
175
|
+
<div class="flex items-center w-full relative">
|
|
176
|
+
<div class="flex-1 min-w-0">
|
|
177
|
+
<InputControllerHeader {label} helpText={helpText} />
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
<div class="absolute right-0">
|
|
181
|
+
<div
|
|
182
|
+
class="h-[48px] w-[185px] rounded-large border border-grey2 flex items-center bg-grey1 transition-colors duration-200 hover:border-forest-green"
|
|
183
|
+
on:focusin={onFocus}
|
|
184
|
+
>
|
|
185
|
+
<Popover.Root {open} onOpenChange={handleToggle}>
|
|
186
|
+
<Popover.Trigger class="w-full h-full">
|
|
187
|
+
<div class="w-full h-full px-[16px] flex items-center">
|
|
188
|
+
<Button
|
|
189
|
+
id="range-calendar"
|
|
190
|
+
variant="ghost"
|
|
191
|
+
class="w-full h-full justify-start text-left border-0 bg-transparent hover:bg-transparent focus:bg-transparent p-0"
|
|
192
|
+
>
|
|
193
|
+
<span class="subtext text-grey7 {!currentValue ? 'text-grey3' : ''}">{formatDateRange(currentValue)}</span>
|
|
194
|
+
</Button>
|
|
195
|
+
</div>
|
|
196
|
+
</Popover.Trigger>
|
|
197
|
+
|
|
198
|
+
<Popover.Content class="w-auto p-0 z-50" align="start" sideOffset={4}>
|
|
199
|
+
<RangeCalendar
|
|
200
|
+
{...currentValue}
|
|
201
|
+
onValueChange={(v: BitsDateRange) => {
|
|
202
|
+
handleSelect(v)
|
|
203
|
+
}}
|
|
204
|
+
numberOfMonths={2}
|
|
205
|
+
weekdayFormat="short"
|
|
206
|
+
fixedWeeks={true}
|
|
207
|
+
class="p-3"
|
|
208
|
+
/>
|
|
209
|
+
</Popover.Content>
|
|
210
|
+
</Popover.Root>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
|
|
216
|
+
<style>
|
|
217
|
+
/* Remove focus ring from trigger */
|
|
218
|
+
:global(.range-calendar-trigger:focus-visible) {
|
|
219
|
+
outline: none !important;
|
|
220
|
+
box-shadow: none !important;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* Style the calendar content */
|
|
224
|
+
:global(.range-calendar-content) {
|
|
225
|
+
border: 1px solid hsl(var(--grey2)) !important;
|
|
226
|
+
background: white !important;
|
|
227
|
+
border-radius: var(--radius) !important;
|
|
228
|
+
margin-top: 4px !important;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/* Remove button styles */
|
|
232
|
+
:global(button.bg-transparent) {
|
|
233
|
+
outline: none !important;
|
|
234
|
+
box-shadow: none !important;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
:global(button.bg-transparent:hover),
|
|
238
|
+
:global(button.bg-transparent:focus) {
|
|
239
|
+
background-color: transparent !important;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/* Style the range calendar */
|
|
243
|
+
:global(.range-calendar) {
|
|
244
|
+
border: none !important;
|
|
245
|
+
background: transparent !important;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* Style the range calendar days */
|
|
249
|
+
:global(.range-calendar [role="gridcell"]) {
|
|
250
|
+
color: hsl(var(--grey7)) !important;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
:global(.range-calendar [role="gridcell"][data-selected]) {
|
|
254
|
+
background: hsl(var(--grey1)) !important;
|
|
255
|
+
color: hsl(var(--grey7)) !important;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
:global(.range-calendar [role="gridcell"][data-highlighted]) {
|
|
259
|
+
background: hsl(var(--grey1)) !important;
|
|
260
|
+
color: hsl(var(--grey7)) !important;
|
|
261
|
+
}
|
|
262
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { DateValue } from "@internationalized/date";
|
|
2
|
+
import type { DateRange as BitsDateRange } from "bits-ui";
|
|
3
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
4
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
|
+
$$bindings?: Bindings;
|
|
6
|
+
} & Exports;
|
|
7
|
+
(internal: unknown, props: Props & {
|
|
8
|
+
$$events?: Events;
|
|
9
|
+
$$slots?: Slots;
|
|
10
|
+
}): Exports & {
|
|
11
|
+
$set?: any;
|
|
12
|
+
$on?: any;
|
|
13
|
+
};
|
|
14
|
+
z_$$bindings?: Bindings;
|
|
15
|
+
}
|
|
16
|
+
declare const RangeCalendarInputController: $$__sveltets_2_IsomorphicComponent<{
|
|
17
|
+
label: string;
|
|
18
|
+
value: BitsDateRange | undefined;
|
|
19
|
+
onChange: (newValue: {
|
|
20
|
+
start?: DateValue;
|
|
21
|
+
end?: DateValue;
|
|
22
|
+
}) => void;
|
|
23
|
+
helpText?: string | undefined;
|
|
24
|
+
controllerId: string;
|
|
25
|
+
openDropdowns: any;
|
|
26
|
+
toggleDropdown: (id: string) => void;
|
|
27
|
+
onFocus?: () => void;
|
|
28
|
+
}, {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
}, {}, {}, string>;
|
|
31
|
+
type RangeCalendarInputController = InstanceType<typeof RangeCalendarInputController>;
|
|
32
|
+
export default RangeCalendarInputController;
|