|
| 1 | +import type { Sdk, UserConfig } from "@stackla/widget-utils" |
| 2 | + |
| 3 | +declare const sdk: Sdk |
| 4 | + |
| 5 | +const tilesLength = sdk.querySelectorAll(".ugc-tile")?.length ?? 0 |
| 6 | + |
| 7 | +export const config: UserConfig = { |
| 8 | + components: { |
| 9 | + inline_products: { |
| 10 | + swiper_options: { |
| 11 | + allowTouchMove: true |
| 12 | + } |
| 13 | + } |
| 14 | + }, |
| 15 | + style: { |
| 16 | + cta_btn_background: "#000000", |
| 17 | + cta_btn_font_color: "#ffffff", |
| 18 | + cta_btn_font_size: "14", |
| 19 | + // The background color of the widget, uses var(--widget-background) in css-variables.ts |
| 20 | + widget_background: "#ffffff", |
| 21 | + // The background color of the tile, uses var(--text-tile-background) in css-variables.ts |
| 22 | + text_tile_background: "#ffffff", |
| 23 | + // The font color of the tiles, uses var(--text-tile-font-color) in css-variables.ts |
| 24 | + text_tile_font_color: "#000000", |
| 25 | + // The font color of the user handle, uses var(--text-tile-user-handle-font-color) in css-variables.ts |
| 26 | + text_tile_user_handle_font_color: "#636062", |
| 27 | + // The font color of the user name, uses var(--text-tile-user-name-font-color) in css-variables.ts |
| 28 | + text_tile_user_name_font_color: "#ffffff", |
| 29 | + // The font size of the tile contents, uses var(--text-tile-font-size) in css-variables.ts |
| 30 | + text_tile_font_size: "10", |
| 31 | + // The font size of the user handle, uses var(--text-tile-user-handle-font-size) in css-variables.ts |
| 32 | + text_tile_user_handle_font_size: "14", |
| 33 | + // The font size of the user name, uses var(--text-tile-user-name-font-size) in css-variables.ts |
| 34 | + text_tile_user_name_font_size: "14", |
| 35 | + // The margin of the widget, and gap between tiles, uses var(--margin) in css-variables.ts |
| 36 | + margin: "10", |
| 37 | + // The mode of what happens when a tile is clicked, options: [EXPAND], [ORIGINAL_URL] or [CUSTOM] |
| 38 | + // [EXPAND] will expand the tile, [ORIGINAL_URL] will open the original URL associated with a social media image, [CUSTOM] will open a custom URL (not implemented) |
| 39 | + click_through_url: "[EXPAND]", |
| 40 | + // The background image of the icon, uses var(--shopspot-icon) in css-variables.ts, defaults to #000 |
| 41 | + shopspot_icon: "", |
| 42 | + // Whether the tile should automatically pull new tiles or not |
| 43 | + auto_refresh: "true", |
| 44 | + // Whether the widget should only load x amount of tiles per page |
| 45 | + tiles_per_page: "", |
| 46 | + enable_custom_tiles_per_page: true, |
| 47 | + // Whether the widget should load more tiles on scroll, button or static |
| 48 | + load_more_type: "static", |
| 49 | + // The name of the widget |
| 50 | + name: "Blank Canvas", |
| 51 | + // The link color of the tile, uses var(--text-tile-link-color) in css-variables.ts |
| 52 | + text_tile_link_color: "", |
| 53 | + // The minimum amount of tiles required to show the widget |
| 54 | + minimal_tiles: "6", |
| 55 | + // Tile size: small, medium, large |
| 56 | + inline_tile_size: "medium", |
| 57 | + // The border radius of the inline tile, uses var(--inline-tile-border-radius) in css-variables.ts |
| 58 | + inline_tile_border_radius: "5", |
| 59 | + // The border radius of the expanded tile, uses var(--expanded-tile-border-radius) in css-variables.ts |
| 60 | + expanded_tile_border_radius: "5" |
| 61 | + }, |
| 62 | + expandedTile: { |
| 63 | + swiper_options: { |
| 64 | + slidesPerView: 1, |
| 65 | + direction: "vertical", |
| 66 | + loop: tilesLength > 4 |
| 67 | + }, |
| 68 | + // Whether to show the caption of the tile |
| 69 | + show_caption: true, |
| 70 | + // Whether to show the timestamp of the tile |
| 71 | + show_timestamp: true, |
| 72 | + // Whether to show the navigation options of the tile |
| 73 | + show_nav: true, |
| 74 | + // Whether to show the sharing options of the tile |
| 75 | + show_sharing: true, |
| 76 | + // Whether to show the shopspots of the tile |
| 77 | + show_shopspots: true, |
| 78 | + // Whether to show the products of the tile |
| 79 | + show_products: true, |
| 80 | + // Whether to show the tags of the tile |
| 81 | + show_tags: true, |
| 82 | + // Whether to show the votes of the tile |
| 83 | + show_votes: true, |
| 84 | + // Whether to show the cross sellers of the tile |
| 85 | + show_cross_sellers: false, |
| 86 | + // Whether to show the add to cart |
| 87 | + show_add_to_cart: true, |
| 88 | + // Whether to show the carousel grouping |
| 89 | + show_carousel_grouping: true |
| 90 | + }, |
| 91 | + inlineTile: { |
| 92 | + // Whether to show the navigation options of the tile |
| 93 | + show_nav: true, |
| 94 | + // Whether to show the sharing options of the tile |
| 95 | + show_sharing: true, |
| 96 | + // Whether to show the shopspots |
| 97 | + show_shopspots: true, |
| 98 | + // Whether to show the tags of the tile |
| 99 | + show_tags: true, |
| 100 | + // Whether to show the timestamp of the tile |
| 101 | + show_timestamp: true, |
| 102 | + // Whether to show the caption of the tile |
| 103 | + show_caption: true, |
| 104 | + // Whether to show the products of the tile |
| 105 | + show_products: true, |
| 106 | + // Whether to show the add to cart functionality |
| 107 | + show_add_to_cart: true, |
| 108 | + // Whether to auto play the video |
| 109 | + auto_play_video: false, |
| 110 | + // Whether to show the inline tiles |
| 111 | + show_inline_tiles: true, |
| 112 | + // Whether to show the carousel |
| 113 | + show_carousel: false |
| 114 | + } |
| 115 | +} |
0 commit comments