@itwin/imodel-components-react 4.11.0 → 4.13.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 (98) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/lib/cjs/imodel-components-react/UiIModelComponents.js +2 -4
  3. package/lib/cjs/imodel-components-react/UiIModelComponents.js.map +1 -1
  4. package/lib/cjs/imodel-components-react/UiIModelComponents.json +150 -0
  5. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js +1 -1
  6. package/lib/cjs/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  7. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.d.ts.map +1 -1
  8. package/lib/cjs/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  9. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js +1 -1
  10. package/lib/cjs/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  11. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js +7 -11
  12. package/lib/cjs/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  13. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js +2 -1
  14. package/lib/cjs/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  15. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js +1 -1
  16. package/lib/cjs/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  17. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js +1 -2
  18. package/lib/cjs/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  19. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js +2 -2
  20. package/lib/cjs/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  21. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js +3 -2
  22. package/lib/cjs/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  23. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js +1 -2
  24. package/lib/cjs/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  25. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js +6 -10
  26. package/lib/cjs/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  27. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js +3 -7
  28. package/lib/cjs/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  29. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +1 -2
  30. package/lib/cjs/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  31. package/lib/cjs/imodel-components-react/timeline/PlayButton.js +2 -2
  32. package/lib/cjs/imodel-components-react/timeline/PlayButton.js.map +1 -1
  33. package/lib/cjs/imodel-components-react/timeline/Scrubber.js +1 -1
  34. package/lib/cjs/imodel-components-react/timeline/Scrubber.js.map +1 -1
  35. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js +1 -2
  36. package/lib/cjs/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  37. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js +9 -10
  38. package/lib/cjs/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  39. package/lib/cjs/imodel-components-react/useTranslation.d.ts +4 -7
  40. package/lib/cjs/imodel-components-react/useTranslation.d.ts.map +1 -1
  41. package/lib/cjs/imodel-components-react/useTranslation.js +39 -7
  42. package/lib/cjs/imodel-components-react/useTranslation.js.map +1 -1
  43. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
  44. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js +12 -11
  45. package/lib/cjs/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  46. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.d.ts +12 -0
  47. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.d.ts.map +1 -1
  48. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js +12 -5
  49. package/lib/cjs/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  50. package/lib/esm/imodel-components-react/UiIModelComponents.js +2 -4
  51. package/lib/esm/imodel-components-react/UiIModelComponents.js.map +1 -1
  52. package/lib/esm/imodel-components-react/UiIModelComponents.json +150 -0
  53. package/lib/esm/imodel-components-react/color/ColorPickerButton.js +1 -1
  54. package/lib/esm/imodel-components-react/color/ColorPickerButton.js.map +1 -1
  55. package/lib/esm/imodel-components-react/color/ColorPickerDialog.d.ts.map +1 -1
  56. package/lib/esm/imodel-components-react/color/ColorPickerDialog.js.map +1 -1
  57. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js +1 -1
  58. package/lib/esm/imodel-components-react/inputs/QuantityNumberInput.js.map +1 -1
  59. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js +7 -11
  60. package/lib/esm/imodel-components-react/navigationaids/CubeNavigationAid.js.map +1 -1
  61. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js +2 -1
  62. package/lib/esm/imodel-components-react/navigationaids/DrawingNavigationAid.js.map +1 -1
  63. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js +1 -1
  64. package/lib/esm/imodel-components-react/quantityformat/FormatPanel.js.map +1 -1
  65. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js +1 -2
  66. package/lib/esm/imodel-components-react/quantityformat/FormatPrecision.js.map +1 -1
  67. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js +2 -2
  68. package/lib/esm/imodel-components-react/quantityformat/FormatSample.js.map +1 -1
  69. package/lib/esm/imodel-components-react/quantityformat/FormatType.js +3 -2
  70. package/lib/esm/imodel-components-react/quantityformat/FormatType.js.map +1 -1
  71. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js +1 -2
  72. package/lib/esm/imodel-components-react/quantityformat/FormatUnitLabel.js.map +1 -1
  73. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js +6 -10
  74. package/lib/esm/imodel-components-react/quantityformat/FormatUnits.js.map +1 -1
  75. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js +3 -7
  76. package/lib/esm/imodel-components-react/quantityformat/MiscFormatOptions.js.map +1 -1
  77. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js +1 -2
  78. package/lib/esm/imodel-components-react/quantityformat/misc/ThousandsSeparator.js.map +1 -1
  79. package/lib/esm/imodel-components-react/timeline/PlayButton.js +2 -2
  80. package/lib/esm/imodel-components-react/timeline/PlayButton.js.map +1 -1
  81. package/lib/esm/imodel-components-react/timeline/Scrubber.js +1 -1
  82. package/lib/esm/imodel-components-react/timeline/Scrubber.js.map +1 -1
  83. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js +1 -2
  84. package/lib/esm/imodel-components-react/timeline/SolarTimeline.js.map +1 -1
  85. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js +9 -10
  86. package/lib/esm/imodel-components-react/timeline/TimelineComponent.js.map +1 -1
  87. package/lib/esm/imodel-components-react/useTranslation.d.ts +4 -7
  88. package/lib/esm/imodel-components-react/useTranslation.d.ts.map +1 -1
  89. package/lib/esm/imodel-components-react/useTranslation.js +14 -5
  90. package/lib/esm/imodel-components-react/useTranslation.js.map +1 -1
  91. package/lib/esm/imodel-components-react/viewport/ViewportComponent.d.ts.map +1 -1
  92. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js +12 -11
  93. package/lib/esm/imodel-components-react/viewport/ViewportComponent.js.map +1 -1
  94. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts +12 -0
  95. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.d.ts.map +1 -1
  96. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js +12 -5
  97. package/lib/esm/imodel-components-react/viewport/ViewportComponentEvents.js.map +1 -1
  98. package/package.json +11 -38
