@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,10 @@
|
|
|
1
|
+
export interface AutocompleteResult {
|
|
2
|
+
suggestion: string;
|
|
3
|
+
remainingText: string;
|
|
4
|
+
allMatches: string[];
|
|
5
|
+
currentIndex: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function getColorSuggestions(input: string, colorNames: {
|
|
8
|
+
[key: string]: string;
|
|
9
|
+
}): AutocompleteResult | null;
|
|
10
|
+
export declare function getNextSuggestion(current: AutocompleteResult, direction: 'up' | 'down'): AutocompleteResult;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function getColorSuggestions(input, colorNames) {
|
|
2
|
+
if (input.length < 2)
|
|
3
|
+
return null;
|
|
4
|
+
const inputLower = input.toLowerCase();
|
|
5
|
+
const matches = Object.keys(colorNames).filter(color => color.toLowerCase().startsWith(inputLower)).sort();
|
|
6
|
+
if (matches.length === 0)
|
|
7
|
+
return null;
|
|
8
|
+
const firstMatch = matches[0];
|
|
9
|
+
const remainingText = firstMatch.slice(input.length);
|
|
10
|
+
return {
|
|
11
|
+
suggestion: firstMatch,
|
|
12
|
+
remainingText,
|
|
13
|
+
allMatches: matches,
|
|
14
|
+
currentIndex: 0
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export function getNextSuggestion(current, direction) {
|
|
18
|
+
const newIndex = direction === 'down'
|
|
19
|
+
? (current.currentIndex + 1) % current.allMatches.length
|
|
20
|
+
: (current.currentIndex - 1 + current.allMatches.length) % current.allMatches.length;
|
|
21
|
+
const newSuggestion = current.allMatches[newIndex];
|
|
22
|
+
return {
|
|
23
|
+
...current,
|
|
24
|
+
suggestion: newSuggestion,
|
|
25
|
+
remainingText: newSuggestion.slice(current.suggestion.length - current.remainingText.length),
|
|
26
|
+
currentIndex: newIndex
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// Source: https://www.w3.org/TR/css-color-3/#svg-color
|
|
2
|
+
export const colorNames = {
|
|
3
|
+
// Basic color keywords (4.1)
|
|
4
|
+
'black': '#000000',
|
|
5
|
+
'silver': '#c0c0c0',
|
|
6
|
+
'gray': '#808080',
|
|
7
|
+
'white': '#ffffff',
|
|
8
|
+
'maroon': '#800000',
|
|
9
|
+
'red': '#ff0000',
|
|
10
|
+
'purple': '#800080',
|
|
11
|
+
'fuchsia': '#ff00ff',
|
|
12
|
+
'green': '#008000',
|
|
13
|
+
'lime': '#00ff00',
|
|
14
|
+
'olive': '#808000',
|
|
15
|
+
'yellow': '#ffff00',
|
|
16
|
+
'navy': '#000080',
|
|
17
|
+
'blue': '#0000ff',
|
|
18
|
+
'teal': '#008080',
|
|
19
|
+
'aqua': '#00ffff',
|
|
20
|
+
// Extended color keywords (4.3)
|
|
21
|
+
'aliceblue': '#f0f8ff',
|
|
22
|
+
'antiquewhite': '#faebd7',
|
|
23
|
+
'aquamarine': '#7fffd4',
|
|
24
|
+
'azure': '#f0ffff',
|
|
25
|
+
'beige': '#f5f5dc',
|
|
26
|
+
'bisque': '#ffe4c4',
|
|
27
|
+
'blanchedalmond': '#ffebcd',
|
|
28
|
+
'blueviolet': '#8a2be2',
|
|
29
|
+
'brown': '#a52a2a',
|
|
30
|
+
'burlywood': '#deb887',
|
|
31
|
+
'cadetblue': '#5f9ea0',
|
|
32
|
+
'chartreuse': '#7fff00',
|
|
33
|
+
'chocolate': '#d2691e',
|
|
34
|
+
'coral': '#ff7f50',
|
|
35
|
+
'cornflowerblue': '#6495ed',
|
|
36
|
+
'cornsilk': '#fff8dc',
|
|
37
|
+
'crimson': '#dc143c',
|
|
38
|
+
'cyan': '#00ffff',
|
|
39
|
+
'darkblue': '#00008b',
|
|
40
|
+
'darkcyan': '#008b8b',
|
|
41
|
+
'darkgoldenrod': '#b8860b',
|
|
42
|
+
'darkgray': '#a9a9a9',
|
|
43
|
+
'darkgreen': '#006400',
|
|
44
|
+
'darkgrey': '#a9a9a9',
|
|
45
|
+
'darkkhaki': '#bdb76b',
|
|
46
|
+
'darkmagenta': '#8b008b',
|
|
47
|
+
'darkolivegreen': '#556b2f',
|
|
48
|
+
'darkorange': '#ff8c00',
|
|
49
|
+
'darkorchid': '#9932cc',
|
|
50
|
+
'darkred': '#8b0000',
|
|
51
|
+
'darksalmon': '#e9967a',
|
|
52
|
+
'darkseagreen': '#8fbc8f',
|
|
53
|
+
'darkslateblue': '#483d8b',
|
|
54
|
+
'darkslategray': '#2f4f4f',
|
|
55
|
+
'darkslategrey': '#2f4f4f',
|
|
56
|
+
'darkturquoise': '#00ced1',
|
|
57
|
+
'darkviolet': '#9400d3',
|
|
58
|
+
'deeppink': '#ff1493',
|
|
59
|
+
'deepskyblue': '#00bfff',
|
|
60
|
+
'dimgray': '#696969',
|
|
61
|
+
'dimgrey': '#696969',
|
|
62
|
+
'dodgerblue': '#1e90ff',
|
|
63
|
+
'firebrick': '#b22222',
|
|
64
|
+
'floralwhite': '#fffaf0',
|
|
65
|
+
'forestgreen': '#228b22',
|
|
66
|
+
'gainsboro': '#dcdcdc',
|
|
67
|
+
'ghostwhite': '#f8f8ff',
|
|
68
|
+
'gold': '#ffd700',
|
|
69
|
+
'goldenrod': '#daa520',
|
|
70
|
+
'greenyellow': '#adff2f',
|
|
71
|
+
'grey': '#808080',
|
|
72
|
+
'honeydew': '#f0fff0',
|
|
73
|
+
'hotpink': '#ff69b4',
|
|
74
|
+
'indianred': '#cd5c5c',
|
|
75
|
+
'indigo': '#4b0082',
|
|
76
|
+
'ivory': '#fffff0',
|
|
77
|
+
'khaki': '#f0e68c',
|
|
78
|
+
'lavender': '#e6e6fa',
|
|
79
|
+
'lavenderblush': '#fff0f5',
|
|
80
|
+
'lawngreen': '#7cfc00',
|
|
81
|
+
'lemonchiffon': '#fffacd',
|
|
82
|
+
'lightblue': '#add8e6',
|
|
83
|
+
'lightcoral': '#f08080',
|
|
84
|
+
'lightcyan': '#e0ffff',
|
|
85
|
+
'lightgoldenrodyellow': '#fafad2',
|
|
86
|
+
'lightgray': '#d3d3d3',
|
|
87
|
+
'lightgreen': '#90ee90',
|
|
88
|
+
'lightgrey': '#d3d3d3',
|
|
89
|
+
'lightpink': '#ffb6c1',
|
|
90
|
+
'lightsalmon': '#ffa07a',
|
|
91
|
+
'lightseagreen': '#20b2aa',
|
|
92
|
+
'lightskyblue': '#87cefa',
|
|
93
|
+
'lightslategray': '#778899',
|
|
94
|
+
'lightslategrey': '#778899',
|
|
95
|
+
'lightsteelblue': '#b0c4de',
|
|
96
|
+
'lightyellow': '#ffffe0',
|
|
97
|
+
'limegreen': '#32cd32',
|
|
98
|
+
'linen': '#faf0e6',
|
|
99
|
+
'magenta': '#ff00ff',
|
|
100
|
+
'mediumaquamarine': '#66cdaa',
|
|
101
|
+
'mediumblue': '#0000cd',
|
|
102
|
+
'mediumorchid': '#ba55d3',
|
|
103
|
+
'mediumpurple': '#9370db',
|
|
104
|
+
'mediumseagreen': '#3cb371',
|
|
105
|
+
'mediumslateblue': '#7b68ee',
|
|
106
|
+
'mediumspringgreen': '#00fa9a',
|
|
107
|
+
'mediumturquoise': '#48d1cc',
|
|
108
|
+
'mediumvioletred': '#c71585',
|
|
109
|
+
'midnightblue': '#191970',
|
|
110
|
+
'mintcream': '#f5fffa',
|
|
111
|
+
'mistyrose': '#ffe4e1',
|
|
112
|
+
'moccasin': '#ffe4b5',
|
|
113
|
+
'navajowhite': '#ffdead',
|
|
114
|
+
'oldlace': '#fdf5e6',
|
|
115
|
+
'olivedrab': '#6b8e23',
|
|
116
|
+
'orange': '#ffa500',
|
|
117
|
+
'orangered': '#ff4500',
|
|
118
|
+
'orchid': '#da70d6',
|
|
119
|
+
'palegoldenrod': '#eee8aa',
|
|
120
|
+
'palegreen': '#98fb98',
|
|
121
|
+
'paleturquoise': '#afeeee',
|
|
122
|
+
'palevioletred': '#db7093',
|
|
123
|
+
'papayawhip': '#ffefd5',
|
|
124
|
+
'peachpuff': '#ffdab9',
|
|
125
|
+
'peru': '#cd853f',
|
|
126
|
+
'pink': '#ffc0cb',
|
|
127
|
+
'plum': '#dda0dd',
|
|
128
|
+
'powderblue': '#b0e0e6',
|
|
129
|
+
'rosybrown': '#bc8f8f',
|
|
130
|
+
'royalblue': '#4169e1',
|
|
131
|
+
'saddlebrown': '#8b4513',
|
|
132
|
+
'salmon': '#fa8072',
|
|
133
|
+
'sandybrown': '#f4a460',
|
|
134
|
+
'seagreen': '#2e8b57',
|
|
135
|
+
'seashell': '#fff5ee',
|
|
136
|
+
'sienna': '#a0522d',
|
|
137
|
+
'skyblue': '#87ceeb',
|
|
138
|
+
'slateblue': '#6a5acd',
|
|
139
|
+
'slategray': '#708090',
|
|
140
|
+
'slategrey': '#708090',
|
|
141
|
+
'snow': '#fffafa',
|
|
142
|
+
'springgreen': '#00ff7f',
|
|
143
|
+
'steelblue': '#4682b4',
|
|
144
|
+
'tan': '#d2b48c',
|
|
145
|
+
'thistle': '#d8bfd8',
|
|
146
|
+
'tomato': '#ff6347',
|
|
147
|
+
'turquoise': '#40e0d0',
|
|
148
|
+
'violet': '#ee82ee',
|
|
149
|
+
'wheat': '#f5deb3',
|
|
150
|
+
'whitesmoke': '#f5f5f5',
|
|
151
|
+
'yellowgreen': '#9acd32'
|
|
152
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for handling color transparency while preserving color positions
|
|
3
|
+
*/
|
|
4
|
+
export interface RGB {
|
|
5
|
+
r: number;
|
|
6
|
+
g: number;
|
|
7
|
+
b: number;
|
|
8
|
+
a: number;
|
|
9
|
+
}
|
|
10
|
+
export declare class ColorTransparencyHandler {
|
|
11
|
+
private persistentOpacity;
|
|
12
|
+
private isInternalUpdate;
|
|
13
|
+
private isColorSelectUpdate;
|
|
14
|
+
constructor(initialOpacity?: number);
|
|
15
|
+
/**
|
|
16
|
+
* Converts hex color to RGBA while preserving opacity
|
|
17
|
+
*/
|
|
18
|
+
hexToRgba(hex: string): RGB;
|
|
19
|
+
/**
|
|
20
|
+
* Converts RGBA values to hex color
|
|
21
|
+
*/
|
|
22
|
+
rgbaToHex(r: number, g: number, b: number, a: number): string;
|
|
23
|
+
/**
|
|
24
|
+
* Updates opacity from slider position
|
|
25
|
+
*/
|
|
26
|
+
updateOpacityFromPosition(event: MouseEvent, sliderElement: HTMLDivElement, onUpdate: (hexValue: string, rgb: RGB) => void, currentRgb: RGB): void;
|
|
27
|
+
/**
|
|
28
|
+
* Updates opacity from input value
|
|
29
|
+
*/
|
|
30
|
+
updateOpacityFromInput(inputValue: number, onUpdate: (hexValue: string, rgb: RGB) => void, currentRgb: RGB): void;
|
|
31
|
+
/**
|
|
32
|
+
* Gets the current opacity percentage
|
|
33
|
+
*/
|
|
34
|
+
getOpacityPercentage(): number;
|
|
35
|
+
/**
|
|
36
|
+
* Gets the current persistent opacity value
|
|
37
|
+
*/
|
|
38
|
+
getCurrentOpacity(): number;
|
|
39
|
+
/**
|
|
40
|
+
* Checks if an update is internal
|
|
41
|
+
*/
|
|
42
|
+
isUpdatingInternally(): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Checks if an update is from color select
|
|
45
|
+
*/
|
|
46
|
+
isUpdatingFromColorSelect(): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Sets the color select update flag
|
|
49
|
+
*/
|
|
50
|
+
setColorSelectUpdate(value: boolean): void;
|
|
51
|
+
}
|
|
52
|
+
export declare function getRGBABorder(color: string, opacity: number): string;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for handling color transparency while preserving color positions
|
|
3
|
+
*/
|
|
4
|
+
export class ColorTransparencyHandler {
|
|
5
|
+
persistentOpacity = 1;
|
|
6
|
+
isInternalUpdate = false;
|
|
7
|
+
isColorSelectUpdate = false;
|
|
8
|
+
constructor(initialOpacity = 1) {
|
|
9
|
+
this.persistentOpacity = initialOpacity;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Converts hex color to RGBA while preserving opacity
|
|
13
|
+
*/
|
|
14
|
+
hexToRgba(hex) {
|
|
15
|
+
console.log('Converting hex to rgba:', hex, 'Current opacity:', this.persistentOpacity);
|
|
16
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(hex);
|
|
17
|
+
if (result) {
|
|
18
|
+
return {
|
|
19
|
+
r: parseInt(result[1], 16) / 255,
|
|
20
|
+
g: parseInt(result[2], 16) / 255,
|
|
21
|
+
b: parseInt(result[3], 16) / 255,
|
|
22
|
+
a: this.persistentOpacity
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
r: 0,
|
|
27
|
+
g: 0,
|
|
28
|
+
b: 0,
|
|
29
|
+
a: this.persistentOpacity
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Converts RGBA values to hex color
|
|
34
|
+
*/
|
|
35
|
+
rgbaToHex(r, g, b, a) {
|
|
36
|
+
const toHex = (x) => Math.round(x * 255).toString(16).padStart(2, '0');
|
|
37
|
+
return `#${toHex(r)}${toHex(g)}${toHex(b)}${a < 1 ? toHex(a) : ''}`;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Updates opacity from slider position
|
|
41
|
+
*/
|
|
42
|
+
updateOpacityFromPosition(event, sliderElement, onUpdate, currentRgb) {
|
|
43
|
+
if (!sliderElement)
|
|
44
|
+
return;
|
|
45
|
+
const rect = sliderElement.getBoundingClientRect();
|
|
46
|
+
const x = event.clientX - rect.left;
|
|
47
|
+
const width = rect.width;
|
|
48
|
+
let newOpacity = Math.max(0, Math.min(x, width)) / width;
|
|
49
|
+
newOpacity = Math.round(newOpacity * 100) / 100;
|
|
50
|
+
try {
|
|
51
|
+
this.isInternalUpdate = true;
|
|
52
|
+
this.persistentOpacity = newOpacity;
|
|
53
|
+
const updatedRgb = { ...currentRgb, a: newOpacity };
|
|
54
|
+
const hexValue = this.rgbaToHex(updatedRgb.r, updatedRgb.g, updatedRgb.b, newOpacity);
|
|
55
|
+
onUpdate(hexValue, updatedRgb);
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
this.isInternalUpdate = false;
|
|
59
|
+
}
|
|
60
|
+
console.log('Updated opacity:', newOpacity);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Updates opacity from input value
|
|
64
|
+
*/
|
|
65
|
+
updateOpacityFromInput(inputValue, onUpdate, currentRgb) {
|
|
66
|
+
const value = Math.min(100, Math.max(0, inputValue));
|
|
67
|
+
const newOpacity = value / 100;
|
|
68
|
+
try {
|
|
69
|
+
this.isInternalUpdate = true;
|
|
70
|
+
this.persistentOpacity = newOpacity;
|
|
71
|
+
const updatedRgb = { ...currentRgb, a: newOpacity };
|
|
72
|
+
const hexValue = this.rgbaToHex(updatedRgb.r, updatedRgb.g, updatedRgb.b, newOpacity);
|
|
73
|
+
onUpdate(hexValue, updatedRgb);
|
|
74
|
+
}
|
|
75
|
+
finally {
|
|
76
|
+
this.isInternalUpdate = false;
|
|
77
|
+
}
|
|
78
|
+
console.log('Updated opacity from input:', value);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Gets the current opacity percentage
|
|
82
|
+
*/
|
|
83
|
+
getOpacityPercentage() {
|
|
84
|
+
return Math.round(this.persistentOpacity * 100);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Gets the current persistent opacity value
|
|
88
|
+
*/
|
|
89
|
+
getCurrentOpacity() {
|
|
90
|
+
return this.persistentOpacity;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Checks if an update is internal
|
|
94
|
+
*/
|
|
95
|
+
isUpdatingInternally() {
|
|
96
|
+
return this.isInternalUpdate;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Checks if an update is from color select
|
|
100
|
+
*/
|
|
101
|
+
isUpdatingFromColorSelect() {
|
|
102
|
+
return this.isColorSelectUpdate;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Sets the color select update flag
|
|
106
|
+
*/
|
|
107
|
+
setColorSelectUpdate(value) {
|
|
108
|
+
this.isColorSelectUpdate = value;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// Export the helper function
|
|
112
|
+
export function getRGBABorder(color, opacity) {
|
|
113
|
+
return `1px solid ${color.replace('rgb', 'rgba').replace(')', `, ${opacity})`)}`;
|
|
114
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type CategoryMap = {
|
|
2
|
+
'sans-serif': 'Sans Serif';
|
|
3
|
+
'serif': 'Serif';
|
|
4
|
+
'display': 'Script';
|
|
5
|
+
'handwriting': 'Script';
|
|
6
|
+
'monospace': 'Other';
|
|
7
|
+
};
|
|
8
|
+
type CategoryTypes = ['All', 'Serif', 'Sans Serif', 'Script', 'Other', 'Mine'];
|
|
9
|
+
type FontCategories = {
|
|
10
|
+
map: CategoryMap;
|
|
11
|
+
types: CategoryTypes;
|
|
12
|
+
normalize: (category: string) => Exclude<CategoryTypes[number], 'All'>;
|
|
13
|
+
};
|
|
14
|
+
export declare const fontCategories: FontCategories;
|
|
15
|
+
export type FontCategory = Exclude<typeof fontCategories.types[number], 'All'>;
|
|
16
|
+
export interface FontItem {
|
|
17
|
+
family: string;
|
|
18
|
+
category: FontCategory;
|
|
19
|
+
isCustom?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface RecentFont {
|
|
22
|
+
family: string;
|
|
23
|
+
category: string;
|
|
24
|
+
isCustom?: boolean;
|
|
25
|
+
lastUsed: number;
|
|
26
|
+
}
|
|
27
|
+
export declare const recentFontsStore: import("svelte/store").Writable<RecentFont[]>;
|
|
28
|
+
export declare const fontUtils: {
|
|
29
|
+
getRecentFonts(): RecentFont[];
|
|
30
|
+
addRecentFont(font: FontItem): RecentFont[];
|
|
31
|
+
removeCustomFont(family: string): RecentFont[];
|
|
32
|
+
categorizeFont(family: string): FontCategory;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { writable } from 'svelte/store';
|
|
2
|
+
// Define our category types with proper typing
|
|
3
|
+
export const fontCategories = {
|
|
4
|
+
// Google Fonts categories to our categories mapping
|
|
5
|
+
map: {
|
|
6
|
+
'sans-serif': 'Sans Serif',
|
|
7
|
+
'serif': 'Serif',
|
|
8
|
+
'display': 'Script',
|
|
9
|
+
'handwriting': 'Script',
|
|
10
|
+
'monospace': 'Other'
|
|
11
|
+
},
|
|
12
|
+
// Our category types
|
|
13
|
+
types: ['All', 'Serif', 'Sans Serif', 'Script', 'Other', 'Mine'],
|
|
14
|
+
// Helper function to map Google Fonts category to our category
|
|
15
|
+
normalize(category) {
|
|
16
|
+
// Handle null or undefined category
|
|
17
|
+
if (!category) {
|
|
18
|
+
console.log('⚠️ [FontUtils] Null category, returning Other');
|
|
19
|
+
return 'Other';
|
|
20
|
+
}
|
|
21
|
+
// Convert to lowercase and trim for consistent matching
|
|
22
|
+
const normalizedCategory = category.toLowerCase().trim();
|
|
23
|
+
// // Debug: log the exact state of the mapping
|
|
24
|
+
// console.log('🔍 [FontUtils] Category mapping:', {
|
|
25
|
+
// input: category,
|
|
26
|
+
// normalized: normalizedCategory,
|
|
27
|
+
// mapKeys: Object.keys(this.map),
|
|
28
|
+
// hasExactMatch: normalizedCategory in this.map,
|
|
29
|
+
// availableMappings: this.map
|
|
30
|
+
// });
|
|
31
|
+
// Try direct mapping first
|
|
32
|
+
if (normalizedCategory in this.map) {
|
|
33
|
+
const mapped = this.map[normalizedCategory];
|
|
34
|
+
// console.log('✅ [FontUtils] Direct mapping found:', {
|
|
35
|
+
// from: normalizedCategory,
|
|
36
|
+
// to: mapped
|
|
37
|
+
// });
|
|
38
|
+
return mapped;
|
|
39
|
+
}
|
|
40
|
+
// If no direct mapping, try to infer category
|
|
41
|
+
// First normalize the input category to match our expected format
|
|
42
|
+
const categoryToCheck = normalizedCategory === 'script' ? 'display' : normalizedCategory;
|
|
43
|
+
if (categoryToCheck in this.map) {
|
|
44
|
+
const mapped = this.map[categoryToCheck];
|
|
45
|
+
// console.log('✅ [FontUtils] Normalized mapping found:', {
|
|
46
|
+
// from: normalizedCategory,
|
|
47
|
+
// via: categoryToCheck,
|
|
48
|
+
// to: mapped
|
|
49
|
+
// });
|
|
50
|
+
return mapped;
|
|
51
|
+
}
|
|
52
|
+
// If still no match, use inference rules
|
|
53
|
+
let inferredCategory = 'Other';
|
|
54
|
+
if (normalizedCategory.includes('serif')) {
|
|
55
|
+
inferredCategory = normalizedCategory.includes('sans') ? 'Sans Serif' : 'Serif';
|
|
56
|
+
}
|
|
57
|
+
else if (normalizedCategory.includes('display') ||
|
|
58
|
+
normalizedCategory.includes('handwriting') ||
|
|
59
|
+
normalizedCategory.includes('script')) {
|
|
60
|
+
inferredCategory = 'Script';
|
|
61
|
+
}
|
|
62
|
+
else if (normalizedCategory.includes('mono')) {
|
|
63
|
+
inferredCategory = 'Other';
|
|
64
|
+
}
|
|
65
|
+
// console.log('ℹ️ [FontUtils] Inferred category:', {
|
|
66
|
+
// from: normalizedCategory,
|
|
67
|
+
// to: inferredCategory
|
|
68
|
+
// });
|
|
69
|
+
return inferredCategory;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const RECENT_FONTS_KEY = 'recent_fonts';
|
|
73
|
+
const MAX_RECENT_FONTS = 3;
|
|
74
|
+
// Add store for recent fonts
|
|
75
|
+
export const recentFontsStore = writable([]);
|
|
76
|
+
export const fontUtils = {
|
|
77
|
+
getRecentFonts() {
|
|
78
|
+
try {
|
|
79
|
+
const stored = localStorage.getItem(RECENT_FONTS_KEY);
|
|
80
|
+
return stored ? JSON.parse(stored) : [];
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
console.error('Error reading recent fonts:', error);
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
addRecentFont(font) {
|
|
88
|
+
try {
|
|
89
|
+
const recentFonts = this.getRecentFonts();
|
|
90
|
+
const filteredFonts = recentFonts.filter(f => f.family !== font.family);
|
|
91
|
+
const newRecentFonts = [
|
|
92
|
+
{
|
|
93
|
+
...font,
|
|
94
|
+
lastUsed: Date.now()
|
|
95
|
+
},
|
|
96
|
+
...filteredFonts
|
|
97
|
+
].slice(0, MAX_RECENT_FONTS);
|
|
98
|
+
localStorage.setItem(RECENT_FONTS_KEY, JSON.stringify(newRecentFonts));
|
|
99
|
+
recentFontsStore.set(newRecentFonts);
|
|
100
|
+
return newRecentFonts;
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
console.error('Error saving recent font:', error);
|
|
104
|
+
return this.getRecentFonts();
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
removeCustomFont(family) {
|
|
108
|
+
try {
|
|
109
|
+
const recentFonts = this.getRecentFonts();
|
|
110
|
+
const filteredFonts = recentFonts.filter(f => f.family !== family);
|
|
111
|
+
localStorage.setItem(RECENT_FONTS_KEY, JSON.stringify(filteredFonts));
|
|
112
|
+
return filteredFonts;
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
console.error('Error removing custom font:', error);
|
|
116
|
+
return this.getRecentFonts();
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
categorizeFont(family) {
|
|
120
|
+
const lowerFamily = family.toLowerCase();
|
|
121
|
+
if (lowerFamily.includes('serif') && !lowerFamily.includes('sans')) {
|
|
122
|
+
return 'Serif';
|
|
123
|
+
}
|
|
124
|
+
else if (lowerFamily.includes('sans')) {
|
|
125
|
+
return 'Sans Serif';
|
|
126
|
+
}
|
|
127
|
+
else if (lowerFamily.includes('script') || lowerFamily.includes('cursive')) {
|
|
128
|
+
return 'Script';
|
|
129
|
+
}
|
|
130
|
+
return 'Other';
|
|
131
|
+
}
|
|
132
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Add passive event listener support globally
|
|
2
|
+
if (typeof window !== 'undefined') {
|
|
3
|
+
// Save the original addEventListener
|
|
4
|
+
const originalAddEventListener = EventTarget.prototype.addEventListener;
|
|
5
|
+
// Override addEventListener
|
|
6
|
+
EventTarget.prototype.addEventListener = function (type, listener, options) {
|
|
7
|
+
// Force passive for touch and wheel events
|
|
8
|
+
if (type === 'touchstart' || type === 'touchmove' || type === 'wheel') {
|
|
9
|
+
let newOptions = options;
|
|
10
|
+
if (typeof options === 'object') {
|
|
11
|
+
newOptions = { ...options, passive: true };
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
newOptions = { passive: true };
|
|
15
|
+
}
|
|
16
|
+
return originalAddEventListener.call(this, type, listener, newOptions);
|
|
17
|
+
}
|
|
18
|
+
return originalAddEventListener.call(this, type, listener, options);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const STORAGE_KEY = 'recentColors';
|
|
2
|
+
const MAX_COLORS = 12;
|
|
3
|
+
export const recentColorsUtil = {
|
|
4
|
+
getRecentColors() {
|
|
5
|
+
try {
|
|
6
|
+
const stored = localStorage.getItem(STORAGE_KEY);
|
|
7
|
+
return stored ? JSON.parse(stored) : [];
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
console.error('Error reading recent colors:', error);
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
addRecentColor(color, alpha) {
|
|
15
|
+
try {
|
|
16
|
+
const normalizedColor = color.toLowerCase();
|
|
17
|
+
console.log('Adding/updating recent color:', {
|
|
18
|
+
normalizedColor,
|
|
19
|
+
alpha,
|
|
20
|
+
originalColor: color
|
|
21
|
+
});
|
|
22
|
+
let colors = this.getRecentColors();
|
|
23
|
+
// Normalize all colors for comparison
|
|
24
|
+
const existingIndex = colors.findIndex(c => {
|
|
25
|
+
const normalizedExisting = c.color.toLowerCase();
|
|
26
|
+
const alphaMatch = Math.abs(c.alpha - alpha) < 0.001;
|
|
27
|
+
console.log('Comparing:', {
|
|
28
|
+
existing: normalizedExisting,
|
|
29
|
+
new: normalizedColor,
|
|
30
|
+
existingAlpha: c.alpha,
|
|
31
|
+
newAlpha: alpha,
|
|
32
|
+
alphaMatch,
|
|
33
|
+
colorsMatch: normalizedExisting === normalizedColor
|
|
34
|
+
});
|
|
35
|
+
return normalizedExisting === normalizedColor && alphaMatch;
|
|
36
|
+
});
|
|
37
|
+
console.log('Found existing color at index:', existingIndex);
|
|
38
|
+
if (existingIndex !== -1) {
|
|
39
|
+
// Remove the existing color
|
|
40
|
+
const removed = colors.splice(existingIndex, 1)[0];
|
|
41
|
+
console.log('Removed existing color:', removed);
|
|
42
|
+
}
|
|
43
|
+
// Add the new/updated color to the front
|
|
44
|
+
const newColor = {
|
|
45
|
+
color: color, // Keep original case
|
|
46
|
+
alpha,
|
|
47
|
+
timestamp: Date.now()
|
|
48
|
+
};
|
|
49
|
+
colors.unshift(newColor);
|
|
50
|
+
// console.log('Added color to front:', newColor);
|
|
51
|
+
// Trim to max size
|
|
52
|
+
colors = colors.slice(0, MAX_COLORS);
|
|
53
|
+
// Save to localStorage
|
|
54
|
+
localStorage.setItem(STORAGE_KEY, JSON.stringify(colors));
|
|
55
|
+
// console.log('Final colors list:', colors);
|
|
56
|
+
return colors;
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
console.error('Error saving recent color:', error);
|
|
60
|
+
return this.getRecentColors(); // Return existing colors on error
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Define patterns for Material Icons/Symbols
|
|
2
|
+
const MATERIAL_PATTERNS = [
|
|
3
|
+
'material icons',
|
|
4
|
+
'material symbols'
|
|
5
|
+
];
|
|
6
|
+
// Define specific fonts to skip
|
|
7
|
+
export const skipFamilies = new Set([
|
|
8
|
+
"Libre Barcode 39"
|
|
9
|
+
]);
|
|
10
|
+
// Define monospace and other fonts to skip
|
|
11
|
+
export const skipFonts = new Set([
|
|
12
|
+
'VT323',
|
|
13
|
+
'PT Mono',
|
|
14
|
+
'DM Mono',
|
|
15
|
+
'Share Tech Mono',
|
|
16
|
+
'Share-Tech-Mono',
|
|
17
|
+
'Anonymous Pro',
|
|
18
|
+
'AnonymousPro',
|
|
19
|
+
'Anonymous-Pro',
|
|
20
|
+
'Noto Sans'
|
|
21
|
+
]);
|
|
22
|
+
function normalizeFontName(fontFamily) {
|
|
23
|
+
return fontFamily
|
|
24
|
+
.toLowerCase()
|
|
25
|
+
.replace(/[^a-z0-9]/g, '');
|
|
26
|
+
}
|
|
27
|
+
export function shouldSkipFont(fontFamily) {
|
|
28
|
+
if (!fontFamily)
|
|
29
|
+
return false;
|
|
30
|
+
// Convert to lowercase for consistent comparison
|
|
31
|
+
const familyLower = fontFamily.toLowerCase();
|
|
32
|
+
// First check if it's a Material font using patterns
|
|
33
|
+
if (MATERIAL_PATTERNS.some(pattern => familyLower.includes(pattern))) {
|
|
34
|
+
// console.log('🚫 [skipFonts] Skipping Material font:', fontFamily);
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
// Then check exact matches
|
|
38
|
+
if (skipFamilies.has(fontFamily) || skipFonts.has(fontFamily)) {
|
|
39
|
+
// console.log('🚫 [skipFonts] Skipping exact match:', fontFamily);
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
// Finally check normalized names
|
|
43
|
+
const normalizedName = normalizeFontName(fontFamily);
|
|
44
|
+
const shouldSkip = Array.from(skipFamilies).some(family => normalizeFontName(family) === normalizedName) || Array.from(skipFonts).some(font => normalizeFontName(font) === normalizedName);
|
|
45
|
+
if (shouldSkip) {
|
|
46
|
+
// console.log('🚫 [skipFonts] Skipping normalized match:', fontFamily);
|
|
47
|
+
}
|
|
48
|
+
return shouldSkip;
|
|
49
|
+
}
|