@uniformdev/transformer 1.1.14 → 1.1.15

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/index.d.ts CHANGED
@@ -469,6 +469,7 @@ declare class CompositionConverterService {
469
469
  private transformContentReferences;
470
470
  private compareTypes;
471
471
  private truncate;
472
+ private truncateName;
472
473
  }
473
474
  /**
474
475
  * Computes a deterministic UUID v4 from a string seed.
package/dist/index.js CHANGED
@@ -1908,10 +1908,11 @@ var CompositionConverterService = class {
1908
1908
  }
1909
1909
  }
1910
1910
  const entryId = computeGuidHash(`entry${comp._id}`);
1911
+ const entryName = this.truncateName(comp._name ?? comp._id, 60);
1911
1912
  return {
1912
1913
  entry: {
1913
1914
  _id: entryId,
1914
- _name: comp._name ?? comp._id,
1915
+ _name: entryName,
1915
1916
  type: comp.type,
1916
1917
  fields: { ...comp.parameters ?? {} },
1917
1918
  ...extraRootProps
@@ -1920,10 +1921,14 @@ var CompositionConverterService = class {
1920
1921
  };
1921
1922
  }
1922
1923
  generateEntryFromFlattenedInstance(inst) {
1924
+ const entryName = this.truncateName(
1925
+ `${inst.componentType} (from ${inst.compositionName})`,
1926
+ 60
1927
+ );
1923
1928
  return {
1924
1929
  entry: {
1925
1930
  _id: inst.determinisiticId,
1926
- _name: `${inst.componentType} (from ${inst.compositionName})`,
1931
+ _name: entryName,
1927
1932
  type: inst.componentType,
1928
1933
  fields: { ...inst.instance.parameters ?? {} }
1929
1934
  }
@@ -2005,6 +2010,10 @@ var CompositionConverterService = class {
2005
2010
  if (str.length <= maxLength) return str;
2006
2011
  return str.substring(0, maxLength - 3) + "...";
2007
2012
  }
2013
+ truncateName(name, maxLength) {
2014
+ if (name.length <= maxLength) return name;
2015
+ return name.substring(0, maxLength);
2016
+ }
2008
2017
  };
2009
2018
  function computeGuidHash(guidOrSeed) {
2010
2019
  let uuidStr;