@widgetic/editor 3.11.3 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +245 -0
- package/dist/assets/fonts.json +331 -0
- package/dist/assets/icons/ic-browser/audio.svg +7 -0
- package/dist/assets/icons/ic-browser/document.svg +11 -0
- package/dist/assets/icons/ic-browser/error.svg +5 -0
- package/dist/assets/icons/ic-browser/folder.svg +28 -0
- package/dist/assets/icons/ic-browser/player-pause.svg +1 -0
- package/dist/assets/icons/ic-browser/player-play.svg +1 -0
- package/dist/assets/icons/ic-browser/trash.svg +1 -0
- package/dist/assets/icons/ic-fixed-position/background-deselected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/background-selected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/bottom-left-background-deselected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/bottom-left-background-selected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/bottom-left-icon.svg +4 -0
- package/dist/assets/icons/ic-fixed-position/bottom-right-background-deselected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/bottom-right-background-selected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/bottom-right-icon.svg +4 -0
- package/dist/assets/icons/ic-fixed-position/center-bottom-icon.svg +5 -0
- package/dist/assets/icons/ic-fixed-position/center-center-icon.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/center-left-icon.svg +5 -0
- package/dist/assets/icons/ic-fixed-position/center-right-icon.svg +5 -0
- package/dist/assets/icons/ic-fixed-position/center-top-icon.svg +5 -0
- package/dist/assets/icons/ic-fixed-position/top-left-background-deselected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/top-left-background-selected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/top-left-icon.svg +4 -0
- package/dist/assets/icons/ic-fixed-position/top-right-background-deselected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/top-right-background-selected.svg +3 -0
- package/dist/assets/icons/ic-fixed-position/top-right-icon.svg +4 -0
- package/dist/assets/icons/trash.svg +1 -0
- package/dist/components/MockWidget.svelte +108 -0
- package/dist/components/MockWidget.svelte.d.ts +22 -0
- package/dist/components/WidgetPreview.svelte +852 -0
- package/dist/components/WidgetPreview.svelte.d.ts +100 -0
- package/dist/components/color-select/ColorSelect.svelte +258 -0
- package/dist/components/color-select/ColorSelect.svelte.d.ts +42 -0
- package/dist/components/color-select/color.d.ts +25 -0
- package/dist/components/color-select/color.js +21 -0
- package/dist/components/color-select/constants.d.ts +5 -0
- package/dist/components/color-select/constants.js +5 -0
- package/dist/components/color-select/render.d.ts +5 -0
- package/dist/components/color-select/render.js +77 -0
- package/dist/components/color-select/shaders.d.ts +3 -0
- package/dist/components/color-select/shaders.js +8 -0
- package/dist/components/editors/EmbedEditor.svelte +700 -0
- package/dist/components/editors/EmbedEditor.svelte.d.ts +50 -0
- package/dist/components/editors/PropsEditor.svelte +3952 -0
- package/dist/components/editors/PropsEditor.svelte.d.ts +62 -0
- package/dist/components/editors/props-editor.css +73 -0
- package/dist/components/ic/AngleInputController.svelte +276 -0
- package/dist/components/ic/AngleInputController.svelte.d.ts +26 -0
- package/dist/components/ic/BrowserInputController.svelte +724 -0
- package/dist/components/ic/BrowserInputController.svelte.d.ts +39 -0
- package/dist/components/ic/CheckboxInputController.svelte +203 -0
- package/dist/components/ic/CheckboxInputController.svelte.d.ts +41 -0
- package/dist/components/ic/ColorPickerInputController.svelte +1584 -0
- package/dist/components/ic/ColorPickerInputController.svelte.d.ts +50 -0
- package/dist/components/ic/DateFieldInputController.svelte +453 -0
- package/dist/components/ic/DateFieldInputController.svelte.d.ts +35 -0
- package/dist/components/ic/DatePickerInputController.svelte +364 -0
- package/dist/components/ic/DatePickerInputController.svelte.d.ts +28 -0
- package/dist/components/ic/DropdownInputController.svelte +226 -0
- package/dist/components/ic/DropdownInputController.svelte.d.ts +43 -0
- package/dist/components/ic/FixedPositionInputController.svelte +353 -0
- package/dist/components/ic/FixedPositionInputController.svelte.d.ts +23 -0
- package/dist/components/ic/FontInputController.svelte +2062 -0
- package/dist/components/ic/FontInputController.svelte.d.ts +47 -0
- package/dist/components/ic/InputControllerHeader.svelte +147 -0
- package/dist/components/ic/InputControllerHeader.svelte.d.ts +23 -0
- package/dist/components/ic/NumberControls.svelte +299 -0
- package/dist/components/ic/NumberControls.svelte.d.ts +30 -0
- package/dist/components/ic/NumberInputController.svelte +397 -0
- package/dist/components/ic/NumberInputController.svelte.d.ts +30 -0
- package/dist/components/ic/PositionInputController.svelte +252 -0
- package/dist/components/ic/PositionInputController.svelte.d.ts +37 -0
- package/dist/components/ic/RadioGroupInputController.svelte +162 -0
- package/dist/components/ic/RadioGroupInputController.svelte.d.ts +38 -0
- package/dist/components/ic/RangeCalendarInputController.svelte +262 -0
- package/dist/components/ic/RangeCalendarInputController.svelte.d.ts +32 -0
- package/dist/components/ic/RoundedCornersInputController.svelte +469 -0
- package/dist/components/ic/RoundedCornersInputController.svelte.d.ts +37 -0
- package/dist/components/ic/SliderInputController.svelte +411 -0
- package/dist/components/ic/SliderInputController.svelte.d.ts +46 -0
- package/dist/components/ic/SliderRangeInputController.svelte +155 -0
- package/dist/components/ic/SliderRangeInputController.svelte.d.ts +33 -0
- package/dist/components/ic/SwitchInputController.svelte +107 -0
- package/dist/components/ic/SwitchInputController.svelte.d.ts +24 -0
- package/dist/components/ic/TagsInputController.svelte +125 -0
- package/dist/components/ic/TagsInputController.svelte.d.ts +27 -0
- package/dist/components/ic/TextAreaInputController.svelte +1804 -0
- package/dist/components/ic/TextAreaInputController.svelte.d.ts +13 -0
- package/dist/components/ic/TextAreaPreviewInputController.svelte +476 -0
- package/dist/components/ic/TextAreaPreviewInputController.svelte.d.ts +28 -0
- package/dist/components/ic/TextInputController.svelte +70 -0
- package/dist/components/ic/TextInputController.svelte.d.ts +30 -0
- package/dist/components/ic/TimeInputController.svelte +434 -0
- package/dist/components/ic/TimeInputController.svelte.d.ts +25 -0
- package/dist/components/ic/VectorInputController.svelte +1826 -0
- package/dist/components/ic/VectorInputController.svelte.d.ts +47 -0
- package/dist/components/ic/index.d.ts +39 -0
- package/dist/components/ic/index.js +24 -0
- package/dist/components/ic/shared/CategoryTabs.svelte +40 -0
- package/dist/components/ic/shared/CategoryTabs.svelte.d.ts +25 -0
- package/dist/components/ic/shared/ItemGrid.svelte +181 -0
- package/dist/components/ic/shared/ItemGrid.svelte.d.ts +35 -0
- package/dist/components/ic/shared/RecentItemsSection.svelte +260 -0
- package/dist/components/ic/shared/RecentItemsSection.svelte.d.ts +35 -0
- package/dist/components/ic/shared/index.d.ts +8 -0
- package/dist/components/ic/shared/index.js +9 -0
- package/dist/components/icons/addnew.svelte +21 -0
- package/dist/components/icons/addnew.svelte.d.ts +20 -0
- package/dist/components/icons/drag.svelte +29 -0
- package/dist/components/icons/drag.svelte.d.ts +20 -0
- package/dist/components/icons/drag.svg +1 -0
- package/dist/components/icons/locked.svelte +4 -0
- package/dist/components/icons/locked.svelte.d.ts +26 -0
- package/dist/components/icons/locked.svg +4 -0
- package/dist/components/icons/ok.svelte +20 -0
- package/dist/components/icons/ok.svelte.d.ts +20 -0
- package/dist/components/icons/ok.svg +11 -0
- package/dist/components/icons/unlocked.svelte +4 -0
- package/dist/components/icons/unlocked.svelte.d.ts +26 -0
- package/dist/components/icons/unlocked.svg +4 -0
- package/dist/components/icons/x.svelte +14 -0
- package/dist/components/icons/x.svelte.d.ts +20 -0
- package/dist/components/icons/x.svg +5 -0
- package/dist/components/ui/arrows/OpacitySliderArrows.svelte +43 -0
- package/dist/components/ui/arrows/OpacitySliderArrows.svelte.d.ts +23 -0
- package/dist/components/ui/checkerboard-background/CheckerboardBackground.svelte +15 -0
- package/dist/components/ui/checkerboard-background/CheckerboardBackground.svelte.d.ts +20 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.js +19 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +8 -0
- package/dist/stores/userSession.d.ts +7 -0
- package/dist/stores/userSession.js +28 -0
- package/dist/utils/FontManager.d.ts +276 -0
- package/dist/utils/FontManager.js +1283 -0
- package/dist/utils/MediaManager.d.ts +35 -0
- package/dist/utils/MediaManager.js +59 -0
- package/dist/utils/VectorManager.d.ts +190 -0
- package/dist/utils/VectorManager.js +754 -0
- package/dist/utils/colorAutocomplete.d.ts +10 -0
- package/dist/utils/colorAutocomplete.js +28 -0
- package/dist/utils/colorNames.d.ts +3 -0
- package/dist/utils/colorNames.js +152 -0
- package/dist/utils/colorTransparency.d.ts +52 -0
- package/dist/utils/colorTransparency.js +114 -0
- package/dist/utils/fontUtils.d.ts +34 -0
- package/dist/utils/fontUtils.js +132 -0
- package/dist/utils/passiveEvents.js +20 -0
- package/dist/utils/recentColors.d.ts +10 -0
- package/dist/utils/recentColors.js +63 -0
- package/dist/utils/skipFonts.d.ts +3 -0
- package/dist/utils/skipFonts.js +49 -0
- package/dist/utils/vectorUtils.d.ts +34 -0
- package/dist/utils/vectorUtils.js +71 -0
- package/dist/utils.d.ts +11 -0
- package/dist/utils.js +38 -0
- package/package.json +134 -74
- package/.babelrc +0 -10
- package/.bowerrc +0 -4
- package/.nvmrc +0 -1
- package/Gruntfile.coffee +0 -69
- package/bower.json +0 -28
- package/css/browser/entries/activateable.styl +0 -29
- package/css/browser/entries/audio.styl +0 -39
- package/css/browser/entries/folder.styl +0 -79
- package/css/browser/entries/image.styl +0 -26
- package/css/browser/entries/index.styl +0 -66
- package/css/browser/entries/rss.styl +0 -11
- package/css/browser/entries/video.styl +0 -11
- package/css/browser/index.styl +0 -86
- package/css/browser/intent/index.styl +0 -61
- package/css/browser/nav/index.styl +0 -73
- package/css/browser/social-browser.styl +0 -23
- package/css/controls/clock.styl +0 -110
- package/css/controls/config.styl +0 -6
- package/css/controls/control-audio-details.styl +0 -63
- package/css/controls/control-audio.styl +0 -28
- package/css/controls/control-browser.styl +0 -48
- package/css/controls/control-color.styl +0 -423
- package/css/controls/control-date_time.styl +0 -191
- package/css/controls/control-dropdown.styl +0 -79
- package/css/controls/control-font.styl +0 -147
- package/css/controls/control-image-details.styl +0 -35
- package/css/controls/control-image.styl +0 -43
- package/css/controls/control-order-picker.styl +0 -29
- package/css/controls/control-position.styl +0 -390
- package/css/controls/control-range.styl +0 -68
- package/css/controls/control-scale.styl +0 -30
- package/css/controls/control-slider.styl +0 -38
- package/css/controls/control-spinner.styl +0 -39
- package/css/controls/control-textarea.styl +0 -52
- package/css/controls/control-toggle.styl +0 -34
- package/css/controls/control-url.styl +0 -32
- package/css/controls/control-video-details.styl +0 -85
- package/css/controls/control-video.styl +0 -43
- package/css/controls/general.styl +0 -98
- package/css/controls/index.styl +0 -25
- package/css/editor/colors.styl +0 -7
- package/css/editor/content/directinput.styl +0 -47
- package/css/editor/content/index.styl +0 -111
- package/css/editor/content/message.styl +0 -53
- package/css/editor/content/tabs.styl +0 -75
- package/css/editor/copied-from-old-style.styl +0 -197
- package/css/editor/details/bulk-editor.styl +0 -104
- package/css/editor/details/index.styl +0 -21
- package/css/editor/details/item.styl +0 -153
- package/css/editor/embed.styl +0 -106
- package/css/editor/footer.styl +0 -180
- package/css/editor/full-editor.styl +0 -16
- package/css/editor/index.styl +0 -124
- package/css/editor/login-popup.styl +0 -13
- package/css/editor/preview.styl +0 -257
- package/css/editor/skin/editor/index.styl +0 -54
- package/css/editor/skin/editor/tabs.styl +0 -111
- package/css/editor/skin/index.styl +0 -138
- package/css/editor/skin/popup.styl +0 -152
- package/css/editor/skin/presets/dropdown.styl +0 -61
- package/css/editor/skin/presets/index.styl +0 -86
- package/css/editor/skin/presets/list.styl +0 -244
- package/css/editor/tooltips.styl +0 -85
- package/css/fonts.styl +0 -47
- package/css/icons/BlogvioEditor.dev.svg +0 -112
- package/css/icons.styl +0 -16
- package/css/img/arrow-right-rounded-v-small.png +0 -0
- package/css/img/browser-folder-separator.png +0 -0
- package/css/img/calendar-input-icons.png +0 -0
- package/css/img/check.png +0 -0
- package/css/img/close.png +0 -0
- package/css/img/composition/edit-icon.png +0 -0
- package/css/img/content/audio-icon.png +0 -0
- package/css/img/content/folder-icon.png +0 -0
- package/css/img/content/messages/error-background.png +0 -0
- package/css/img/content/messages/error-icon.png +0 -0
- package/css/img/content/messages/notification-background.png +0 -0
- package/css/img/content/messages/notification-icon.png +0 -0
- package/css/img/content/no-files-audio.png +0 -0
- package/css/img/content/no-files-image.png +0 -0
- package/css/img/content/no-files-video.png +0 -0
- package/css/img/content/no-files.png +0 -0
- package/css/img/content/rss-icon.png +0 -0
- package/css/img/content/selected.png +0 -0
- package/css/img/content/video-icon.png +0 -0
- package/css/img/content/with-control-text.png +0 -0
- package/css/img/control-dropdown-arrow.png +0 -0
- package/css/img/control-image-valid.png +0 -0
- package/css/img/control-position-icon.png +0 -0
- package/css/img/control-scale-lock-icon.png +0 -0
- package/css/img/control-slider-arrows-hover.png +0 -0
- package/css/img/control-slider-arrows.png +0 -0
- package/css/img/control-spinner-buttons-hover.png +0 -0
- package/css/img/control-spinner-buttons.png +0 -0
- package/css/img/control-textarea-bold-active.png +0 -0
- package/css/img/control-textarea-bold.png +0 -0
- package/css/img/control-textarea-italic-active.png +0 -0
- package/css/img/control-textarea-italic.png +0 -0
- package/css/img/control-textarea-underline-active.png +0 -0
- package/css/img/control-textarea-underline.png +0 -0
- package/css/img/custom-checkbox-sprite.png +0 -0
- package/css/img/details/item-collapse-icon.png +0 -0
- package/css/img/details/item-expand-icon.png +0 -0
- package/css/img/details/item-sort-icon.png +0 -0
- package/css/img/done-arrow.png +0 -0
- package/css/img/fb-logo-icon-w.png +0 -0
- package/css/img/grid-icons.png +0 -0
- package/css/img/icon-reference.png +0 -0
- package/css/img/indicator.png +0 -0
- package/css/img/loader.gif +0 -0
- package/css/img/loaders/audio-white.png +0 -0
- package/css/img/loaders/audio.png +0 -0
- package/css/img/loaders/photo-white.png +0 -0
- package/css/img/loaders/photo.png +0 -0
- package/css/img/loaders/util-white.png +0 -0
- package/css/img/loaders/util.png +0 -0
- package/css/img/loaders/video-white.png +0 -0
- package/css/img/loaders/video.png +0 -0
- package/css/img/maximize.png +0 -0
- package/css/img/minimize.png +0 -0
- package/css/img/next-btn.png +0 -0
- package/css/img/search-icon-sprite.png +0 -0
- package/css/img/services/blogvio.png +0 -0
- package/css/img/services/drive.png +0 -0
- package/css/img/services/dropbox-login.png +0 -0
- package/css/img/services/dropbox.png +0 -0
- package/css/img/services/facebook-login.png +0 -0
- package/css/img/services/facebook.png +0 -0
- package/css/img/services/flickr-login.png +0 -0
- package/css/img/services/flickr.png +0 -0
- package/css/img/services/instagram-login.png +0 -0
- package/css/img/services/instagram.png +0 -0
- package/css/img/services/text.png +0 -0
- package/css/img/services/uploads.png +0 -0
- package/css/img/services/uploads.svg +0 -689
- package/css/img/services/webaddress-bw.png +0 -0
- package/css/img/services/webaddress.png +0 -0
- package/css/img/services/webadress.png +0 -0
- package/css/img/services/websearch.png +0 -0
- package/css/img/services/wix.png +0 -0
- package/css/img/skin/item-active-indicator.png +0 -0
- package/css/img/skin/item-hover-icon.png +0 -0
- package/css/img/skin/overwrite.png +0 -0
- package/css/img/skin/popup-name-icon.png +0 -0
- package/css/img/skin/popup-save.png +0 -0
- package/css/img/skin/preset.png +0 -0
- package/css/img/skin/presets-arrow-purple.png +0 -0
- package/css/img/tw-icon-w.png +0 -0
- package/css/img/warning.png +0 -0
- package/css/img/white-rounded-check.png +0 -0
- package/css/index.styl +0 -9
- package/css/mixins.styl +0 -62
- package/css/scrollable.styl +0 -101
- package/karma.conf.js +0 -73
- package/lib/control.js +0 -1
- package/lib/controls.js +0 -1
- package/lib/core.editor.js +0 -4
- package/lib/core.js +0 -1
- package/lib/core.vendor.js +0 -3
- package/lib/dev/control.js +0 -845
- package/lib/dev/controls.js +0 -7774
- package/lib/dev/core.editor.js +0 -6439
- package/lib/dev/core.js +0 -1486
- package/lib/dev/core.vendor.js +0 -10708
- package/lib/dev/editor.css +0 -166
- package/lib/dev/editor.js +0 -29710
- package/lib/dev/editor.vendor.js +0 -15119
- package/lib/dev/jquery.nanoscroller.js.map +0 -10
- package/lib/editor.css +0 -167
- package/lib/editor.js +0 -49
- package/lib/editor.vendor.js +0 -11
- package/src/api/index.coffee +0 -23
- package/src/api/mixin.coffee +0 -89
- package/src/browser/controller/entry/audio.coffee +0 -38
- package/src/browser/controller/entry/button.coffee +0 -16
- package/src/browser/controller/entry/file.coffee +0 -35
- package/src/browser/controller/entry/folder.coffee +0 -14
- package/src/browser/controller/entry/image.coffee +0 -24
- package/src/browser/controller/entry/index.coffee +0 -18
- package/src/browser/controller/entry/rss.coffee +0 -5
- package/src/browser/controller/entry/video.coffee +0 -4
- package/src/browser/controller/index.coffee +0 -289
- package/src/browser/controller/instagram.coffee +0 -129
- package/src/browser/controller/navbar.coffee +0 -48
- package/src/browser/controller/social.coffee +0 -213
- package/src/browser/model/entry.coffee +0 -18
- package/src/browser/model/index.coffee +0 -34
- package/src/core/controller/font-loader.coffee +0 -65
- package/src/core/controller/lazyload.coffee +0 -14
- package/src/core/controller/overlay.coffee +0 -146
- package/src/core/controller/popup.coffee +0 -36
- package/src/core/controller/scrollable.coffee +0 -68
- package/src/core/controls/audio.coffee +0 -56
- package/src/core/controls/browser.coffee +0 -271
- package/src/core/controls/color.coffee +0 -121
- package/src/core/controls/date-time/calendar/index.coffee +0 -99
- package/src/core/controls/date-time/calendar/months.coffee +0 -52
- package/src/core/controls/date-time/calendar/years.coffee +0 -58
- package/src/core/controls/date-time/clock.coffee +0 -62
- package/src/core/controls/date-time/helper.coffee +0 -31
- package/src/core/controls/date-time/index.coffee +0 -62
- package/src/core/controls/date-time/popup.coffee +0 -56
- package/src/core/controls/details/audio.coffee +0 -33
- package/src/core/controls/details/image.coffee +0 -19
- package/src/core/controls/details/video.coffee +0 -14
- package/src/core/controls/dropdown.coffee +0 -100
- package/src/core/controls/font/font-item.coffee +0 -22
- package/src/core/controls/font/font-list.coffee +0 -108
- package/src/core/controls/font/fonts-popup.coffee +0 -91
- package/src/core/controls/font/index.coffee +0 -66
- package/src/core/controls/image.coffee +0 -37
- package/src/core/controls/index.coffee +0 -88
- package/src/core/controls/orderPicker.coffee +0 -93
- package/src/core/controls/position/grid-panel.coffee +0 -75
- package/src/core/controls/position/index.coffee +0 -98
- package/src/core/controls/position/panel.coffee +0 -68
- package/src/core/controls/position/pixel-panel.coffee +0 -54
- package/src/core/controls/position/popup.coffee +0 -63
- package/src/core/controls/position/reference-panel.coffee +0 -26
- package/src/core/controls/range.coffee +0 -191
- package/src/core/controls/rss.coffee +0 -16
- package/src/core/controls/scale.coffee +0 -78
- package/src/core/controls/slider.coffee +0 -122
- package/src/core/controls/stepper.coffee +0 -97
- package/src/core/controls/text.coffee +0 -54
- package/src/core/controls/textarea.coffee +0 -78
- package/src/core/controls/toggle.coffee +0 -29
- package/src/core/controls/url.coffee +0 -88
- package/src/core/controls/video.coffee +0 -9
- package/src/core/embed/api.js +0 -178
- package/src/core/embed/controller.js +0 -331
- package/src/core/models/composition.coffee +0 -178
- package/src/core/models/content.coffee +0 -79
- package/src/core/models/skin.coffee +0 -91
- package/src/core/models/user.coffee +0 -6
- package/src/core/models/widget.coffee +0 -88
- package/src/core/router/index.coffee +0 -44
- package/src/core/services/container/index.js +0 -18
- package/src/core/services/container/instance.js +0 -3
- package/src/core/services/content.js +0 -80
- package/src/core/services/instagram.coffee +0 -47
- package/src/core/services/mixin/events.js +0 -17
- package/src/core/services/service.js +0 -1
- package/src/core/services/sounds.js +0 -81
- package/src/core/services/uploads.js +0 -299
- package/src/core/utils/popup.coffee +0 -67
- package/src/core/utils/should-show.coffee +0 -12
- package/src/core/views/audio-details.pug +0 -9
- package/src/core/views/audio.pug +0 -7
- package/src/core/views/browser.pug +0 -4
- package/src/core/views/color.pug +0 -8
- package/src/core/views/date-time/calendar.pug +0 -3
- package/src/core/views/date-time/clock.pug +0 -12
- package/src/core/views/date-time/grid.pug +0 -6
- package/src/core/views/date-time/input.pug +0 -4
- package/src/core/views/date-time/table.pug +0 -6
- package/src/core/views/dropdown.pug +0 -9
- package/src/core/views/font/font-item.pug +0 -3
- package/src/core/views/font/fonts-list.pug +0 -7
- package/src/core/views/font/fonts-popup.pug +0 -5
- package/src/core/views/font/index.pug +0 -7
- package/src/core/views/image-details.pug +0 -6
- package/src/core/views/image.pug +0 -5
- package/src/core/views/input-layout.pug +0 -15
- package/src/core/views/order-items.pug +0 -7
- package/src/core/views/order-picker.pug +0 -7
- package/src/core/views/pixelpanel.pug +0 -69
- package/src/core/views/position.pug +0 -10
- package/src/core/views/range.pug +0 -9
- package/src/core/views/scale.pug +0 -7
- package/src/core/views/slider.pug +0 -6
- package/src/core/views/stepper.pug +0 -6
- package/src/core/views/text.pug +0 -4
- package/src/core/views/textarea.pug +0 -8
- package/src/core/views/toggle.pug +0 -5
- package/src/core/views/video-details.pug +0 -7
- package/src/core/views/video.pug +0 -4
- package/src/core/widget/index.coffee +0 -66
- package/src/editor/content/browser/dropzone.html +0 -268
- package/src/editor/content/browser/file.html +0 -124
- package/src/editor/content/browser/scroll-pane.html +0 -32
- package/src/editor/content/browser/service.html +0 -53
- package/src/editor/content/browser/upload.coffee +0 -44
- package/src/editor/content/browser/upload.html +0 -439
- package/src/editor/content/index.coffee +0 -294
- package/src/editor/content/input/field.coffee +0 -45
- package/src/editor/content/input/index.coffee +0 -115
- package/src/editor/content/service/base/photoitem.coffee +0 -49
- package/src/editor/content/service/cache.coffee +0 -20
- package/src/editor/content/service/default.coffee +0 -59
- package/src/editor/content/service/dropbox.coffee +0 -71
- package/src/editor/content/service/facebook.coffee +0 -143
- package/src/editor/content/service/flickr.coffee +0 -85
- package/src/editor/content/service/google-drive-sdk.coffee +0 -18
- package/src/editor/content/service/google-drive.coffee +0 -144
- package/src/editor/content/service/instagram-social.coffee +0 -84
- package/src/editor/content/service/instagram.coffee +0 -168
- package/src/editor/content/service/share-popup.coffee +0 -15
- package/src/editor/content/service/soundcloud.coffee +0 -163
- package/src/editor/content/tab.coffee +0 -27
- package/src/editor/details/bulk-editor/attributes-panel.coffee +0 -11
- package/src/editor/details/bulk-editor/index.coffee +0 -86
- package/src/editor/details/index.coffee +0 -156
- package/src/editor/details/item/attributes.coffee +0 -45
- package/src/editor/details/item/index.coffee +0 -82
- package/src/editor/editor.coffee +0 -274
- package/src/editor/footer/breadcrumb.coffee +0 -17
- package/src/editor/footer/index.coffee +0 -36
- package/src/editor/index.coffee +0 -79
- package/src/editor/listeners/embed-listener.coffee +0 -143
- package/src/editor/login-popup.coffee +0 -29
- package/src/editor/notification-controller.coffee +0 -35
- package/src/editor/popup.coffee +0 -68
- package/src/editor/remote-preview.coffee +0 -68
- package/src/editor/save/index.coffee +0 -62
- package/src/editor/skin/delete.coffee +0 -33
- package/src/editor/skin/editor/index.coffee +0 -188
- package/src/editor/skin/editor/panel.coffee +0 -37
- package/src/editor/skin/index.coffee +0 -126
- package/src/editor/skin/save.coffee +0 -58
- package/src/editor/skin/selector/index.coffee +0 -59
- package/src/editor/skin/selector/item.coffee +0 -123
- package/src/editor/skin/selector/list.coffee +0 -97
- package/src/editor/views/embed.pug +0 -10
- package/src/editor/views/loginbutton.pug +0 -8
- package/src/editor/views/popup.pug +0 -17
- package/src/editor/views/presets.pug +0 -8
- package/src/editor/views/presetslist-header.pug +0 -8
- package/src/editor/views/skinitem.pug +0 -13
- package/src/modules/control.js +0 -3
- package/src/modules/controls.js +0 -29
- package/src/modules/core.js +0 -19
- package/src/modules/editor.js +0 -80
- package/test/config.js +0 -3
- package/test/core/models/skin-spec.js +0 -209
- package/webpack.config.js +0 -46
- package/webpack.config.prod.js +0 -9
- /package/{src/core/views/date-time/popup.pug → dist/utils/passiveEvents.d.ts} +0 -0
package/lib/dev/control.js
DELETED
|
@@ -1,845 +0,0 @@
|
|
|
1
|
-
/******/ (function(modules) { // webpackBootstrap
|
|
2
|
-
/******/ // The module cache
|
|
3
|
-
/******/ var installedModules = {};
|
|
4
|
-
/******/
|
|
5
|
-
/******/ // The require function
|
|
6
|
-
/******/ function __webpack_require__(moduleId) {
|
|
7
|
-
/******/
|
|
8
|
-
/******/ // Check if module is in cache
|
|
9
|
-
/******/ if(installedModules[moduleId]) {
|
|
10
|
-
/******/ return installedModules[moduleId].exports;
|
|
11
|
-
/******/ }
|
|
12
|
-
/******/ // Create a new module (and put it into the cache)
|
|
13
|
-
/******/ var module = installedModules[moduleId] = {
|
|
14
|
-
/******/ i: moduleId,
|
|
15
|
-
/******/ l: false,
|
|
16
|
-
/******/ exports: {}
|
|
17
|
-
/******/ };
|
|
18
|
-
/******/
|
|
19
|
-
/******/ // Execute the module function
|
|
20
|
-
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
21
|
-
/******/
|
|
22
|
-
/******/ // Flag the module as loaded
|
|
23
|
-
/******/ module.l = true;
|
|
24
|
-
/******/
|
|
25
|
-
/******/ // Return the exports of the module
|
|
26
|
-
/******/ return module.exports;
|
|
27
|
-
/******/ }
|
|
28
|
-
/******/
|
|
29
|
-
/******/
|
|
30
|
-
/******/ // expose the modules object (__webpack_modules__)
|
|
31
|
-
/******/ __webpack_require__.m = modules;
|
|
32
|
-
/******/
|
|
33
|
-
/******/ // expose the module cache
|
|
34
|
-
/******/ __webpack_require__.c = installedModules;
|
|
35
|
-
/******/
|
|
36
|
-
/******/ // define getter function for harmony exports
|
|
37
|
-
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
38
|
-
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
39
|
-
/******/ Object.defineProperty(exports, name, {
|
|
40
|
-
/******/ configurable: false,
|
|
41
|
-
/******/ enumerable: true,
|
|
42
|
-
/******/ get: getter
|
|
43
|
-
/******/ });
|
|
44
|
-
/******/ }
|
|
45
|
-
/******/ };
|
|
46
|
-
/******/
|
|
47
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
48
|
-
/******/ __webpack_require__.n = function(module) {
|
|
49
|
-
/******/ var getter = module && module.__esModule ?
|
|
50
|
-
/******/ function getDefault() { return module['default']; } :
|
|
51
|
-
/******/ function getModuleExports() { return module; };
|
|
52
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
53
|
-
/******/ return getter;
|
|
54
|
-
/******/ };
|
|
55
|
-
/******/
|
|
56
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
57
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
58
|
-
/******/
|
|
59
|
-
/******/ // __webpack_public_path__
|
|
60
|
-
/******/ __webpack_require__.p = "";
|
|
61
|
-
/******/
|
|
62
|
-
/******/ // Load entry module and return exports
|
|
63
|
-
/******/ return __webpack_require__(__webpack_require__.s = 199);
|
|
64
|
-
/******/ })
|
|
65
|
-
/************************************************************************/
|
|
66
|
-
/******/ ({
|
|
67
|
-
|
|
68
|
-
/***/ 199:
|
|
69
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
70
|
-
|
|
71
|
-
"use strict";
|
|
72
|
-
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
|
|
73
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_Core_embed_controller__ = __webpack_require__(200);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
window.EmbedController = __WEBPACK_IMPORTED_MODULE_0_Core_embed_controller__["a" /* default */];
|
|
77
|
-
|
|
78
|
-
/***/ }),
|
|
79
|
-
|
|
80
|
-
/***/ 200:
|
|
81
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
82
|
-
|
|
83
|
-
"use strict";
|
|
84
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__api__ = __webpack_require__(201);
|
|
85
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_pyrsmk_toast__ = __webpack_require__(202);
|
|
86
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_pyrsmk_toast___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_pyrsmk_toast__);
|
|
87
|
-
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
88
|
-
|
|
89
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
90
|
-
|
|
91
|
-
var Widget = void 0,
|
|
92
|
-
Composition = void 0,
|
|
93
|
-
Content = void 0,
|
|
94
|
-
Skin = void 0;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
var send = function send(message) {
|
|
99
|
-
(window.opener || window.parent).postMessage(JSON.stringify(message), '*');
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
var messenger = {
|
|
103
|
-
load: function load() {
|
|
104
|
-
return send({ t: 'u', d: window.name });
|
|
105
|
-
},
|
|
106
|
-
apiReady: function apiReady() {
|
|
107
|
-
return send({ t: 'd', d: window.name });
|
|
108
|
-
},
|
|
109
|
-
notify: function notify(ev, data) {
|
|
110
|
-
return send({ t: 'ce', id: window.name, d: data, e: ev.type || ev });
|
|
111
|
-
},
|
|
112
|
-
replyPublicApiCall: function replyPublicApiCall(id, err, data) {
|
|
113
|
-
return send({ t: 'pr', id: id, err: err, d: data });
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
var _newComposition = function _newComposition(widget, demo) {
|
|
118
|
-
var id = 'c-0';
|
|
119
|
-
return {
|
|
120
|
-
id: id,
|
|
121
|
-
widget_id: widget.id,
|
|
122
|
-
width: widget.width,
|
|
123
|
-
height: widget.height,
|
|
124
|
-
skin_id: widget.skins[0].id,
|
|
125
|
-
content: !demo ? [] : widget.content[0].content.map(function (c, i) {
|
|
126
|
-
c.id = i;
|
|
127
|
-
c.composition_id = id;
|
|
128
|
-
c._isDemoContent = true;
|
|
129
|
-
return c;
|
|
130
|
-
}),
|
|
131
|
-
metadata: {
|
|
132
|
-
client: (window.location.search.match(/client_id=([^\&$]+)/) || [])[1]
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
// TODO relay mouse and keyboard events - maybe not?
|
|
138
|
-
|
|
139
|
-
var EmbedController = function () {
|
|
140
|
-
function EmbedController(el, _ref) {
|
|
141
|
-
var loader = _ref.loader,
|
|
142
|
-
widget = _ref.widget,
|
|
143
|
-
user = _ref.user,
|
|
144
|
-
composition = _ref.composition,
|
|
145
|
-
skin = _ref.skin,
|
|
146
|
-
js = _ref.js,
|
|
147
|
-
css = _ref.css,
|
|
148
|
-
data = _ref.data,
|
|
149
|
-
_ref$demo = _ref.demo,
|
|
150
|
-
demo = _ref$demo === undefined ? true : _ref$demo,
|
|
151
|
-
_ref$bootstrapped = _ref.bootstrapped,
|
|
152
|
-
bootstrapped = _ref$bootstrapped === undefined ? false : _ref$bootstrapped;
|
|
153
|
-
|
|
154
|
-
_classCallCheck(this, EmbedController);
|
|
155
|
-
|
|
156
|
-
// widget element
|
|
157
|
-
this.el = el;
|
|
158
|
-
|
|
159
|
-
// loader
|
|
160
|
-
this.loader = loader;
|
|
161
|
-
|
|
162
|
-
// read if it's a bootstrapped widget
|
|
163
|
-
this.bootstrapped = bootstrapped;
|
|
164
|
-
|
|
165
|
-
// read widget data
|
|
166
|
-
if (!widget && !data) throw new Error('You must supply either `widget` or `data`');
|
|
167
|
-
this.widget = widget;
|
|
168
|
-
this.dataURL = data;
|
|
169
|
-
this.user = user;
|
|
170
|
-
this.composition = composition;
|
|
171
|
-
this.skin = skin;
|
|
172
|
-
this.loadDemo = demo;
|
|
173
|
-
// widget js & css
|
|
174
|
-
this.js = 'https://widgetic.com' + js;
|
|
175
|
-
this.css = 'https://widgetic.com' + css;
|
|
176
|
-
|
|
177
|
-
// start loading widget
|
|
178
|
-
this.dataLoaded = Widgetic.Aye.defer();
|
|
179
|
-
this.dataLoaded.promise.then(this._showBranding.bind(this));
|
|
180
|
-
// init widget
|
|
181
|
-
this._init();
|
|
182
|
-
|
|
183
|
-
// init editor
|
|
184
|
-
this._initEditorApi();
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
_createClass(EmbedController, [{
|
|
188
|
-
key: '_init',
|
|
189
|
-
value: function _init() {
|
|
190
|
-
var _this = this;
|
|
191
|
-
|
|
192
|
-
var wait = function wait() {};
|
|
193
|
-
|
|
194
|
-
// Bootstrapped widgets(using spine - coffescript widgets)
|
|
195
|
-
if (!this.bootstrapped) {
|
|
196
|
-
__WEBPACK_IMPORTED_MODULE_1_pyrsmk_toast___default.a(
|
|
197
|
-
// load shims, css and libraries in paralel
|
|
198
|
-
'https://files.widgetic.com/file/widgetic-uploads/assets/js/core-js.shim.min.js', 'https://widgetic.com/bundles/blogvioapp/js/editor/core.vendor.js', 'https://widgetic.com/bundles/blogvioapp/js/require.js', 'https://widgetic.com/bundles/blogvioapp/css/embed.css', this.css, wait,
|
|
199
|
-
// load spine next, depends on require.js
|
|
200
|
-
'https://widgetic.com/bundles/blogvioapp/js/spine.js', wait,
|
|
201
|
-
// load widgetic code, depends on spine
|
|
202
|
-
'https://widgetic.com/bundles/blogvioapp/js/editor/core.js', this._loadModels.bind(this), this._loadData.bind(this), this.js,
|
|
203
|
-
// load the widget, depends on hydrated models
|
|
204
|
-
function () {
|
|
205
|
-
return _this.dataLoaded.promise.then(_this._loadWidget.bind(_this)).fail(function (e) {
|
|
206
|
-
return console.error(e);
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
// Angular & Svelte widgets
|
|
211
|
-
else {
|
|
212
|
-
this._loadModels();
|
|
213
|
-
this._loadData();
|
|
214
|
-
this._loadWidget();
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}, {
|
|
218
|
-
key: '_loadModels',
|
|
219
|
-
value: function _loadModels() {
|
|
220
|
-
Widget = window.require('core/models/widget');
|
|
221
|
-
Composition = window.require('core/models/composition');
|
|
222
|
-
Content = window.require('core/models/content');
|
|
223
|
-
Skin = window.require('core/models/skin');
|
|
224
|
-
}
|
|
225
|
-
}, {
|
|
226
|
-
key: '_loadData',
|
|
227
|
-
value: function _loadData() {
|
|
228
|
-
var _this2 = this;
|
|
229
|
-
|
|
230
|
-
// if the data is local, proceed to hydrating the models
|
|
231
|
-
if (!this.dataURL) return this._hydrateModels();
|
|
232
|
-
|
|
233
|
-
Widgetic.uxhr(this.dataURL, null, {
|
|
234
|
-
success: function success(response) {
|
|
235
|
-
var data = void 0;
|
|
236
|
-
try {
|
|
237
|
-
data = JSON.parse(response);
|
|
238
|
-
} catch (e) {
|
|
239
|
-
return console.error('Could not parse response', response);
|
|
240
|
-
}
|
|
241
|
-
_this2.skin = data.skin;
|
|
242
|
-
_this2.composition = data.composition;
|
|
243
|
-
_this2.widget = data.widget;
|
|
244
|
-
_this2.user = data.user;
|
|
245
|
-
_this2._hydrateModels();
|
|
246
|
-
},
|
|
247
|
-
error: function error(_error) {
|
|
248
|
-
return console.error('The widget data could not be loaded', _error);
|
|
249
|
-
}
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
}, {
|
|
253
|
-
key: '_hydrateModels',
|
|
254
|
-
value: function _hydrateModels() {
|
|
255
|
-
this.composition = this.composition || _newComposition(this.widget, this.loadDemo);
|
|
256
|
-
// console.log("Embed created composition:", this.composition);
|
|
257
|
-
|
|
258
|
-
// load composition
|
|
259
|
-
Widget.refresh(this.widget);
|
|
260
|
-
Composition.refresh(this.composition);
|
|
261
|
-
|
|
262
|
-
// load skin
|
|
263
|
-
Skin.refresh(this.skin || this.widget.skins);
|
|
264
|
-
this._skin = Skin.first();
|
|
265
|
-
|
|
266
|
-
// load content
|
|
267
|
-
Content.refresh(this.composition.content);
|
|
268
|
-
|
|
269
|
-
this.dataLoaded.resolve();
|
|
270
|
-
|
|
271
|
-
// init embed api
|
|
272
|
-
this._initApi();
|
|
273
|
-
}
|
|
274
|
-
}, {
|
|
275
|
-
key: '_initApi',
|
|
276
|
-
value: function _initApi() {
|
|
277
|
-
var api = new __WEBPACK_IMPORTED_MODULE_0__api__["a" /* default */]();
|
|
278
|
-
Widgetic.Event.on(window, 'message', api.receiver);
|
|
279
|
-
|
|
280
|
-
api.skinSet.listen(this._onSkinSet.bind(this));
|
|
281
|
-
api.contentCleared.listen(this._onContentCleared.bind(this));
|
|
282
|
-
api.contentAdded.listen(this._onContentAdded.bind(this));
|
|
283
|
-
api.publicApiCalled.listen(this._onPublicApiCalled.bind(this));
|
|
284
|
-
|
|
285
|
-
messenger.apiReady();
|
|
286
|
-
}
|
|
287
|
-
}, {
|
|
288
|
-
key: '_initEditorApi',
|
|
289
|
-
value: function _initEditorApi() {
|
|
290
|
-
var _this3 = this;
|
|
291
|
-
|
|
292
|
-
window.getPreview = function () {
|
|
293
|
-
return {
|
|
294
|
-
widget: function widget() {
|
|
295
|
-
return _this3.widgetController;
|
|
296
|
-
},
|
|
297
|
-
window: window
|
|
298
|
-
};
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
window.getData = function () {
|
|
302
|
-
return {
|
|
303
|
-
widget: _this3.widget,
|
|
304
|
-
composition: $.extend({}, _this3.composition, {
|
|
305
|
-
widget_id: _this3.widget.id,
|
|
306
|
-
width: (_this3.composition || _this3.widget).width,
|
|
307
|
-
height: (_this3.composition || _this3.widget).height,
|
|
308
|
-
content: _this3.composition.content,
|
|
309
|
-
skin_id: _this3.composition.skin_id
|
|
310
|
-
}),
|
|
311
|
-
skin: _this3.skin || _this3.widget.skins[0],
|
|
312
|
-
user: _this3.user
|
|
313
|
-
};
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
// used by weebly editor
|
|
317
|
-
// TODO remove
|
|
318
|
-
// @deprecated
|
|
319
|
-
window.getCurrentData = function () {
|
|
320
|
-
return { widget: _this3.widgetController };
|
|
321
|
-
};
|
|
322
|
-
|
|
323
|
-
// used by weebly editor
|
|
324
|
-
// TODO remove
|
|
325
|
-
var access_token = (window.location.search.match(/access_token=([^\&$]+)/) || [])[1];
|
|
326
|
-
if (access_token) Widgetic.auth.token(access_token);
|
|
327
|
-
}
|
|
328
|
-
}, {
|
|
329
|
-
key: '_loadWidget',
|
|
330
|
-
value: function _loadWidget() {
|
|
331
|
-
var _this4 = this;
|
|
332
|
-
|
|
333
|
-
var uri = Widgetic.parse(window.location.href);
|
|
334
|
-
|
|
335
|
-
var mode = uri.queryKey.edit_mode !== undefined ? Widgetic.UI.Composition.EDIT_MODE : Widgetic.UI.Composition.EMBED_MODE;
|
|
336
|
-
|
|
337
|
-
// create widget metadata
|
|
338
|
-
var metadata = {
|
|
339
|
-
mode: mode,
|
|
340
|
-
embedOptions: {
|
|
341
|
-
resize: uri.queryKey.resize,
|
|
342
|
-
autoscale: uri.queryKey.autoscale,
|
|
343
|
-
adaptive: uri.queryKey.adaptive
|
|
344
|
-
},
|
|
345
|
-
widget: this.widget,
|
|
346
|
-
composition: {
|
|
347
|
-
id: this.composition.id
|
|
348
|
-
},
|
|
349
|
-
referrer: document.referrer
|
|
350
|
-
};
|
|
351
|
-
|
|
352
|
-
// get widget main component(coffee, angular, svelte 1, svelte 2, svelte 3)
|
|
353
|
-
var _widget = window.require(this.widget.module);
|
|
354
|
-
// console.log("Embed controller load:", _widget)
|
|
355
|
-
|
|
356
|
-
// create an instance of the widget's main component with the skin and content
|
|
357
|
-
this.widgetController = new _widget({ metadata: metadata }, this._skin, Content.all());
|
|
358
|
-
// console.log("Embed controller load:", this.widgetController)
|
|
359
|
-
|
|
360
|
-
// remove loader
|
|
361
|
-
this.loader && this.loader.parentNode.removeChild(this.loader);
|
|
362
|
-
|
|
363
|
-
// add the widget container
|
|
364
|
-
// TODO replace jquery use with native DOM
|
|
365
|
-
var widgetContainer = $('<div class="widget-container" style="width:1px; min-width: 100%; height: 100%">');
|
|
366
|
-
$(this.el).append(widgetContainer);
|
|
367
|
-
// TODO remove when all widgets are updated to svelte
|
|
368
|
-
widgetContainer.append(this.widgetController.el);
|
|
369
|
-
this.widgetController.added();
|
|
370
|
-
|
|
371
|
-
// add messenger listeners for widget's public events
|
|
372
|
-
this.widgetController.getPublicEvents && this.widgetController.getPublicEvents().forEach(function (event) {
|
|
373
|
-
_this4.widgetController.on(event, function (data) {
|
|
374
|
-
return messenger.notify(event, data);
|
|
375
|
-
});
|
|
376
|
-
});
|
|
377
|
-
messenger.load();
|
|
378
|
-
}
|
|
379
|
-
}, {
|
|
380
|
-
key: '_showBranding',
|
|
381
|
-
value: function _showBranding() {
|
|
382
|
-
// read branding value
|
|
383
|
-
var brandingValue = new URLSearchParams(window.location.search).get('branding');
|
|
384
|
-
// console.log("read brandingValue:", brandingValue);
|
|
385
|
-
if (!brandingValue) brandingValue = 'off';
|
|
386
|
-
|
|
387
|
-
// check if user is premium
|
|
388
|
-
var isPremium = this.user && this.user.premium ? this.user.premium : false;
|
|
389
|
-
|
|
390
|
-
// establish branding
|
|
391
|
-
if (!isPremium) brandingValue = "on";
|
|
392
|
-
// console.log("final brandingValue:", this.user, isPremium, brandingValue);
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
// show branding if user is free or flag is on
|
|
396
|
-
if (brandingValue != "off") window.initBranding();
|
|
397
|
-
}
|
|
398
|
-
}, {
|
|
399
|
-
key: '_onSkinSet',
|
|
400
|
-
value: function _onSkinSet(skin) {
|
|
401
|
-
this._skin = skin;
|
|
402
|
-
if (!this.widgetController) return;
|
|
403
|
-
this.widgetController.setSkin(this._skin);
|
|
404
|
-
}
|
|
405
|
-
}, {
|
|
406
|
-
key: '_onContentCleared',
|
|
407
|
-
value: function _onContentCleared() {
|
|
408
|
-
if (!this.widgetController) return;
|
|
409
|
-
this.widgetController.clearContent();
|
|
410
|
-
}
|
|
411
|
-
}, {
|
|
412
|
-
key: '_onContentAdded',
|
|
413
|
-
value: function _onContentAdded(item) {
|
|
414
|
-
if (!this.widgetController) return;
|
|
415
|
-
this.widgetController.addContent(item);
|
|
416
|
-
}
|
|
417
|
-
}, {
|
|
418
|
-
key: '_onPublicApiCalled',
|
|
419
|
-
value: function _onPublicApiCalled(data) {
|
|
420
|
-
if (!this.widgetController) throw new Error('The widget is not ready yet.');
|
|
421
|
-
if (!this.widgetController.getPublicMethods) throw new Error('The widget does not support public api calls.');
|
|
422
|
-
|
|
423
|
-
var publicMethods = this.widgetController.getPublicMethods();
|
|
424
|
-
var widget = this.widgetController.widget;
|
|
425
|
-
|
|
426
|
-
if (publicMethods.indexOf(data.method) === -1 || !(data.method in widget)) throw new Error('The widget does not support method `' + data.method + '`.');
|
|
427
|
-
|
|
428
|
-
try {
|
|
429
|
-
var result = widget[data.method].apply(widget, data.args);
|
|
430
|
-
messenger.replyPublicApiCall(data.id, null, result);
|
|
431
|
-
} catch (e) {
|
|
432
|
-
messenger.replyPublicApiCall(data.id, {
|
|
433
|
-
message: e.message,
|
|
434
|
-
stack: e.stack
|
|
435
|
-
});
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
}]);
|
|
439
|
-
|
|
440
|
-
return EmbedController;
|
|
441
|
-
}();
|
|
442
|
-
|
|
443
|
-
/* harmony default export */ __webpack_exports__["a"] = (EmbedController);
|
|
444
|
-
|
|
445
|
-
/***/ }),
|
|
446
|
-
|
|
447
|
-
/***/ 201:
|
|
448
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
449
|
-
|
|
450
|
-
"use strict";
|
|
451
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_geval_event__ = __webpack_require__(56);
|
|
452
|
-
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_geval_event___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_geval_event__);
|
|
453
|
-
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
454
|
-
|
|
455
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
var Skin = void 0;
|
|
460
|
-
var Composition = void 0;
|
|
461
|
-
var Content = void 0;
|
|
462
|
-
|
|
463
|
-
var EmbedApi = function () {
|
|
464
|
-
function EmbedApi() {
|
|
465
|
-
_classCallCheck(this, EmbedApi);
|
|
466
|
-
|
|
467
|
-
Skin = window.require('core/models/skin');
|
|
468
|
-
Content = window.require('core/models/content');
|
|
469
|
-
Composition = window.require('core/models/composition');
|
|
470
|
-
|
|
471
|
-
this.eventMap = {
|
|
472
|
-
cx: 'clearContent',
|
|
473
|
-
sc: 'setContent',
|
|
474
|
-
ac: 'addContent',
|
|
475
|
-
cc: 'changeContent',
|
|
476
|
-
rc: 'removeContent',
|
|
477
|
-
ss: 'setSkin',
|
|
478
|
-
cs: 'changeSkin',
|
|
479
|
-
asht: 'addSheet',
|
|
480
|
-
acss: 'addCss',
|
|
481
|
-
pa: 'publicApi'
|
|
482
|
-
};
|
|
483
|
-
this.receiver = this.receiver.bind(this);
|
|
484
|
-
|
|
485
|
-
this.skin = Skin.first();
|
|
486
|
-
this.composition = Composition.first();
|
|
487
|
-
|
|
488
|
-
this.skinSet = new __WEBPACK_IMPORTED_MODULE_0_geval_event___default.a();
|
|
489
|
-
this.contentCleared = new __WEBPACK_IMPORTED_MODULE_0_geval_event___default.a();
|
|
490
|
-
this.contentAdded = new __WEBPACK_IMPORTED_MODULE_0_geval_event___default.a();
|
|
491
|
-
this.publicApiCalled = new __WEBPACK_IMPORTED_MODULE_0_geval_event___default.a();
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
_createClass(EmbedApi, [{
|
|
495
|
-
key: 'receiver',
|
|
496
|
-
value: function receiver(event) {
|
|
497
|
-
var data = void 0;
|
|
498
|
-
try {
|
|
499
|
-
data = JSON.parse(event.data);
|
|
500
|
-
} catch (e) {
|
|
501
|
-
return console.warn(e);
|
|
502
|
-
}
|
|
503
|
-
var handler = this.eventMap[data.t];
|
|
504
|
-
|
|
505
|
-
if (!handler || !this[handler]) return;
|
|
506
|
-
|
|
507
|
-
try {
|
|
508
|
-
this[handler](data.d);
|
|
509
|
-
} catch (e) {
|
|
510
|
-
console.error(e);
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
/**
|
|
515
|
-
* Replaces the current skin with the provided one.
|
|
516
|
-
* TODO load defaults for missing props
|
|
517
|
-
*/
|
|
518
|
-
|
|
519
|
-
}, {
|
|
520
|
-
key: 'setSkin',
|
|
521
|
-
value: function setSkin(newSkin) {
|
|
522
|
-
this.skin.unbind();
|
|
523
|
-
this.skin = new Skin(newSkin);
|
|
524
|
-
|
|
525
|
-
this.composition.updateAttribute('skin_id', this.skin.id, { ajax: false });
|
|
526
|
-
this.skinSet.broadcast(this.skin);
|
|
527
|
-
}
|
|
528
|
-
}, {
|
|
529
|
-
key: 'changeSkin',
|
|
530
|
-
value: function changeSkin(skin) {
|
|
531
|
-
// console.log('Embed changeSkin:', skin);
|
|
532
|
-
this.skin.updateAttributes(skin, { attribute: Object.keys(skin)[0], ajax: false });
|
|
533
|
-
}
|
|
534
|
-
}, {
|
|
535
|
-
key: 'clearDemoContent',
|
|
536
|
-
value: function clearDemoContent() {
|
|
537
|
-
return Content.select(function (c) {
|
|
538
|
-
return c._isDemoContent;
|
|
539
|
-
}).forEach(function (c) {
|
|
540
|
-
try {
|
|
541
|
-
c.destroy();
|
|
542
|
-
} catch (error) {}
|
|
543
|
-
});
|
|
544
|
-
}
|
|
545
|
-
}, {
|
|
546
|
-
key: 'clearContent',
|
|
547
|
-
value: function clearContent() {
|
|
548
|
-
Content.destroyAll();
|
|
549
|
-
this.composition.updateAttribute('content', [], { ajax: false });
|
|
550
|
-
this.contentCleared.broadcast();
|
|
551
|
-
}
|
|
552
|
-
}, {
|
|
553
|
-
key: 'getContent',
|
|
554
|
-
value: function getContent() {
|
|
555
|
-
return this.composition.getContent();
|
|
556
|
-
}
|
|
557
|
-
}, {
|
|
558
|
-
key: 'setContent',
|
|
559
|
-
value: function setContent(data) {
|
|
560
|
-
this.clearContent();
|
|
561
|
-
data.map(this.addContent.bind(this));
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
// TODO validate limits
|
|
565
|
-
|
|
566
|
-
}, {
|
|
567
|
-
key: 'addContent',
|
|
568
|
-
value: function addContent(content) {
|
|
569
|
-
this.clearDemoContent();
|
|
570
|
-
|
|
571
|
-
// return if thre's already added a content with the same id
|
|
572
|
-
try {
|
|
573
|
-
Content.find(content.id);
|
|
574
|
-
return console.warn('Content with id ' + content.id + ' already exists, use changeContent if you want to update it!');
|
|
575
|
-
} catch (error) {}
|
|
576
|
-
|
|
577
|
-
if (content.id == null) {
|
|
578
|
-
content.id = Widgetic.GUID();
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
if (!content.composition_id) {
|
|
582
|
-
content.composition_id = this.composition.id;
|
|
583
|
-
}
|
|
584
|
-
var c = new Content(content);
|
|
585
|
-
c.save();
|
|
586
|
-
this.contentAdded.broadcast(c);
|
|
587
|
-
}
|
|
588
|
-
}, {
|
|
589
|
-
key: 'changeContent',
|
|
590
|
-
value: function changeContent(content) {
|
|
591
|
-
var item = content.item ? content.item : content;
|
|
592
|
-
var attribute = content.attribute;
|
|
593
|
-
// console.log('Embed change content item:', item, attribute);
|
|
594
|
-
|
|
595
|
-
// check if item has id
|
|
596
|
-
if (item.id == null) {
|
|
597
|
-
return console.error('Content must have an id:', content);
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
// find the item to be changed
|
|
601
|
-
var c = void 0;
|
|
602
|
-
try {
|
|
603
|
-
c = Content.find(item.id);
|
|
604
|
-
} catch (error) {
|
|
605
|
-
return console.warn('Content with id ' + item.id + ' doesn\'t exists, use addContent if you want to add it!');
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
// update the item
|
|
609
|
-
c.updateAttributes(item, { attribute: attribute, ajax: false });
|
|
610
|
-
}
|
|
611
|
-
}, {
|
|
612
|
-
key: 'removeContent',
|
|
613
|
-
value: function removeContent(content) {
|
|
614
|
-
try {
|
|
615
|
-
return Content.find(content.id).destroy();
|
|
616
|
-
} catch (e) {
|
|
617
|
-
return console.error('Content ' + content.id + ' couldn\'t be removed!', e.stack);
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
}, {
|
|
621
|
-
key: 'addSheet',
|
|
622
|
-
value: function addSheet(href) {
|
|
623
|
-
var link = document.createElement('link');
|
|
624
|
-
link.rel = 'stylesheet';
|
|
625
|
-
link.href = href;
|
|
626
|
-
|
|
627
|
-
document.head.appendChild(link);
|
|
628
|
-
}
|
|
629
|
-
}, {
|
|
630
|
-
key: 'addCss',
|
|
631
|
-
value: function addCss(css) {
|
|
632
|
-
if (!this._customCssNode) {
|
|
633
|
-
this._customCssNode = document.createElement('style');
|
|
634
|
-
document.head.appendChild(this._customCssNode);
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
this._customCssNode.textContent += css;
|
|
638
|
-
}
|
|
639
|
-
}, {
|
|
640
|
-
key: 'publicApi',
|
|
641
|
-
value: function publicApi(data) {
|
|
642
|
-
this.publicApiCalled.broadcast(data);
|
|
643
|
-
}
|
|
644
|
-
}]);
|
|
645
|
-
|
|
646
|
-
return EmbedApi;
|
|
647
|
-
}();
|
|
648
|
-
|
|
649
|
-
/* harmony default export */ __webpack_exports__["a"] = (EmbedApi);
|
|
650
|
-
|
|
651
|
-
/***/ }),
|
|
652
|
-
|
|
653
|
-
/***/ 202:
|
|
654
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
655
|
-
|
|
656
|
-
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function(root, factory) {
|
|
657
|
-
if (true) {
|
|
658
|
-
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
|
|
659
|
-
return (root.toast = factory());
|
|
660
|
-
}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
|
|
661
|
-
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
|
662
|
-
} else if (typeof exports === 'object') {
|
|
663
|
-
module.exports = factory();
|
|
664
|
-
} else {
|
|
665
|
-
root.toast = factory();
|
|
666
|
-
}
|
|
667
|
-
}(this, function() {
|
|
668
|
-
var handled_resources = {};
|
|
669
|
-
|
|
670
|
-
function Toast() {
|
|
671
|
-
var head = document.getElementsByTagName('head')[0],
|
|
672
|
-
|
|
673
|
-
// Load as much resources as we can
|
|
674
|
-
loadResources = function(resources) {
|
|
675
|
-
// Waiting for DOM readiness then load resources
|
|
676
|
-
if(!head) {
|
|
677
|
-
setTimeout(function() {
|
|
678
|
-
loadResources(resources);
|
|
679
|
-
}, 50);
|
|
680
|
-
}
|
|
681
|
-
// Load resources
|
|
682
|
-
else if(resources.length) {
|
|
683
|
-
var i = -1,
|
|
684
|
-
resource,
|
|
685
|
-
callback;
|
|
686
|
-
while(resource = resources[++i]) {
|
|
687
|
-
// Resource
|
|
688
|
-
if(typeof resource == 'string') {
|
|
689
|
-
loadResource(resource);
|
|
690
|
-
}
|
|
691
|
-
// Callback
|
|
692
|
-
else if(typeof resource == 'function') {
|
|
693
|
-
callback = resource;
|
|
694
|
-
break;
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
watchResources(callback, Array.prototype.slice.call(resources, i+1));
|
|
698
|
-
}
|
|
699
|
-
},
|
|
700
|
-
|
|
701
|
-
// Load one resource
|
|
702
|
-
loadResource = function(resource) {
|
|
703
|
-
// Extract resource type
|
|
704
|
-
var implicit_type = /\.(\w+)$/.exec(resource),
|
|
705
|
-
explicit_type = /^\[(\w+)\](.+)/.exec(resource),
|
|
706
|
-
type, node;
|
|
707
|
-
if(explicit_type !== null) {
|
|
708
|
-
type = explicit_type[1];
|
|
709
|
-
resource = explicit_type[2];
|
|
710
|
-
}
|
|
711
|
-
else if(implicit_type !== null) {
|
|
712
|
-
type = implicit_type[1];
|
|
713
|
-
}
|
|
714
|
-
else {
|
|
715
|
-
return;
|
|
716
|
-
}
|
|
717
|
-
// Verify if the resource is not already handled
|
|
718
|
-
if(resource in handled_resources) {
|
|
719
|
-
return;
|
|
720
|
-
}
|
|
721
|
-
// Mark the resource as handled (but not loaded yet)
|
|
722
|
-
handled_resources[resource] = false;
|
|
723
|
-
// Load resource
|
|
724
|
-
switch(type) {
|
|
725
|
-
case 'js':
|
|
726
|
-
// Create SCRIPT element
|
|
727
|
-
node = document.createElement('script');
|
|
728
|
-
node.src = resource;
|
|
729
|
-
node.async = false;
|
|
730
|
-
head.appendChild(node);
|
|
731
|
-
// Watch loading state
|
|
732
|
-
var version = navigator.appVersion.match(/MSIE (\d)/);
|
|
733
|
-
if(version !== null && parseInt(version[1], 10) < 9) {
|
|
734
|
-
// IE<9
|
|
735
|
-
node.onreadystatechange = function() {
|
|
736
|
-
if(/ded|co/.test(this.readyState)) {
|
|
737
|
-
handled_resources[resource] = true;
|
|
738
|
-
node.onreadystatechange = null;
|
|
739
|
-
}
|
|
740
|
-
};
|
|
741
|
-
}
|
|
742
|
-
else {
|
|
743
|
-
// Other browsers
|
|
744
|
-
node.onload = function() {
|
|
745
|
-
handled_resources[resource] = true;
|
|
746
|
-
node.onload = null;
|
|
747
|
-
};
|
|
748
|
-
}
|
|
749
|
-
break;
|
|
750
|
-
case 'css':
|
|
751
|
-
// Create LINK element
|
|
752
|
-
node = document.createElement('link');
|
|
753
|
-
node.rel = 'styleSheet';
|
|
754
|
-
node.href = resource;
|
|
755
|
-
head.appendChild(node);
|
|
756
|
-
// Watch loading state
|
|
757
|
-
watchStylesheet(node, resource);
|
|
758
|
-
break;
|
|
759
|
-
default:
|
|
760
|
-
delete handled_resources[resource];
|
|
761
|
-
return;
|
|
762
|
-
}
|
|
763
|
-
},
|
|
764
|
-
|
|
765
|
-
// Watch if all resources have been loaded
|
|
766
|
-
watchResources = function(callback, resourcesToLoad) {
|
|
767
|
-
for(var resource in handled_resources) {
|
|
768
|
-
if(!handled_resources[resource]) {
|
|
769
|
-
setTimeout(function() {
|
|
770
|
-
watchResources(callback, resourcesToLoad);
|
|
771
|
-
}, 50);
|
|
772
|
-
return;
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
if(typeof callback == 'function') {
|
|
776
|
-
callback();
|
|
777
|
-
}
|
|
778
|
-
loadResources(resourcesToLoad);
|
|
779
|
-
},
|
|
780
|
-
|
|
781
|
-
// Watch if a CSS resource has been loaded
|
|
782
|
-
watchStylesheet = function(node, resource) {
|
|
783
|
-
if(node.sheet || node.styleSheet) {
|
|
784
|
-
handled_resources[resource] = true;
|
|
785
|
-
}
|
|
786
|
-
else {
|
|
787
|
-
setTimeout(function() {
|
|
788
|
-
watchStylesheet(node, resource);
|
|
789
|
-
}, 50);
|
|
790
|
-
}
|
|
791
|
-
};
|
|
792
|
-
|
|
793
|
-
// Load resources
|
|
794
|
-
loadResources(arguments);
|
|
795
|
-
}
|
|
796
|
-
return Toast;
|
|
797
|
-
}));
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
/***/ }),
|
|
801
|
-
|
|
802
|
-
/***/ 56:
|
|
803
|
-
/***/ (function(module, exports) {
|
|
804
|
-
|
|
805
|
-
module.exports = Event
|
|
806
|
-
function Event() {
|
|
807
|
-
var listeners = []
|
|
808
|
-
|
|
809
|
-
return { broadcast: broadcast, listen: event }
|
|
810
|
-
|
|
811
|
-
function broadcast(value) {
|
|
812
|
-
var listenersCopy = listeners.slice()
|
|
813
|
-
for (var i = 0; i < listenersCopy.length; i++) {
|
|
814
|
-
if (!listenersCopy[i].deleted) {
|
|
815
|
-
listenersCopy[i].fn(value)
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
function event(listener) {
|
|
821
|
-
listeners.push(new ListItem(listener))
|
|
822
|
-
|
|
823
|
-
return removeListener
|
|
824
|
-
|
|
825
|
-
function removeListener() {
|
|
826
|
-
for (var i = 0; i < listeners.length; i++) {
|
|
827
|
-
if (listeners[i].fn === listener) {
|
|
828
|
-
listeners[i].deleted = true
|
|
829
|
-
listeners.splice(i, 1)
|
|
830
|
-
break
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
function ListItem(fn) {
|
|
838
|
-
this.fn = fn
|
|
839
|
-
this.deleted = false
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
/***/ })
|
|
844
|
-
|
|
845
|
-
/******/ });
|