@@ -1 +1 @@
1
- {"version":3,"file":"SolarTimeline.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/Solar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AK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,IACzD,kBAAkB,CAAC,SAAS,CAAC,2BAA2B,CAAC,CACrD;wBACP,oBAAC,YAAY,OAAG;wBAChB,oBAAC,eAAe,IAAC,kBAAkB,EAAC,KAAK,GAAG;wBAC5C,oBAAC,YAAY,IACX,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GACvD,CACU,EAEhB,SAAS,EAAC,KAAK,EACf,UAAU,EAAE;wBACV,MAAM;qBACP;oBAED,oBAAC,UAAU,IACT,SAAS,EAAC,YAAY,iBACV,wBAAwB,EACpC,KAAK,EAAE,kBAAkB,CAAC,SAAS,CAAC,wBAAwB,CAAC,EAC7D,OAAO,EAAE,IAAI,CAAC,oBAAoB;wBAElC,oBAAC,WAAW,OAAG,CACJ,CACL,CACL,CACH,CACP,CAAC;IACJ,CAAC;CACF;AAOD,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CACrC,SAAS,cAAc,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,GAAG;IAChD,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IACvC,MAAM,OAAO,GAAG,SAAS,CAAC,wBAAwB,CAAC,CAAC;IAEpD,OAAO,CACL,oBAAC,OAAO,IAAC,OAAO,EAAE,OAAO;QACvB,oBAAC,MAAM,IACL,SAAS,EAAC,YAAY,EACtB,SAAS,EAAE,oBAAC,WAAW,OAAG,iBACd,wBAAwB,EACpC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,GAAG;YAER,8BAAM,SAAS,EAAC,0BAA0B,IAAE,QAAQ,CAAQ,CACrD,CACD,CACX,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Timeline\n */\n\nimport \"./SolarTimeline.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { ColorByName, ColorDef } from \"@itwin/core-common\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { adjustDateToTimezone, UiComponents } from \"@itwin/components-react\";\nimport {\n Button,\n ColorBuilder,\n ColorInputPanel,\n ColorPalette,\n ColorPicker,\n DatePicker,\n Flex,\n Icon,\n IconButton,\n Label,\n Popover,\n Select,\n Slider,\n Text,\n Tooltip,\n VisuallyHidden,\n} from \"@itwin/itwinui-react\";\nimport {\n SvgCalendar,\n SvgLoop,\n SvgMoon,\n SvgSettings,\n SvgSun,\n} from \"@itwin/itwinui-icons-react\";\nimport type { SolarDataProvider } from \"./interfaces\";\nimport { UiIModelComponents } from \"../UiIModelComponents\";\nimport { PlayButton } from \"./PlayButton\";\nimport { useTranslation } from \"../useTranslation\";\n\nconst msPerMinute = 1000 * 60;\nconst msPerHour = msPerMinute * 60;\nconst defaultPlaybackDuration = 40 * 1000;\n\nconst offset = 6;\n\ninterface TimelineProps extends CommonProps {\n dayStartMs: number;\n sunRiseOffsetMs: number;\n sunSetOffsetMs: number;\n currentTimeOffsetMs: number;\n isPlaying: boolean;\n formatTick?: (ms: number) => string;\n formatTime: (ms: number) => string;\n onChange?: (values: ReadonlyArray<number>) => void;\n onUpdate?: (values: ReadonlyArray<number>) => void;\n}\n\nfunction Timeline(props: TimelineProps) {\n const {\n formatTick,\n formatTime,\n onChange,\n onUpdate,\n dayStartMs,\n sunSetOffsetMs,\n sunRiseOffsetMs,\n currentTimeOffsetMs,\n } = props;\n\n const tooltipContent = formatTime(dayStartMs + currentTimeOffsetMs);\n\n const className = classnames(\n \"solar-timeline\",\n props.className,\n formatTick && \"showticks\"\n );\n const sunRiseStr = formatTime(dayStartMs + sunRiseOffsetMs);\n const sunSetStr = formatTime(dayStartMs + sunSetOffsetMs);\n return (\n <div className={className}>\n <VisuallyHidden>Solar timeline</VisuallyHidden>\n <Slider\n thumbProps={() => ({ \"aria-labelledby\": \"timeline\" })}\n step={msPerMinute}\n min={sunRiseOffsetMs}\n max={sunSetOffsetMs}\n minLabel={\n <Tooltip content={sunRiseStr}>\n <Icon>\n <SvgSun />\n </Icon>\n </Tooltip>\n }\n maxLabel={\n <Tooltip content={sunSetStr}>\n <Icon>\n <SvgMoon />\n </Icon>\n </Tooltip>\n }\n onUpdate={onUpdate}\n onChange={onChange}\n values={[currentTimeOffsetMs]}\n tooltipProps={() => ({\n content: tooltipContent,\n })}\n />\n </div>\n );\n}\n\ninterface SolarTimelineComponentProps {\n dataProvider: SolarDataProvider; // provides date, sunrise, sunset in ms, also contains timezone offset from UTC, and updates the display style to current time.\n onPlayPause?: (playing: boolean) => void; // callback triggered when play/pause button is pressed\n duration?: number; // playback duration in milliseconds\n speed?: number;\n}\n\ninterface SolarTimelineComponentState {\n isPlaying: boolean; // timeline is currently playing or paused\n isDateOpened: boolean; // date picker is opened\n isSettingsOpened: boolean; // settings popup is opened\n dayStartMs: number;\n sunRiseOffsetMs: number;\n sunSetOffsetMs: number;\n sunDeltaMs: number;\n currentTimeOffsetMs: number;\n speed: number;\n loop: boolean;\n shadowColor: ColorDef;\n duration: number; // playback duration in milliseconds\n adjustedDuration: number; // playback duration in milliseconds/ speed\n}\n\n/** Solar Timeline\n * @alpha\n */\nexport class SolarTimeline extends React.PureComponent<\n SolarTimelineComponentProps,\n SolarTimelineComponentState\n> {\n private _requestFrame = 0;\n private _unmounted = false;\n private _timeLastCycle = 0;\n private _totalPlayTime = 0;\n\n private readonly _presetColors = [\n ColorDef.create(ColorByName.grey),\n ColorDef.create(ColorByName.lightGrey),\n ColorDef.create(ColorByName.darkGrey),\n ColorDef.create(ColorByName.lightBlue),\n ColorDef.create(ColorByName.lightGreen),\n ColorDef.create(ColorByName.darkGreen),\n ColorDef.create(ColorByName.tan),\n ColorDef.create(ColorByName.darkBrown),\n ];\n\n private readonly _speeds = [1, 2, 3, 4, 5, 6];\n\n constructor(props: SolarTimelineComponentProps) {\n super(props);\n\n const dayStartMs = this.props.dataProvider.dayStartMs;\n const sunRiseOffsetMs =\n this.props.dataProvider.sunrise.getTime() - dayStartMs;\n const sunSetOffsetMs =\n this.props.dataProvider.sunset.getTime() - dayStartMs;\n const sunDeltaMs = sunSetOffsetMs - sunRiseOffsetMs;\n const sunOffsetMs =\n this.props.dataProvider.timeOfDay.getTime() - dayStartMs;\n const currentTimeOffsetMs = this.ensureRange(\n sunOffsetMs,\n sunRiseOffsetMs,\n sunSetOffsetMs\n );\n const shadowColor = this.props.dataProvider.shadowColor;\n const duration = this.props.duration\n ? this.props.duration\n : defaultPlaybackDuration;\n const speed = this.props.speed ? this.props.speed : 2;\n const adjustedDuration = duration / speed;\n this.setPlaybackTimeBySunTime(\n currentTimeOffsetMs,\n sunRiseOffsetMs,\n sunDeltaMs,\n adjustedDuration\n );\n\n this.state = {\n isDateOpened: false,\n isSettingsOpened: false,\n isPlaying: false,\n dayStartMs,\n sunRiseOffsetMs,\n sunSetOffsetMs,\n sunDeltaMs,\n currentTimeOffsetMs,\n speed,\n loop: false,\n shadowColor,\n duration,\n adjustedDuration,\n };\n }\n\n public override componentWillUnmount() {\n window.cancelAnimationFrame(this._requestFrame);\n this._unmounted = true;\n }\n\n // recursively update the animation until we hit the end or the pause button is clicked\n private _updateAnimation = (_timestamp: number) => {\n if (!this.state.isPlaying || this._unmounted) {\n window.cancelAnimationFrame(this._requestFrame);\n return;\n }\n\n const currentTime = new Date().getTime();\n this._totalPlayTime += currentTime - this._timeLastCycle;\n this._timeLastCycle = currentTime;\n let percentComplete = this._totalPlayTime / this.state.adjustedDuration;\n if (percentComplete > 1) percentComplete = 1;\n\n let newPlayingState = true;\n\n // calculate the next sun time base on the percentage playback complete - should be int value as that is step amount for slider\n let nextSunOffset = Math.floor(\n this.state.sunRiseOffsetMs + percentComplete * this.state.sunDeltaMs\n );\n\n if (percentComplete > 0.99) {\n if (!this.state.loop) {\n newPlayingState = false;\n nextSunOffset = this.state.sunSetOffsetMs;\n window.cancelAnimationFrame(this._requestFrame);\n } else {\n nextSunOffset = this.state.sunRiseOffsetMs;\n this._totalPlayTime = 0;\n }\n }\n\n if (this.props.dataProvider.onTimeChanged) {\n const currentSunTime = new Date(this.state.dayStartMs + nextSunOffset);\n this.props.dataProvider.onTimeChanged(currentSunTime);\n }\n\n this.setState(\n { isPlaying: newPlayingState, currentTimeOffsetMs: nextSunOffset },\n () => {\n if (newPlayingState)\n this._requestFrame = window.requestAnimationFrame(\n this._updateAnimation\n );\n }\n );\n };\n\n private _play(sunTimeMs: number) {\n this._timeLastCycle = new Date().getTime();\n\n // start playing\n this.setState({ isPlaying: true, currentTimeOffsetMs: sunTimeMs }, () => {\n this._requestFrame = window.requestAnimationFrame(this._updateAnimation);\n if (this.props.onPlayPause) this.props.onPlayPause(true);\n });\n }\n\n // user clicked pause button\n private _onPause = () => {\n if (!this.state.isPlaying) return;\n\n const currentTime = new Date().getTime();\n this._totalPlayTime += currentTime - this._timeLastCycle;\n\n // stop requesting frames\n window.cancelAnimationFrame(this._requestFrame);\n\n // stop playing\n this.setState({ isPlaying: false });\n\n if (this.props.onPlayPause) this.props.onPlayPause(false);\n };\n\n // user clicked play button\n private _onPlay = () => {\n if (this.state.isPlaying) return;\n\n if (\n this.state.currentTimeOffsetMs >= this.state.sunSetOffsetMs ||\n this.state.currentTimeOffsetMs <= this.state.sunRiseOffsetMs\n ) {\n this._totalPlayTime = 0;\n this._play(this.state.sunRiseOffsetMs);\n } else {\n this._play(this.state.currentTimeOffsetMs);\n }\n };\n\n private setPlaybackTimeBySunTime(\n sunOffsetMs: number,\n sunRiseOffsetMs: number,\n sunDeltaMs: number,\n adjustedDuration?: number\n ) {\n this._totalPlayTime =\n ((sunOffsetMs - sunRiseOffsetMs) / sunDeltaMs) *\n (adjustedDuration ? adjustedDuration : this.state.adjustedDuration);\n }\n\n private _onDateChange = (newDate: Date) => {\n this.props.dataProvider.setDateAndTime(newDate);\n\n const dayStartMs = this.props.dataProvider.dayStartMs;\n const sunRiseOffsetMs =\n this.props.dataProvider.sunrise.getTime() - dayStartMs;\n const sunSetOffsetMs =\n this.props.dataProvider.sunset.getTime() - dayStartMs;\n const sunDeltaMs = sunSetOffsetMs - sunRiseOffsetMs;\n\n /** call dataProvider to update display style */\n // this.props.dataProvider.onTimeChanged?.(this.props.dataProvider.timeOfDay);\n\n // Update time\n const newHours = newDate.getHours();\n const newMinutes = newDate.getMinutes();\n const newSunTime = newHours * msPerHour + newMinutes * msPerMinute;\n const dateWithNewTime = new Date(dayStartMs + newSunTime);\n // this.props.dataProvider.setDateAndTime(dateWithNewTime, true);\n\n const currentTimeOffsetMs = this.ensureRange(\n newSunTime,\n sunRiseOffsetMs,\n sunSetOffsetMs\n );\n this.setPlaybackTimeBySunTime(\n currentTimeOffsetMs,\n sunRiseOffsetMs,\n sunDeltaMs\n );\n this._timeLastCycle = new Date().getTime();\n\n this.props.dataProvider.onTimeChanged?.(dateWithNewTime);\n this.setState({\n dayStartMs,\n sunRiseOffsetMs,\n sunSetOffsetMs,\n currentTimeOffsetMs,\n sunDeltaMs,\n isDateOpened: false,\n });\n };\n\n private _onCloseSettingsPopup = () => {\n this.setState({ isSettingsOpened: false });\n };\n\n private _onOpenSettingsPopup = () => {\n this.setState((prevState) => ({\n isSettingsOpened: !prevState.isSettingsOpened,\n }));\n };\n\n private ensureRange(value: number, min: number, max: number): number {\n return Math.max(Math.min(value, max), min);\n }\n\n private processSunTimeChange(sunTime: number) {\n if (sunTime === this.state.currentTimeOffsetMs) return;\n\n const currentTimeOffsetMs = this.ensureRange(\n sunTime,\n this.state.sunRiseOffsetMs,\n this.state.sunSetOffsetMs\n );\n\n if (this.props.dataProvider.onTimeChanged) {\n const currentSunTime = new Date(\n this.state.dayStartMs + currentTimeOffsetMs\n );\n this.props.dataProvider.onTimeChanged(currentSunTime);\n }\n\n this.setState({ currentTimeOffsetMs }, () => {\n const currentTime = new Date().getTime();\n this._timeLastCycle = currentTime;\n const percentComplete =\n (currentTimeOffsetMs - this.state.sunRiseOffsetMs) /\n this.state.sunDeltaMs;\n this._totalPlayTime = percentComplete * this.state.adjustedDuration;\n });\n }\n\n private _onUpdate = (values: ReadonlyArray<number>) => {\n if (!this.state.isPlaying) this.processSunTimeChange(values[0]);\n };\n\n private _onChange = (values: ReadonlyArray<number>) => {\n if (!this.state.isPlaying) this.processSunTimeChange(values[0]);\n };\n\n private _onSpeedChange = (value: number) => {\n const adjustedDuration = this.state.duration / value;\n this.setState({ speed: value, adjustedDuration });\n };\n\n private _onToggleLoop = () => {\n this.setState((prevState) => ({ loop: !prevState.loop }));\n };\n\n private _formatTime = (ms: number) => {\n const date = new Date(ms);\n const amLabel = UiComponents.translate(\"time.am\");\n const pmLabel = UiComponents.translate(\"time.pm\");\n // convert project date to browser locale date\n const localTime = adjustDateToTimezone(\n date,\n this.props.dataProvider.timeZoneOffset * 60\n );\n let hours = localTime.getHours();\n const minutes = date.getMinutes();\n const abbrev = hours < 12 ? amLabel : hours === 24 ? amLabel : pmLabel;\n hours = hours > 12 ? hours - 12 : hours;\n const hoursStr = hours.toLocaleString(undefined, {\n minimumIntegerDigits: 2,\n });\n const minutesStr = minutes.toLocaleString(undefined, {\n minimumIntegerDigits: 2,\n });\n return `${hoursStr}:${minutesStr} ${abbrev}`;\n };\n\n public getLocalTime(ticks: number): Date {\n const projectTime = new Date(ticks);\n // convert project date to browser locale date\n return adjustDateToTimezone(\n projectTime,\n this.props.dataProvider.timeZoneOffset * 60\n );\n }\n\n public override render() {\n const { dataProvider } = this.props;\n const {\n speed: currentSpeed,\n loop,\n currentTimeOffsetMs,\n sunRiseOffsetMs,\n sunSetOffsetMs,\n } = this.state;\n const months = [\n UiComponents.translate(\"month.short.january\"),\n UiComponents.translate(\"month.short.february\"),\n UiComponents.translate(\"month.short.march\"),\n UiComponents.translate(\"month.short.april\"),\n UiComponents.translate(\"month.short.may\"),\n UiComponents.translate(\"month.short.june\"),\n UiComponents.translate(\"month.short.july\"),\n UiComponents.translate(\"month.short.august\"),\n UiComponents.translate(\"month.short.september\"),\n UiComponents.translate(\"month.short.october\"),\n UiComponents.translate(\"month.short.november\"),\n UiComponents.translate(\"month.short.december\"),\n ];\n\n const localTime = this.getLocalTime(\n this.state.dayStartMs + this.state.currentTimeOffsetMs\n );\n const formattedTime = this._formatTime(\n dataProvider.dayStartMs + currentTimeOffsetMs\n );\n const formattedDate = `${\n months[localTime.getMonth()]\n }, ${localTime.getDate()}`;\n\n return (\n <div className=\"solar-timeline-wrapper\">\n <Flex flexWrap=\"wrap\" gap=\"none\" className=\"solar-timeline-start\">\n <PlayButton\n isPlaying={this.state.isPlaying}\n onPlay={this._onPlay}\n onPause={this._onPause}\n />\n <Popover\n content={\n <DatePicker\n date={localTime}\n onChange={this._onDateChange}\n showTime\n use12Hours\n />\n }\n visible={this.state.isDateOpened}\n onVisibleChange={(isDateOpened) => {\n this.setState({ isDateOpened });\n }}\n placement=\"top\"\n middleware={{\n offset,\n }}\n >\n <CalendarButton\n onClick={() => {\n const isDateOpened = !this.state.isDateOpened;\n this.setState({ isDateOpened });\n }}\n >\n {formattedDate} @ {formattedTime}\n </CalendarButton>\n </Popover>\n </Flex>\n\n <Timeline\n dayStartMs={dataProvider.dayStartMs}\n sunSetOffsetMs={sunSetOffsetMs}\n sunRiseOffsetMs={sunRiseOffsetMs}\n currentTimeOffsetMs={currentTimeOffsetMs}\n onChange={this._onChange}\n onUpdate={this._onUpdate}\n formatTime={this._formatTime}\n isPlaying={this.state.isPlaying}\n />\n\n <Flex\n justifyContent=\"flex-end\"\n flexWrap=\"wrap\"\n gap=\"none\"\n className=\"solar-timeline-end\"\n >\n <VisuallyHidden>\n <Label htmlFor=\"speed\">Timeline speed</Label>\n </VisuallyHidden>\n <Tooltip\n content={UiIModelComponents.translate(\"solartimeline.speed\")}\n >\n <Select\n native\n styleType=\"borderless\"\n triggerProps={{\n name: \"speed\",\n }}\n onChange={(newValue) => this._onSpeedChange(Number(newValue))}\n value={currentSpeed.toString()}\n options={this._speeds.map((speed) => ({\n value: speed.toString(),\n label: `${speed}x`,\n }))}\n />\n </Tooltip>\n\n <IconButton\n styleType=\"borderless\"\n label={UiIModelComponents.translate(\"timeline.repeat\")}\n onClick={this._onToggleLoop}\n isActive={loop}\n >\n <SvgLoop />\n </IconButton>\n\n <Popover\n content={\n <ColorPicker\n selectedColor={this.state.shadowColor.colors}\n onChangeComplete={(color) => {\n const colorDef = ColorDef.create(color.toTbgr());\n this.setState(\n { shadowColor: colorDef },\n () => (this.props.dataProvider.shadowColor = colorDef)\n );\n }}\n >\n <Text variant=\"title\" as=\"h2\" style={{ textAlign: \"center\" }}>\n {UiIModelComponents.translate(\"solarsettings.shadowcolor\")}\n </Text>\n <ColorBuilder />\n <ColorInputPanel defaultColorFormat=\"hsl\" />\n <ColorPalette\n colors={this._presetColors.map((color) => color.colors)}\n />\n </ColorPicker>\n }\n placement=\"top\"\n middleware={{\n offset,\n }}\n >\n <IconButton\n styleType=\"borderless\"\n data-testid=\"shadow-settings-button\"\n label={UiIModelComponents.translate(\"solartimeline.settings\")}\n onClick={this._onOpenSettingsPopup}\n >\n <SvgSettings />\n </IconButton>\n </Popover>\n </Flex>\n </div>\n );\n }\n}\n\ninterface CalendarButtonProps {\n children?: React.ReactNode;\n onClick?: () => void;\n}\n\nconst CalendarButton = React.forwardRef<HTMLButtonElement, CalendarButtonProps>(\n function CalendarButton({ children, onClick }, ref) {\n const { translate } = useTranslation();\n const tooltip = translate(\"solartimeline.dateTime\");\n\n return (\n <Tooltip content={tooltip}>\n <Button\n styleType=\"borderless\"\n startIcon={<SvgCalendar />}\n data-testid=\"solar-date-time-button\"\n title={tooltip}\n onClick={onClick}\n ref={ref}\n >\n <span className=\"solar-timeline-date-time\">{children}</span>\n </Button>\n </Tooltip>\n );\n }\n);\n"]}
1
+ {"version":3,"file":"SolarTimeline.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/tim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K,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,IACzD,kBAAkB,CAAC,SAAS,CAAC,2BAA2B,CAAC,CACrD;wBACP,oBAAC,YAAY,OAAG;wBAChB,oBAAC,eAAe,IAAC,kBAAkB,EAAC,KAAK,GAAG;wBAC5C,oBAAC,YAAY,IACX,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,GACvD,CACU,EAEhB,SAAS,EAAC,KAAK,EACf,UAAU,EAAE;wBACV,MAAM;qBACP;oBAED,oBAAC,UAAU,IACT,SAAS,EAAC,YAAY,iBACV,wBAAwB,EACpC,KAAK,EAAE,kBAAkB,CAAC,SAAS,CAAC,wBAAwB,CAAC,EAC7D,OAAO,EAAE,IAAI,CAAC,oBAAoB;wBAElC,oBAAC,WAAW,OAAG,CACJ,CACL,CACL,CACH,CACP,CAAC;IACJ,CAAC;CACF;AAOD,MAAM,cAAc,GAAG,KAAK,CAAC,UAAU,CACrC,SAAS,cAAc,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,GAAG;IAChD,MAAM,EAAE,SAAS,EAAE,GAAG,cAAc,EAAE,CAAC;IACvC,MAAM,OAAO,GAAG,SAAS,CAAC,wBAAwB,CAAC,CAAC;IAEpD,OAAO,CACL,oBAAC,OAAO,IAAC,OAAO,EAAE,OAAO;QACvB,oBAAC,MAAM,IACL,SAAS,EAAC,YAAY,EACtB,SAAS,EAAE,oBAAC,WAAW,OAAG,iBACd,wBAAwB,EACpC,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,OAAO,EAChB,GAAG,EAAE,GAAG;YAER,8BAAM,SAAS,EAAC,0BAA0B,IAAE,QAAQ,CAAQ,CACrD,CACD,CACX,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Timeline\n */\n\nimport \"./SolarTimeline.scss\";\nimport classnames from \"classnames\";\nimport * as React from \"react\";\nimport { ColorByName, ColorDef } from \"@itwin/core-common\";\nimport type { CommonProps } from \"@itwin/core-react\";\nimport { adjustDateToTimezone, UiComponents } from \"@itwin/components-react\";\nimport {\n Button,\n ColorBuilder,\n ColorInputPanel,\n ColorPalette,\n ColorPicker,\n DatePicker,\n Flex,\n Icon,\n IconButton,\n Label,\n Popover,\n Select,\n Slider,\n Text,\n Tooltip,\n VisuallyHidden,\n} from \"@itwin/itwinui-react\";\nimport {\n SvgCalendar,\n SvgLoop,\n SvgMoon,\n SvgSettings,\n SvgSun,\n} from \"@itwin/itwinui-icons-react\";\nimport type { SolarDataProvider } from \"./interfaces\";\nimport { UiIModelComponents } from \"../UiIModelComponents\";\nimport { PlayButton } from \"./PlayButton\";\nimport { useTranslation } from \"../useTranslation\";\n\nconst msPerMinute = 1000 * 60;\nconst msPerHour = msPerMinute * 60;\nconst defaultPlaybackDuration = 40 * 1000;\n\nconst offset = 6;\n\ninterface TimelineProps extends CommonProps {\n dayStartMs: number;\n sunRiseOffsetMs: number;\n sunSetOffsetMs: number;\n currentTimeOffsetMs: number;\n isPlaying: boolean;\n formatTick?: (ms: number) => string;\n formatTime: (ms: number) => string;\n onChange?: (values: ReadonlyArray<number>) => void;\n onUpdate?: (values: ReadonlyArray<number>) => void;\n}\n\nfunction Timeline(props: TimelineProps) {\n const {\n formatTick,\n formatTime,\n onChange,\n onUpdate,\n dayStartMs,\n sunSetOffsetMs,\n sunRiseOffsetMs,\n currentTimeOffsetMs,\n } = props;\n\n const tooltipContent = formatTime(dayStartMs + currentTimeOffsetMs);\n\n const className = classnames(\n \"solar-timeline\",\n props.className,\n formatTick && \"showticks\"\n );\n const sunRiseStr = formatTime(dayStartMs + sunRiseOffsetMs);\n const sunSetStr = formatTime(dayStartMs + sunSetOffsetMs);\n return (\n <div className={className}>\n <VisuallyHidden>Solar timeline</VisuallyHidden>\n <Slider\n thumbProps={() => ({ \"aria-labelledby\": \"timeline\" })}\n step={msPerMinute}\n min={sunRiseOffsetMs}\n max={sunSetOffsetMs}\n minLabel={\n <Tooltip content={sunRiseStr}>\n <Icon>\n <SvgSun />\n </Icon>\n </Tooltip>\n }\n maxLabel={\n <Tooltip content={sunSetStr}>\n <Icon>\n <SvgMoon />\n </Icon>\n </Tooltip>\n }\n onUpdate={onUpdate}\n onChange={onChange}\n values={[currentTimeOffsetMs]}\n tooltipProps={() => ({\n content: tooltipContent,\n })}\n />\n </div>\n );\n}\n\ninterface SolarTimelineComponentProps {\n dataProvider: SolarDataProvider; // provides date, sunrise, sunset in ms, also contains timezone offset from UTC, and updates the display style to current time.\n onPlayPause?: (playing: boolean) => void; // callback triggered when play/pause button is pressed\n duration?: number; // playback duration in milliseconds\n speed?: number;\n}\n\ninterface SolarTimelineComponentState {\n isPlaying: boolean; // timeline is currently playing or paused\n isDateOpened: boolean; // date picker is opened\n isSettingsOpened: boolean; // settings popup is opened\n dayStartMs: number;\n sunRiseOffsetMs: number;\n sunSetOffsetMs: number;\n sunDeltaMs: number;\n currentTimeOffsetMs: number;\n speed: number;\n loop: boolean;\n shadowColor: ColorDef;\n duration: number; // playback duration in milliseconds\n adjustedDuration: number; // playback duration in milliseconds/ speed\n}\n\n/** Solar Timeline\n * @alpha\n */\nexport class SolarTimeline extends React.PureComponent<\n SolarTimelineComponentProps,\n SolarTimelineComponentState\n> {\n private _requestFrame = 0;\n private _unmounted = false;\n private _timeLastCycle = 0;\n private _totalPlayTime = 0;\n\n private readonly _presetColors = [\n ColorDef.create(ColorByName.grey),\n ColorDef.create(ColorByName.lightGrey),\n ColorDef.create(ColorByName.darkGrey),\n ColorDef.create(ColorByName.lightBlue),\n ColorDef.create(ColorByName.lightGreen),\n ColorDef.create(ColorByName.darkGreen),\n ColorDef.create(ColorByName.tan),\n ColorDef.create(ColorByName.darkBrown),\n ];\n\n private readonly _speeds = [1, 2, 3, 4, 5, 6];\n\n constructor(props: SolarTimelineComponentProps) {\n super(props);\n\n const dayStartMs = this.props.dataProvider.dayStartMs;\n const sunRiseOffsetMs =\n this.props.dataProvider.sunrise.getTime() - dayStartMs;\n const sunSetOffsetMs =\n this.props.dataProvider.sunset.getTime() - dayStartMs;\n const sunDeltaMs = sunSetOffsetMs - sunRiseOffsetMs;\n const sunOffsetMs =\n this.props.dataProvider.timeOfDay.getTime() - dayStartMs;\n const currentTimeOffsetMs = this.ensureRange(\n sunOffsetMs,\n sunRiseOffsetMs,\n sunSetOffsetMs\n );\n const shadowColor = this.props.dataProvider.shadowColor;\n const duration = this.props.duration\n ? this.props.duration\n : defaultPlaybackDuration;\n const speed = this.props.speed ? this.props.speed : 2;\n const adjustedDuration = duration / speed;\n this.setPlaybackTimeBySunTime(\n currentTimeOffsetMs,\n sunRiseOffsetMs,\n sunDeltaMs,\n adjustedDuration\n );\n\n this.state = {\n isDateOpened: false,\n isSettingsOpened: false,\n isPlaying: false,\n dayStartMs,\n sunRiseOffsetMs,\n sunSetOffsetMs,\n sunDeltaMs,\n currentTimeOffsetMs,\n speed,\n loop: false,\n shadowColor,\n duration,\n adjustedDuration,\n };\n }\n\n public override componentWillUnmount() {\n window.cancelAnimationFrame(this._requestFrame);\n this._unmounted = true;\n }\n\n // recursively update the animation until we hit the end or the pause button is clicked\n private _updateAnimation = (_timestamp: number) => {\n if (!this.state.isPlaying || this._unmounted) {\n window.cancelAnimationFrame(this._requestFrame);\n return;\n }\n\n const currentTime = new Date().getTime();\n this._totalPlayTime += currentTime - this._timeLastCycle;\n this._timeLastCycle = currentTime;\n let percentComplete = this._totalPlayTime / this.state.adjustedDuration;\n if (percentComplete > 1) percentComplete = 1;\n\n let newPlayingState = true;\n\n // calculate the next sun time base on the percentage playback complete - should be int value as that is step amount for slider\n let nextSunOffset = Math.floor(\n this.state.sunRiseOffsetMs + percentComplete * this.state.sunDeltaMs\n );\n\n if (percentComplete > 0.99) {\n if (!this.state.loop) {\n newPlayingState = false;\n nextSunOffset = this.state.sunSetOffsetMs;\n window.cancelAnimationFrame(this._requestFrame);\n } else {\n nextSunOffset = this.state.sunRiseOffsetMs;\n this._totalPlayTime = 0;\n }\n }\n\n if (this.props.dataProvider.onTimeChanged) {\n const currentSunTime = new Date(this.state.dayStartMs + nextSunOffset);\n this.props.dataProvider.onTimeChanged(currentSunTime);\n }\n\n this.setState(\n { isPlaying: newPlayingState, currentTimeOffsetMs: nextSunOffset },\n () => {\n if (newPlayingState)\n this._requestFrame = window.requestAnimationFrame(\n this._updateAnimation\n );\n }\n );\n };\n\n private _play(sunTimeMs: number) {\n this._timeLastCycle = new Date().getTime();\n\n // start playing\n this.setState({ isPlaying: true, currentTimeOffsetMs: sunTimeMs }, () => {\n this._requestFrame = window.requestAnimationFrame(this._updateAnimation);\n if (this.props.onPlayPause) this.props.onPlayPause(true);\n });\n }\n\n // user clicked pause button\n private _onPause = () => {\n if (!this.state.isPlaying) return;\n\n const currentTime = new Date().getTime();\n this._totalPlayTime += currentTime - this._timeLastCycle;\n\n // stop requesting frames\n window.cancelAnimationFrame(this._requestFrame);\n\n // stop playing\n this.setState({ isPlaying: false });\n\n if (this.props.onPlayPause) this.props.onPlayPause(false);\n };\n\n // user clicked play button\n private _onPlay = () => {\n if (this.state.isPlaying) return;\n\n if (\n this.state.currentTimeOffsetMs >= this.state.sunSetOffsetMs ||\n this.state.currentTimeOffsetMs <= this.state.sunRiseOffsetMs\n ) {\n this._totalPlayTime = 0;\n this._play(this.state.sunRiseOffsetMs);\n } else {\n this._play(this.state.currentTimeOffsetMs);\n }\n };\n\n private setPlaybackTimeBySunTime(\n sunOffsetMs: number,\n sunRiseOffsetMs: number,\n sunDeltaMs: number,\n adjustedDuration?: number\n ) {\n this._totalPlayTime =\n ((sunOffsetMs - sunRiseOffsetMs) / sunDeltaMs) *\n (adjustedDuration ? adjustedDuration : this.state.adjustedDuration);\n }\n\n private _onDateChange = (newDate: Date) => {\n this.props.dataProvider.setDateAndTime(newDate);\n\n const dayStartMs = this.props.dataProvider.dayStartMs;\n const sunRiseOffsetMs =\n this.props.dataProvider.sunrise.getTime() - dayStartMs;\n const sunSetOffsetMs =\n this.props.dataProvider.sunset.getTime() - dayStartMs;\n const sunDeltaMs = sunSetOffsetMs - sunRiseOffsetMs;\n\n /** call dataProvider to update display style */\n // this.props.dataProvider.onTimeChanged?.(this.props.dataProvider.timeOfDay);\n\n // Update time\n const newHours = newDate.getHours();\n const newMinutes = newDate.getMinutes();\n const newSunTime = newHours * msPerHour + newMinutes * msPerMinute;\n const dateWithNewTime = new Date(dayStartMs + newSunTime);\n // this.props.dataProvider.setDateAndTime(dateWithNewTime, true);\n\n const currentTimeOffsetMs = this.ensureRange(\n newSunTime,\n sunRiseOffsetMs,\n sunSetOffsetMs\n );\n this.setPlaybackTimeBySunTime(\n currentTimeOffsetMs,\n sunRiseOffsetMs,\n sunDeltaMs\n );\n this._timeLastCycle = new Date().getTime();\n\n this.props.dataProvider.onTimeChanged?.(dateWithNewTime);\n this.setState({\n dayStartMs,\n sunRiseOffsetMs,\n sunSetOffsetMs,\n currentTimeOffsetMs,\n sunDeltaMs,\n isDateOpened: false,\n });\n };\n\n private _onCloseSettingsPopup = () => {\n this.setState({ isSettingsOpened: false });\n };\n\n private _onOpenSettingsPopup = () => {\n this.setState((prevState) => ({\n isSettingsOpened: !prevState.isSettingsOpened,\n }));\n };\n\n private ensureRange(value: number, min: number, max: number): number {\n return Math.max(Math.min(value, max), min);\n }\n\n private processSunTimeChange(sunTime: number) {\n if (sunTime === this.state.currentTimeOffsetMs) return;\n\n const currentTimeOffsetMs = this.ensureRange(\n sunTime,\n this.state.sunRiseOffsetMs,\n this.state.sunSetOffsetMs\n );\n\n if (this.props.dataProvider.onTimeChanged) {\n const currentSunTime = new Date(\n this.state.dayStartMs + currentTimeOffsetMs\n );\n this.props.dataProvider.onTimeChanged(currentSunTime);\n }\n\n this.setState({ currentTimeOffsetMs }, () => {\n const currentTime = new Date().getTime();\n this._timeLastCycle = currentTime;\n const percentComplete =\n (currentTimeOffsetMs - this.state.sunRiseOffsetMs) /\n this.state.sunDeltaMs;\n this._totalPlayTime = percentComplete * this.state.adjustedDuration;\n });\n }\n\n private _onUpdate = (values: ReadonlyArray<number>) => {\n if (!this.state.isPlaying) this.processSunTimeChange(values[0]);\n };\n\n private _onChange = (values: ReadonlyArray<number>) => {\n if (!this.state.isPlaying) this.processSunTimeChange(values[0]);\n };\n\n private _onSpeedChange = (value: number) => {\n const adjustedDuration = this.state.duration / value;\n this.setState({ speed: value, adjustedDuration });\n };\n\n private _onToggleLoop = () => {\n this.setState((prevState) => ({ loop: !prevState.loop }));\n };\n\n private _formatTime = (ms: number) => {\n const date = new Date(ms);\n const amLabel = UiComponents.translate(\"time.am\");\n const pmLabel = UiComponents.translate(\"time.pm\");\n // convert project date to browser locale date\n const localTime = adjustDateToTimezone(\n date,\n this.props.dataProvider.timeZoneOffset * 60\n );\n let hours = localTime.getHours();\n const minutes = date.getMinutes();\n const abbrev = hours < 12 ? amLabel : hours === 24 ? amLabel : pmLabel;\n hours = hours > 12 ? hours - 12 : hours;\n const hoursStr = hours.toLocaleString(undefined, {\n minimumIntegerDigits: 2,\n });\n const minutesStr = minutes.toLocaleString(undefined, {\n minimumIntegerDigits: 2,\n });\n return `${hoursStr}:${minutesStr} ${abbrev}`;\n };\n\n public getLocalTime(ticks: number): Date {\n const projectTime = new Date(ticks);\n // convert project date to browser locale date\n return adjustDateToTimezone(\n projectTime,\n this.props.dataProvider.timeZoneOffset * 60\n );\n }\n\n public override render() {\n const { dataProvider } = this.props;\n const {\n speed: currentSpeed,\n loop,\n currentTimeOffsetMs,\n sunRiseOffsetMs,\n sunSetOffsetMs,\n } = this.state;\n const months = [\n UiComponents.translate(\"month.short.january\"),\n UiComponents.translate(\"month.short.february\"),\n UiComponents.translate(\"month.short.march\"),\n UiComponents.translate(\"month.short.april\"),\n UiComponents.translate(\"month.short.may\"),\n UiComponents.translate(\"month.short.june\"),\n UiComponents.translate(\"month.short.july\"),\n UiComponents.translate(\"month.short.august\"),\n UiComponents.translate(\"month.short.september\"),\n UiComponents.translate(\"month.short.october\"),\n UiComponents.translate(\"month.short.november\"),\n UiComponents.translate(\"month.short.december\"),\n ];\n\n const localTime = this.getLocalTime(\n this.state.dayStartMs + this.state.currentTimeOffsetMs\n );\n const formattedTime = this._formatTime(\n dataProvider.dayStartMs + currentTimeOffsetMs\n );\n const formattedDate = `${\n months[localTime.getMonth()]\n }, ${localTime.getDate()}`;\n\n return (\n <div className=\"solar-timeline-wrapper\">\n <Flex flexWrap=\"wrap\" gap=\"none\" className=\"solar-timeline-start\">\n <PlayButton\n isPlaying={this.state.isPlaying}\n onPlay={this._onPlay}\n onPause={this._onPause}\n />\n <Popover\n content={\n <DatePicker\n date={localTime}\n onChange={this._onDateChange}\n showTime\n use12Hours\n />\n }\n visible={this.state.isDateOpened}\n onVisibleChange={(isDateOpened) => {\n this.setState({ isDateOpened });\n }}\n placement=\"top\"\n middleware={{\n offset,\n }}\n >\n <CalendarButton\n onClick={() => {\n const isDateOpened = !this.state.isDateOpened;\n this.setState({ isDateOpened });\n }}\n >\n {formattedDate} @ {formattedTime}\n </CalendarButton>\n </Popover>\n </Flex>\n\n <Timeline\n dayStartMs={dataProvider.dayStartMs}\n sunSetOffsetMs={sunSetOffsetMs}\n sunRiseOffsetMs={sunRiseOffsetMs}\n currentTimeOffsetMs={currentTimeOffsetMs}\n onChange={this._onChange}\n onUpdate={this._onUpdate}\n formatTime={this._formatTime}\n isPlaying={this.state.isPlaying}\n />\n\n <Flex\n justifyContent=\"flex-end\"\n flexWrap=\"wrap\"\n gap=\"none\"\n className=\"solar-timeline-end\"\n >\n <VisuallyHidden>\n <Label htmlFor=\"speed\">Timeline speed</Label>\n </VisuallyHidden>\n <Tooltip\n content={UiIModelComponents.translate(\"solartimeline.speed\")}\n >\n <Select\n native\n styleType=\"borderless\"\n triggerProps={{\n name: \"speed\",\n }}\n onChange={(newValue) => this._onSpeedChange(Number(newValue))}\n value={currentSpeed.toString()}\n options={this._speeds.map((speed) => ({\n value: speed.toString(),\n label: `${speed}x`,\n }))}\n />\n </Tooltip>\n\n <IconButton\n styleType=\"borderless\"\n label={UiIModelComponents.translate(\"timeline.repeat\")}\n onClick={this._onToggleLoop}\n isActive={loop}\n >\n <SvgLoop />\n </IconButton>\n\n <Popover\n content={\n <ColorPicker\n selectedColor={this.state.shadowColor.colors}\n onChangeComplete={(color) => {\n const colorDef = ColorDef.create(color.toTbgr());\n this.setState(\n { shadowColor: colorDef },\n () => (this.props.dataProvider.shadowColor = colorDef)\n );\n }}\n >\n <Text variant=\"title\" as=\"h2\" style={{ textAlign: \"center\" }}>\n {UiIModelComponents.translate(\"solarsettings.shadowcolor\")}\n </Text>\n <ColorBuilder />\n <ColorInputPanel defaultColorFormat=\"hsl\" />\n <ColorPalette\n colors={this._presetColors.map((color) => color.colors)}\n />\n </ColorPicker>\n }\n placement=\"top\"\n middleware={{\n offset,\n }}\n >\n <IconButton\n styleType=\"borderless\"\n data-testid=\"shadow-settings-button\"\n label={UiIModelComponents.translate(\"solartimeline.settings\")}\n onClick={this._onOpenSettingsPopup}\n >\n <SvgSettings />\n </IconButton>\n </Popover>\n </Flex>\n </div>\n );\n }\n}\n\ninterface CalendarButtonProps {\n children?: React.ReactNode;\n onClick?: () => void;\n}\n\nconst CalendarButton = React.forwardRef<HTMLButtonElement, CalendarButtonProps>(\n function CalendarButton({ children, onClick }, ref) {\n const { translate } = useTranslation();\n const tooltip = translate(\"solartimeline.dateTime\");\n\n return (\n <Tooltip content={tooltip}>\n <Button\n styleType=\"borderless\"\n startIcon={<SvgCalendar />}\n data-testid=\"solar-date-time-button\"\n title={tooltip}\n onClick={onClick}\n ref={ref}\n >\n <span className=\"solar-timeline-date-time\">{children}</span>\n </Button>\n </Tooltip>\n );\n }\n);\n"]}
@@ -23,12 +23,11 @@ const fastSpeed = 10 * 1000;
23
23
  * @public
