@kaltura-sdk/avatars 1.17.0 → 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 +36 -5
  2. package/package.json +2 -2
package/index.esm.js CHANGED
@@ -18914,6 +18914,27 @@ const parseStageDirective = text => {
18914
18914
 
18915
18915
  const MIN_STEPS = 2;
18916
18916
  const MAX_STEPS = 12;
18917
+ const MIN_SUB_STEPS = 2;
18918
+ const MAX_TOOLTIP_LENGTH = 200;
18919
+ // Tooltips are optional decoration: bad entries are dropped, never a reason to reject the bar.
18920
+ const parseTooltips = (value, totalSteps) => {
18921
+ if (!Array.isArray(value)) return null;
18922
+ const tooltips = value.slice(0, totalSteps).map(entry => typeof entry === 'string' ? entry.trim().slice(0, MAX_TOOLTIP_LENGTH) : '');
18923
+ return tooltips.some(Boolean) ? tooltips : null;
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
+ };
18917
18938
  const parseVisible = value => {
18918
18939
  if (typeof value === 'boolean') return value;
18919
18940
  if (typeof value !== 'string') return null;
@@ -18937,7 +18958,10 @@ const parseProgressBar = text => {
18937
18958
  totalSteps,
18938
18959
  currentStep,
18939
18960
  type,
18940
- variant
18961
+ variant,
18962
+ tooltips,
18963
+ subSteps,
18964
+ currentSubStep
18941
18965
  } = parsed;
18942
18966
  const isVisible = parseVisible(visible);
18943
18967
  if (isVisible === null) return null;
@@ -18948,14 +18972,18 @@ const parseProgressBar = text => {
18948
18972
  if (!Number.isInteger(currentStep) || currentStep < 1 || currentStep > totalSteps) {
18949
18973
  return null;
18950
18974
  }
18951
- return Object.assign({
18975
+ const stepTooltips = parseTooltips(tooltips, totalSteps);
18976
+ const parts = parseSubSteps(subSteps, currentSubStep, currentStep, totalSteps);
18977
+ return Object.assign(Object.assign(Object.assign({
18952
18978
  visible: isVisible,
18953
18979
  totalSteps: totalSteps,
18954
18980
  currentStep: currentStep,
18955
18981
  type: 'dots'
18956
18982
  }, typeof variant === 'string' && variant ? {
18957
18983
  variant
18958
- } : {});
18984
+ } : {}), stepTooltips ? {
18985
+ tooltips: stepTooltips
18986
+ } : {}), parts !== null && parts !== void 0 ? parts : {});
18959
18987
  };
18960
18988
 
18961
18989
  var $$b = _export;
@@ -19078,11 +19106,14 @@ const buildProgressBarVariable = progressBar => {
19078
19106
  status: 'hidden'
19079
19107
  });
19080
19108
  }
19081
- return JSON.stringify({
19109
+ return JSON.stringify(Object.assign({
19082
19110
  status: 'shown',
19083
19111
  currentStep: progressBar.currentStep,
19084
19112
  totalSteps: progressBar.totalSteps
19085
- });
19113
+ }, progressBar.subSteps ? {
19114
+ subSteps: progressBar.subSteps,
19115
+ currentSubStep: progressBar.currentSubStep
19116
+ } : {}));
19086
19117
  };
19087
19118
 
19088
19119
  const sendJoinRoom = ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaltura-sdk/avatars",
3
- "version": "1.17.0",
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.0",
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",