@milaboratories/milaboratories.ui-examples.model 1.3.20 → 1.3.22

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.
@@ -1,16 +1,16 @@
1
1
   WARN  Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @milaboratories/milaboratories.ui-examples.model@1.3.20 build /home/runner/_work/platforma/platforma/etc/blocks/ui-examples/model
3
+ > @milaboratories/milaboratories.ui-examples.model@1.3.22 build /home/runner/_work/platforma/platforma/etc/blocks/ui-examples/model
4
4
  > ts-builder build --target block-model && block-tools build-model
5
5
 
6
6
  Building block-model project...
7
7
  ↳ rollup -c /configs/rollup.block-model.config.js
8
8
  
9
9
  ./src/index.ts → dist, dist...
10
- created dist, dist in 2.8s
10
+ created dist, dist in 3.2s
11
11
  
12
12
  ./src/index.ts → dist...
13
13
  (!) Circular dependency
14
14
  ../../../../sdk/model/dist/components/PFrameForGraphs.js -> ../../../../sdk/model/dist/pframe_utils/columns.js -> ../../../../sdk/model/dist/components/PFrameForGraphs.js
15
- created dist in 3.8s
15
+ created dist in 4.6s
16
16
  Build completed successfully
@@ -1,5 +1,5 @@
1
1
   WARN  Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @milaboratories/milaboratories.ui-examples.model@1.3.20 lint /home/runner/_work/platforma/platforma/etc/blocks/ui-examples/model
3
+ > @milaboratories/milaboratories.ui-examples.model@1.3.22 lint /home/runner/_work/platforma/platforma/etc/blocks/ui-examples/model
4
4
  > eslint .
5
5
 
@@ -1,6 +1,6 @@
1
1
   WARN  Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @milaboratories/milaboratories.ui-examples.model@1.3.20 type-check /home/runner/_work/platforma/platforma/etc/blocks/ui-examples/model
3
+ > @milaboratories/milaboratories.ui-examples.model@1.3.22 type-check /home/runner/_work/platforma/platforma/etc/blocks/ui-examples/model
4
4
  > ts-builder types --target block-model
5
5
 
6
6
  ↳ tsc --noEmit --project ./tsconfig.json --customConditions ,
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @milaboratories/milaboratories.ui-examples.model
2
2
 
3
+ ## 1.3.22
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [38534c5]
8
+ - @platforma-sdk/model@1.51.9
9
+
10
+ ## 1.3.21
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [b0ceca1]
15
+ - @platforma-sdk/model@1.51.6
16
+
3
17
  ## 1.3.20
4
18
 
5
19
  ### Patch Changes
package/dist/bundle.js CHANGED
@@ -6108,6 +6108,30 @@
6108
6108
  }
6109
6109
  return result;
6110
6110
  };
6111
+ const countUniqueLabels = (result) => result === undefined ? 0 : new Set(result.map((c) => c.label)).size;
6112
+ // Post-processing: try removing types one by one (lowest importance first) to minimize the label set
6113
+ // Accepts removal if it doesn't decrease the number of unique labels (cardinality)
6114
+ const minimizeTypeSet = (typeSet) => {
6115
+ const initialResult = calculate(typeSet);
6116
+ if (initialResult === undefined) {
6117
+ return typeSet;
6118
+ }
6119
+ const currentCardinality = countUniqueLabels(initialResult);
6120
+ // Get types sorted by importance ascending (lowest first), excluding forced elements
6121
+ const removableSorted = [...typeSet]
6122
+ .filter((t) => !forceTraceElements?.has(t.split('@')[0])
6123
+ && !(ops.includeNativeLabel && t === LabelTypeFull))
6124
+ .sort((a, b) => (importances.get(a) ?? 0) - (importances.get(b) ?? 0));
6125
+ for (const typeToRemove of removableSorted) {
6126
+ const reducedSet = new Set(typeSet);
6127
+ reducedSet.delete(typeToRemove);
6128
+ const candidateResult = calculate(reducedSet);
6129
+ if (candidateResult !== undefined && countUniqueLabels(candidateResult) >= currentCardinality) {
6130
+ typeSet.delete(typeToRemove);
6131
+ }
6132
+ }
6133
+ return typeSet;
6134
+ };
6111
6135
  if (mainTypes.length === 0) {
6112
6136
  if (secondaryTypes.length !== 0)
6113
6137
  throw new Error('Non-empty secondary types list while main types list is empty.');
@@ -6133,16 +6157,20 @@
6133
6157
  if (additionalType >= 0)
6134
6158
  currentSet.add(mainTypes[additionalType]);
6135
6159
  const candidateResult = calculate(currentSet);
6136
- // checking if labels uniquely separate our records
6137
- if (candidateResult !== undefined && new Set(candidateResult.map((c) => c.label)).size === values.length)
6138
- return candidateResult;
6160
+ if (candidateResult !== undefined && countUniqueLabels(candidateResult) === values.length) {
6161
+ minimizeTypeSet(currentSet);
6162
+ return calculate(currentSet);
6163
+ }
6139
6164
  additionalType++;
6140
6165
  if (additionalType >= mainTypes.length) {
6141
6166
  includedTypes++;
6142
6167
  additionalType = includedTypes;
6143
6168
  }
6144
6169
  }
6145
- return calculate(new Set([...mainTypes, ...secondaryTypes]), true);
6170
+ // Fallback: include all types, then try to minimize
6171
+ const fallbackSet = new Set([...mainTypes, ...secondaryTypes]);
6172
+ minimizeTypeSet(fallbackSet);
6173
+ return calculate(fallbackSet, true);
6146
6174
  }
6147
6175
 
6148
6176
  const PCD_PREFIX = 'PColumnData/';
@@ -7378,7 +7406,7 @@
7378
7406
  }
7379
7407
  }
7380
7408
 
7381
- var version = "1.51.5";
7409
+ var version = "1.51.9";
7382
7410
 
7383
7411
  const PlatformaSDKVersion = version;
7384
7412