24
24
  */
25
25
  export function TimelineComponent(props) {
26
- var _a, _b, _c, _d;
27
26
  const { appMenuItemOption = "replace", startDate, endDate, showDuration, timeZoneOffset, dateFormatOptions, timeFormatOptions, includeRepeat = true, onSettingsChange, onChange, onPlayPause, } = props;
28
27
  const [isPlaying, setIsPlaying] = React.useState(!!props.isPlaying);
29
- const [currentDuration, setCurrentDuration] = React.useState((_a = props.initialDuration) !== null && _a !== void 0 ? _a : 0);
28
+ const [currentDuration, setCurrentDuration] = React.useState(props.initialDuration ?? 0);
30
29
  const [totalDuration, setTotalDuration] = React.useState(props.totalDuration);
31
- const [repeat, setRepeat] = React.useState((_b = props.repeat) !== null && _b !== void 0 ? _b : false);
30
+ const [repeat, setRepeat] = React.useState(props.repeat ?? false);
32
31
  const playOrReplay = React.useCallback(() => {
33
32
  if (isPlaying)
34
33
  return;
@@ -36,13 +35,13 @@ export function TimelineComponent(props) {
36
35
  setCurrentDuration(0);
37
36
  }
38
37
  setIsPlaying(true);
39
- onPlayPause === null || onPlayPause === void 0 ? void 0 : onPlayPause(true);
38
+ onPlayPause?.(true);
40
39
  }, [isPlaying, onPlayPause, currentDuration, totalDuration]);
41
40
  const pause = React.useCallback(() => {
42
41
  if (!isPlaying)
43
42
  return;
44
43
  setIsPlaying(false);
45
- onPlayPause === null || onPlayPause === void 0 ? void 0 : onPlayPause(false);
44
+ onPlayPause?.(false);
46
45
  }, [isPlaying, onPlayPause]);
47
46
  const updateTotalDuration = (newTotalDuration) => {
48
47
  if (newTotalDuration === totalDuration)
@@ -51,7 +50,7 @@ export function TimelineComponent(props) {
51
50
  const newCurrentDuration = fraction * newTotalDuration;
52
51
  setTotalDuration(newTotalDuration);
53
52
  setCurrentDuration(newCurrentDuration);
54
- onSettingsChange === null || onSettingsChange === void 0 ? void 0 : onSettingsChange({ duration: newTotalDuration });
53
+ onSettingsChange?.({ duration: newTotalDuration });
55
54
  };
56
55
  const updateDuration = (newDuration, currentTotalDuration = totalDuration) => {
57
56
  newDuration = Math.max(newDuration, 0);
@@ -60,13 +59,13 @@ export function TimelineComponent(props) {
60
59
  return;
61
60
  setCurrentDuration(newDuration);
62
61
  const fraction = newDuration / currentTotalDuration;
63
- onChange === null || onChange === void 0 ? void 0 : onChange(fraction);
62
+ onChange?.(fraction);
64
63
  };
65
64
  const updateRepeat = (newRepeat) => {
66
65
  if (newRepeat === repeat)
67
66
  return;
68
67
  setRepeat(newRepeat);
69
- onSettingsChange === null || onSettingsChange === void 0 ? void 0 : onSettingsChange({ loop: newRepeat });
68
+ onSettingsChange?.({ loop: newRepeat });
70
69
  };
71
70
  const [prevTotalDuration, setPrevTotalDuration] = React.useState(props.totalDuration);
72
71
  if (prevTotalDuration !== props.totalDuration) {
@@ -76,12 +75,12 @@ export function TimelineComponent(props) {
76
75
  const [prevInitialDuration, setPrevInitialDuration] = React.useState(props.initialDuration);
77
76
  if (prevInitialDuration !== props.initialDuration) {
78
77
  setPrevInitialDuration(props.initialDuration);
79
- updateDuration((_c = props.initialDuration) !== null && _c !== void 0 ? _c : 0, props.totalDuration);
78
+ updateDuration(props.initialDuration ?? 0, props.totalDuration);
80
79
  }
81
80
  const [prevRepeat, setPrevRepeat] = React.useState(props.repeat);
82
81
  if (prevRepeat !== props.repeat) {
83
82
  setPrevRepeat(props.repeat);
84
- updateRepeat((_d = props.repeat) !== null && _d !== void 0 ? _d : repeat);
83
+ updateRepeat(props.repeat ?? repeat);
85
84
  }
86
85
  React.useEffect(() => {
87
86
  // eslint-disable-next-line deprecation/deprecation
@@ -1 +1 @@
1
- {"version":3,"file":"TimelineComponent.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/TimelineComponent.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAA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AAC,CAAC;IAEF,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1B,oCAAoC;IACpC,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;IACrC,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;IACrC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;AACnD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Timeline\n */\nimport \"./TimelineComponent.scss\";\nimport * as React from \"react\";\nimport { UiAdmin } from \"@itwin/appui-abstract\";\nimport type { DateFormatOptions } from \"@itwin/components-react\";\nimport { toDateString, toTimeString } from \"@itwin/components-react\";\nimport { SvgCheckmark, SvgMoreVertical } from \"@itwin/itwinui-icons-react\";\nimport {\n DropdownMenu,\n IconButton,\n MenuDivider,\n MenuItem,\n} from \"@itwin/itwinui-react\";\nimport { InlineEdit } from \"./InlineEdit\";\nimport type { PlaybackSettings, TimelinePausePlayArgs } from \"./interfaces\";\nimport { TimelinePausePlayAction } from \"./interfaces\";\nimport { PlayButton } from \"./PlayButton\";\nimport { Scrubber } from \"./Scrubber\";\nimport { useTranslation } from \"../useTranslation\";\n\nconst slowSpeed = 60 * 1000;\nconst mediumSpeed = 20 * 1000;\nconst fastSpeed = 10 * 1000;\n\n/** [[TimelineMenuItemOption]]: specifies how the app wants the timeline speeds to be installed on the TimelineComponent's ContextMenu\n * \"replace\" : use the app-supplied items in place of the standard items\n * \"append\" : add the app-supplied items following the standard items\n * \"prefix\" : add the app-supplied items before the standard items\n *\n * @public\n */\nexport type TimelineMenuItemOption = \"replace\" | \"append\" | \"prefix\";\n\n/** [[TimelineMenuItemProps]] specifies playback speed entries in the Timeline's ContextMenu\n * @public\n */\nexport interface TimelineMenuItemProps {\n /** localized label for menu item */\n label: string;\n\n /** duration for the entire timeline to play */\n timelineDuration: number;\n}\n\n/** TimelineDateMarkerProps: Mark a date on the timeline with an indicator\n * @public\n */\nexport interface TimelineDateMarkerProps {\n /** Date to mark. If undefined, today's date will be used. */\n date?: Date;\n /** ReactNode to use as the marker on the timeline. If undefined, a short vertical bar will mark the date. */\n dateMarker?: React.ReactNode;\n}\n\n/** [[TimelineComponentProps]] configure the timeline\n * @public\n */\nexport interface TimelineComponentProps {\n /** Start date: beginning of the date range of a date-based timeline. */\n startDate?: Date;\n /** End date: end of the date range of a date-based timeline. */\n endDate?: Date;\n /** Total duration: range of the timeline in milliseconds.\n * @note This can be changed by user interaction. See {@link TimelineComponentProps.appMenuItems}.\n */\n totalDuration: number;\n /** Initial value for the current duration (the location of the thumb) in milliseconds */\n initialDuration?: number;\n /** Show in minimized mode (For future use. This prop will always be treated as true.)\n * @deprecated in 4.10.x. Has no effect.\n */\n minimized?: boolean;\n /** When playing, repeat indefinitely. Defaults to `false`.\n * @note This can be changed by user interaction. See {@link TimelineComponentProps.includeRepeat}.\n */\n repeat?: boolean;\n /** Show duration instead of time */\n showDuration?: boolean;\n /** Callback with current duration value (as a fraction) */\n onChange?: (duration: number) => void;\n /** Callback triggered when play/pause button is pressed */\n onPlayPause?: (playing: boolean) => void;\n /** Callback triggered when backward/forward buttons are pressed.\n * @deprecated in 4.10.x. Has no effect.\n */\n onJump?: (forward: boolean) => void;\n /** Callback triggered when a setting is changed */\n onSettingsChange?: (arg: PlaybackSettings) => void;\n /** Always display in miniMode with no expand menu (For future use. This prop will always be treated as true)\n * @deprecated in 4.10.x. Has no effect.\n */\n alwaysMinimized?: boolean;\n /** ComponentId -- must be set to use TimelineComponentEvents\n * @deprecated in 4.11.x. Use the isPlaying prop instead.\n */\n componentId?: string;\n /** Include the repeat option on the Timeline Context Menu. Defaults to `true`. */\n includeRepeat?: boolean;\n /** App-supplied speed entries in the Timeline Context Menu. Defaults to `[Slow, Medium, Fast]` items. */\n appMenuItems?: TimelineMenuItemProps[];\n /** How to include the supplied app menu items in the Timeline Context Menu (prefix, append or replace). Defaults to `replace`. */\n appMenuItemOption?: TimelineMenuItemOption;\n /** Display date and time offset by the number of minutes specified. When undefined - local timezone will be used */\n timeZoneOffset?: number;\n /** Display a marker on the timeline rail to indicate current date - will only work if starDate and endDate are defined */\n markDate?: TimelineDateMarkerProps;\n /** Options used to format date string. If not defined it will user browser default locale settings. */\n dateFormatOptions?: DateFormatOptions;\n /** Options used to format time string. If not defined it will user browser default locale settings. */\n timeFormatOptions?: DateFormatOptions;\n /** Used to control the play/pause state of the Timeline.*/\n isPlaying?: boolean;\n}\n\n/** [[TimelineComponent]] is used to playback timeline data\n * @public\n */\nexport function TimelineComponent(props: TimelineComponentProps) {\n const {\n appMenuItemOption = \"replace\",\n startDate,\n endDate,\n showDuration,\n timeZoneOffset,\n dateFormatOptions,\n timeFormatOptions,\n includeRepeat = true,\n onSettingsChange,\n onChange,\n onPlayPause,\n } = props;\n const [isPlaying, setIsPlaying] = React.useState(!!props.isPlaying);\n const [currentDuration, setCurrentDuration] = React.useState(\n props.initialDuration ?? 0\n );\n const [totalDuration, setTotalDuration] = React.useState(props.totalDuration);\n const [repeat, setRepeat] = React.useState(props.repeat ?? false);\n\n const playOrReplay = React.useCallback(() => {\n if (isPlaying) return;\n\n if (currentDuration >= totalDuration) {\n setCurrentDuration(0);\n }\n\n setIsPlaying(true);\n onPlayPause?.(true);\n }, [isPlaying, onPlayPause, currentDuration, totalDuration]);\n const pause = React.useCallback(() => {\n if (!isPlaying) return;\n setIsPlaying(false);\n onPlayPause?.(false);\n }, [isPlaying, onPlayPause]);\n const updateTotalDuration = (newTotalDuration: number) => {\n if (newTotalDuration === totalDuration) return;\n\n const fraction = currentDuration / totalDuration;\n const newCurrentDuration = fraction * newTotalDuration;\n\n setTotalDuration(newTotalDuration);\n setCurrentDuration(newCurrentDuration);\n onSettingsChange?.({ duration: newTotalDuration });\n };\n const updateDuration = (\n newDuration: number,\n currentTotalDuration = totalDuration\n ) => {\n newDuration = Math.max(newDuration, 0);\n newDuration = Math.min(newDuration, currentTotalDuration);\n\n if (newDuration === currentDuration) return;\n setCurrentDuration(newDuration);\n\n const fraction = newDuration / currentTotalDuration;\n onChange?.(fraction);\n };\n const updateRepeat = (newRepeat: boolean) => {\n if (newRepeat === repeat) return;\n\n setRepeat(newRepeat);\n onSettingsChange?.({ loop: newRepeat });\n };\n\n const [prevTotalDuration, setPrevTotalDuration] = React.useState(\n props.totalDuration\n );\n if (prevTotalDuration !== props.totalDuration) {\n setPrevTotalDuration(props.totalDuration);\n updateTotalDuration(props.totalDuration);\n }\n\n const [prevInitialDuration, setPrevInitialDuration] = React.useState(\n props.initialDuration\n );\n if (prevInitialDuration !== props.initialDuration) {\n setPrevInitialDuration(props.initialDuration);\n updateDuration(props.initialDuration ?? 0, props.totalDuration);\n }\n\n const [prevRepeat, setPrevRepeat] = React.useState(props.repeat);\n if (prevRepeat !== props.repeat) {\n setPrevRepeat(props.repeat);\n updateRepeat(props.repeat ?? repeat);\n }\n\n React.useEffect(() => {\n // eslint-disable-next-line deprecation/deprecation\n if (!props.componentId) return;\n return UiAdmin.onGenericUiEvent.addListener((args) => {\n const timelineArgs = args as TimelinePausePlayArgs;\n if (\n !timelineArgs ||\n // eslint-disable-next-line deprecation/deprecation\n props.componentId !== timelineArgs.uiComponentId ||\n timelineArgs.timelineAction === undefined\n )\n return;\n\n switch (timelineArgs.timelineAction) {\n case TimelinePausePlayAction.Play:\n playOrReplay();\n break;\n case TimelinePausePlayAction.Pause:\n pause();\n break;\n case TimelinePausePlayAction.Toggle:\n if (isPlaying) {\n pause();\n } else {\n playOrReplay();\n }\n break;\n }\n });\n // eslint-disable-next-line deprecation/deprecation\n }, [isPlaying, pause, playOrReplay, props.componentId]);\n useAnimation(({ delta }) => {\n const duration = currentDuration + delta;\n updateDuration(duration);\n\n if (duration >= totalDuration) {\n if (repeat) {\n setCurrentDuration(0);\n return;\n }\n\n pause();\n }\n }, isPlaying);\n\n React.useEffect(() => {\n if (props.isPlaying) playOrReplay();\n\n if (props.isPlaying === false) pause();\n }, [props.isPlaying, playOrReplay, pause]);\n\n const onTimelineChange = (values: ReadonlyArray<number>) => {\n const newDuration = values[0];\n updateDuration(newDuration);\n };\n\n const currentDurationStr = toDisplayTime(currentDuration);\n const totalDurationStr = toDisplayTime(totalDuration);\n const hasDates = !!startDate && !!endDate;\n return (\n <div data-testid=\"timeline-component\" className=\"timeline-component\">\n <PlayButton isPlaying={isPlaying} onPlay={playOrReplay} onPause={pause} />\n <div className=\"time-container\">\n {hasDates && (\n <span data-testid=\"test-start-date\" className=\"timeline-date\">\n {toDateString(startDate, timeZoneOffset, dateFormatOptions)}\n </span>\n )}\n {hasDates && !showDuration && (\n <span data-testid=\"test-start-time\" className=\"timeline-time\">\n {toTimeString(startDate, timeZoneOffset, timeFormatOptions)}\n </span>\n )}\n {showDuration && (\n <span className=\"timeline-duration-time\">{currentDurationStr}</span>\n )}\n </div>\n <Scrubber\n className=\"slider\"\n currentDuration={currentDuration}\n totalDuration={totalDuration}\n startDate={startDate}\n endDate={endDate}\n isPlaying={isPlaying}\n showTime={!showDuration}\n onChange={onTimelineChange}\n onUpdate={onTimelineChange}\n timeZoneOffset={props.timeZoneOffset}\n markDate={props.markDate}\n />\n <div className=\"time-container\">\n {hasDates && (\n <span data-testid=\"test-end-date\" className=\"timeline-date\">\n {toDateString(endDate, timeZoneOffset)}\n </span>\n )}\n {hasDates && !showDuration && (\n <span className=\"timeline-time\">\n {toTimeString(endDate, timeZoneOffset, timeFormatOptions)}\n </span>\n )}\n {showDuration && (\n <InlineEdit\n className=\"timeline-duration-time\"\n defaultValue={totalDurationStr}\n onChange={(value) => {\n const newTotalDuration = timeToMs(value);\n updateTotalDuration(newTotalDuration);\n }}\n />\n )}\n </div>\n <SettingsMenu\n appMenuItems={props.appMenuItems}\n appMenuItemOption={appMenuItemOption}\n includeRepeat={includeRepeat}\n repeat={repeat}\n totalDuration={totalDuration}\n onRepeatClick={() => {\n updateRepeat(!repeat);\n }}\n onTotalDurationChange={(newTotalDuration) => {\n updateTotalDuration(newTotalDuration);\n }}\n />\n </div>\n );\n}\n\ntype SettingsMenuProps = Pick<\n TimelineComponentProps,\n \"appMenuItems\" | \"totalDuration\"\n> &\n Pick<\n Required<TimelineComponentProps>,\n \"appMenuItemOption\" | \"includeRepeat\" | \"repeat\"\n > & {\n onRepeatClick: () => void;\n onTotalDurationChange: (totalDuration: number) => void;\n };\n\nfunction SettingsMenu({\n appMenuItems,\n appMenuItemOption,\n includeRepeat,\n repeat,\n totalDuration,\n onRepeatClick,\n onTotalDurationChange,\n}: SettingsMenuProps) {\n const { translate } = useTranslation();\n\n const menuItems = React.useMemo(() => {\n const standardItems: TimelineMenuItemProps[] = [\n {\n label: translate(\"timeline.slow\"),\n timelineDuration: slowSpeed,\n },\n {\n label: translate(\"timeline.medium\"),\n timelineDuration: mediumSpeed,\n },\n {\n label: translate(\"timeline.fast\"),\n timelineDuration: fastSpeed,\n },\n ];\n\n if (!appMenuItems) {\n return standardItems;\n }\n\n if (appMenuItemOption === \"append\") {\n return [...standardItems, ...appMenuItems];\n }\n if (appMenuItemOption === \"prefix\") {\n return [...appMenuItems, ...standardItems];\n }\n // Replace\n return appMenuItems;\n }, [appMenuItemOption, appMenuItems, translate]);\n\n return (\n <DropdownMenu\n menuItems={(close) => {\n return [\n ...(includeRepeat\n ? [\n <MenuItem\n key=\"repeat\"\n onClick={() => {\n onRepeatClick();\n close();\n }}\n startIcon={repeat ? <SvgCheckmark /> : <></>}\n >\n {translate(\"timeline.repeat\")}\n </MenuItem>,\n <MenuDivider key=\"divider\" />,\n ]\n : []),\n ...menuItems.map((item, index) => {\n const checked = totalDuration === item.timelineDuration;\n return (\n <MenuItem\n key={index}\n startIcon={checked ? <SvgCheckmark /> : <></>}\n onClick={() => {\n onTotalDurationChange(item.timelineDuration);\n close();\n }}\n >\n {item.label}\n </MenuItem>\n );\n }),\n ];\n }}\n placement=\"top-start\"\n >\n <IconButton\n data-testid=\"timeline-settings\"\n label={translate(\"button.label.settings\")}\n styleType=\"borderless\"\n >\n <SvgMoreVertical />\n </IconButton>\n </DropdownMenu>\n );\n}\n\nfunction useAnimation(\n onAnimate: (args: { delta: number }) => void,\n playing = true\n) {\n const onAnimateRef = React.useRef(onAnimate);\n onAnimateRef.current = onAnimate;\n\n const lastTimeRef = React.useRef<number | undefined>();\n\n React.useEffect(() => {\n if (!playing) return;\n\n let handle = 0;\n let didCancel = false;\n\n const animate = (time: number) => {\n if (lastTimeRef.current === undefined) {\n lastTimeRef.current = time;\n }\n\n const delta = time - lastTimeRef.current;\n lastTimeRef.current = time;\n\n onAnimateRef.current({\n delta,\n });\n\n if (didCancel) return;\n\n handle = window.requestAnimationFrame(animate);\n };\n\n handle = window.requestAnimationFrame(animate);\n return () => {\n didCancel = true;\n lastTimeRef.current = undefined;\n window.cancelAnimationFrame(handle);\n };\n }, [playing]);\n}\n\nfunction timeToMs(time: string) {\n if (time.indexOf(\":\") !== -1) {\n return (\n (Number(time.split(\":\")[0]) * 60 + Number(time.split(\":\")[1])) * 1000\n );\n } else {\n return Number(time) * 1000;\n }\n}\n\nfunction toDisplayTime(ms: number) {\n const addZero = (i: number) => {\n return i < 10 ? `0${i}` : i;\n };\n\n const date = new Date(ms);\n // const hours = date.getUTCHours();\n const minutes = date.getUTCMinutes();\n const seconds = date.getUTCSeconds();\n return `${addZero(minutes)}:${addZero(seconds)}`;\n}\n"]}
1
+ {"version":3,"file":"TimelineComponent.js","sourceRoot":"","sources":["../../../../src/imodel-components-react/timeline/TimelineComponent.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG;AACH,OAAO,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,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C,aAAa,EAAE,CAAC;IACrC,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;IACrC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;AACnD,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Timeline\n */\nimport \"./TimelineComponent.scss\";\nimport * as React from \"react\";\nimport { UiAdmin } from \"@itwin/appui-abstract\";\nimport type { DateFormatOptions } from \"@itwin/components-react\";\nimport { toDateString, toTimeString } from \"@itwin/components-react\";\nimport { SvgCheckmark, SvgMoreVertical } from \"@itwin/itwinui-icons-react\";\nimport {\n DropdownMenu,\n IconButton,\n MenuDivider,\n MenuItem,\n} from \"@itwin/itwinui-react\";\nimport { InlineEdit } from \"./InlineEdit\";\nimport type { PlaybackSettings, TimelinePausePlayArgs } from \"./interfaces\";\nimport { TimelinePausePlayAction } from \"./interfaces\";\nimport { PlayButton } from \"./PlayButton\";\nimport { Scrubber } from \"./Scrubber\";\nimport { useTranslation } from \"../useTranslation\";\n\nconst slowSpeed = 60 * 1000;\nconst mediumSpeed = 20 * 1000;\nconst fastSpeed = 10 * 1000;\n\n/** [[TimelineMenuItemOption]]: specifies how the app wants the timeline speeds to be installed on the TimelineComponent's ContextMenu\n * \"replace\" : use the app-supplied items in place of the standard items\n * \"append\" : add the app-supplied items following the standard items\n * \"prefix\" : add the app-supplied items before the standard items\n *\n * @public\n */\nexport type TimelineMenuItemOption = \"replace\" | \"append\" | \"prefix\";\n\n/** [[TimelineMenuItemProps]] specifies playback speed entries in the Timeline's ContextMenu\n * @public\n */\nexport interface TimelineMenuItemProps {\n /** localized label for menu item */\n label: string;\n\n /** duration for the entire timeline to play */\n timelineDuration: number;\n}\n\n/** TimelineDateMarkerProps: Mark a date on the timeline with an indicator\n * @public\n */\nexport interface TimelineDateMarkerProps {\n /** Date to mark. If undefined, today's date will be used. */\n date?: Date;\n /** ReactNode to use as the marker on the timeline. If undefined, a short vertical bar will mark the date. */\n dateMarker?: React.ReactNode;\n}\n\n/** [[TimelineComponentProps]] configure the timeline\n * @public\n */\nexport interface TimelineComponentProps {\n /** Start date: beginning of the date range of a date-based timeline. */\n startDate?: Date;\n /** End date: end of the date range of a date-based timeline. */\n endDate?: Date;\n /** Total duration: range of the timeline in milliseconds.\n * @note This can be changed by user interaction. See {@link TimelineComponentProps.appMenuItems}.\n */\n totalDuration: number;\n /** Initial value for the current duration (the location of the thumb) in milliseconds */\n initialDuration?: number;\n /** Show in minimized mode (For future use. This prop will always be treated as true.)\n * @deprecated in 4.10.x. Has no effect.\n */\n minimized?: boolean;\n /** When playing, repeat indefinitely. Defaults to `false`.\n * @note This can be changed by user interaction. See {@link TimelineComponentProps.includeRepeat}.\n */\n repeat?: boolean;\n /** Show duration instead of time */\n showDuration?: boolean;\n /** Callback with current duration value (as a fraction) */\n onChange?: (duration: number) => void;\n /** Callback triggered when play/pause button is pressed */\n onPlayPause?: (playing: boolean) => void;\n /** Callback triggered when backward/forward buttons are pressed.\n * @deprecated in 4.10.x. Has no effect.\n */\n onJump?: (forward: boolean) => void;\n /** Callback triggered when a setting is changed */\n onSettingsChange?: (arg: PlaybackSettings) => void;\n /** Always display in miniMode with no expand menu (For future use. This prop will always be treated as true)\n * @deprecated in 4.10.x. Has no effect.\n */\n alwaysMinimized?: boolean;\n /** ComponentId -- must be set to use TimelineComponentEvents\n * @deprecated in 4.11.x. Use the isPlaying prop instead.\n */\n componentId?: string;\n /** Include the repeat option on the Timeline Context Menu. Defaults to `true`. */\n includeRepeat?: boolean;\n /** App-supplied speed entries in the Timeline Context Menu. Defaults to `[Slow, Medium, Fast]` items. */\n appMenuItems?: TimelineMenuItemProps[];\n /** How to include the supplied app menu items in the Timeline Context Menu (prefix, append or replace). Defaults to `replace`. */\n appMenuItemOption?: TimelineMenuItemOption;\n /** Display date and time offset by the number of minutes specified. When undefined - local timezone will be used */\n timeZoneOffset?: number;\n /** Display a marker on the timeline rail to indicate current date - will only work if starDate and endDate are defined */\n markDate?: TimelineDateMarkerProps;\n /** Options used to format date string. If not defined it will user browser default locale settings. */\n dateFormatOptions?: DateFormatOptions;\n /** Options used to format time string. If not defined it will user browser default locale settings. */\n timeFormatOptions?: DateFormatOptions;\n /** Used to control the play/pause state of the Timeline.*/\n isPlaying?: boolean;\n}\n\n/** [[TimelineComponent]] is used to playback timeline data\n * @public\n */\nexport function TimelineComponent(props: TimelineComponentProps) {\n const {\n appMenuItemOption = \"replace\",\n startDate,\n endDate,\n showDuration,\n timeZoneOffset,\n dateFormatOptions,\n timeFormatOptions,\n includeRepeat = true,\n onSettingsChange,\n onChange,\n onPlayPause,\n } = props;\n const [isPlaying, setIsPlaying] = React.useState(!!props.isPlaying);\n const [currentDuration, setCurrentDuration] = React.useState(\n props.initialDuration ?? 0\n );\n const [totalDuration, setTotalDuration] = React.useState(props.totalDuration);\n const [repeat, setRepeat] = React.useState(props.repeat ?? false);\n\n const playOrReplay = React.useCallback(() => {\n if (isPlaying) return;\n\n if (currentDuration >= totalDuration) {\n setCurrentDuration(0);\n }\n\n setIsPlaying(true);\n onPlayPause?.(true);\n }, [isPlaying, onPlayPause, currentDuration, totalDuration]);\n const pause = React.useCallback(() => {\n if (!isPlaying) return;\n setIsPlaying(false);\n onPlayPause?.(false);\n }, [isPlaying, onPlayPause]);\n const updateTotalDuration = (newTotalDuration: number) => {\n if (newTotalDuration === totalDuration) return;\n\n const fraction = currentDuration / totalDuration;\n const newCurrentDuration = fraction * newTotalDuration;\n\n setTotalDuration(newTotalDuration);\n setCurrentDuration(newCurrentDuration);\n onSettingsChange?.({ duration: newTotalDuration });\n };\n const updateDuration = (\n newDuration: number,\n currentTotalDuration = totalDuration\n ) => {\n newDuration = Math.max(newDuration, 0);\n newDuration = Math.min(newDuration, currentTotalDuration);\n\n if (newDuration === currentDuration) return;\n setCurrentDuration(newDuration);\n\n const fraction = newDuration / currentTotalDuration;\n onChange?.(fraction);\n };\n const updateRepeat = (newRepeat: boolean) => {\n if (newRepeat === repeat) return;\n\n setRepeat(newRepeat);\n onSettingsChange?.({ loop: newRepeat });\n };\n\n const [prevTotalDuration, setPrevTotalDuration] = React.useState(\n props.totalDuration\n );\n if (prevTotalDuration !== props.totalDuration) {\n setPrevTotalDuration(props.totalDuration);\n updateTotalDuration(props.totalDuration);\n }\n\n const [prevInitialDuration, setPrevInitialDuration] = React.useState(\n props.initialDuration\n );\n if (prevInitialDuration !== props.initialDuration) {\n setPrevInitialDuration(props.initialDuration);\n updateDuration(props.initialDuration ?? 0, props.totalDuration);\n }\n\n const [prevRepeat, setPrevRepeat] = React.useState(props.repeat);\n if (prevRepeat !== props.repeat) {\n setPrevRepeat(props.repeat);\n updateRepeat(props.repeat ?? repeat);\n }\n\n React.useEffect(() => {\n // eslint-disable-next-line deprecation/deprecation\n if (!props.componentId) return;\n return UiAdmin.onGenericUiEvent.addListener((args) => {\n const timelineArgs = args as TimelinePausePlayArgs;\n if (\n !timelineArgs ||\n // eslint-disable-next-line deprecation/deprecation\n props.componentId !== timelineArgs.uiComponentId ||\n timelineArgs.timelineAction === undefined\n )\n return;\n\n switch (timelineArgs.timelineAction) {\n case TimelinePausePlayAction.Play:\n playOrReplay();\n break;\n case TimelinePausePlayAction.Pause:\n pause();\n break;\n case TimelinePausePlayAction.Toggle:\n if (isPlaying) {\n pause();\n } else {\n playOrReplay();\n }\n break;\n }\n });\n // eslint-disable-next-line deprecation/deprecation\n }, [isPlaying, pause, playOrReplay, props.componentId]);\n useAnimation(({ delta }) => {\n const duration = currentDuration + delta;\n updateDuration(duration);\n\n if (duration >= totalDuration) {\n if (repeat) {\n setCurrentDuration(0);\n return;\n }\n\n pause();\n }\n }, isPlaying);\n\n React.useEffect(() => {\n if (props.isPlaying) playOrReplay();\n\n if (props.isPlaying === false) pause();\n }, [props.isPlaying, playOrReplay, pause]);\n\n const onTimelineChange = (values: ReadonlyArray<number>) => {\n const newDuration = values[0];\n updateDuration(newDuration);\n };\n\n const currentDurationStr = toDisplayTime(currentDuration);\n const totalDurationStr = toDisplayTime(totalDuration);\n const hasDates = !!startDate && !!endDate;\n return (\n <div data-testid=\"timeline-component\" className=\"timeline-component\">\n <PlayButton isPlaying={isPlaying} onPlay={playOrReplay} onPause={pause} />\n <div className=\"time-container\">\n {hasDates && (\n <span data-testid=\"test-start-date\" className=\"timeline-date\">\n {toDateString(startDate, timeZoneOffset, dateFormatOptions)}\n </span>\n )}\n {hasDates && !showDuration && (\n <span data-testid=\"test-start-time\" className=\"timeline-time\">\n {toTimeString(startDate, timeZoneOffset, timeFormatOptions)}\n </span>\n )}\n {showDuration && (\n <span className=\"timeline-duration-time\">{currentDurationStr}</span>\n )}\n </div>\n <Scrubber\n className=\"slider\"\n currentDuration={currentDuration}\n totalDuration={totalDuration}\n startDate={startDate}\n endDate={endDate}\n isPlaying={isPlaying}\n showTime={!showDuration}\n onChange={onTimelineChange}\n onUpdate={onTimelineChange}\n timeZoneOffset={props.timeZoneOffset}\n markDate={props.markDate}\n />\n <div className=\"time-container\">\n {hasDates && (\n <span data-testid=\"test-end-date\" className=\"timeline-date\">\n {toDateString(endDate, timeZoneOffset)}\n </span>\n )}\n {hasDates && !showDuration && (\n <span className=\"timeline-time\">\n {toTimeString(endDate, timeZoneOffset, timeFormatOptions)}\n </span>\n )}\n {showDuration && (\n <InlineEdit\n className=\"timeline-duration-time\"\n defaultValue={totalDurationStr}\n onChange={(value) => {\n const newTotalDuration = timeToMs(value);\n updateTotalDuration(newTotalDuration);\n }}\n />\n )}\n </div>\n <SettingsMenu\n appMenuItems={props.appMenuItems}\n appMenuItemOption={appMenuItemOption}\n includeRepeat={includeRepeat}\n repeat={repeat}\n totalDuration={totalDuration}\n onRepeatClick={() => {\n updateRepeat(!repeat);\n }}\n onTotalDurationChange={(newTotalDuration) => {\n updateTotalDuration(newTotalDuration);\n }}\n />\n </div>\n );\n}\n\ntype SettingsMenuProps = Pick<\n TimelineComponentProps,\n \"appMenuItems\" | \"totalDuration\"\n> &\n Pick<\n Required<TimelineComponentProps>,\n \"appMenuItemOption\" | \"includeRepeat\" | \"repeat\"\n > & {\n onRepeatClick: () => void;\n onTotalDurationChange: (totalDuration: number) => void;\n };\n\nfunction SettingsMenu({\n appMenuItems,\n appMenuItemOption,\n includeRepeat,\n repeat,\n totalDuration,\n onRepeatClick,\n onTotalDurationChange,\n}: SettingsMenuProps) {\n const { translate } = useTranslation();\n\n const menuItems = React.useMemo(() => {\n const standardItems: TimelineMenuItemProps[] = [\n {\n label: translate(\"timeline.slow\"),\n timelineDuration: slowSpeed,\n },\n {\n label: translate(\"timeline.medium\"),\n timelineDuration: mediumSpeed,\n },\n {\n label: translate(\"timeline.fast\"),\n timelineDuration: fastSpeed,\n },\n ];\n\n if (!appMenuItems) {\n return standardItems;\n }\n\n if (appMenuItemOption === \"append\") {\n return [...standardItems, ...appMenuItems];\n }\n if (appMenuItemOption === \"prefix\") {\n return [...appMenuItems, ...standardItems];\n }\n // Replace\n return appMenuItems;\n }, [appMenuItemOption, appMenuItems, translate]);\n\n return (\n <DropdownMenu\n menuItems={(close) => {\n return [\n ...(includeRepeat\n ? [\n <MenuItem\n key=\"repeat\"\n onClick={() => {\n onRepeatClick();\n close();\n }}\n startIcon={repeat ? <SvgCheckmark /> : <></>}\n >\n {translate(\"timeline.repeat\")}\n </MenuItem>,\n <MenuDivider key=\"divider\" />,\n ]\n : []),\n ...menuItems.map((item, index) => {\n const checked = totalDuration === item.timelineDuration;\n return (\n <MenuItem\n key={index}\n startIcon={checked ? <SvgCheckmark /> : <></>}\n onClick={() => {\n onTotalDurationChange(item.timelineDuration);\n close();\n }}\n >\n {item.label}\n </MenuItem>\n );\n }),\n ];\n }}\n placement=\"top-start\"\n >\n <IconButton\n data-testid=\"timeline-settings\"\n label={translate(\"button.label.settings\")}\n styleType=\"borderless\"\n >\n <SvgMoreVertical />\n </IconButton>\n </DropdownMenu>\n );\n}\n\nfunction useAnimation(\n onAnimate: (args: { delta: number }) => void,\n playing = true\n) {\n const onAnimateRef = React.useRef(onAnimate);\n onAnimateRef.current = onAnimate;\n\n const lastTimeRef = React.useRef<number | undefined>();\n\n React.useEffect(() => {\n if (!playing) return;\n\n let handle = 0;\n let didCancel = false;\n\n const animate = (time: number) => {\n if (lastTimeRef.current === undefined) {\n lastTimeRef.current = time;\n }\n\n const delta = time - lastTimeRef.current;\n lastTimeRef.current = time;\n\n onAnimateRef.current({\n delta,\n });\n\n if (didCancel) return;\n\n handle = window.requestAnimationFrame(animate);\n };\n\n handle = window.requestAnimationFrame(animate);\n return () => {\n didCancel = true;\n lastTimeRef.current = undefined;\n window.cancelAnimationFrame(handle);\n };\n }, [playing]);\n}\n\nfunction timeToMs(time: string) {\n if (time.indexOf(\":\") !== -1) {\n return (\n (Number(time.split(\":\")[0]) * 60 + Number(time.split(\":\")[1])) * 1000\n );\n } else {\n return Number(time) * 1000;\n }\n}\n\nfunction toDisplayTime(ms: number) {\n const addZero = (i: number) => {\n return i < 10 ? `0${i}` : i;\n };\n\n const date = new Date(ms);\n // const hours = date.getUTCHours();\n const minutes = date.getUTCMinutes();\n const seconds = date.getUTCSeconds();\n return `${addZero(minutes)}:${addZero(seconds)}`;\n}\n"]}
@@ -1,10 +1,7 @@
1
- interface UseTranslationResult {
2
- translate: (key: string) => string;
3
- }
4
- /**
5
- * Returns a translation function.
1
+ /** Returns a translation function.
6
2
  * @internal
7
3
  */
8
- export declare function useTranslation(): UseTranslationResult;
9
- export {};
4
+ export declare function useTranslation(): {
5
+ translate: (key: string) => string;
6
+ };
10
7
  //# sourceMappingURL=useTranslation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/useTranslation.ts"],"names":[],"mappings":"AAOA,UAAU,oBAAoB;IAC5B,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;CACpC;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,oBAAoB,CAMrD"}
1
+ {"version":3,"file":"useTranslation.d.ts","sourceRoot":"","sources":["../../../src/imodel-components-react/useTranslation.tsx"],"names":[],"mappings":"AASA;;GAEG;AACH,wBAAgB,cAAc;;EAY7B"}
@@ -2,15 +2,24 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
+ import * as defaults from "./UiIModelComponents.json";
6
+ import * as React from "react";
7
+ import { usePackageTranslation } from "@itwin/core-react";
5
8
  import { UiIModelComponents } from "./UiIModelComponents";
6
- /**
7
- * Returns a translation function.
9
+ /** Returns a translation function.
8
10
  * @internal
9
11
  */
10
12
  export function useTranslation() {
11
- const translate = (key) => {
13
+ const fallback = React.useCallback((key) => {
14
+ if (!UiIModelComponents.initialized) {
15
+ return undefined;
16
+ }
12
17
  return UiIModelComponents.translate(key);
13
- };
14
- return { translate };
18
+ }, []);
19
+ return usePackageTranslation({
20
+ namespace: UiIModelComponents.localizationNamespace,
21
+ fallback,
22
+ defaults,
23
+ });
15
24
  }
16
25
  //# sourceMappingURL=useTranslation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTranslation.js","sourceRoot":"","sources":["../../../src/imodel-components-react/useTranslation.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAEhG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAM1D;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE;QAChC,OAAO,kBAAkB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC,CAAC;IAEF,OAAO,EAAE,SAAS,EAAE,CAAC;AACvB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\nimport { UiIModelComponents } from \"./UiIModelComponents\";\n\ninterface UseTranslationResult {\n translate: (key: string) => string;\n}\n\n/**\n * Returns a translation function.\n * @internal\n */\nexport function useTranslation(): UseTranslationResult {\n const translate = (key: string) => {\n return UiIModelComponents.translate(key);\n };\n\n return { translate };\n}\n"]}
1
+ {"version":3,"file":"useTranslation.js","sourceRoot":"","sources":["../../../src/imodel-components-react/useTranslation.tsx"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG,OAAO,KAAK,QAAQ,MAAM,2BAA2B,CAAC;AACtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,GAAW,EAAE,EAAE;QACjD,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE;YACnC,OAAO,SAAS,CAAC;SAClB;QACD,OAAO,kBAAkB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC3C,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,qBAAqB,CAAC;QAC3B,SAAS,EAAE,kBAAkB,CAAC,qBAAqB;QACnD,QAAQ;QACR,QAAQ;KACT,CAAC,CAAC;AACL,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport * as defaults from \"./UiIModelComponents.json\";\nimport * as React from \"react\";\nimport { usePackageTranslation } from \"@itwin/core-react\";\nimport { UiIModelComponents } from \"./UiIModelComponents\";\n\n/** Returns a translation function.\n * @internal\n */\nexport function useTranslation() {\n const fallback = React.useCallback((key: string) => {\n if (!UiIModelComponents.initialized) {\n return undefined;\n }\n return UiIModelComponents.translate(key);\n }, []);\n return usePackageTranslation({\n namespace: UiIModelComponents.localizationNamespace,\n fallback,\n defaults,\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ViewportComponent.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAKtD,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,WAAW,EAEX,SAAS,EACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,cAAc,EAGf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQrD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,CAAC,MAAM,SAAS,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,wBAAwB;IACxB,MAAM,EAAE,gBAAgB,CAAC;IACzB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,wDAAwD;IACxD,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB;IAChB,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,OAAO,CAAC;IACjD,gBAAgB;IAChB,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,KAAK,CAAC,SAAS,CAAC;IAC/D,sCAAsC;IACtC,mBAAmB,CAAC,EAAE,WAAW,CAAC;IAClC,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,OAAO,cAAc,CAAC;IAC/C,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,cAAc,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,qBA2UrD"}
1
+ {"version":3,"file":"ViewportComponent.d.ts","sourceRoot":"","sources":["../../../../src/imodel-components-react/viewport/ViewportComponent.tsx"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAKtD,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,WAAW,EAEX,SAAS,EACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,cAAc,EAGf,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQrD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,CAAC,MAAM,SAAS,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,wBAAwB;IACxB,MAAM,EAAE,gBAAgB,CAAC;IACzB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,UAAU,CAAC;IAC9B,2CAA2C;IAC3C,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,wDAAwD;IACxD,WAAW,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB;IAChB,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,OAAO,CAAC;IACjD,gBAAgB;IAChB,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,KAAK,CAAC,SAAS,CAAC;IAC/D,sCAAsC;IACtC,mBAAmB,CAAC,EAAE,WAAW,CAAC;IAClC,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,OAAO,cAAc,CAAC;IAC/C,sCAAsC;IACtC,sBAAsB,CAAC,EAAE,cAAc,CAAC;CACzC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,qBA4UrD"}
@@ -18,7 +18,7 @@ import { ViewportComponentEvents } from "./ViewportComponentEvents";
18
18
  export function ViewportComponent(props) {
19
19
  const { viewState, imodel, viewDefinitionId, getViewOverlay, viewManagerOverride, tentativePointOverride, onContextMenu, style, className, screenViewportOverride, controlId, viewportRef, } = props;
20
20
  // istanbul ignore next
21
- const viewManagerRef = React.useRef(viewManagerOverride !== null && viewManagerOverride !== void 0 ? viewManagerOverride : IModelApp.viewManager);
21
+ const viewManagerRef = React.useRef(viewManagerOverride ?? IModelApp.viewManager);
22
22
  const tentativePointOverrideRef = React.useRef(tentativePointOverride);
23
23
  const screenViewportCreated = React.useRef(false);
24
24
  const viewportDiv = React.useRef(null);
@@ -53,7 +53,8 @@ export function ViewportComponent(props) {
53
53
  });
54
54
  }
55
55
  };
56
- const handleStandardRotationChangeEvent = (args) => {
56
+ const handleStandardRotationChangeEvent = (args // eslint-disable-line deprecation/deprecation
57
+ ) => {
57
58
  const viewManager = viewManagerRef.current;
58
59
  const currentScreenViewport = screenViewportRef.current;
59
60
  if (currentScreenViewport &&
@@ -62,7 +63,8 @@ export function ViewportComponent(props) {
62
63
  currentScreenViewport.synchWithView();
63
64
  }
64
65
  };
65
- const handleDrawingViewportChangeEvent = (args) => {
66
+ const handleDrawingViewportChangeEvent = (args // eslint-disable-line deprecation/deprecation
67
+ ) => {
66
68
  const viewManager = viewManagerRef.current;
67
69
  const currentScreenViewport = screenViewportRef.current;
68
70
  if (currentScreenViewport &&
@@ -76,10 +78,9 @@ export function ViewportComponent(props) {
76
78
  };
77
79
  const targetPoint = React.useRef(null);
78
80
  const getRotatePoint = (vp) => {
79
- var _a, _b;
80
81
  const lastTargetPoint = targetPoint.current;
81
82
  // istanbul ignore next
82
- const tentativePoint = (_a = tentativePointOverrideRef.current) !== null && _a !== void 0 ? _a : IModelApp.tentativePoint;
83
+ const tentativePoint = tentativePointOverrideRef.current ?? IModelApp.tentativePoint;
83
84
  // istanbul ignore else
84
85
  if (tentativePoint.isActive)
85
86
  return tentativePoint.getPoint();
@@ -97,8 +98,9 @@ export function ViewportComponent(props) {
97
98
  targetPoint.current =
98
99
  undefined !== visiblePoint ? visiblePoint : vp.view.getTargetPoint();
99
100
  // istanbul ignore next
100
- return (_b = targetPoint.current) !== null && _b !== void 0 ? _b : vp.view.getCenter();
101
+ return targetPoint.current ?? vp.view.getCenter();
101
102
  };
103
+ // eslint-disable-next-line deprecation/deprecation
102
104
  const handleCubeRotationChangeEvent = (args) => {
103
105
  const viewManager = viewManagerRef.current;
104
106
  const currentScreenViewport = screenViewportRef.current;
@@ -204,8 +206,8 @@ export function ViewportComponent(props) {
204
206
  }
205
207
  // istanbul ignore next
206
208
  if (isMounted.current &&
207
- ((currentViewState === null || currentViewState === void 0 ? void 0 : currentViewState.iModel.isOpen) || (currentViewState === null || currentViewState === void 0 ? void 0 : currentViewState.iModel.isBlank))) {
208
- setInitialViewState(currentViewState === null || currentViewState === void 0 ? void 0 : currentViewState.clone());
209
+ (currentViewState?.iModel.isOpen || currentViewState?.iModel.isBlank)) {
210
+ setInitialViewState(currentViewState?.clone());
209
211
  }
210
212
  }
211
213
  if (undefined === initialViewState)
@@ -214,13 +216,12 @@ export function ViewportComponent(props) {
214
216
  const [viewOverlay, setViewOverlay] = React.useState(null);
215
217
  // This useEffect connects to ViewManger as soon as initialViewState is available once component is mounted.
216
218
  React.useEffect(() => {
217
- var _a;
218
219
  const parentDiv = viewportDiv.current;
219
220
  const viewManager = viewManagerRef.current;
220
221
  // istanbul ignore next
221
222
  if (parentDiv &&
222
223
  initialViewState &&
223
- ((initialViewState === null || initialViewState === void 0 ? void 0 : initialViewState.iModel.isOpen) || (initialViewState === null || initialViewState === void 0 ? void 0 : initialViewState.iModel.isBlank))) {
224
+ (initialViewState?.iModel.isOpen || initialViewState?.iModel.isBlank)) {
224
225
  if (!screenViewportCreated.current) {
225
226
  const screenViewport = getScreenViewport(parentDiv, initialViewState);
226
227
  screenViewportRef.current = screenViewport;
@@ -233,7 +234,7 @@ export function ViewportComponent(props) {
233
234
  }
234
235
  else {
235
236
  // istanbul ignore next
236
- (_a = screenViewportRef.current) === null || _a === void 0 ? void 0 : _a.changeView(initialViewState);
237
+ screenViewportRef.current?.changeView(initialViewState);
237
238
  }
238
239
  }
239
240
  // eslint-disable-next-line react-hooks/exhaustive-deps