@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,14 @@
|
|
|
1
|
+
import type { InputControllerConfig } from './index';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
class: string;
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
onChange: (newValue: string) => void;
|
|
7
|
+
config?: InputControllerConfig;
|
|
8
|
+
description?: string;
|
|
9
|
+
onFocus?: () => void;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
};
|
|
12
|
+
declare const TextAreaInputController: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
13
|
+
type TextAreaInputController = ReturnType<typeof TextAreaInputController>;
|
|
14
|
+
export default TextAreaInputController;
|
|
@@ -0,0 +1,478 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Portal } from '@widgetic/design-system/components';
|
|
3
|
+
import { IconArrowsDiagonal } from '@widgetic/design-system/icons';
|
|
4
|
+
import { onMount, onDestroy } from 'svelte';
|
|
5
|
+
|
|
6
|
+
import { TextAreaInputController } from './index';
|
|
7
|
+
import type { InputControllerConfig } from './index';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Component props
|
|
11
|
+
*/
|
|
12
|
+
export let label: string = '';
|
|
13
|
+
export let value: string = '';
|
|
14
|
+
export let onChange: any;
|
|
15
|
+
export let config: InputControllerConfig = {};
|
|
16
|
+
export let description: string | undefined = undefined;
|
|
17
|
+
export let portalTarget: string = '';
|
|
18
|
+
/**
|
|
19
|
+
* Local Variables
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
// Use config values with fallbacks
|
|
23
|
+
const placeholder: string = config.placeholder || '';
|
|
24
|
+
|
|
25
|
+
let isShowingTextArea = false;
|
|
26
|
+
|
|
27
|
+
// Add a computed property to determine if we're showing placeholder
|
|
28
|
+
$: isShowingPlaceholder = !value && placeholder;
|
|
29
|
+
|
|
30
|
+
// Create a preview version of the text that preserves formatting
|
|
31
|
+
$: previewText = value ? createPreviewText(value) : placeholder;
|
|
32
|
+
|
|
33
|
+
// Add this to track the current color
|
|
34
|
+
let currentColor = '#1a1a1a'; // Default color
|
|
35
|
+
|
|
36
|
+
// Add this near the top with other state declarations
|
|
37
|
+
let isPortalHovered = false;
|
|
38
|
+
|
|
39
|
+
// Add this to store the background rect ref
|
|
40
|
+
let backgroundRectRef: HTMLDivElement;
|
|
41
|
+
|
|
42
|
+
// Add these near the top with other state declarations
|
|
43
|
+
let isClosing = false;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Methods
|
|
47
|
+
*/
|
|
48
|
+
function createPreviewText(text: string) {
|
|
49
|
+
if (!text) return '';
|
|
50
|
+
|
|
51
|
+
let html = text;
|
|
52
|
+
if (!html.includes('<') && html.includes('<')) {
|
|
53
|
+
const decoded = document.createElement('textarea');
|
|
54
|
+
decoded.innerHTML = html;
|
|
55
|
+
html = decoded.value;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const parser = new DOMParser();
|
|
59
|
+
const doc = parser.parseFromString(html, 'text/html');
|
|
60
|
+
|
|
61
|
+
function processNode(node: Node): string {
|
|
62
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
63
|
+
return node.textContent || '';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
67
|
+
const element = node as Element;
|
|
68
|
+
let tag = element.tagName.toLowerCase();
|
|
69
|
+
const attributes: Record<string, string> = {};
|
|
70
|
+
const children = Array.from(node.childNodes)
|
|
71
|
+
.map(child => processNode(child))
|
|
72
|
+
.join('');
|
|
73
|
+
|
|
74
|
+
// Flatten block wrappers so marks render inside the compact clamp box
|
|
75
|
+
if (tag === 'p' || tag === 'div' || tag === 'br') {
|
|
76
|
+
return tag === 'br' ? ' ' : `${children} `;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const style = element.getAttribute('style');
|
|
80
|
+
if (style) {
|
|
81
|
+
const colorMatch = style.match(/color:\s*([^;]+)/);
|
|
82
|
+
if (colorMatch) {
|
|
83
|
+
attributes.style = `--color: ${colorMatch[1]}; ${style}`;
|
|
84
|
+
} else {
|
|
85
|
+
attributes.style = style;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const textStyle = element.getAttribute('data-text-style');
|
|
90
|
+
if (textStyle) {
|
|
91
|
+
attributes['data-text-style'] = textStyle;
|
|
92
|
+
attributes.class = (attributes.class || '') + ' preserve-color';
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (tag.match(/^h[1-4]$/)) {
|
|
96
|
+
tag = 'span';
|
|
97
|
+
attributes.class = (attributes.class || '') + ' tiptap-heading';
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
let startTag = `<${tag}`;
|
|
101
|
+
for (const [key, attrValue] of Object.entries(attributes)) {
|
|
102
|
+
startTag += ` ${key}="${attrValue.trim()}"`;
|
|
103
|
+
}
|
|
104
|
+
startTag += '>';
|
|
105
|
+
|
|
106
|
+
return `${startTag}${children}</${tag}>`;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return '';
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return Array.from(doc.body.childNodes)
|
|
113
|
+
.map(node => processNode(node))
|
|
114
|
+
.join('')
|
|
115
|
+
.trim();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function handleFullEditorChange(html: string) {
|
|
119
|
+
value = html;
|
|
120
|
+
if (typeof onChange === 'function') onChange(html);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function handleClick() {
|
|
124
|
+
console.log('Opening text area in portal');
|
|
125
|
+
isShowingTextArea = !isShowingTextArea;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
$: if (isShowingTextArea) {
|
|
129
|
+
setTimeout(() => {
|
|
130
|
+
const editor = document.querySelector('.ProseMirror');
|
|
131
|
+
if (editor instanceof HTMLElement) {
|
|
132
|
+
editor.focus();
|
|
133
|
+
}
|
|
134
|
+
}, 100); // Give a bit more time for the portal to mount
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Update value reactively to track color changes
|
|
138
|
+
$: {
|
|
139
|
+
if (value) {
|
|
140
|
+
const colorMatch = value.match(/color:\s*(#[0-9A-Fa-f]{6}|rgb\([^)]+\))/);
|
|
141
|
+
if (colorMatch) {
|
|
142
|
+
currentColor = colorMatch[1];
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
$: if (value) {
|
|
148
|
+
console.log('[TextAreaPreview] compact preview html', value.slice(0, 180));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
function handlePortalMouseEnter() {
|
|
152
|
+
// console.log('Portal mouse entered');
|
|
153
|
+
isPortalHovered = true;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function handlePortalMouseLeave(event: MouseEvent) {
|
|
157
|
+
// if (!backgroundRectRef) return;
|
|
158
|
+
// console.log('Portal mouse leave: ', event, backgroundRectRef.getBoundingClientRect());
|
|
159
|
+
|
|
160
|
+
// Get mouse position relative to the portal content
|
|
161
|
+
const { offsetX, offsetY } = event;
|
|
162
|
+
const offsetWidth = backgroundRectRef.getBoundingClientRect().width;
|
|
163
|
+
const offsetHeight = backgroundRectRef.getBoundingClientRect().height;
|
|
164
|
+
// console.log('Portal mouse leave mousePosition: ', offsetX, offsetY, offsetWidth, offsetHeight);
|
|
165
|
+
|
|
166
|
+
// Check if cursor is within the background rect boundaries
|
|
167
|
+
if (
|
|
168
|
+
0 < offsetX && offsetX < offsetWidth &&
|
|
169
|
+
0 < offsetY && offsetY < offsetHeight
|
|
170
|
+
) {
|
|
171
|
+
// console.log('Portal mouse leave mousePosition: ', offsetX, offsetY, offsetWidth, offsetHeight);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// console.log('Portal mouse leave mousePosition: ', offsetX, offsetY, offsetWidth, offsetHeight);
|
|
176
|
+
isPortalHovered = false;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// Add keyboard event handler for Escape key
|
|
180
|
+
function handleKeydown(event: KeyboardEvent) {
|
|
181
|
+
if (event.key === 'Escape' && isShowingTextArea) {
|
|
182
|
+
handleClose();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
onMount(() => {
|
|
187
|
+
// Add keyboard event listener when component mounts
|
|
188
|
+
window.addEventListener('keydown', handleKeydown);
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
onDestroy(() => {
|
|
192
|
+
// Remove keyboard event listener when component is destroyed
|
|
193
|
+
window.removeEventListener('keydown', handleKeydown);
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
// Update the close handler
|
|
197
|
+
function handleClose() {
|
|
198
|
+
if (isClosing) return; // Prevent multiple closes
|
|
199
|
+
isClosing = true;
|
|
200
|
+
|
|
201
|
+
// Add animation end handler
|
|
202
|
+
const content = document.querySelector('.text-area-portal-content') as HTMLDivElement;
|
|
203
|
+
const overlay = content?.previousElementSibling as HTMLDivElement;
|
|
204
|
+
|
|
205
|
+
const handleAnimationEnd = () => {
|
|
206
|
+
if (content) content.dataset.state = 'complete';
|
|
207
|
+
if (overlay) overlay.dataset.state = 'complete';
|
|
208
|
+
|
|
209
|
+
// Remove the elements after a short delay
|
|
210
|
+
setTimeout(() => {
|
|
211
|
+
isShowingTextArea = false;
|
|
212
|
+
isClosing = false;
|
|
213
|
+
if (content) content.dataset.state = '';
|
|
214
|
+
if (overlay) overlay.dataset.state = '';
|
|
215
|
+
}, 50);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
// Listen for the end of the scale animation
|
|
219
|
+
content?.addEventListener('animationend', handleAnimationEnd, { once: true });
|
|
220
|
+
}
|
|
221
|
+
</script>
|
|
222
|
+
|
|
223
|
+
<div class="text-area-preview-input-controller w-full min-w-0 overflow-hidden widgetic-colors">
|
|
224
|
+
<div
|
|
225
|
+
class="text-area-preview-main-container w-full min-w-0 overflow-hidden"
|
|
226
|
+
>
|
|
227
|
+
<div
|
|
228
|
+
class="textarea-ic-preview-box relative h-[92px] w-full min-w-0 border border-grey2 bg-grey1 transition-colors duration-200 hover:border-forest-green cursor-pointer group overflow-hidden"
|
|
229
|
+
style="border-radius: var(--radius-large);"
|
|
230
|
+
on:click={handleClick}
|
|
231
|
+
on:keydown={(e) => e.key === 'Enter' && handleClick()}
|
|
232
|
+
role="button"
|
|
233
|
+
tabindex="0"
|
|
234
|
+
>
|
|
235
|
+
<div class="textarea-ic-preview-copy min-w-0 overflow-hidden pr-10 pt-[13px] pb-4 pl-4">
|
|
236
|
+
<div
|
|
237
|
+
class="textarea-ic-preview-html break-words text-grey7 text-sm leading-5"
|
|
238
|
+
class:text-grey3={isShowingPlaceholder}
|
|
239
|
+
>
|
|
240
|
+
{@html previewText}
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
<div class="textarea-ic-expand-icon absolute top-[14px] right-[12px]">
|
|
244
|
+
<IconArrowsDiagonal
|
|
245
|
+
class="w-5 h-5 text-grey5 group-hover:text-grey7 transition-colors duration-200"
|
|
246
|
+
/>
|
|
247
|
+
</div>
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
|
|
251
|
+
<!-- Description -->
|
|
252
|
+
{#if description}
|
|
253
|
+
<p class="subtext text-grey5">{description}</p>
|
|
254
|
+
{/if}
|
|
255
|
+
|
|
256
|
+
<!-- Text Area Input Controller in Portal -->
|
|
257
|
+
{#if isShowingTextArea}
|
|
258
|
+
<Portal
|
|
259
|
+
target={portalTarget}
|
|
260
|
+
class="text-area-portal absolute top-0 left-0 w-full h-full"
|
|
261
|
+
>
|
|
262
|
+
<!-- Blocking overlay -->
|
|
263
|
+
<div
|
|
264
|
+
class="absolute inset-0 bg-white {isClosing ? 'fade-out-animation' : 'fade-in-animation'}"
|
|
265
|
+
style="z-index: 50; transform: translateZ(0); backface-visibility: hidden;"
|
|
266
|
+
></div>
|
|
267
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
268
|
+
<div
|
|
269
|
+
class="text-area-portal-content absolute mt-4 mx-6 mb-6 inset-0 {isClosing ? 'scale-out-animation' : 'scale-in-animation'}"
|
|
270
|
+
style="z-index: 51; transform: translateZ(0); backface-visibility: hidden;"
|
|
271
|
+
on:mouseenter={handlePortalMouseEnter}
|
|
272
|
+
on:mouseleave={handlePortalMouseLeave}
|
|
273
|
+
>
|
|
274
|
+
<!-- Background rect that defines our hover boundaries -->
|
|
275
|
+
<div
|
|
276
|
+
bind:this={backgroundRectRef}
|
|
277
|
+
class="portal-background-rect absolute inset-0 bg-transparent pointer-events-none"
|
|
278
|
+
style="border-radius: var(--radius-large);"
|
|
279
|
+
></div>
|
|
280
|
+
|
|
281
|
+
<TextAreaInputController
|
|
282
|
+
class="text-area w-full h-full transition-colors duration-200 {isPortalHovered ? 'border-solid !border-forest-green' : ''}"
|
|
283
|
+
label={label}
|
|
284
|
+
bind:value
|
|
285
|
+
onChange={handleFullEditorChange}
|
|
286
|
+
config={config}
|
|
287
|
+
description={description}
|
|
288
|
+
onClose={handleClose}
|
|
289
|
+
/>
|
|
290
|
+
</div>
|
|
291
|
+
</Portal>
|
|
292
|
+
{/if}
|
|
293
|
+
|
|
294
|
+
</div>
|
|
295
|
+
|
|
296
|
+
<style>
|
|
297
|
+
/* Keep only preview-specific styles */
|
|
298
|
+
:global(.text-area-preview-main-container .group) {
|
|
299
|
+
position: relative;
|
|
300
|
+
isolation: isolate;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
:global(.text-area-preview-main-container .group:hover) {
|
|
304
|
+
border-color: hsl(var(--forest-green)) !important;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
/* Heading styles matching tiptap editor */
|
|
309
|
+
:global(.textarea-ic-preview-html h1.tiptap-heading) {
|
|
310
|
+
font-size: 2em !important;
|
|
311
|
+
font-weight: 600 !important;
|
|
312
|
+
line-height: 1.2 !important;
|
|
313
|
+
margin-top: 0 !important;
|
|
314
|
+
margin-bottom: 0 !important;
|
|
315
|
+
color: inherit !important;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
:global(.textarea-ic-preview-html h2.tiptap-heading) {
|
|
319
|
+
font-size: 1.5em !important;
|
|
320
|
+
font-weight: 600 !important;
|
|
321
|
+
line-height: 1.3 !important;
|
|
322
|
+
margin-top: 0.4em !important;
|
|
323
|
+
margin-bottom: 0.2em !important;
|
|
324
|
+
color: inherit !important;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
:global(.textarea-ic-preview-html h3.tiptap-heading) {
|
|
328
|
+
font-size: 1.17em !important;
|
|
329
|
+
font-weight: 600 !important;
|
|
330
|
+
line-height: 1.3 !important;
|
|
331
|
+
margin-top: 0.3em !important;
|
|
332
|
+
margin-bottom: 0.2em !important;
|
|
333
|
+
color: inherit !important;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
:global(.textarea-ic-preview-html h4.tiptap-heading) {
|
|
337
|
+
font-size: 1em !important;
|
|
338
|
+
font-weight: 600 !important;
|
|
339
|
+
line-height: 1.4 !important;
|
|
340
|
+
margin-top: 0.2em !important;
|
|
341
|
+
margin-bottom: 0.1em !important;
|
|
342
|
+
color: inherit !important;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
:global(.textarea-ic-preview-html) {
|
|
346
|
+
display: -webkit-box;
|
|
347
|
+
-webkit-box-orient: vertical;
|
|
348
|
+
-webkit-line-clamp: 3;
|
|
349
|
+
line-clamp: 3;
|
|
350
|
+
overflow: hidden;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/* Color preservation */
|
|
354
|
+
:global(.textarea-ic-preview-html [style*="color"]) {
|
|
355
|
+
color: var(--color) !important;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/* Text formatting — {@html} children need :global; include b/i as well as strong/em/u */
|
|
359
|
+
:global(.textarea-ic-preview-html :is(strong, b, [style*="font-weight"])) {
|
|
360
|
+
font-weight: 700 !important;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
:global(.textarea-ic-preview-html :is(em, i)) {
|
|
364
|
+
font-style: italic !important;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
:global(.textarea-ic-preview-html :is(u, [style*="text-decoration: underline"])) {
|
|
368
|
+
text-decoration: underline !important;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
:global(.textarea-ic-preview-html strong[style*="color"]),
|
|
372
|
+
:global(.textarea-ic-preview-html em[style*="color"]),
|
|
373
|
+
:global(.textarea-ic-preview-html u[style*="color"]) {
|
|
374
|
+
color: var(--color) !important;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/* Add specific color inheritance for data-text-style */
|
|
378
|
+
:global(.textarea-ic-preview-html [data-text-style*="color"]) {
|
|
379
|
+
color: var(--color) !important;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/* Ensure all text elements can inherit colors */
|
|
383
|
+
:global(.textarea-ic-preview-html *) {
|
|
384
|
+
color: inherit;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/* Ensure paragraphs have no margins */
|
|
388
|
+
:global(.textarea-ic-preview-html p) {
|
|
389
|
+
margin-top: 0 !important;
|
|
390
|
+
margin-bottom: 0 !important;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/* Ensure line-clamp ellipsis inherits color */
|
|
394
|
+
:global(.line-clamp-3) {
|
|
395
|
+
-webkit-box-orient: vertical;
|
|
396
|
+
-webkit-line-clamp: 3;
|
|
397
|
+
line-clamp: 3;
|
|
398
|
+
display: -webkit-box;
|
|
399
|
+
overflow: hidden;
|
|
400
|
+
color: inherit;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/* Add scale animation */
|
|
404
|
+
@keyframes scaleIn {
|
|
405
|
+
from {
|
|
406
|
+
transform: scale(0.95) translateZ(0);
|
|
407
|
+
opacity: 0;
|
|
408
|
+
}
|
|
409
|
+
to {
|
|
410
|
+
transform: scale(1) translateZ(0);
|
|
411
|
+
opacity: 1;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
@keyframes fadeIn {
|
|
416
|
+
from {
|
|
417
|
+
opacity: 0;
|
|
418
|
+
}
|
|
419
|
+
to {
|
|
420
|
+
opacity: 1;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
:global(.scale-in-animation) {
|
|
425
|
+
animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
|
|
426
|
+
transform-origin: center center;
|
|
427
|
+
will-change: transform, opacity;
|
|
428
|
+
backface-visibility: hidden;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
:global(.fade-in-animation) {
|
|
432
|
+
animation: fadeIn 0.15s ease-out;
|
|
433
|
+
will-change: opacity;
|
|
434
|
+
backface-visibility: hidden;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/* Add scale out animation */
|
|
438
|
+
@keyframes scaleOut {
|
|
439
|
+
0% {
|
|
440
|
+
transform: scale(1) translateZ(0);
|
|
441
|
+
opacity: 1;
|
|
442
|
+
}
|
|
443
|
+
100% {
|
|
444
|
+
transform: scale(0.95) translateZ(0);
|
|
445
|
+
opacity: 0;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
@keyframes fadeOut {
|
|
450
|
+
0% {
|
|
451
|
+
opacity: 1;
|
|
452
|
+
}
|
|
453
|
+
100% {
|
|
454
|
+
opacity: 0;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
:global(.scale-out-animation) {
|
|
459
|
+
animation: scaleOut 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
460
|
+
transform-origin: center center;
|
|
461
|
+
will-change: transform, opacity;
|
|
462
|
+
backface-visibility: hidden;
|
|
463
|
+
pointer-events: none;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
:global(.fade-out-animation) {
|
|
467
|
+
animation: fadeOut 0.15s ease-out forwards;
|
|
468
|
+
will-change: opacity;
|
|
469
|
+
backface-visibility: hidden;
|
|
470
|
+
pointer-events: none;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/* Add a class to handle visibility at animation end */
|
|
474
|
+
:global(.scale-out-animation[data-state="complete"]),
|
|
475
|
+
:global(.fade-out-animation[data-state="complete"]) {
|
|
476
|
+
visibility: hidden;
|
|
477
|
+
}
|
|
478
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
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 TextAreaPreviewInputController: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
/**
|
|
17
|
+
* Component props
|
|
18
|
+
*/ label?: string;
|
|
19
|
+
value?: string;
|
|
20
|
+
onChange: any;
|
|
21
|
+
config?: InputControllerConfig;
|
|
22
|
+
description?: string | undefined;
|
|
23
|
+
portalTarget?: string;
|
|
24
|
+
}, {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
}, {}, {}, string>;
|
|
27
|
+
type TextAreaPreviewInputController = InstanceType<typeof TextAreaPreviewInputController>;
|
|
28
|
+
export default TextAreaPreviewInputController;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
// Import Shadcn UI components from Widgetic design-system package
|
|
3
|
+
import { Input } from '@widgetic/design-system/components';
|
|
4
|
+
import { InputControllerHeader } from './index';
|
|
5
|
+
|
|
6
|
+
// Component props
|
|
7
|
+
import type { InputControllerConfig } from './index';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Component props
|
|
11
|
+
*/
|
|
12
|
+
export let label: string;
|
|
13
|
+
export let value: string;
|
|
14
|
+
export let onChange: (newValue: string) => void;
|
|
15
|
+
export let config: InputControllerConfig = {};
|
|
16
|
+
|
|
17
|
+
// Use config values with fallbacks
|
|
18
|
+
export let type: 'text' | 'email' | 'url' = 'text';
|
|
19
|
+
export let placeholder: string = config.placeholder || '';
|
|
20
|
+
export let description: string | undefined = undefined;
|
|
21
|
+
export let onFocus: () => void = () => {};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Methods
|
|
25
|
+
*/
|
|
26
|
+
function validate(value: string): boolean {
|
|
27
|
+
switch (type) {
|
|
28
|
+
case 'email':
|
|
29
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
|
|
30
|
+
case 'url':
|
|
31
|
+
return /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/.test(value);
|
|
32
|
+
default:
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<div class="flex flex-col gap-2 widgetic-colors">
|
|
39
|
+
<div class="flex items-center w-full relative">
|
|
40
|
+
<div class="flex-1 min-w-0">
|
|
41
|
+
<InputControllerHeader {label} />
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div class="absolute right-0">
|
|
45
|
+
<div
|
|
46
|
+
class="h-[48px] w-[185px] rounded-large border border-grey2 flex items-center bg-grey1 transition-colors duration-200 hover:border-forest-green"
|
|
47
|
+
on:focusin={onFocus}
|
|
48
|
+
>
|
|
49
|
+
<Input
|
|
50
|
+
id="text-input"
|
|
51
|
+
{type}
|
|
52
|
+
{value}
|
|
53
|
+
{placeholder}
|
|
54
|
+
onfocus={onFocus}
|
|
55
|
+
oninput={(e) => {
|
|
56
|
+
const newValue = e.currentTarget.value;
|
|
57
|
+
if (validate(newValue)) {
|
|
58
|
+
onChange(newValue);
|
|
59
|
+
}
|
|
60
|
+
}}
|
|
61
|
+
class="h-full w-full border-none bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 subtext text-grey7 placeholder:text-grey3 placeholder:subtext px-4"
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
{#if description}
|
|
68
|
+
<p class="subtext text-grey5">{description}</p>
|
|
69
|
+
{/if}
|
|
70
|
+
</div>
|
|
@@ -0,0 +1,30 @@
|
|
|
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 TextInputController: $$__sveltets_2_IsomorphicComponent<{
|
|
16
|
+
/**
|
|
17
|
+
* Component props
|
|
18
|
+
*/ label: string;
|
|
19
|
+
value: string;
|
|
20
|
+
onChange: (newValue: string) => void;
|
|
21
|
+
config?: InputControllerConfig;
|
|
22
|
+
type?: "text" | "email" | "url";
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
description?: string | undefined;
|
|
25
|
+
onFocus?: () => void;
|
|
26
|
+
}, {
|
|
27
|
+
[evt: string]: CustomEvent<any>;
|
|
28
|
+
}, {}, {}, string>;
|
|
29
|
+
type TextInputController = InstanceType<typeof TextInputController>;
|
|
30
|
+
export default TextInputController;
|