@websolutespa/bom-llm 3.0.1 → 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/CHANGELOG.md +6 -0
- package/dist/esm/index.js +7 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/umd/index.js +7 -5
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/esm/index.js
CHANGED
|
@@ -42542,7 +42542,7 @@ const App = ({
|
|
|
42542
42542
|
const defaultEndpoint = typeof props.test !== 'undefined' ? 'https://bom-sample-basic-web-git-bom-llm-actarian.vercel.app' : 'https://platform.websolute.ai';
|
|
42543
42543
|
const endpoint = props.endpoint || defaultEndpoint;
|
|
42544
42544
|
const layout = {
|
|
42545
|
-
labels: getLabels(data.locale, defaultLabels, props.labels),
|
|
42545
|
+
labels: getLabels(data.locale, defaultLabels, props.pluginLabels, props.labels),
|
|
42546
42546
|
locale: data.locale,
|
|
42547
42547
|
locales: [{
|
|
42548
42548
|
id: data.locale,
|
|
@@ -42613,9 +42613,10 @@ const App = ({
|
|
|
42613
42613
|
})
|
|
42614
42614
|
});
|
|
42615
42615
|
};
|
|
42616
|
-
function getLabels(locale, defaultLabels,
|
|
42617
|
-
const labels = [...defaultLabels.filter(x =>
|
|
42618
|
-
|
|
42616
|
+
function getLabels(locale, defaultLabels, pluginLabels = [], externalLabels = []) {
|
|
42617
|
+
const labels = [...defaultLabels.filter(x => pluginLabels.findIndex(e => e.id === x.id) === -1), ...pluginLabels];
|
|
42618
|
+
const finalLabels = [...labels.filter(x => externalLabels.findIndex(e => e.id === x.id) === -1), ...externalLabels];
|
|
42619
|
+
return finalLabels.map(x => {
|
|
42619
42620
|
const localizedItem = localizeItem(x, locale, 'en');
|
|
42620
42621
|
return {
|
|
42621
42622
|
id: localizedItem.id,
|
|
@@ -42752,7 +42753,7 @@ function isIterable(element) {
|
|
|
42752
42753
|
return element != null && typeof element[Symbol.iterator] === 'function';
|
|
42753
42754
|
}
|
|
42754
42755
|
|
|
42755
|
-
function getInitializer(globalName = 'bomLlm', plugins) {
|
|
42756
|
+
function getInitializer(globalName = 'bomLlm', plugins, pluginLabels) {
|
|
42756
42757
|
const initializer = props => {
|
|
42757
42758
|
if (!document) {
|
|
42758
42759
|
return;
|
|
@@ -42762,6 +42763,7 @@ function getInitializer(globalName = 'bomLlm', plugins) {
|
|
|
42762
42763
|
return;
|
|
42763
42764
|
}
|
|
42764
42765
|
props.plugins = [...(props.plugins || []), ...(plugins || [])];
|
|
42766
|
+
props.pluginLabels = pluginLabels;
|
|
42765
42767
|
const id = toKebabCase(globalName);
|
|
42766
42768
|
const node = document.createElement('div');
|
|
42767
42769
|
node.setAttribute('id', id);
|