@websolutespa/bom-llm 3.0.0 → 3.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/dist/umd/index.js CHANGED
@@ -42548,7 +42548,7 @@ ${Object.entries(vars).map(([k, v]) => `
42548
42548
  const defaultEndpoint = typeof props.test !== 'undefined' ? 'https://bom-sample-basic-web-git-bom-llm-actarian.vercel.app' : 'https://platform.websolute.ai';
42549
42549
  const endpoint = props.endpoint || defaultEndpoint;
42550
42550
  const layout = {
42551
- labels: getLabels(data.locale, defaultLabels, props.labels),
42551
+ labels: getLabels(data.locale, defaultLabels, props.pluginLabels, props.labels),
42552
42552
  locale: data.locale,
42553
42553
  locales: [{
42554
42554
  id: data.locale,
@@ -42619,9 +42619,10 @@ ${Object.entries(vars).map(([k, v]) => `
42619
42619
  })
42620
42620
  });
42621
42621
  };
42622
- function getLabels(locale, defaultLabels, extendedLabels = []) {
42623
- const labels = [...defaultLabels.filter(x => extendedLabels.findIndex(e => e.id === x.id) === -1), ...extendedLabels];
42624
- return labels.map(x => {
42622
+ function getLabels(locale, defaultLabels, pluginLabels = [], externalLabels = []) {
42623
+ const labels = [...defaultLabels.filter(x => pluginLabels.findIndex(e => e.id === x.id) === -1), ...pluginLabels];
42624
+ const finalLabels = [...labels.filter(x => externalLabels.findIndex(e => e.id === x.id) === -1), ...externalLabels];
42625
+ return finalLabels.map(x => {
42625
42626
  const localizedItem = localizeItem(x, locale, 'en');
42626
42627
  return {
42627
42628
  id: localizedItem.id,
@@ -42758,7 +42759,7 @@ ${Object.entries(vars).map(([k, v]) => `
42758
42759
  return element != null && typeof element[Symbol.iterator] === 'function';
42759
42760
  }
42760
42761
 
42761
- function getInitializer(globalName = 'bomLlm', plugins) {
42762
+ function getInitializer(globalName = 'bomLlm', plugins, pluginLabels) {
42762
42763
  const initializer = props => {
42763
42764
  if (!document) {
42764
42765
  return;
@@ -42768,6 +42769,7 @@ ${Object.entries(vars).map(([k, v]) => `
42768
42769
  return;
42769
42770
  }
42770
42771
  props.plugins = [...(props.plugins || []), ...(plugins || [])];
42772
+ props.pluginLabels = pluginLabels;
42771
42773
  const id = toKebabCase(globalName);
42772
42774
  const node = document.createElement('div');
42773
42775
  node.setAttribute('id', id);