@kaltura-sdk/avatars 1.17.1 → 1.18.0

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.
Files changed (2) hide show
  1. package/index.esm.js +25 -5
  2. package/package.json +2 -2
package/index.esm.js CHANGED
@@ -18914,6 +18914,7 @@ const parseStageDirective = text => {
18914
18914
 
18915
18915
  const MIN_STEPS = 2;
18916
18916
  const MAX_STEPS = 12;
18917
+ const MIN_SUB_STEPS = 2;
18917
18918
  const MAX_TOOLTIP_LENGTH = 200;
18918
18919
  // Tooltips are optional decoration: bad entries are dropped, never a reason to reject the bar.
18919
18920
  const parseTooltips = (value, totalSteps) => {
@@ -18921,6 +18922,19 @@ const parseTooltips = (value, totalSteps) => {
18921
18922
  const tooltips = value.slice(0, totalSteps).map(entry => typeof entry === 'string' ? entry.trim().slice(0, MAX_TOOLTIP_LENGTH) : '');
18922
18923
  return tooltips.some(Boolean) ? tooltips : null;
18923
18924
  };
18925
+ // Sub-steps are optional decoration like tooltips: invalid values drop them, never the bar.
18926
+ // The last step has no line to split, so it never carries them.
18927
+ const parseSubSteps = (subSteps, currentSubStep, currentStep, totalSteps) => {
18928
+ if (!Number.isInteger(subSteps) || subSteps < MIN_SUB_STEPS || currentStep >= totalSteps) {
18929
+ return null;
18930
+ }
18931
+ const total = subSteps;
18932
+ const current = Number.isInteger(currentSubStep) ? Math.min(total, Math.max(1, currentSubStep)) : 1;
18933
+ return {
18934
+ subSteps: total,
18935
+ currentSubStep: current
18936
+ };
18937
+ };
18924
18938
  const parseVisible = value => {
18925
18939
  if (typeof value === 'boolean') return value;
18926
18940
  if (typeof value !== 'string') return null;
@@ -18945,7 +18959,9 @@ const parseProgressBar = text => {
18945
18959
  currentStep,
18946
18960
  type,
18947
18961
  variant,
18948
- tooltips
18962
+ tooltips,
18963
+ subSteps,
18964
+ currentSubStep
18949
18965
  } = parsed;
18950
18966
  const isVisible = parseVisible(visible);
18951
18967
  if (isVisible === null) return null;
@@ -18957,7 +18973,8 @@ const parseProgressBar = text => {
18957
18973
  return null;
18958
18974
  }
18959
18975
  const stepTooltips = parseTooltips(tooltips, totalSteps);
18960
- return Object.assign(Object.assign({
18976
+ const parts = parseSubSteps(subSteps, currentSubStep, currentStep, totalSteps);
18977
+ return Object.assign(Object.assign(Object.assign({
18961
18978
  visible: isVisible,
18962
18979
  totalSteps: totalSteps,
18963
18980
  currentStep: currentStep,
@@ -18966,7 +18983,7 @@ const parseProgressBar = text => {
18966
18983
  variant
18967
18984
  } : {}), stepTooltips ? {
18968
18985
  tooltips: stepTooltips
18969
- } : {});
18986
+ } : {}), parts !== null && parts !== void 0 ? parts : {});
18970
18987
  };
18971
18988
 
18972
18989
  var $$b = _export;
@@ -19089,11 +19106,14 @@ const buildProgressBarVariable = progressBar => {
19089
19106
  status: 'hidden'
19090
19107
  });
19091
19108
  }
19092
- return JSON.stringify({
19109
+ return JSON.stringify(Object.assign({
19093
19110
  status: 'shown',
19094
19111
  currentStep: progressBar.currentStep,
19095
19112
  totalSteps: progressBar.totalSteps
19096
- });
19113
+ }, progressBar.subSteps ? {
19114
+ subSteps: progressBar.subSteps,
19115
+ currentSubStep: progressBar.currentSubStep
19116
+ } : {}));
19097
19117
  };
19098
19118
 
19099
19119
  const sendJoinRoom = ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaltura-sdk/avatars",
3
- "version": "1.17.1",
3
+ "version": "1.18.0",
4
4
  "author": "kaltura",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {
@@ -13,7 +13,7 @@
13
13
  "@kaltura-sdk/rtc-core": "^1.26.2",
14
14
  "@local/genie-shared-utils": "^1.0.0",
15
15
  "@unisphere/core": "^1.99.0",
16
- "@unisphere/genie-types": "^1.42.1",
16
+ "@unisphere/genie-types": "^1.43.0",
17
17
  "@unisphere/notifications-core": "^1.25.0",
18
18
  "@unisphere/runtime": "^1.98.0",
19
19
  "@unisphere/runtime-js": "^1.98.0",