<commit_before>import Vue from 'vue';
import vueCustomElement from 'vue-custom-element';

Vue.use(vueCustomElement);

export const wrap = <T extends Vue>(tag: string, component: { new (): T }): void => {
  Vue.customElement(tag, new component().$options);
};<commit_msg>[frontend] Add global web component attribute for hue base URL config<commit_after>import axios from 'axios';
import Vue, { ComponentOptions } from 'vue';
import vueCustomElement from 'vue-custom-element';

Vue.use(vueCustomElement);

export interface HueComponentOptions<T extends Vue> extends ComponentOptions<T> {
  hueBaseUrl?: string;
}

export const wrap = <T extends Vue>(tag: string, component: { new (): T }): void => {
  Vue.customElement(tag, new component().$options, {
    connectedCallback() {
      const element = <HTMLElement>this;
      const hueBaseUrl = element.getAttribute('hue-base-url');
      if (hueBaseUrl) {
        axios.defaults.baseURL = hueBaseUrl;
      }
    }
  });
};
{'fraction_non_alphanumeric': 0.13463514902363824, 'fraction_numerical': 0.0, 'mean_word_length': 4.565714285714286, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5932124', 'n_tokens_mistral': 305, 'n_tokens_neox': 302, 'n_words': 81}