@widgetic/editor 3.11.4 → 4.0.2
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 +4009 -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 +731 -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 +2098 -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 +1932 -0
- package/dist/components/ic/TextAreaInputController.svelte.d.ts +14 -0
- package/dist/components/ic/TextAreaPreviewInputController.svelte +478 -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 +11 -0
- package/dist/config.js +31 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +9 -0
- package/dist/stores/userSession.d.ts +7 -0
- package/dist/stores/userSession.js +28 -0
- package/dist/utils/FontManager.d.ts +278 -0
- package/dist/utils/FontManager.js +1302 -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,50 @@
|
|
|
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 ColorPickerInputController: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
/**
|
|
17
|
+
* Component Props
|
|
18
|
+
* External properties that configure the color picker's behavior
|
|
19
|
+
*/ label?: string;
|
|
20
|
+
value?: string;
|
|
21
|
+
onChange: (newValue: string) => void;
|
|
22
|
+
controllerId?: string;
|
|
23
|
+
id?: string;
|
|
24
|
+
openDropdowns: any;
|
|
25
|
+
toggleDropdown: (id: string) => void;
|
|
26
|
+
config?: InputControllerConfig;
|
|
27
|
+
helpText?: string | undefined;
|
|
28
|
+
saveRecentColors?: boolean;
|
|
29
|
+
showOpacityControls?: boolean;
|
|
30
|
+
autofocus?: boolean;
|
|
31
|
+
portalTarget?: string;
|
|
32
|
+
pickerSize?: number;
|
|
33
|
+
sliderWidth?: number;
|
|
34
|
+
opacity?: number;
|
|
35
|
+
showRing?: boolean;
|
|
36
|
+
onFocus?: () => void;
|
|
37
|
+
focus?: () => void;
|
|
38
|
+
onOpacityChange?: (opacity: number) => void;
|
|
39
|
+
}, {
|
|
40
|
+
focus: CustomEvent<any>;
|
|
41
|
+
blur: CustomEvent<any>;
|
|
42
|
+
colorselectmodalclose: CustomEvent<any>;
|
|
43
|
+
colorselectmodalopen: CustomEvent<any>;
|
|
44
|
+
} & {
|
|
45
|
+
[evt: string]: CustomEvent<any>;
|
|
46
|
+
}, {}, {
|
|
47
|
+
focus: () => void;
|
|
48
|
+
}, string>;
|
|
49
|
+
type ColorPickerInputController = InstanceType<typeof ColorPickerInputController>;
|
|
50
|
+
export default ColorPickerInputController;
|
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* DateFieldInputController
|
|
3
|
+
*
|
|
4
|
+
* A specialized input controller for date fields allowing continuous typing across day, month, year fields.
|
|
5
|
+
*
|
|
6
|
+
* Features:
|
|
7
|
+
* - Customizable field order (day-month-year, month-day-year, year-month-day)
|
|
8
|
+
* - Automatic field progression when typing
|
|
9
|
+
* - Focus management and keyboard navigation
|
|
10
|
+
* - Field validation for valid date values
|
|
11
|
+
* - Visual feedback consistent with other input controllers
|
|
12
|
+
-->
|
|
13
|
+
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
import { onMount, tick } from 'svelte';
|
|
16
|
+
import InputControllerHeader from './InputControllerHeader.svelte';
|
|
17
|
+
import type { InputControllerConfig } from './index';
|
|
18
|
+
|
|
19
|
+
// Constants
|
|
20
|
+
const MIN_DAY = 1;
|
|
21
|
+
const MAX_DAY = 31;
|
|
22
|
+
const MIN_MONTH = 1;
|
|
23
|
+
const MAX_MONTH = 12;
|
|
24
|
+
const MIN_YEAR = 1900;
|
|
25
|
+
const MAX_YEAR = 2100;
|
|
26
|
+
|
|
27
|
+
// Required props
|
|
28
|
+
export let label: string;
|
|
29
|
+
export let value: { day: number; month: number; year: number };
|
|
30
|
+
export let onChange: (newValue: { day: number; month: number; year: number }) => void;
|
|
31
|
+
export let config: InputControllerConfig = {};
|
|
32
|
+
export let helpText: string | undefined = undefined;
|
|
33
|
+
export let onFocus: () => void = () => {};
|
|
34
|
+
|
|
35
|
+
// Optional: Class prop for external styling
|
|
36
|
+
let className = '';
|
|
37
|
+
export { className as class };
|
|
38
|
+
|
|
39
|
+
// Configure field order - default to day-month-year, can be overridden in config
|
|
40
|
+
const FORMAT_DMY = 'day-month-year';
|
|
41
|
+
const FORMAT_MDY = 'month-day-year';
|
|
42
|
+
const FORMAT_YMD = 'year-month-day';
|
|
43
|
+
|
|
44
|
+
let format = config.format || FORMAT_DMY;
|
|
45
|
+
let fieldOrder = getFieldOrder(format);
|
|
46
|
+
|
|
47
|
+
// Internal state
|
|
48
|
+
let day = value?.day || '';
|
|
49
|
+
let month = value?.month || '';
|
|
50
|
+
let year = value?.year || '';
|
|
51
|
+
let focusedField: 'day' | 'month' | 'year' | null = null;
|
|
52
|
+
let hasInitialValues = false;
|
|
53
|
+
|
|
54
|
+
// Reference to the input elements
|
|
55
|
+
let inputRefs: { day?: HTMLInputElement; month?: HTMLInputElement; year?: HTMLInputElement } = {};
|
|
56
|
+
|
|
57
|
+
// Get field order based on format
|
|
58
|
+
function getFieldOrder(format: string): ('day' | 'month' | 'year')[] {
|
|
59
|
+
switch (format) {
|
|
60
|
+
case FORMAT_DMY:
|
|
61
|
+
return ['day', 'month', 'year'];
|
|
62
|
+
case FORMAT_MDY:
|
|
63
|
+
return ['month', 'day', 'year'];
|
|
64
|
+
case FORMAT_YMD:
|
|
65
|
+
return ['year', 'month', 'day'];
|
|
66
|
+
default:
|
|
67
|
+
return ['day', 'month', 'year'];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Set initial values from prop
|
|
72
|
+
onMount(() => {
|
|
73
|
+
if (value) {
|
|
74
|
+
day = value.day || '';
|
|
75
|
+
month = value.month || '';
|
|
76
|
+
year = value.year || '';
|
|
77
|
+
hasInitialValues = true;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// Get field configuration
|
|
82
|
+
function getFieldConfig(field: 'day' | 'month' | 'year') {
|
|
83
|
+
const configs = {
|
|
84
|
+
day: {
|
|
85
|
+
min: MIN_DAY,
|
|
86
|
+
max: MAX_DAY,
|
|
87
|
+
placeholder: 'DD',
|
|
88
|
+
width: '40px',
|
|
89
|
+
maxLength: 2
|
|
90
|
+
},
|
|
91
|
+
month: {
|
|
92
|
+
min: MIN_MONTH,
|
|
93
|
+
max: MAX_MONTH,
|
|
94
|
+
placeholder: 'MM',
|
|
95
|
+
width: '40px',
|
|
96
|
+
maxLength: 2
|
|
97
|
+
},
|
|
98
|
+
year: {
|
|
99
|
+
min: MIN_YEAR,
|
|
100
|
+
max: MAX_YEAR,
|
|
101
|
+
placeholder: 'YYYY',
|
|
102
|
+
width: '60px',
|
|
103
|
+
maxLength: 4
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
return configs[field];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Helper function to focus on next field
|
|
110
|
+
async function focusNextField(currentField: 'day' | 'month' | 'year') {
|
|
111
|
+
const currentIndex = fieldOrder.indexOf(currentField);
|
|
112
|
+
if (currentIndex < fieldOrder.length - 1) {
|
|
113
|
+
const nextField = fieldOrder[currentIndex + 1];
|
|
114
|
+
await tick();
|
|
115
|
+
inputRefs[nextField]?.focus();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Helper function to focus on previous field
|
|
120
|
+
async function focusPreviousField(currentField: 'day' | 'month' | 'year') {
|
|
121
|
+
const currentIndex = fieldOrder.indexOf(currentField);
|
|
122
|
+
if (currentIndex > 0) {
|
|
123
|
+
const prevField = fieldOrder[currentIndex - 1];
|
|
124
|
+
await tick();
|
|
125
|
+
inputRefs[prevField]?.focus();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Validate and set day value
|
|
130
|
+
function handleDayInput(e: Event) {
|
|
131
|
+
const input = e.target as HTMLInputElement;
|
|
132
|
+
let inputValue = input.value;
|
|
133
|
+
|
|
134
|
+
// Handle empty input
|
|
135
|
+
if (inputValue === '') {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Remove non-numeric characters
|
|
140
|
+
inputValue = inputValue.replace(/[^\d]/g, '');
|
|
141
|
+
|
|
142
|
+
// Handle leading zeros - normalize to single 0
|
|
143
|
+
if (inputValue.length > 1 && inputValue.startsWith('0')) {
|
|
144
|
+
inputValue = inputValue.substring(1);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Parse as number
|
|
148
|
+
const numValue = parseInt(inputValue);
|
|
149
|
+
|
|
150
|
+
// If value is too large, cap at max (31)
|
|
151
|
+
if (numValue > MAX_DAY) {
|
|
152
|
+
inputValue = MAX_DAY.toString();
|
|
153
|
+
input.value = inputValue;
|
|
154
|
+
} else {
|
|
155
|
+
input.value = inputValue;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
day = inputValue === '' ? '' : parseInt(inputValue);
|
|
159
|
+
|
|
160
|
+
// Auto-advance to next field when 2 digits are entered
|
|
161
|
+
if (inputValue.length >= 2 && parseInt(inputValue) > 0) {
|
|
162
|
+
focusNextField('day');
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Validate and set month value
|
|
167
|
+
function handleMonthInput(e: Event) {
|
|
168
|
+
const input = e.target as HTMLInputElement;
|
|
169
|
+
let inputValue = input.value;
|
|
170
|
+
|
|
171
|
+
// Handle empty input
|
|
172
|
+
if (inputValue === '') {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Remove non-numeric characters
|
|
177
|
+
inputValue = inputValue.replace(/[^\d]/g, '');
|
|
178
|
+
|
|
179
|
+
// Handle leading zeros - normalize to single 0
|
|
180
|
+
if (inputValue.length > 1 && inputValue.startsWith('0')) {
|
|
181
|
+
inputValue = inputValue.substring(1);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// Parse as number
|
|
185
|
+
const numValue = parseInt(inputValue);
|
|
186
|
+
|
|
187
|
+
// If value is too large, cap at max (12)
|
|
188
|
+
if (numValue > MAX_MONTH) {
|
|
189
|
+
inputValue = MAX_MONTH.toString();
|
|
190
|
+
input.value = inputValue;
|
|
191
|
+
} else {
|
|
192
|
+
input.value = inputValue;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
month = inputValue === '' ? '' : parseInt(inputValue);
|
|
196
|
+
|
|
197
|
+
// Auto-advance to next field when 2 digits are entered
|
|
198
|
+
if (inputValue.length >= 2 && parseInt(inputValue) > 0) {
|
|
199
|
+
focusNextField('month');
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Validate and set year value
|
|
204
|
+
function handleYearInput(e: Event) {
|
|
205
|
+
const input = e.target as HTMLInputElement;
|
|
206
|
+
let inputValue = input.value;
|
|
207
|
+
|
|
208
|
+
// Handle empty input
|
|
209
|
+
if (inputValue === '') {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Remove non-numeric characters
|
|
214
|
+
inputValue = inputValue.replace(/[^\d]/g, '');
|
|
215
|
+
|
|
216
|
+
// Handle leading zeros
|
|
217
|
+
if (inputValue.length > 1 && inputValue.startsWith('0')) {
|
|
218
|
+
inputValue = inputValue.substring(1);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Enforce max length of 4
|
|
222
|
+
if (inputValue.length > 4) {
|
|
223
|
+
inputValue = inputValue.substring(0, 4);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const numValue = parseInt(inputValue);
|
|
227
|
+
|
|
228
|
+
// If value is too large, cap at max
|
|
229
|
+
if (numValue > MAX_YEAR) {
|
|
230
|
+
inputValue = MAX_YEAR.toString();
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
input.value = inputValue;
|
|
234
|
+
year = inputValue === '' ? '' : parseInt(inputValue);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Handle input changes
|
|
238
|
+
function handleChange() {
|
|
239
|
+
// Only update if we have valid values for all fields
|
|
240
|
+
if (
|
|
241
|
+
day !== '' && month !== '' && year !== '' &&
|
|
242
|
+
!isNaN(Number(day)) && !isNaN(Number(month)) && !isNaN(Number(year))
|
|
243
|
+
) {
|
|
244
|
+
onChange({
|
|
245
|
+
day: Number(day),
|
|
246
|
+
month: Number(month),
|
|
247
|
+
year: Number(year)
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// Handle focus
|
|
253
|
+
function handleFocus(field: 'day' | 'month' | 'year') {
|
|
254
|
+
focusedField = field;
|
|
255
|
+
onFocus();
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Handle blur
|
|
259
|
+
function handleBlur(field: 'day' | 'month' | 'year') {
|
|
260
|
+
const input = inputRefs[field];
|
|
261
|
+
|
|
262
|
+
if (!input) return;
|
|
263
|
+
|
|
264
|
+
// If empty, display as empty
|
|
265
|
+
if (input.value === '') {
|
|
266
|
+
if (field === 'day') day = '';
|
|
267
|
+
if (field === 'month') month = '';
|
|
268
|
+
if (field === 'year') year = '';
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// Otherwise, ensure we have a valid number
|
|
273
|
+
let min: number, max: number;
|
|
274
|
+
|
|
275
|
+
if (field === 'day') {
|
|
276
|
+
min = MIN_DAY;
|
|
277
|
+
max = MAX_DAY;
|
|
278
|
+
const numDay = parseInt(input.value);
|
|
279
|
+
day = Math.max(min, Math.min(max, numDay));
|
|
280
|
+
input.value = day.toString();
|
|
281
|
+
} else if (field === 'month') {
|
|
282
|
+
min = MIN_MONTH;
|
|
283
|
+
max = MAX_MONTH;
|
|
284
|
+
const numMonth = parseInt(input.value);
|
|
285
|
+
month = Math.max(min, Math.min(max, numMonth));
|
|
286
|
+
input.value = month.toString();
|
|
287
|
+
} else if (field === 'year') {
|
|
288
|
+
min = MIN_YEAR;
|
|
289
|
+
max = MAX_YEAR;
|
|
290
|
+
const numYear = parseInt(input.value);
|
|
291
|
+
year = Math.max(min, Math.min(max, numYear));
|
|
292
|
+
input.value = year.toString();
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Trigger change if we have all values
|
|
296
|
+
handleChange();
|
|
297
|
+
|
|
298
|
+
// Reset focused field after a short delay to allow for focus changes
|
|
299
|
+
setTimeout(() => {
|
|
300
|
+
if (!document.activeElement ||
|
|
301
|
+
!(document.activeElement instanceof HTMLInputElement) ||
|
|
302
|
+
!Object.values(inputRefs).includes(document.activeElement)) {
|
|
303
|
+
focusedField = null;
|
|
304
|
+
}
|
|
305
|
+
}, 100);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// Handle keydown events
|
|
309
|
+
function handleKeyDown(field: 'day' | 'month' | 'year', e: KeyboardEvent) {
|
|
310
|
+
const input = e.target as HTMLInputElement;
|
|
311
|
+
|
|
312
|
+
// Allow selection shortcuts (Ctrl+A)
|
|
313
|
+
if ((e.metaKey || e.ctrlKey) && e.key === 'a') {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// Allow editing keys (Backspace, Delete)
|
|
318
|
+
if (e.key === 'Backspace' || e.key === 'Delete') {
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// Handle arrow navigation
|
|
323
|
+
if (e.key === 'ArrowRight') {
|
|
324
|
+
if (input.selectionStart === input.value.length) {
|
|
325
|
+
e.preventDefault();
|
|
326
|
+
focusNextField(field);
|
|
327
|
+
}
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (e.key === 'ArrowLeft') {
|
|
332
|
+
if (input.selectionStart === 0) {
|
|
333
|
+
e.preventDefault();
|
|
334
|
+
focusPreviousField(field);
|
|
335
|
+
}
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// Handle Tab navigation
|
|
340
|
+
if (e.key === 'Tab') {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// Prevent non-numeric inputs except navigation and editing keys
|
|
345
|
+
if (!/^\d$/.test(e.key) &&
|
|
346
|
+
!['Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'Tab', 'Enter'].includes(e.key) &&
|
|
347
|
+
!(e.ctrlKey || e.metaKey)) {
|
|
348
|
+
e.preventDefault();
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// Prevent leading zeros
|
|
353
|
+
if (e.key === '0' && input.value === '') {
|
|
354
|
+
e.preventDefault();
|
|
355
|
+
return;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// Get field-specific CSS classes
|
|
360
|
+
function getFieldClasses(field: 'day' | 'month' | 'year') {
|
|
361
|
+
return {
|
|
362
|
+
container: `
|
|
363
|
+
relative
|
|
364
|
+
${focusedField === field ? 'bg-sage-green' : 'bg-grey1'}
|
|
365
|
+
transition-colors
|
|
366
|
+
rounded-small
|
|
367
|
+
`,
|
|
368
|
+
input: `
|
|
369
|
+
w-full
|
|
370
|
+
h-full
|
|
371
|
+
bg-transparent
|
|
372
|
+
text-center
|
|
373
|
+
focus:outline-none
|
|
374
|
+
subtext
|
|
375
|
+
${focusedField === field ? 'text-white' : 'text-grey7'}
|
|
376
|
+
placeholder:text-grey3
|
|
377
|
+
`
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
</script>
|
|
381
|
+
|
|
382
|
+
<div class="date-field-container widgetic-colors {className}" on:focusin={onFocus}>
|
|
383
|
+
<div class="flex items-center w-full relative">
|
|
384
|
+
<div class="flex-1 min-w-0">
|
|
385
|
+
<InputControllerHeader {label} {helpText} />
|
|
386
|
+
</div>
|
|
387
|
+
|
|
388
|
+
<div class="absolute right-0">
|
|
389
|
+
<div class="h-[48px] w-[185px] rounded-large border border-grey2 bg-grey1 flex items-center transition-colors duration-200 hover:border-forest-green">
|
|
390
|
+
<div class="flex items-center justify-between px-4 w-full">
|
|
391
|
+
{#each fieldOrder as field}
|
|
392
|
+
{@const config = getFieldConfig(field)}
|
|
393
|
+
|
|
394
|
+
<div class={getFieldClasses(field).container} style="width: {config.width}; min-height: 34px;">
|
|
395
|
+
<input
|
|
396
|
+
type="text"
|
|
397
|
+
inputmode="numeric"
|
|
398
|
+
pattern="[0-9]*"
|
|
399
|
+
bind:this={inputRefs[field]}
|
|
400
|
+
value={field === 'day' ? day : field === 'month' ? month : year}
|
|
401
|
+
placeholder={config.placeholder}
|
|
402
|
+
on:input={field === 'day' ? handleDayInput : field === 'month' ? handleMonthInput : handleYearInput}
|
|
403
|
+
on:change={handleChange}
|
|
404
|
+
on:focus={() => handleFocus(field)}
|
|
405
|
+
on:blur={() => handleBlur(field)}
|
|
406
|
+
on:keydown={(e) => handleKeyDown(field, e)}
|
|
407
|
+
class={getFieldClasses(field).input}
|
|
408
|
+
aria-label={`${field} input`}
|
|
409
|
+
maxlength={config.maxLength}
|
|
410
|
+
/>
|
|
411
|
+
</div>
|
|
412
|
+
|
|
413
|
+
{#if field !== fieldOrder[fieldOrder.length - 1]}
|
|
414
|
+
<span class="date-separator subtext text-grey3">/</span>
|
|
415
|
+
{/if}
|
|
416
|
+
{/each}
|
|
417
|
+
</div>
|
|
418
|
+
</div>
|
|
419
|
+
</div>
|
|
420
|
+
</div>
|
|
421
|
+
</div>
|
|
422
|
+
|
|
423
|
+
<style>
|
|
424
|
+
input {
|
|
425
|
+
-moz-appearance: textfield;
|
|
426
|
+
appearance: textfield;
|
|
427
|
+
padding: 8px 4px;
|
|
428
|
+
font-size: 16px;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/* Focus states */
|
|
432
|
+
input:focus {
|
|
433
|
+
outline: none !important;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/* Date field container */
|
|
437
|
+
.date-field-container {
|
|
438
|
+
position: relative;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/* Separator style */
|
|
442
|
+
.date-separator {
|
|
443
|
+
font-size: 14px;
|
|
444
|
+
line-height: 1.5;
|
|
445
|
+
font-weight: 400;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
:global(.subtext) {
|
|
449
|
+
font-size: 14px;
|
|
450
|
+
line-height: 1.5;
|
|
451
|
+
font-weight: 400;
|
|
452
|
+
}
|
|
453
|
+
</style>
|
|
@@ -0,0 +1,35 @@
|
|
|
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 DateFieldInputController: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
label: string;
|
|
17
|
+
value: {
|
|
18
|
+
day: number;
|
|
19
|
+
month: number;
|
|
20
|
+
year: number;
|
|
21
|
+
};
|
|
22
|
+
onChange: (newValue: {
|
|
23
|
+
day: number;
|
|
24
|
+
month: number;
|
|
25
|
+
year: number;
|
|
26
|
+
}) => void;
|
|
27
|
+
config?: InputControllerConfig;
|
|
28
|
+
helpText?: string | undefined;
|
|
29
|
+
onFocus?: () => void;
|
|
30
|
+
class?: string;
|
|
31
|
+
}, {
|
|
32
|
+
[evt: string]: CustomEvent<any>;
|
|
33
|
+
}, {}, {}, string>;
|
|
34
|
+
type DateFieldInputController = InstanceType<typeof DateFieldInputController>;
|
|
35
|
+
export default DateFieldInputController;
|