@kaltura-sdk/avatars 1.17.0 → 1.17.1

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 +13 -2
  2. package/package.json +2 -2
package/index.esm.js CHANGED
@@ -18914,6 +18914,13 @@ const parseStageDirective = text => {
18914
18914
 
18915
18915
  const MIN_STEPS = 2;
18916
18916
  const MAX_STEPS = 12;
18917
+ const MAX_TOOLTIP_LENGTH = 200;
18918
+ // Tooltips are optional decoration: bad entries are dropped, never a reason to reject the bar.
18919
+ const parseTooltips = (value, totalSteps) => {
18920
+ if (!Array.isArray(value)) return null;
18921
+ const tooltips = value.slice(0, totalSteps).map(entry => typeof entry === 'string' ? entry.trim().slice(0, MAX_TOOLTIP_LENGTH) : '');
18922
+ return tooltips.some(Boolean) ? tooltips : null;
18923
+ };
18917
18924
  const parseVisible = value => {
18918
18925
  if (typeof value === 'boolean') return value;
18919
18926
  if (typeof value !== 'string') return null;
@@ -18937,7 +18944,8 @@ const parseProgressBar = text => {
18937
18944
  totalSteps,
18938
18945
  currentStep,
18939
18946
  type,
18940
- variant
18947
+ variant,
18948
+ tooltips
18941
18949
  } = parsed;
18942
18950
  const isVisible = parseVisible(visible);
18943
18951
  if (isVisible === null) return null;
@@ -18948,13 +18956,16 @@ const parseProgressBar = text => {
18948
18956
  if (!Number.isInteger(currentStep) || currentStep < 1 || currentStep > totalSteps) {
18949
18957
  return null;
18950
18958
  }
18951
- return Object.assign({
18959
+ const stepTooltips = parseTooltips(tooltips, totalSteps);
18960
+ return Object.assign(Object.assign({
18952
18961
  visible: isVisible,
18953
18962
  totalSteps: totalSteps,
18954
18963
  currentStep: currentStep,
18955
18964
  type: 'dots'
18956
18965
  }, typeof variant === 'string' && variant ? {
18957
18966
  variant
18967
+ } : {}), stepTooltips ? {
18968
+ tooltips: stepTooltips
18958
18969
  } : {});
18959
18970
  };
18960
18971
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kaltura-sdk/avatars",
3
- "version": "1.17.0",
3
+ "version": "1.17.1",
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.42.1",
17
17
  "@unisphere/notifications-core": "^1.25.0",
18
18
  "@unisphere/runtime": "^1.98.0",
19
19
  "@unisphere/runtime-js": "^1.98.0",