@babylonjs/shared-ui-components 5.34.0 → 5.35.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 (129) hide show
  1. package/colorPicker/colorComponentEntry.js.map +1 -1
  2. package/colorPicker/colorPicker.js.map +1 -1
  3. package/colorPicker/hexColor.js.map +1 -1
  4. package/components/Button.js.map +1 -1
  5. package/components/Icon.js.map +1 -1
  6. package/components/Label.js.map +1 -1
  7. package/components/MessageDialog.js.map +1 -1
  8. package/components/TextInputWithSubmit.js.map +1 -1
  9. package/components/Toggle.js.map +1 -1
  10. package/components/bars/CommandBarComponent.js.map +1 -1
  11. package/components/bars/CommandButtonComponent.js.map +1 -1
  12. package/components/bars/CommandDropdownComponent.js.map +1 -1
  13. package/components/classNames.js.map +1 -1
  14. package/components/colorPicker/ColorComponentEntry.js.map +1 -1
  15. package/components/colorPicker/ColorPicker.js.map +1 -1
  16. package/components/colorPicker/HexColor.js.map +1 -1
  17. package/components/layout/DraggableIcon.js.map +1 -1
  18. package/components/layout/FlexibleColumn.js.map +1 -1
  19. package/components/layout/FlexibleDragHandler.js.map +1 -1
  20. package/components/layout/FlexibleDropZone.js.map +1 -1
  21. package/components/layout/FlexibleGridContainer.js.map +1 -1
  22. package/components/layout/FlexibleGridLayout.js.map +1 -1
  23. package/components/layout/FlexibleResizeBar.js.map +1 -1
  24. package/components/layout/FlexibleTab.js.map +1 -1
  25. package/components/layout/FlexibleTabsContainer.js.map +1 -1
  26. package/components/layout/LayoutContext.js.map +1 -1
  27. package/components/layout/types.js.map +1 -1
  28. package/components/layout/utils.js.map +1 -1
  29. package/components/lines/ColorLineComponent.js.map +1 -1
  30. package/components/lines/ColorPickerLineComponent.js.map +1 -1
  31. package/components/lines/FileButtonLineComponent.js.map +1 -1
  32. package/components/lines/NumericInputComponent.js.map +1 -1
  33. package/components/lines/OptionsLineComponent.js.map +1 -1
  34. package/components/reactGraphSystem/GraphConnectorHandle.js.map +1 -1
  35. package/components/reactGraphSystem/GraphContainer.js.map +1 -1
  36. package/components/reactGraphSystem/GraphContextManager.js.map +1 -1
  37. package/components/reactGraphSystem/GraphLine.js.map +1 -1
  38. package/components/reactGraphSystem/GraphLinesContainer.js.map +1 -1
  39. package/components/reactGraphSystem/GraphNode.js.map +1 -1
  40. package/components/reactGraphSystem/GraphNodesContainer.js.map +1 -1
  41. package/components/reactGraphSystem/NodeRenderer.js.map +1 -1
  42. package/components/reactGraphSystem/useGraphContext.js.map +1 -1
  43. package/lines/booleanLineComponent.js.map +1 -1
  44. package/lines/buttonLineComponent.js.map +1 -1
  45. package/lines/checkBoxLineComponent.js.map +1 -1
  46. package/lines/color3LineComponent.js.map +1 -1
  47. package/lines/color4LineComponent.js.map +1 -1
  48. package/lines/colorLineComponent.js.map +1 -1
  49. package/lines/colorPickerComponent.js.map +1 -1
  50. package/lines/draggableLineComponent.js.map +1 -1
  51. package/lines/fileButtonLineComponent.js.map +1 -1
  52. package/lines/fileMultipleButtonLineComponent.js.map +1 -1
  53. package/lines/floatLineComponent.js.map +1 -1
  54. package/lines/hexLineComponent.js.map +1 -1
  55. package/lines/iSelectedLineContainer.js.map +1 -1
  56. package/lines/iconButtonLineComponent.js.map +1 -1
  57. package/lines/iconComponent.js.map +1 -1
  58. package/lines/indentedTextLineComponent.js.map +1 -1
  59. package/lines/inputArrowsComponent.js.map +1 -1
  60. package/lines/lineContainerComponent.js.map +1 -1
  61. package/lines/linkButtonComponent.js.map +1 -1
  62. package/lines/matrixLineComponent.js.map +1 -1
  63. package/lines/messageLineComponent.js.map +1 -1
  64. package/lines/numericInputComponent.js.map +1 -1
  65. package/lines/optionsLineComponent.js.map +1 -1
  66. package/lines/popup.js.map +1 -1
  67. package/lines/radioLineComponent.js.map +1 -1
  68. package/lines/sliderLineComponent.js.map +1 -1
  69. package/lines/targetsProxy.js.map +1 -1
  70. package/lines/textInputLineComponent.js.map +1 -1
  71. package/lines/textLineComponent.js.map +1 -1
  72. package/lines/unitButton.js.map +1 -1
  73. package/lines/valueLineComponent.js.map +1 -1
  74. package/lines/vector2LineComponent.js.map +1 -1
  75. package/lines/vector3LineComponent.js.map +1 -1
  76. package/lines/vector4LineComponent.js.map +1 -1
  77. package/nodeGraphSystem/displayLedger.js.map +1 -1
  78. package/nodeGraphSystem/frameNodePort.js.map +1 -1
  79. package/nodeGraphSystem/graphCanvas.js.map +1 -1
  80. package/nodeGraphSystem/graphFrame.js.map +1 -1
  81. package/nodeGraphSystem/graphNode.js.map +1 -1
  82. package/nodeGraphSystem/interfaces/displayManager.js.map +1 -1
  83. package/nodeGraphSystem/interfaces/nodeContainer.js.map +1 -1
  84. package/nodeGraphSystem/interfaces/nodeData.js.map +1 -1
  85. package/nodeGraphSystem/interfaces/nodeLocationInfo.js.map +1 -1
  86. package/nodeGraphSystem/interfaces/portData.js.map +1 -1
  87. package/nodeGraphSystem/interfaces/propertyComponentProps.js.map +1 -1
  88. package/nodeGraphSystem/interfaces/selectionChangedOptions.js.map +1 -1
  89. package/nodeGraphSystem/nodeLink.js.map +1 -1
  90. package/nodeGraphSystem/nodePort.js.map +1 -1
  91. package/nodeGraphSystem/propertyLedger.js.map +1 -1
  92. package/nodeGraphSystem/stateManager.js.map +1 -1
  93. package/nodeGraphSystem/tools.js.map +1 -1
  94. package/nodeGraphSystem/typeLedger.js.map +1 -1
  95. package/nodeGraphSystem/types/framePortData.js.map +1 -1
  96. package/package.json +3 -4
  97. package/propertyChangedEvent.js.map +1 -1
  98. package/stories/Button.stories.js.map +1 -1
  99. package/stories/Icon.stories.js.map +1 -1
  100. package/stories/Label.stories.js.map +1 -1
  101. package/stories/MessageDialog.stories.js.map +1 -1
  102. package/stories/Toggle.stories.js.map +1 -1
  103. package/stories/bars/CommandBarComponent.stories.js.map +1 -1
  104. package/stories/bars/CommandButtonComponent.stories.js.map +1 -1
  105. package/stories/colorPicker/ColorPicker.stories.js.map +1 -1
  106. package/stories/layout/FlexibleGridLayout.stories.js.map +1 -1
  107. package/stories/lines/ColorLineComponent.stories.js.map +1 -1
  108. package/stories/lines/ColorPickerLineComponent.stories.js.map +1 -1
  109. package/stories/lines/FileButtonLineComponent.stories.js.map +1 -1
  110. package/stories/lines/NumericInputComponent.stories.js.map +1 -1
  111. package/stories/lines/OptionsLineComponent.stories.js.map +1 -1
  112. package/stringTools.js.map +1 -1
  113. package/tabs/propertyGrids/gui/checkboxPropertyGridComponent.js.map +1 -1
  114. package/tabs/propertyGrids/gui/colorPickerPropertyGridComponent.js.map +1 -1
  115. package/tabs/propertyGrids/gui/commonControlPropertyGridComponent.js.map +1 -1
  116. package/tabs/propertyGrids/gui/controlPropertyGridComponent.js.map +1 -1
  117. package/tabs/propertyGrids/gui/ellipsePropertyGridComponent.js.map +1 -1
  118. package/tabs/propertyGrids/gui/gridPropertyGridComponent.js.map +1 -1
  119. package/tabs/propertyGrids/gui/imageBasedSliderPropertyGridComponent.js.map +1 -1
  120. package/tabs/propertyGrids/gui/imagePropertyGridComponent.js.map +1 -1
  121. package/tabs/propertyGrids/gui/inputTextPropertyGridComponent.js.map +1 -1
  122. package/tabs/propertyGrids/gui/linePropertyGridComponent.js.map +1 -1
  123. package/tabs/propertyGrids/gui/radioButtonPropertyGridComponent.js.map +1 -1
  124. package/tabs/propertyGrids/gui/rectanglePropertyGridComponent.js.map +1 -1
  125. package/tabs/propertyGrids/gui/scrollViewerPropertyGridComponent.js.map +1 -1
  126. package/tabs/propertyGrids/gui/sliderPropertyGridComponent.js.map +1 -1
  127. package/tabs/propertyGrids/gui/stackPanelPropertyGridComponent.js.map +1 -1
  128. package/tabs/propertyGrids/gui/textBlockPropertyGridComponent.js.map +1 -1
  129. package/tabs/propertyGrids/lockObject.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"colorComponentEntry.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/colorPicker/colorComponentEntry.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,MAAM,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AM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,EAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAC1B,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EACrD,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAC/B,GACA,EACN,cAAK,SAAS,EAAC,8BAA8B,YAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAO,IACpE,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport type { LockObject } from \"../tabs/propertyGrids/lockObject\";\r\n\r\nexport interface IColorComponentEntryProps {\r\n value: number;\r\n label: string;\r\n max?: number;\r\n min?: number;\r\n onChange: (value: number) => void;\r\n disabled?: boolean;\r\n lockObject: LockObject;\r\n}\r\n\r\nexport class ColorComponentEntry extends React.Component<IColorComponentEntryProps> {\r\n constructor(props: IColorComponentEntryProps) {\r\n super(props);\r\n }\r\n\r\n updateValue(valueString: string) {\r\n if (/[^0-9.-]/g.test(valueString)) {\r\n return;\r\n }\r\n\r\n let valueAsNumber = parseInt(valueString);\r\n\r\n if (isNaN(valueAsNumber)) {\r\n return;\r\n }\r\n if (this.props.max != undefined && valueAsNumber > this.props.max) {\r\n valueAsNumber = this.props.max;\r\n }\r\n if (this.props.min != undefined && valueAsNumber < this.props.min) {\r\n valueAsNumber = this.props.min;\r\n }\r\n\r\n this.props.onChange(valueAsNumber);\r\n }\r\n\r\n lock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = true;\r\n }\r\n }\r\n\r\n unlock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = false;\r\n }\r\n }\r\n\r\n public render() {\r\n return (\r\n <div className=\"color-picker-component\">\r\n <div className=\"color-picker-component-value\">\r\n <input\r\n type=\"number\"\r\n step={1}\r\n className=\"numeric-input\"\r\n value={this.props.value}\r\n onBlur={() => this.unlock()}\r\n onFocus={() => this.lock()}\r\n onChange={(evt) => this.updateValue(evt.target.value)}\r\n disabled={this.props.disabled}\r\n />\r\n </div>\r\n <div className=\"color-picker-component-label\">{this.props.label}</div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"colorComponentEntry.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/colorPicker/colorComponentEntry.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,MAAM,OAAO,mBAAoB,SAAQ,KAAK,CAAC,SAAoC;IAC/E,YAAY,KAAgC;QACxC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED,WAAW,CAAC,WAAmB;QAC3B,IAAI,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;YAC/B,OAAO;SACV;QAED,IAAI,aAAa,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;QAE1C,IAAI,KAAK,CAAC,aAAa,CAAC,EAAE;YACtB,OAAO;SACV;QACD,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,SAAS,IAAI,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;YAC/D,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;SAClC;QACD,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,SAAS,IAAI,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;YAC/D,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;SAClC;QAED,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IACvC,CAAC;IAED,IAAI;QACA,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE;YACvB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;SACrC;IACL,CAAC;IAED,MAAM;QACF,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE;YACvB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,KAAK,CAAC;SACtC;IACL,CAAC;IAEM,MAAM;QACT,OAAO,CACH,eAAK,SAAS,EAAC,wBAAwB,aACnC,cAAK,SAAS,EAAC,8BAA8B,YACzC,gBACI,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,CAAC,EACP,SAAS,EAAC,eAAe,EACzB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,EAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAC1B,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EACrD,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAC/B,GACA,EACN,cAAK,SAAS,EAAC,8BAA8B,YAAE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAO,IACpE,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport type { LockObject } from \"../tabs/propertyGrids/lockObject\";\r\n\r\nexport interface IColorComponentEntryProps {\r\n value: number;\r\n label: string;\r\n max?: number;\r\n min?: number;\r\n onChange: (value: number) => void;\r\n disabled?: boolean;\r\n lockObject: LockObject;\r\n}\r\n\r\nexport class ColorComponentEntry extends React.Component<IColorComponentEntryProps> {\r\n constructor(props: IColorComponentEntryProps) {\r\n super(props);\r\n }\r\n\r\n updateValue(valueString: string) {\r\n if (/[^0-9.-]/g.test(valueString)) {\r\n return;\r\n }\r\n\r\n let valueAsNumber = parseInt(valueString);\r\n\r\n if (isNaN(valueAsNumber)) {\r\n return;\r\n }\r\n if (this.props.max != undefined && valueAsNumber > this.props.max) {\r\n valueAsNumber = this.props.max;\r\n }\r\n if (this.props.min != undefined && valueAsNumber < this.props.min) {\r\n valueAsNumber = this.props.min;\r\n }\r\n\r\n this.props.onChange(valueAsNumber);\r\n }\r\n\r\n lock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = true;\r\n }\r\n }\r\n\r\n unlock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = false;\r\n }\r\n }\r\n\r\n public render() {\r\n return (\r\n <div className=\"color-picker-component\">\r\n <div className=\"color-picker-component-value\">\r\n <input\r\n type=\"number\"\r\n step={1}\r\n className=\"numeric-input\"\r\n value={this.props.value}\r\n onBlur={() => this.unlock()}\r\n onFocus={() => this.lock()}\r\n onChange={(evt) => this.updateValue(evt.target.value)}\r\n disabled={this.props.disabled}\r\n />\r\n </div>\r\n <div className=\"color-picker-component-label\">{this.props.label}</div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"colorPicker.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/colorPicker/colorPicker.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,4CAA8B;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,oBAAoB,CAAC;AAqB5B;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK,CAAC,SAA+C;IAMlF,YAAY,KAAwB;QAChC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,YAAY,MAAM,EAAE;YACpC,IAAI,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,E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AE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;qCACvF;yCAAM;wCACH,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;qCACzD;gCACL,CAAC,GACH,GACA,IACJ,EACL,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,CACtB,cAAK,SAAS,EAAC,sBAAsB,0IAE/B,CACT,IACC,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport { Color3, Color4 } from \"core/Maths/math.color\";\r\nimport { ColorComponentEntry } from \"./colorComponentEntry\";\r\nimport { HexColor } from \"./hexColor\";\r\nimport type { LockObject } from \"../tabs/propertyGrids/lockObject\";\r\n\r\nimport \"./colorPicker.scss\";\r\n\r\n/**\r\n * Interface used to specify creation options for color picker\r\n */\r\nexport interface IColorPickerProps {\r\n color: Color3 | Color4;\r\n linearhint?: boolean;\r\n debugMode?: boolean;\r\n onColorChanged?: (color: Color3 | Color4) => void;\r\n lockObject: LockObject;\r\n}\r\n\r\n/**\r\n * Interface used to specify creation options for color picker\r\n */\r\nexport interface IColorPickerState {\r\n color: Color3;\r\n alpha: number;\r\n}\r\n\r\n/**\r\n * Class used to create a color picker\r\n */\r\nexport class ColorPicker extends React.Component<IColorPickerProps, IColorPickerState> {\r\n private _saturationRef: React.RefObject<HTMLDivElement>;\r\n private _hueRef: React.RefObject<HTMLDivElement>;\r\n private _isSaturationPointerDown: boolean;\r\n private _isHuePointerDown: boolean;\r\n\r\n constructor(props: IColorPickerProps) {\r\n super(props);\r\n if (this.props.color instanceof Color4) {\r\n this.state = { color: new Color3(this.props.color.r, this.props.color.g, this.props.color.b), alpha: this.props.color.a };\r\n } else {\r\n this.state = { color: this.props.color.clone(), alpha: 1 };\r\n }\r\n this._saturationRef = React.createRef();\r\n this._hueRef = React.createRef();\r\n }\r\n\r\n shouldComponentUpdate(nextProps: IColorPickerProps, nextState: IColorPickerState) {\r\n return nextProps.color.toHexString() !== this.props.color.toHexString() || nextState.color.toHexString() !== this.props.color.toHexString();\r\n }\r\n\r\n onSaturationPointerDown(evt: React.PointerEvent<HTMLDivElement>) {\r\n this._evaluateSaturation(evt);\r\n this._isSaturationPointerDown = true;\r\n\r\n evt.currentTarget.setPointerCapture(evt.pointerId);\r\n }\r\n\r\n onSaturationPointerUp(evt: React.PointerEvent<HTMLDivElement>) {\r\n this._isSaturationPointerDown = false;\r\n evt.currentTarget.releasePointerCapture(evt.pointerId);\r\n }\r\n\r\n onSaturationPointerMove(evt: React.PointerEvent<HTMLDivElement>) {\r\n if (!this._isSaturationPointerDown) {\r\n return;\r\n }\r\n this._evaluateSaturation(evt);\r\n }\r\n\r\n onHuePointerDown(evt: React.PointerEvent<HTMLDivElement>) {\r\n this._evaluateHue(evt);\r\n this._isHuePointerDown = true;\r\n\r\n evt.currentTarget.setPointerCapture(evt.pointerId);\r\n }\r\n\r\n onHuePointerUp(evt: React.PointerEvent<HTMLDivElement>) {\r\n this._isHuePointerDown = false;\r\n evt.currentTarget.releasePointerCapture(evt.pointerId);\r\n }\r\n\r\n onHuePointerMove(evt: React.PointerEvent<HTMLDivElement>) {\r\n if (!this._isHuePointerDown) {\r\n return;\r\n }\r\n this._evaluateHue(evt);\r\n }\r\n\r\n private _evaluateSaturation(evt: React.PointerEvent<HTMLDivElement>) {\r\n const left = evt.nativeEvent.offsetX;\r\n const top = evt.nativeEvent.offsetY;\r\n\r\n const saturation = Math.min(1, Math.max(0.0001, left / this._saturationRef.current!.clientWidth));\r\n const value = Math.min(1, Math.max(0.0001, 1 - top / this._saturationRef.current!.clientHeight));\r\n\r\n if (this.props.debugMode) {\r\n console.log(\"Saturation: \" + saturation);\r\n console.log(\"Value: \" + value);\r\n }\r\n\r\n const hsv = this.state.color.toHSV();\r\n Color3.HSVtoRGBToRef(hsv.r, saturation, value, this.state.color);\r\n if (this.state.alpha === 0) {\r\n this.setState({ alpha: 1 });\r\n }\r\n this.setState({ color: this.state.color });\r\n }\r\n\r\n private _evaluateHue(evt: React.PointerEvent<HTMLDivElement>) {\r\n const left = evt.nativeEvent.offsetX;\r\n\r\n const hue = 360 * Math.min(0.9999, Math.max(0.0001, left / this._hueRef.current!.clientWidth));\r\n\r\n if (this.props.debugMode) {\r\n console.log(\"Hue: \" + hue);\r\n }\r\n\r\n const hsv = this.state.color.toHSV();\r\n Color3.HSVtoRGBToRef(hue, Math.max(hsv.g, 0.01), Math.max(hsv.b, 0.01), this.state.color);\r\n this.setState({ color: this.state.color });\r\n }\r\n\r\n componentDidUpdate() {\r\n this.raiseOnColorChanged();\r\n }\r\n\r\n raiseOnColorChanged() {\r\n if (!this.props.onColorChanged) {\r\n return;\r\n }\r\n\r\n if (this.props.color instanceof Color4) {\r\n const newColor4 = Color4.FromColor3(this.state.color, this.state.alpha);\r\n\r\n this.props.onColorChanged(newColor4);\r\n\r\n return;\r\n }\r\n\r\n this.props.onColorChanged(this.state.color.clone());\r\n }\r\n\r\n public render() {\r\n const color4 = Color4.FromColor3(this.state.color);\r\n color4.a = this.state.alpha;\r\n const colorHex = color4.toHexString();\r\n const hsv = this.state.color.toHSV();\r\n const colorRef = new Color3();\r\n Color3.HSVtoRGBToRef(hsv.r, 1, 1, colorRef);\r\n const colorHexRef = colorRef.toHexString();\r\n const hasAlpha = this.props.color instanceof Color4;\r\n\r\n return (\r\n <div className={\"color-picker-container\" + (this.props.linearhint ? \" with-hints\" : \"\")}>\r\n <div\r\n className=\"color-picker-saturation\"\r\n onPointerMove={(e) => this.onSaturationPointerMove(e)}\r\n onPointerDown={(e) => this.onSaturationPointerDown(e)}\r\n onPointerUp={(e) => this.onSaturationPointerUp(e)}\r\n ref={this._saturationRef}\r\n style={{\r\n background: colorHexRef,\r\n }}\r\n >\r\n <div className=\"color-picker-saturation-white\"></div>\r\n <div className=\"color-picker-saturation-black\"></div>\r\n <div\r\n className=\"color-picker-saturation-cursor\"\r\n style={{\r\n top: `${-(hsv.b * 100) + 100}%`,\r\n left: `${hsv.g * 100}%`,\r\n }}\r\n ></div>\r\n </div>\r\n <div className=\"color-picker-hue\">\r\n <div\r\n className=\"color-picker-hue-color\"\r\n style={{\r\n background: colorHex,\r\n }}\r\n ></div>\r\n <div\r\n className=\"color-picker-hue-slider\"\r\n ref={this._hueRef}\r\n onPointerMove={(e) => this.onHuePointerMove(e)}\r\n onPointerDown={(e) => this.onHuePointerDown(e)}\r\n onPointerUp={(e) => this.onHuePointerUp(e)}\r\n >\r\n <div\r\n className=\"color-picker-hue-cursor\"\r\n style={{\r\n left: `${(hsv.r / 360.0) * 100}%`,\r\n border: `1px solid ` + colorHexRef,\r\n }}\r\n ></div>\r\n </div>\r\n </div>\r\n <div className=\"color-picker-alpha\"></div>\r\n <div className=\"color-picker-rgb\">\r\n <div className=\"red\">\r\n <ColorComponentEntry\r\n lockObject={this.props.lockObject}\r\n label=\"R\"\r\n min={0}\r\n max={255}\r\n value={Math.round(this.state.color.r * 255)}\r\n onChange={(value) => {\r\n this.state.color.r = value / 255.0;\r\n this.forceUpdate();\r\n }}\r\n />\r\n </div>\r\n <div className=\"green\">\r\n <ColorComponentEntry\r\n lockObject={this.props.lockObject}\r\n label=\"G\"\r\n min={0}\r\n max={255}\r\n value={Math.round(this.state.color.g * 255)}\r\n onChange={(value) => {\r\n this.state.color.g = value / 255.0;\r\n this.forceUpdate();\r\n }}\r\n />\r\n </div>\r\n <div className=\"blue\">\r\n <ColorComponentEntry\r\n lockObject={this.props.lockObject}\r\n label=\"B\"\r\n min={0}\r\n max={255}\r\n value={Math.round(this.state.color.b * 255)}\r\n onChange={(value) => {\r\n this.state.color.b = value / 255.0;\r\n this.forceUpdate();\r\n }}\r\n />\r\n </div>\r\n <div className={\"alpha\" + (hasAlpha ? \"\" : \" grayed\")}>\r\n <ColorComponentEntry\r\n lockObject={this.props.lockObject}\r\n label=\"A\"\r\n min={0}\r\n max={255}\r\n value={Math.round(this.state.alpha * 255)}\r\n onChange={(value) => {\r\n this.setState({ alpha: value / 255.0 });\r\n this.forceUpdate();\r\n }}\r\n />\r\n </div>\r\n </div>\r\n <div className=\"color-picker-hex\">\r\n <div className=\"color-picker-hex-label\">Hex</div>\r\n <div className=\"color-picker-hex-value\">\r\n <HexColor\r\n lockObject={this.props.lockObject}\r\n expectedLength={hasAlpha ? 8 : 6}\r\n value={colorHex}\r\n onChange={(value) => {\r\n if (hasAlpha) {\r\n const color4 = Color4.FromHexString(value);\r\n this.setState({ color: new Color3(color4.r, color4.g, color4.b), alpha: color4.a });\r\n } else {\r\n this.setState({ color: Color3.FromHexString(value) });\r\n }\r\n }}\r\n />\r\n </div>\r\n </div>\r\n {this.props.linearhint && (\r\n <div className=\"color-picker-warning\">\r\n (Note: color is stored in linear mode and was converted to gamma to be displayed here (toGammaSpace() / toLinearSpace()))\r\n </div>\r\n )}\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"colorPicker.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/colorPicker/colorPicker.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,4CAA8B;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,oBAAoB,CAAC;AAqB5B;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,KAAK,CAAC,SAA+C;IAMlF,YAAY,KAAwB;QAChC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,YAAY,MAAM,EAAE;YACpC,IAAI,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE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EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;qCACvF;yCAAM;wCACH,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;qCACzD;gCACL,CAAC,GACH,GACA,IACJ,EACL,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,CACtB,cAAK,SAAS,EAAC,sBAAsB,0IAE/B,CACT,IACC,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport { Color3, Color4 } from \"core/Maths/math.color\";\r\nimport { ColorComponentEntry } from \"./colorComponentEntry\";\r\nimport { HexColor } from \"./hexColor\";\r\nimport type { LockObject } from \"../tabs/propertyGrids/lockObject\";\r\n\r\nimport \"./colorPicker.scss\";\r\n\r\n/**\r\n * Interface used to specify creation options for color picker\r\n */\r\nexport interface IColorPickerProps {\r\n color: Color3 | Color4;\r\n linearhint?: boolean;\r\n debugMode?: boolean;\r\n onColorChanged?: (color: Color3 | Color4) => void;\r\n lockObject: LockObject;\r\n}\r\n\r\n/**\r\n * Interface used to specify creation options for color picker\r\n */\r\nexport interface IColorPickerState {\r\n color: Color3;\r\n alpha: number;\r\n}\r\n\r\n/**\r\n * Class used to create a color picker\r\n */\r\nexport class ColorPicker extends React.Component<IColorPickerProps, IColorPickerState> {\r\n private _saturationRef: React.RefObject<HTMLDivElement>;\r\n private _hueRef: React.RefObject<HTMLDivElement>;\r\n private _isSaturationPointerDown: boolean;\r\n private _isHuePointerDown: boolean;\r\n\r\n constructor(props: IColorPickerProps) {\r\n super(props);\r\n if (this.props.color instanceof Color4) {\r\n this.state = { color: new Color3(this.props.color.r, this.props.color.g, this.props.color.b), alpha: this.props.color.a };\r\n } else {\r\n this.state = { color: this.props.color.clone(), alpha: 1 };\r\n }\r\n this._saturationRef = React.createRef();\r\n this._hueRef = React.createRef();\r\n }\r\n\r\n shouldComponentUpdate(nextProps: IColorPickerProps, nextState: IColorPickerState) {\r\n return nextProps.color.toHexString() !== this.props.color.toHexString() || nextState.color.toHexString() !== this.props.color.toHexString();\r\n }\r\n\r\n onSaturationPointerDown(evt: React.PointerEvent<HTMLDivElement>) {\r\n this._evaluateSaturation(evt);\r\n this._isSaturationPointerDown = true;\r\n\r\n evt.currentTarget.setPointerCapture(evt.pointerId);\r\n }\r\n\r\n onSaturationPointerUp(evt: React.PointerEvent<HTMLDivElement>) {\r\n this._isSaturationPointerDown = false;\r\n evt.currentTarget.releasePointerCapture(evt.pointerId);\r\n }\r\n\r\n onSaturationPointerMove(evt: React.PointerEvent<HTMLDivElement>) {\r\n if (!this._isSaturationPointerDown) {\r\n return;\r\n }\r\n this._evaluateSaturation(evt);\r\n }\r\n\r\n onHuePointerDown(evt: React.PointerEvent<HTMLDivElement>) {\r\n this._evaluateHue(evt);\r\n this._isHuePointerDown = true;\r\n\r\n evt.currentTarget.setPointerCapture(evt.pointerId);\r\n }\r\n\r\n onHuePointerUp(evt: React.PointerEvent<HTMLDivElement>) {\r\n this._isHuePointerDown = false;\r\n evt.currentTarget.releasePointerCapture(evt.pointerId);\r\n }\r\n\r\n onHuePointerMove(evt: React.PointerEvent<HTMLDivElement>) {\r\n if (!this._isHuePointerDown) {\r\n return;\r\n }\r\n this._evaluateHue(evt);\r\n }\r\n\r\n private _evaluateSaturation(evt: React.PointerEvent<HTMLDivElement>) {\r\n const left = evt.nativeEvent.offsetX;\r\n const top = evt.nativeEvent.offsetY;\r\n\r\n const saturation = Math.min(1, Math.max(0.0001, left / this._saturationRef.current!.clientWidth));\r\n const value = Math.min(1, Math.max(0.0001, 1 - top / this._saturationRef.current!.clientHeight));\r\n\r\n if (this.props.debugMode) {\r\n console.log(\"Saturation: \" + saturation);\r\n console.log(\"Value: \" + value);\r\n }\r\n\r\n const hsv = this.state.color.toHSV();\r\n Color3.HSVtoRGBToRef(hsv.r, saturation, value, this.state.color);\r\n if (this.state.alpha === 0) {\r\n this.setState({ alpha: 1 });\r\n }\r\n this.setState({ color: this.state.color });\r\n }\r\n\r\n private _evaluateHue(evt: React.PointerEvent<HTMLDivElement>) {\r\n const left = evt.nativeEvent.offsetX;\r\n\r\n const hue = 360 * Math.min(0.9999, Math.max(0.0001, left / this._hueRef.current!.clientWidth));\r\n\r\n if (this.props.debugMode) {\r\n console.log(\"Hue: \" + hue);\r\n }\r\n\r\n const hsv = this.state.color.toHSV();\r\n Color3.HSVtoRGBToRef(hue, Math.max(hsv.g, 0.01), Math.max(hsv.b, 0.01), this.state.color);\r\n this.setState({ color: this.state.color });\r\n }\r\n\r\n componentDidUpdate() {\r\n this.raiseOnColorChanged();\r\n }\r\n\r\n raiseOnColorChanged() {\r\n if (!this.props.onColorChanged) {\r\n return;\r\n }\r\n\r\n if (this.props.color instanceof Color4) {\r\n const newColor4 = Color4.FromColor3(this.state.color, this.state.alpha);\r\n\r\n this.props.onColorChanged(newColor4);\r\n\r\n return;\r\n }\r\n\r\n this.props.onColorChanged(this.state.color.clone());\r\n }\r\n\r\n public render() {\r\n const color4 = Color4.FromColor3(this.state.color);\r\n color4.a = this.state.alpha;\r\n const colorHex = color4.toHexString();\r\n const hsv = this.state.color.toHSV();\r\n const colorRef = new Color3();\r\n Color3.HSVtoRGBToRef(hsv.r, 1, 1, colorRef);\r\n const colorHexRef = colorRef.toHexString();\r\n const hasAlpha = this.props.color instanceof Color4;\r\n\r\n return (\r\n <div className={\"color-picker-container\" + (this.props.linearhint ? \" with-hints\" : \"\")}>\r\n <div\r\n className=\"color-picker-saturation\"\r\n onPointerMove={(e) => this.onSaturationPointerMove(e)}\r\n onPointerDown={(e) => this.onSaturationPointerDown(e)}\r\n onPointerUp={(e) => this.onSaturationPointerUp(e)}\r\n ref={this._saturationRef}\r\n style={{\r\n background: colorHexRef,\r\n }}\r\n >\r\n <div className=\"color-picker-saturation-white\"></div>\r\n <div className=\"color-picker-saturation-black\"></div>\r\n <div\r\n className=\"color-picker-saturation-cursor\"\r\n style={{\r\n top: `${-(hsv.b * 100) + 100}%`,\r\n left: `${hsv.g * 100}%`,\r\n }}\r\n ></div>\r\n </div>\r\n <div className=\"color-picker-hue\">\r\n <div\r\n className=\"color-picker-hue-color\"\r\n style={{\r\n background: colorHex,\r\n }}\r\n ></div>\r\n <div\r\n className=\"color-picker-hue-slider\"\r\n ref={this._hueRef}\r\n onPointerMove={(e) => this.onHuePointerMove(e)}\r\n onPointerDown={(e) => this.onHuePointerDown(e)}\r\n onPointerUp={(e) => this.onHuePointerUp(e)}\r\n >\r\n <div\r\n className=\"color-picker-hue-cursor\"\r\n style={{\r\n left: `${(hsv.r / 360.0) * 100}%`,\r\n border: `1px solid ` + colorHexRef,\r\n }}\r\n ></div>\r\n </div>\r\n </div>\r\n <div className=\"color-picker-alpha\"></div>\r\n <div className=\"color-picker-rgb\">\r\n <div className=\"red\">\r\n <ColorComponentEntry\r\n lockObject={this.props.lockObject}\r\n label=\"R\"\r\n min={0}\r\n max={255}\r\n value={Math.round(this.state.color.r * 255)}\r\n onChange={(value) => {\r\n this.state.color.r = value / 255.0;\r\n this.forceUpdate();\r\n }}\r\n />\r\n </div>\r\n <div className=\"green\">\r\n <ColorComponentEntry\r\n lockObject={this.props.lockObject}\r\n label=\"G\"\r\n min={0}\r\n max={255}\r\n value={Math.round(this.state.color.g * 255)}\r\n onChange={(value) => {\r\n this.state.color.g = value / 255.0;\r\n this.forceUpdate();\r\n }}\r\n />\r\n </div>\r\n <div className=\"blue\">\r\n <ColorComponentEntry\r\n lockObject={this.props.lockObject}\r\n label=\"B\"\r\n min={0}\r\n max={255}\r\n value={Math.round(this.state.color.b * 255)}\r\n onChange={(value) => {\r\n this.state.color.b = value / 255.0;\r\n this.forceUpdate();\r\n }}\r\n />\r\n </div>\r\n <div className={\"alpha\" + (hasAlpha ? \"\" : \" grayed\")}>\r\n <ColorComponentEntry\r\n lockObject={this.props.lockObject}\r\n label=\"A\"\r\n min={0}\r\n max={255}\r\n value={Math.round(this.state.alpha * 255)}\r\n onChange={(value) => {\r\n this.setState({ alpha: value / 255.0 });\r\n this.forceUpdate();\r\n }}\r\n />\r\n </div>\r\n </div>\r\n <div className=\"color-picker-hex\">\r\n <div className=\"color-picker-hex-label\">Hex</div>\r\n <div className=\"color-picker-hex-value\">\r\n <HexColor\r\n lockObject={this.props.lockObject}\r\n expectedLength={hasAlpha ? 8 : 6}\r\n value={colorHex}\r\n onChange={(value) => {\r\n if (hasAlpha) {\r\n const color4 = Color4.FromHexString(value);\r\n this.setState({ color: new Color3(color4.r, color4.g, color4.b), alpha: color4.a });\r\n } else {\r\n this.setState({ color: Color3.FromHexString(value) });\r\n }\r\n }}\r\n />\r\n </div>\r\n </div>\r\n {this.props.linearhint && (\r\n <div className=\"color-picker-warning\">\r\n (Note: color is stored in linear mode and was converted to gamma to be displayed here (toGammaSpace() / toLinearSpace()))\r\n </div>\r\n )}\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"hexColor.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/colorPicker/hexColor.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,OAAO,QAAS,SAAQ,KAAK,CAAC,SAA0C;IAC1E,YAAY,KAAqB;QAC7B,KAAK,CAAC,KAAK,CAAC,CAAC;QAEb,IAAI,CAAC,KAAK,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC;IAC5D,CAAC;IAED,qBAAqB,CAAC,SAAyB,EAAE,SAA0B;QACvE,IAAI,SAAS,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;YACtC,SAAS,CAAC,GAAG,GAAG,SAAS,CAAC,KAAK,CAAC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G,CAAC,MAAM,CAAC,KAAK,CAAC,GAC1D,CACL,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport type { LockObject } from \"../tabs/propertyGrids/lockObject\";\r\n\r\nexport interface IHexColorProps {\r\n value: string;\r\n expectedLength: number;\r\n onChange: (value: string) => void;\r\n lockObject: LockObject;\r\n}\r\n\r\nexport class HexColor extends React.Component<IHexColorProps, { hex: string }> {\r\n constructor(props: IHexColorProps) {\r\n super(props);\r\n\r\n this.state = { hex: this.props.value.replace(\"#\", \"\") };\r\n }\r\n\r\n shouldComponentUpdate(nextProps: IHexColorProps, nextState: { hex: string }) {\r\n if (nextProps.value !== this.props.value) {\r\n nextState.hex = nextProps.value.replace(\"#\", \"\");\r\n }\r\n\r\n return true;\r\n }\r\n\r\n lock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = true;\r\n }\r\n }\r\n\r\n unlock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = false;\r\n }\r\n }\r\n\r\n updateHexValue(valueString: string) {\r\n if (valueString != \"\" && /^[0-9A-Fa-f]+$/g.test(valueString) == false) {\r\n return;\r\n }\r\n\r\n this.setState({ hex: valueString });\r\n\r\n if (valueString.length !== this.props.expectedLength) {\r\n if (this.props.expectedLength === 8 && valueString.length === 6) {\r\n valueString = valueString + \"FF\";\r\n } else {\r\n return;\r\n }\r\n }\r\n\r\n this.props.onChange(\"#\" + valueString);\r\n }\r\n\r\n public render() {\r\n return (\r\n <input\r\n type=\"string\"\r\n className=\"hex-input\"\r\n value={this.state.hex}\r\n onBlur={() => this.unlock()}\r\n onFocus={() => this.lock()}\r\n onChange={(evt) => this.updateHexValue(evt.target.value)}\r\n />\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"hexColor.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/colorPicker/hexColor.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM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AED,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC;IAC3C,CAAC;IAEM,MAAM;QACT,OAAO,CACH,gBACI,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,WAAW,EACrB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,EACrB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,EAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAC1B,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAC1D,CACL,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport type { LockObject } from \"../tabs/propertyGrids/lockObject\";\r\n\r\nexport interface IHexColorProps {\r\n value: string;\r\n expectedLength: number;\r\n onChange: (value: string) => void;\r\n lockObject: LockObject;\r\n}\r\n\r\nexport class HexColor extends React.Component<IHexColorProps, { hex: string }> {\r\n constructor(props: IHexColorProps) {\r\n super(props);\r\n\r\n this.state = { hex: this.props.value.replace(\"#\", \"\") };\r\n }\r\n\r\n shouldComponentUpdate(nextProps: IHexColorProps, nextState: { hex: string }) {\r\n if (nextProps.value !== this.props.value) {\r\n nextState.hex = nextProps.value.replace(\"#\", \"\");\r\n }\r\n\r\n return true;\r\n }\r\n\r\n lock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = true;\r\n }\r\n }\r\n\r\n unlock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = false;\r\n }\r\n }\r\n\r\n updateHexValue(valueString: string) {\r\n if (valueString != \"\" && /^[0-9A-Fa-f]+$/g.test(valueString) == false) {\r\n return;\r\n }\r\n\r\n this.setState({ hex: valueString });\r\n\r\n if (valueString.length !== this.props.expectedLength) {\r\n if (this.props.expectedLength === 8 && valueString.length === 6) {\r\n valueString = valueString + \"FF\";\r\n } else {\r\n return;\r\n }\r\n }\r\n\r\n this.props.onChange(\"#\" + valueString);\r\n }\r\n\r\n public render() {\r\n return (\r\n <input\r\n type=\"string\"\r\n className=\"hex-input\"\r\n value={this.state.hex}\r\n onBlur={() => this.unlock()}\r\n onFocus={() => this.lock()}\r\n onChange={(evt) => this.updateHexValue(evt.target.value)}\r\n />\r\n );\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/components/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAY1C,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE;IAC1H,OAAO,CACH,iBACI,SAAS,EAAE,UAAU,CACjB,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,KAAK,MAAM,EAAE,KAAK,EAAE,IAAI,KAAK,OAAO,EAAE,OAAO,EAAE,IAAI,KAAK,SAAS,EAAE,KAAK,EAAE,KAAK,KAAK,OAAO,EAAE,IAAI,EAAE,KAAK,KAAK,MAAM,EAAE,EACvJ,MAAM,CACT,EACD,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,EAAE,eAAe,EAAE,YAEzB,QAAQ,GACJ,CACZ,CAAC;AACN,CAAC,CAAC","sourcesContent":["import styles from \"./Button.modules.scss\";\r\nimport { ClassNames } from \"./classNames\";\r\n\r\nexport type ButtonProps = {\r\n disabled?: boolean;\r\n active?: boolean;\r\n onClick?: () => void;\r\n color: \"light\" | \"dark\";\r\n size: \"default\" | \"small\" | \"wide\" | \"smaller\";\r\n title?: string;\r\n backgroundColor?: string;\r\n};\r\n\r\nexport const Button: React.FC<ButtonProps> = ({ disabled, active, onClick, children, color, size, title, backgroundColor }) => {\r\n return (\r\n <button\r\n className={ClassNames(\r\n { button: true, active, wide: size === \"wide\", small: size === \"small\", smaller: size === \"smaller\", light: color === \"light\", dark: color === \"dark\" },\r\n styles\r\n )}\r\n disabled={disabled}\r\n onClick={onClick}\r\n title={title}\r\n style={{ backgroundColor }}\r\n >\r\n {children}\r\n </button>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/components/Button.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAY1C,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,eAAe,EAAE,EAAE,EAAE;IAC1H,OAAO,CACH,iBACI,SAAS,EAAE,UAAU,CACjB,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,KAAK,MAAM,EAAE,KAAK,EAAE,IAAI,KAAK,OAAO,EAAE,OAAO,EAAE,IAAI,KAAK,SAAS,EAAE,KAAK,EAAE,KAAK,KAAK,OAAO,EAAE,IAAI,EAAE,KAAK,KAAK,MAAM,EAAE,EACvJ,MAAM,CACT,EACD,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,EAAE,eAAe,EAAE,YAEzB,QAAQ,GACJ,CACZ,CAAC;AACN,CAAC,CAAC","sourcesContent":["import styles from \"./Button.modules.scss\";\r\nimport { ClassNames } from \"./classNames\";\r\n\r\nexport type ButtonProps = {\r\n disabled?: boolean;\r\n active?: boolean;\r\n onClick?: () => void;\r\n color: \"light\" | \"dark\";\r\n size: \"default\" | \"small\" | \"wide\" | \"smaller\";\r\n title?: string;\r\n backgroundColor?: string;\r\n};\r\n\r\nexport const Button: React.FC<ButtonProps> = ({ disabled, active, onClick, children, color, size, title, backgroundColor }) => {\r\n return (\r\n <button\r\n className={ClassNames(\r\n { button: true, active, wide: size === \"wide\", small: size === \"small\", smaller: size === \"smaller\", light: color === \"light\", dark: color === \"dark\" },\r\n styles\r\n )}\r\n disabled={disabled}\r\n onClick={onClick}\r\n title={title}\r\n style={{ backgroundColor }}\r\n >\r\n {children}\r\n </button>\r\n );\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/components/Icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAOzC,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;IAClE,OAAO,cAAK,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,OAAO,EAAE,EAAE,MAAM,CAAC,GAAI,CAAC;AACrI,CAAC,CAAC","sourcesContent":["import { ClassNames } from \"./classNames\";\r\nimport styles from \"./Icon.modules.scss\";\r\n\r\nexport type IconProps = {\r\n color?: \"dark\" | \"light\";\r\n icon: string;\r\n};\r\n\r\nexport const Icon: React.FC<IconProps> = ({ color = \"dark\", icon }) => {\r\n return <img src={icon} style={{ width: \"100%\", height: \"100%\" }} className={ClassNames({ light: color === \"light\" }, styles)} />;\r\n};\r\n"]}
1
+ {"version":3,"file":"Icon.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/components/Icon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAOzC,MAAM,CAAC,MAAM,IAAI,GAAwB,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;IAClE,OAAO,cAAK,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,OAAO,EAAE,EAAE,MAAM,CAAC,GAAI,CAAC;AACrI,CAAC,CAAC","sourcesContent":["import { ClassNames } from \"./classNames\";\r\nimport styles from \"./Icon.modules.scss\";\r\n\r\nexport type IconProps = {\r\n color?: \"dark\" | \"light\";\r\n icon: string;\r\n};\r\n\r\nexport const Icon: React.FC<IconProps> = ({ color = \"dark\", icon }) => {\r\n return <img src={icon} style={{ width: \"100%\", height: \"100%\" }} className={ClassNames({ light: color === \"light\" }, styles)} />;\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Label.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/components/Label.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAQ1C,MAAM,CAAC,MAAM,KAAK,GAAyB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE;IACrE,OAAO,CACH,iBAAO,SAAS,EAAE,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,KAAK,OAAO,EAAE,IAAI,EAAE,KAAK,KAAK,MAAM,EAAE,EAAE,MAAM,CAAC,aACnG,yBAAO,IAAI,GAAQ,EAClB,QAAQ,IACL,CACX,CAAC;AACN,CAAC,CAAC","sourcesContent":["import type { ReactChild } from \"react\";\r\nimport { ClassNames } from \"./classNames\";\r\nimport styles from \"./Label.modules.scss\";\r\n\r\nexport type LabelProps = {\r\n text: string;\r\n children?: ReactChild;\r\n color?: \"dark\" | \"light\";\r\n};\r\n\r\nexport const Label: React.FC<LabelProps> = ({ text, children, color }) => {\r\n return (\r\n <label className={ClassNames({ label: true, light: color === \"light\", dark: color === \"dark\" }, styles)}>\r\n <span>{text}</span>\r\n {children}\r\n </label>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"Label.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/components/Label.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAQ1C,MAAM,CAAC,MAAM,KAAK,GAAyB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE;IACrE,OAAO,CACH,iBAAO,SAAS,EAAE,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,KAAK,OAAO,EAAE,IAAI,EAAE,KAAK,KAAK,MAAM,EAAE,EAAE,MAAM,CAAC,aACnG,yBAAO,IAAI,GAAQ,EAClB,QAAQ,IACL,CACX,CAAC;AACN,CAAC,CAAC","sourcesContent":["import type { ReactChild } from \"react\";\r\nimport { ClassNames } from \"./classNames\";\r\nimport styles from \"./Label.modules.scss\";\r\n\r\nexport type LabelProps = {\r\n text: string;\r\n children?: ReactChild;\r\n color?: \"dark\" | \"light\";\r\n};\r\n\r\nexport const Label: React.FC<LabelProps> = ({ text, children, color }) => {\r\n return (\r\n <label className={ClassNames({ label: true, light: color === \"light\", dark: color === \"dark\" }, styles)}>\r\n <span>{text}</span>\r\n {children}\r\n </label>\r\n );\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MessageDialog.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/components/Message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,CAAC","sourcesContent":["import { useState, useEffect } from \"react\";\r\nimport * as React from \"react\";\r\nimport { ClassNames } from \"./classNames\";\r\nimport styles from \"./MessageDialog.modules.scss\";\r\n\r\nexport interface MessageDialogProps {\r\n message: string;\r\n isError: boolean;\r\n onClose?: () => void;\r\n}\r\n\r\nexport const MessageDialog: React.FC<MessageDialogProps> = (props) => {\r\n const [message, setMessage] = useState(props.message);\r\n const [isError, setIsError] = useState(props.isError);\r\n\r\n useEffect(() => {\r\n setMessage(props.message);\r\n setIsError(props.isError);\r\n }, [props]);\r\n\r\n const onClick = () => {\r\n setMessage(\"\");\r\n if (props.onClose) {\r\n props.onClose();\r\n }\r\n };\r\n\r\n if (!message) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className={styles[\"dialog-container\"]}>\r\n <div className={styles[\"dialog\"]}>\r\n <div className={styles[\"dialog-message\"]}>{message}</div>\r\n <div className={styles[\"dialog-buttons\"]}>\r\n <div className={ClassNames({ \"dialog-button-ok\": true, error: isError }, styles)} onClick={onClick}>\r\n OK\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"MessageDialog.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/components/MessageDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,MAAM,MAAM,8BAA8B,CAAC;AAQlD,MAAM,CAAC,MAAM,aAAa,GAAiC,CAAC,KAAK,EAAE,EAAE;IACjE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACtD,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAEtD,SAAS,CAAC,GAAG,EAAE;QACX,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1B,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,MAAM,OAAO,GAAG,GAAG,EAAE;QACjB,UAAU,CAAC,EAAE,CAAC,CAAC;QACf,IAAI,KAAK,CAAC,OAAO,EAAE;YACf,KAAK,CAAC,OAAO,EAAE,CAAC;SACnB;IACL,CAAC,CAAC;IAEF,IAAI,CAAC,OAAO,EAAE;QACV,OAAO,IAAI,CAAC;KACf;IAED,OAAO,CACH,cAAK,SAAS,EAAE,MAAM,CAAC,kBAAkB,CAAC,YACtC,eAAK,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,aAC5B,cAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,YAAG,OAAO,GAAO,EACzD,cAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,YACpC,cAAK,SAAS,EAAE,UAAU,CAAC,EAAE,kBAAkB,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,mBAE5F,GACJ,IACJ,GACJ,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { useState, useEffect } from \"react\";\r\nimport * as React from \"react\";\r\nimport { ClassNames } from \"./classNames\";\r\nimport styles from \"./MessageDialog.modules.scss\";\r\n\r\nexport interface MessageDialogProps {\r\n message: string;\r\n isError: boolean;\r\n onClose?: () => void;\r\n}\r\n\r\nexport const MessageDialog: React.FC<MessageDialogProps> = (props) => {\r\n const [message, setMessage] = useState(props.message);\r\n const [isError, setIsError] = useState(props.isError);\r\n\r\n useEffect(() => {\r\n setMessage(props.message);\r\n setIsError(props.isError);\r\n }, [props]);\r\n\r\n const onClick = () => {\r\n setMessage(\"\");\r\n if (props.onClose) {\r\n props.onClose();\r\n }\r\n };\r\n\r\n if (!message) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className={styles[\"dialog-container\"]}>\r\n <div className={styles[\"dialog\"]}>\r\n <div className={styles[\"dialog-message\"]}>{message}</div>\r\n <div className={styles[\"dialog-buttons\"]}>\r\n <div className={ClassNames({ \"dialog-button-ok\": true, error: isError }, styles)} onClick={onClick}>\r\n OK\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"TextInputWithSubmit.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/components/TextInputWithSubmit.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,KAAK,MAAM,oCAAoC,CAAC;AAEvD,OAAO,UAAU,MAAM,oCAAoC,CAAC;AAC5D,OAAO,UAAU,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAU1C;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAsB,EAAE,EAAE;IAC1D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAE5F,SAAS,CAAC,GAAG,EAAE;QACX,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACtE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,MA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Button\";\r\nimport { Icon } from \"./Icon\";\r\nimport style from \"./TextInputWithSubmit.modules.scss\";\r\n\r\nimport submitIcon from \"../imgs/confirmGridElementDark.svg\";\r\nimport cancelIcon from \"../imgs/deleteGridElementDark.svg\";\r\nimport { ClassNames } from \"./classNames\";\r\n\r\nexport interface ITextInputProps {\r\n label?: string;\r\n placeholder?: string;\r\n submitValue: (newValue: string) => void; // Function to call when the value is updated\r\n validateValue?: (value: string) => boolean; // Function to call to validate the value\r\n cancelSubmit?: () => void; // Function to call when the user cancels the submit\r\n}\r\n\r\n/**\r\n * This component represents a text input that can be submitted or cancelled on buttons\r\n */\r\nexport const TextInputWithSubmit = (props: ITextInputProps) => {\r\n const [value, setValue] = useState(\"\");\r\n const [valid, setValid] = useState(props.validateValue ? props.validateValue(value) : true);\r\n\r\n useEffect(() => {\r\n setValid(props.validateValue ? props.validateValue(value) : true);\r\n }, [value]);\r\n\r\n const onChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n setValue(event.target.value);\r\n };\r\n\r\n const onClickSubmit = () => {\r\n props.submitValue(value);\r\n };\r\n\r\n const onClickCancel = () => {\r\n props.cancelSubmit?.();\r\n setValue(\"\");\r\n };\r\n\r\n return (\r\n <div className={ClassNames({ line: true, valid, invalid: !valid }, style)}>\r\n {props.label && <label>{props.label}</label>}\r\n <input className={style.input} type=\"text\" placeholder={props.placeholder} value={value} onChange={onChange} />\r\n <div>\r\n <Button color=\"light\" size=\"smaller\" backgroundColor=\"inherit\" onClick={onClickSubmit} disabled={!valid}>\r\n <Icon icon={submitIcon} color=\"dark\"></Icon>\r\n </Button>\r\n <Button color=\"light\" size=\"smaller\" backgroundColor=\"inherit\" onClick={onClickCancel}>\r\n <Icon icon={cancelIcon} color=\"dark\"></Icon>\r\n </Button>\r\n </div>\r\n </div>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"TextInputWithSubmit.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/components/TextInputWithSubmit.tsx"],"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jB,CAAC,CAAC;IAEF,OAAO,CACH,eAAK,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,KAAK,CAAC,aACpE,KAAK,CAAC,KAAK,IAAI,0BAAQ,KAAK,CAAC,KAAK,GAAS,EAC5C,gBAAO,SAAS,EAAE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAC,MAAM,EAAC,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,GAAI,EAC/G,0BACI,KAAC,MAAM,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,SAAS,EAAC,eAAe,EAAC,SAAS,EAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,KAAK,YACnG,KAAC,IAAI,IAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAC,MAAM,GAAQ,GACvC,EACT,KAAC,MAAM,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,EAAC,SAAS,EAAC,eAAe,EAAC,SAAS,EAAC,OAAO,EAAE,aAAa,YACjF,KAAC,IAAI,IAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAC,MAAM,GAAQ,GACvC,IACP,IACJ,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { useEffect, useState } from \"react\";\r\nimport { Button } from \"./Button\";\r\nimport { Icon } from \"./Icon\";\r\nimport style from \"./TextInputWithSubmit.modules.scss\";\r\n\r\nimport submitIcon from \"../imgs/confirmGridElementDark.svg\";\r\nimport cancelIcon from \"../imgs/deleteGridElementDark.svg\";\r\nimport { ClassNames } from \"./classNames\";\r\n\r\nexport interface ITextInputProps {\r\n label?: string;\r\n placeholder?: string;\r\n submitValue: (newValue: string) => void; // Function to call when the value is updated\r\n validateValue?: (value: string) => boolean; // Function to call to validate the value\r\n cancelSubmit?: () => void; // Function to call when the user cancels the submit\r\n}\r\n\r\n/**\r\n * This component represents a text input that can be submitted or cancelled on buttons\r\n */\r\nexport const TextInputWithSubmit = (props: ITextInputProps) => {\r\n const [value, setValue] = useState(\"\");\r\n const [valid, setValid] = useState(props.validateValue ? props.validateValue(value) : true);\r\n\r\n useEffect(() => {\r\n setValid(props.validateValue ? props.validateValue(value) : true);\r\n }, [value]);\r\n\r\n const onChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n setValue(event.target.value);\r\n };\r\n\r\n const onClickSubmit = () => {\r\n props.submitValue(value);\r\n };\r\n\r\n const onClickCancel = () => {\r\n props.cancelSubmit?.();\r\n setValue(\"\");\r\n };\r\n\r\n return (\r\n <div className={ClassNames({ line: true, valid, invalid: !valid }, style)}>\r\n {props.label && <label>{props.label}</label>}\r\n <input className={style.input} type=\"text\" placeholder={props.placeholder} value={value} onChange={onChange} />\r\n <div>\r\n <Button color=\"light\" size=\"smaller\" backgroundColor=\"inherit\" onClick={onClickSubmit} disabled={!valid}>\r\n <Icon icon={submitIcon} color=\"dark\"></Icon>\r\n </Button>\r\n <Button color=\"light\" size=\"smaller\" backgroundColor=\"inherit\" onClick={onClickCancel}>\r\n <Icon icon={cancelIcon} color=\"dark\"></Icon>\r\n </Button>\r\n </div>\r\n </div>\r\n );\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Toggle.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/components/Toggle.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,iBAAiB,MAAM,+BAA+B,CAAC;AAC9D,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AACpE,OAAO,kBAAkB,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,KAAK,GAAG;IACV,EAAE,EAAE,iBAAiB;IACrB,KAAK,EAAE,oBAAoB;IAC3B,GAAG,EAAE,kBAAkB;CAC1B,CAAC;AASF,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,EAAE,EAAE,EAAE;IACtH,OAAO,CACH,iBAAO,SAAS,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,aAC1D,gBAAO,IAAI,EAAC,UAAU,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,GAAI,EAC5G,KAAC,IAAI,IAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,GAAI,IACxC,CACX,CAAC;AACN,CAAC,CAAC","sourcesContent":["import styles from \"./Toggle.modules.scss\";\r\nimport { ClassNames } from \"./classNames\";\r\n\r\nimport toggleOnIcon_30px from \"../imgs/toggleOnIcon_30px.svg\";\r\nimport toggleMixedIcon_30px from \"../imgs/toggleMixedIcon_30px.svg\";\r\nimport toggleOffIcon_30px from \"../imgs/toggleOffIcon_30px.svg\";\r\nimport { Icon } from \"./Icon\";\r\n\r\nconst Icons = {\r\n on: toggleOnIcon_30px,\r\n mixed: toggleMixedIcon_30px,\r\n off: toggleOffIcon_30px,\r\n};\r\n\r\nexport type ToggleProps = {\r\n toggled: \"on\" | \"mixed\" | \"off\";\r\n onToggle?: () => void;\r\n padded?: boolean;\r\n color?: \"dark\" | \"light\";\r\n};\r\n\r\nexport const Toggle: React.FC<ToggleProps> = ({ color = \"dark\", toggled = \"off\", padded = false, onToggle = () => {} }) => {\r\n return (\r\n <label className={ClassNames({ toggle: true, padded }, styles)}>\r\n <input type=\"checkbox\" style={{ display: \"none\" }} checked={toggled === \"on\"} onChange={() => onToggle()} />\r\n <Icon icon={Icons[toggled]} color={color} />\r\n </label>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"Toggle.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/components/Toggle.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,MAAM,uBAAuB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,iBAAiB,MAAM,+BAA+B,CAAC;AAC9D,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AACpE,OAAO,kBAAkB,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,KAAK,GAAG;IACV,EAAE,EAAE,iBAAiB;IACrB,KAAK,EAAE,oBAAoB;IAC3B,GAAG,EAAE,kBAAkB;CAC1B,CAAC;AASF,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE,QAAQ,GAAG,GAAG,EAAE,GAAE,CAAC,EAAE,EAAE,EAAE;IACtH,OAAO,CACH,iBAAO,SAAS,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,aAC1D,gBAAO,IAAI,EAAC,UAAU,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,QAAQ,EAAE,GAAI,EAC5G,KAAC,IAAI,IAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,KAAK,GAAI,IACxC,CACX,CAAC;AACN,CAAC,CAAC","sourcesContent":["import styles from \"./Toggle.modules.scss\";\r\nimport { ClassNames } from \"./classNames\";\r\n\r\nimport toggleOnIcon_30px from \"../imgs/toggleOnIcon_30px.svg\";\r\nimport toggleMixedIcon_30px from \"../imgs/toggleMixedIcon_30px.svg\";\r\nimport toggleOffIcon_30px from \"../imgs/toggleOffIcon_30px.svg\";\r\nimport { Icon } from \"./Icon\";\r\n\r\nconst Icons = {\r\n on: toggleOnIcon_30px,\r\n mixed: toggleMixedIcon_30px,\r\n off: toggleOffIcon_30px,\r\n};\r\n\r\nexport type ToggleProps = {\r\n toggled: \"on\" | \"mixed\" | \"off\";\r\n onToggle?: () => void;\r\n padded?: boolean;\r\n color?: \"dark\" | \"light\";\r\n};\r\n\r\nexport const Toggle: React.FC<ToggleProps> = ({ color = \"dark\", toggled = \"off\", padded = false, onToggle = () => {} }) => {\r\n return (\r\n <label className={ClassNames({ toggle: true, padded }, styles)}>\r\n <input type=\"checkbox\" style={{ display: \"none\" }} checked={toggled === \"on\"} onChange={() => onToggle()} />\r\n <Icon icon={Icons[toggled]} color={color} />\r\n </label>\r\n );\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CommandBarComponent.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/components/bars/CommandBarComponent.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,aAAa,MAAM,8BAA8B,CAAC;AACzD,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAClD,OAAO,aAAa,MAAM,8BAA8B,CAAC;AACzD,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAE/C,OAAO,KAAK,MAAM,2BAA2B,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,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C,sBAAsB,IAAI,CAC7B,KAAC,wBAAwB,IACrB,eAAe,EAAE,KAAK,CAAC,wBAAwB,IAAI,SAAS,EAC5D,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAC5F,cAAc,EAAE,CAAC,QAAgB,EAAE,EAAE;oCACjC,IAAI,KAAK,CAAC,sBAAsB,EAAE;wCAC9B,KAAK,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC;qCAC1C;gCACL,CAAC,GACH,CACL,IACC,EACN,cAAK,SAAS,EAAE,KAAK,CAAC,OAAO,YAAG,KAAK,CAAC,QAAQ,GAAO,IACnD,EACN,cAAK,SAAS,EAAE,KAAK,CAAC,aAAa,YAC/B,cAAK,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,GAAI,GACjE,IACJ,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import type { FC } from \"react\";\r\nimport { JoinClassNames } from \"../classNames\";\r\nimport { CommandButtonComponent } from \"./CommandButtonComponent\";\r\nimport { CommandDropdownComponent } from \"./CommandDropdownComponent\";\r\n\r\nimport hamburgerIcon from \"../../imgs/hamburgerIcon.svg\";\r\nimport pointerIcon from \"../../imgs/pointerIcon.svg\";\r\nimport handIcon from \"../../imgs/handIcon.svg\";\r\nimport zoomIcon from \"../../imgs/zoomIcon.svg\";\r\nimport logoIcon from \"../../imgs/babylonLogo.svg\";\r\nimport canvasFitIcon from \"../../imgs/canvasFitIcon.svg\";\r\nimport betaFlag from \"../../imgs/betaFlag.svg\";\r\n\r\nimport style from \"./CommandBar.modules.scss\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport { ColorPickerLineComponent } from \"../lines/ColorPickerLineComponent\";\r\n\r\nexport interface ICommandBarComponentProps {\r\n onSaveButtonClicked?: () => void;\r\n onSaveToSnippetButtonClicked?: () => void;\r\n onLoadFromSnippetButtonClicked?: () => void;\r\n onHelpButtonClicked?: () => void;\r\n onGiveFeedbackButtonClicked?: () => void;\r\n onSelectButtonClicked?: () => void;\r\n onPanButtonClicked?: () => void;\r\n onZoomButtonClicked?: () => void;\r\n onFitButtonClicked?: () => void;\r\n onArtboardColorChanged?: (newColor: string) => void;\r\n artboardColor?: string;\r\n artboardColorPickerColor?: string;\r\n}\r\n\r\nexport const CommandBarComponent: FC<ICommandBarComponentProps> = (props) => {\r\n return (\r\n <div className={style.commandBar}>\r\n <div className={style.commandsLeft}>\r\n <div className={style.divider}>\r\n <img src={logoIcon} color=\"white\" className={\"active\"} draggable={false} />\r\n <CommandDropdownComponent\r\n //globalState={this.props.globalState}\r\n toRight={true}\r\n icon={hamburgerIcon}\r\n tooltip=\"Options\"\r\n items={[\r\n {\r\n label: \"Save\",\r\n onClick: () => {\r\n props.onSaveButtonClicked && props.onSaveButtonClicked();\r\n },\r\n },\r\n {\r\n label: \"Load\",\r\n fileButton: true,\r\n },\r\n {\r\n label: \"Save to snippet\",\r\n onClick: () => {\r\n props.onSaveToSnippetButtonClicked && props.onSaveToSnippetButtonClicked();\r\n },\r\n },\r\n {\r\n label: \"Load from snippet\",\r\n onClick: () => {\r\n props.onLoadFromSnippetButtonClicked && props.onLoadFromSnippetButtonClicked();\r\n },\r\n },\r\n {\r\n label: \"Help\",\r\n onClick: () => {\r\n props.onHelpButtonClicked && props.onHelpButtonClicked();\r\n },\r\n },\r\n {\r\n label: \"Give feedback\",\r\n onClick: () => {\r\n props.onGiveFeedbackButtonClicked && props.onGiveFeedbackButtonClicked();\r\n },\r\n },\r\n ]}\r\n />\r\n <CommandButtonComponent\r\n tooltip=\"Select\"\r\n icon={pointerIcon}\r\n shortcut=\"S\"\r\n isActive={false}\r\n onClick={() => {\r\n props.onSelectButtonClicked && props.onSelectButtonClicked();\r\n }}\r\n />\r\n <CommandButtonComponent\r\n tooltip=\"Pan\"\r\n icon={handIcon}\r\n shortcut=\"P\"\r\n isActive={false}\r\n onClick={() => {\r\n props.onPanButtonClicked && props.onPanButtonClicked();\r\n }}\r\n />\r\n <CommandButtonComponent\r\n tooltip=\"Zoom\"\r\n shortcut=\"Z\"\r\n icon={zoomIcon}\r\n isActive={false}\r\n onClick={() => {\r\n props.onZoomButtonClicked && props.onZoomButtonClicked();\r\n }}\r\n />\r\n </div>\r\n <div className={style.divider}>\r\n <CommandButtonComponent\r\n tooltip=\"Fit to Window\"\r\n shortcut=\"F\"\r\n icon={canvasFitIcon}\r\n isActive={false}\r\n onClick={() => {\r\n props.onFitButtonClicked && props.onFitButtonClicked();\r\n }}\r\n />\r\n </div>\r\n <div className={JoinClassNames(style, \"divider\", \"padded\")}>\r\n <div style={{ paddingRight: \"5px\" }}>Artboard:</div>\r\n {props.onArtboardColorChanged && (\r\n <ColorPickerLineComponent\r\n backgroundColor={props.artboardColorPickerColor || \"#888888\"}\r\n value={props.artboardColor ? Color3.FromHexString(props.artboardColor) : new Color3(0, 0, 0)}\r\n onColorChanged={(newColor: string) => {\r\n if (props.onArtboardColorChanged) {\r\n props.onArtboardColorChanged(newColor);\r\n }\r\n }}\r\n />\r\n )}\r\n </div>\r\n <div className={style.divider}>{props.children}</div>\r\n </div>\r\n <div className={style.commandsRight}>\r\n <img src={betaFlag} className={style.betaFlag} draggable={false} />\r\n </div>\r\n </div>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"CommandBarComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/components/bars/CommandBarComponent.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,aAAa,MAAM,8BAA8B,CAAC;AACzD,OA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,aAAa,EACnB,QAAQ,EAAE,KAAK,EACf,OAAO,EAAE,GAAG,EAAE;gCACV,KAAK,CAAC,kBAAkB,IAAI,KAAK,CAAC,kBAAkB,EAAE,CAAC;4BAC3D,CAAC,GACH,GACA,EACN,eAAK,SAAS,EAAE,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,aACtD,cAAK,KAAK,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,0BAAiB,EACnD,KAAK,CAAC,sBAAsB,IAAI,CAC7B,KAAC,wBAAwB,IACrB,eAAe,EAAE,KAAK,CAAC,wBAAwB,IAAI,SAAS,EAC5D,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAC5F,cAAc,EAAE,CAAC,QAAgB,EAAE,EAAE;oCACjC,IAAI,KAAK,CAAC,sBAAsB,EAAE;wCAC9B,KAAK,CAAC,sBAAsB,CAAC,QAAQ,CAAC,CAAC;qCAC1C;gCACL,CAAC,GACH,CACL,IACC,EACN,cAAK,SAAS,EAAE,KAAK,CAAC,OAAO,YAAG,KAAK,CAAC,QAAQ,GAAO,IACnD,EACN,cAAK,SAAS,EAAE,KAAK,CAAC,aAAa,YAC/B,cAAK,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,GAAI,GACjE,IACJ,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import type { FC } from \"react\";\r\nimport { JoinClassNames } from \"../classNames\";\r\nimport { CommandButtonComponent } from \"./CommandButtonComponent\";\r\nimport { CommandDropdownComponent } from \"./CommandDropdownComponent\";\r\n\r\nimport hamburgerIcon from \"../../imgs/hamburgerIcon.svg\";\r\nimport pointerIcon from \"../../imgs/pointerIcon.svg\";\r\nimport handIcon from \"../../imgs/handIcon.svg\";\r\nimport zoomIcon from \"../../imgs/zoomIcon.svg\";\r\nimport logoIcon from \"../../imgs/babylonLogo.svg\";\r\nimport canvasFitIcon from \"../../imgs/canvasFitIcon.svg\";\r\nimport betaFlag from \"../../imgs/betaFlag.svg\";\r\n\r\nimport style from \"./CommandBar.modules.scss\";\r\nimport { Color3 } from \"core/Maths/math.color\";\r\nimport { ColorPickerLineComponent } from \"../lines/ColorPickerLineComponent\";\r\n\r\nexport interface ICommandBarComponentProps {\r\n onSaveButtonClicked?: () => void;\r\n onSaveToSnippetButtonClicked?: () => void;\r\n onLoadFromSnippetButtonClicked?: () => void;\r\n onHelpButtonClicked?: () => void;\r\n onGiveFeedbackButtonClicked?: () => void;\r\n onSelectButtonClicked?: () => void;\r\n onPanButtonClicked?: () => void;\r\n onZoomButtonClicked?: () => void;\r\n onFitButtonClicked?: () => void;\r\n onArtboardColorChanged?: (newColor: string) => void;\r\n artboardColor?: string;\r\n artboardColorPickerColor?: string;\r\n}\r\n\r\nexport const CommandBarComponent: FC<ICommandBarComponentProps> = (props) => {\r\n return (\r\n <div className={style.commandBar}>\r\n <div className={style.commandsLeft}>\r\n <div className={style.divider}>\r\n <img src={logoIcon} color=\"white\" className={\"active\"} draggable={false} />\r\n <CommandDropdownComponent\r\n //globalState={this.props.globalState}\r\n toRight={true}\r\n icon={hamburgerIcon}\r\n tooltip=\"Options\"\r\n items={[\r\n {\r\n label: \"Save\",\r\n onClick: () => {\r\n props.onSaveButtonClicked && props.onSaveButtonClicked();\r\n },\r\n },\r\n {\r\n label: \"Load\",\r\n fileButton: true,\r\n },\r\n {\r\n label: \"Save to snippet\",\r\n onClick: () => {\r\n props.onSaveToSnippetButtonClicked && props.onSaveToSnippetButtonClicked();\r\n },\r\n },\r\n {\r\n label: \"Load from snippet\",\r\n onClick: () => {\r\n props.onLoadFromSnippetButtonClicked && props.onLoadFromSnippetButtonClicked();\r\n },\r\n },\r\n {\r\n label: \"Help\",\r\n onClick: () => {\r\n props.onHelpButtonClicked && props.onHelpButtonClicked();\r\n },\r\n },\r\n {\r\n label: \"Give feedback\",\r\n onClick: () => {\r\n props.onGiveFeedbackButtonClicked && props.onGiveFeedbackButtonClicked();\r\n },\r\n },\r\n ]}\r\n />\r\n <CommandButtonComponent\r\n tooltip=\"Select\"\r\n icon={pointerIcon}\r\n shortcut=\"S\"\r\n isActive={false}\r\n onClick={() => {\r\n props.onSelectButtonClicked && props.onSelectButtonClicked();\r\n }}\r\n />\r\n <CommandButtonComponent\r\n tooltip=\"Pan\"\r\n icon={handIcon}\r\n shortcut=\"P\"\r\n isActive={false}\r\n onClick={() => {\r\n props.onPanButtonClicked && props.onPanButtonClicked();\r\n }}\r\n />\r\n <CommandButtonComponent\r\n tooltip=\"Zoom\"\r\n shortcut=\"Z\"\r\n icon={zoomIcon}\r\n isActive={false}\r\n onClick={() => {\r\n props.onZoomButtonClicked && props.onZoomButtonClicked();\r\n }}\r\n />\r\n </div>\r\n <div className={style.divider}>\r\n <CommandButtonComponent\r\n tooltip=\"Fit to Window\"\r\n shortcut=\"F\"\r\n icon={canvasFitIcon}\r\n isActive={false}\r\n onClick={() => {\r\n props.onFitButtonClicked && props.onFitButtonClicked();\r\n }}\r\n />\r\n </div>\r\n <div className={JoinClassNames(style, \"divider\", \"padded\")}>\r\n <div style={{ paddingRight: \"5px\" }}>Artboard:</div>\r\n {props.onArtboardColorChanged && (\r\n <ColorPickerLineComponent\r\n backgroundColor={props.artboardColorPickerColor || \"#888888\"}\r\n value={props.artboardColor ? Color3.FromHexString(props.artboardColor) : new Color3(0, 0, 0)}\r\n onColorChanged={(newColor: string) => {\r\n if (props.onArtboardColorChanged) {\r\n props.onArtboardColorChanged(newColor);\r\n }\r\n }}\r\n />\r\n )}\r\n </div>\r\n <div className={style.divider}>{props.children}</div>\r\n </div>\r\n <div className={style.commandsRight}>\r\n <img src={betaFlag} className={style.betaFlag} draggable={false} />\r\n </div>\r\n </div>\r\n );\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CommandButtonComponent.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/components/bars/CommandButtonComponent.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,MAAM,8BAA8B,CAAC;AAYjD,MAAM,CAAC,MAAM,sBAAsB,GAA2C,CAAC,KAAK,EAAE,EAAE;IACpF,OAAO,CACH,cACI,SAAS,EAAE,UAAU,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,EACvG,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,KAAK,EAAE,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,YAE9E,cAAK,SAAS,EAAE,UAAU,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,YAC1D,cAAK,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,GAAI,GACtF,GACJ,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { ClassNames } from \"../classNames\";\r\n\r\nimport style from \"./CommandButton.modules.scss\";\r\n\r\nexport interface ICommandButtonComponentProps {\r\n tooltip: string;\r\n shortcut?: string;\r\n icon: string;\r\n iconLabel?: string;\r\n isActive: boolean;\r\n onClick: () => void;\r\n disabled?: boolean;\r\n}\r\n\r\nexport const CommandButtonComponent: React.FC<ICommandButtonComponentProps> = (props) => {\r\n return (\r\n <div\r\n className={ClassNames({ commandButton: true, active: props.isActive, disabled: props.disabled }, style)}\r\n onClick={props.onClick}\r\n title={`${props.tooltip} ${props.shortcut ? \" (\" + props.shortcut + \")\" : \"\"}`}\r\n >\r\n <div className={ClassNames({ commandButtonIcon: true }, style)}>\r\n <img src={props.icon} title={props.iconLabel} alt={props.iconLabel} draggable={false} />\r\n </div>\r\n </div>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"CommandButtonComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/components/bars/CommandButtonComponent.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,MAAM,8BAA8B,CAAC;AAYjD,MAAM,CAAC,MAAM,sBAAsB,GAA2C,CAAC,KAAK,EAAE,EAAE;IACpF,OAAO,CACH,cACI,SAAS,EAAE,UAAU,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,EAAE,KAAK,CAAC,EACvG,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,KAAK,EAAE,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,YAE9E,cAAK,SAAS,EAAE,UAAU,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,YAC1D,cAAK,GAAG,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,GAAG,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,GAAI,GACtF,GACJ,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { ClassNames } from \"../classNames\";\r\n\r\nimport style from \"./CommandButton.modules.scss\";\r\n\r\nexport interface ICommandButtonComponentProps {\r\n tooltip: string;\r\n shortcut?: string;\r\n icon: string;\r\n iconLabel?: string;\r\n isActive: boolean;\r\n onClick: () => void;\r\n disabled?: boolean;\r\n}\r\n\r\nexport const CommandButtonComponent: React.FC<ICommandButtonComponentProps> = (props) => {\r\n return (\r\n <div\r\n className={ClassNames({ commandButton: true, active: props.isActive, disabled: props.disabled }, style)}\r\n onClick={props.onClick}\r\n title={`${props.tooltip} ${props.shortcut ? \" (\" + props.shortcut + \")\" : \"\"}`}\r\n >\r\n <div className={ClassNames({ commandButtonIcon: true }, style)}>\r\n <img src={props.icon} title={props.iconLabel} alt={props.iconLabel} draggable={false} />\r\n </div>\r\n </div>\r\n );\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CommandDropdownComponent.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/components/bars/CommandDropdownComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,KAAK,MAAM,gCAAgC,CAAC;AAoBnD,MAAM,OAAO,wBAAyB,SAAQ,KAAK,CAAC,SAAuF;IACvI,YAAmB,KAAqC;QACpD,KAAK,CAAC,KAAK,CAAC,CAAC;QAEb,IAAI,CAAC,KAAK,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;IACxD,CAAC;IAEM,MAAM;QACT,OAAO,CACH,8BACK,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,CACtB,cACI,SAAS,EAAE,KAAK,CAAC,sBAAsB,EACvC,OAAO,EAAE,GAAG,EAAE;wBACV,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;oBACzC,CAAC,GACE,CACV,EACD,eAAK,SAAS,EAAE,KAAK,CAAC,mBAAmB,a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CAAC,CAAC,QAAQ,IAAI,CACX,cAAK,SAAS,EAAE,KAAK,CAAC,QAAQ,YACzB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;oDAClB,OAAO,CACH,cAEI,SAAS,EAAE,KAAK,CAAC,OAAO,EACxB,OAAO,EAAE,GAAG,EAAE;4DACV,CAAC,CAAC,OAAQ,EAAE,CAAC;4DACb,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;wDACzC,CAAC,YAED,wBAAM,CAAC,GAAO,IAPT,CAAC,CAQJ,CACT,CAAC;gDACN,CAAC,CAAC,GACA,CACT,KAjDI,CAAC,CAAC,KAAK,CAkDV,CACT,CAAC;iCACL;qCAAM;oCACH,OAAO,KAAC,uBAAuB,IAAe,KAAK,EAAC,MAAM,EAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE,MAAM,EAAC,OAAO,IAAxF,CAAC,CAAC,KAAK,CAAoF,CAAC;iCACpI;4BACL,CAAC,CAAC,GACA,CACT,IACC,IACP,CACN,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport { FileButtonLineComponent } from \"../lines/FileButtonLineComponent\";\r\nimport { JoinClassNames } from \"../classNames\";\r\n\r\nimport style from \"./CommandDropdown.modules.scss\";\r\n\r\ninterface ICommandDropdownComponentProps {\r\n icon?: string;\r\n tooltip: string;\r\n defaultValue?: string;\r\n items: {\r\n label: string;\r\n icon?: string;\r\n fileButton?: boolean;\r\n onClick?: () => void;\r\n onCheck?: (value: boolean) => void;\r\n storeKey?: string;\r\n isActive?: boolean;\r\n defaultValue?: boolean | string;\r\n subItems?: string[];\r\n }[];\r\n toRight?: boolean;\r\n}\r\n\r\nexport class CommandDropdownComponent extends React.Component<ICommandDropdownComponentProps, { isExpanded: boolean; activeState: string }> {\r\n public constructor(props: ICommandDropdownComponentProps) {\r\n super(props);\r\n\r\n this.state = { isExpanded: false, activeState: \"\" };\r\n }\r\n\r\n public render() {\r\n return (\r\n <>\r\n {this.state.isExpanded && (\r\n <div\r\n className={style.commandDropdownBlocker}\r\n onClick={() => {\r\n this.setState({ isExpanded: false });\r\n }}\r\n ></div>\r\n )}\r\n <div className={style.commandDropdownRoot}>\r\n <div\r\n className={JoinClassNames(style, \"commandDropdown\", this.state.isExpanded ? \"activated\" : \"\")}\r\n title={this.props.tooltip}\r\n onClick={() => {\r\n this.setState({ isExpanded: false });\r\n const newState = !this.state.isExpanded;\r\n const pgHost = document.getElementById(\"embed-host\");\r\n\r\n if (pgHost) {\r\n pgHost.style.zIndex = newState ? \"0\" : \"10\";\r\n }\r\n\r\n this.setState({ isExpanded: newState });\r\n }}\r\n >\r\n {this.props.icon && (\r\n <div className={style.commandDropdownIcon}>\r\n <img src={this.props.icon} />\r\n </div>\r\n )}\r\n {!this.props.icon && <div className={style.commandDropdownActive}></div>}\r\n </div>\r\n {this.state.isExpanded && (\r\n <div className={JoinClassNames(style, \"commandDropdownContent\", this.props.toRight ? \"toRight\" : \"\")}>\r\n {this.props.items.map((m) => {\r\n if (!m.fileButton) {\r\n return (\r\n <div\r\n className={JoinClassNames(style, \"commandDropdownLabel\", m.isActive ? \"active\" : \"\")}\r\n key={m.label}\r\n onClick={() => {\r\n if (!m.onClick) {\r\n this.forceUpdate();\r\n return;\r\n }\r\n if (!m.subItems) {\r\n m.onClick();\r\n\r\n this.setState({ isExpanded: false, activeState: m.label });\r\n }\r\n }}\r\n title={m.label}\r\n >\r\n {!m.icon && <div className={style.commandDropdownLabelText}>{(m.isActive ? \"> \" : \"\") + m.label}</div>}\r\n {m.icon && (\r\n <div className={style.commandDropdownIcon}>\r\n <img src={m.icon} />\r\n </div>\r\n )}\r\n {m.onCheck && (\r\n <input\r\n type=\"checkBox\"\r\n className={style.commandDropdownLabelCheck}\r\n onChange={(evt) => {\r\n this.forceUpdate();\r\n m.onCheck!(evt.target.checked);\r\n }}\r\n checked={false}\r\n />\r\n )}\r\n {m.subItems && <div className={style.commandDropdownArrow}>{\">\"}</div>}\r\n {m.subItems && (\r\n <div className={style.subItems}>\r\n {m.subItems.map((s) => {\r\n return (\r\n <div\r\n key={s}\r\n className={style.subItem}\r\n onClick={() => {\r\n m.onClick!();\r\n this.setState({ isExpanded: false });\r\n }}\r\n >\r\n <div>{s}</div>\r\n </div>\r\n );\r\n })}\r\n </div>\r\n )}\r\n </div>\r\n );\r\n } else {\r\n return <FileButtonLineComponent key={m.label} label=\"Load\" onClick={(file) => console.log(\"file btn clicked\")} accept=\".json\" />;\r\n }\r\n })}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CommandDropdownComponent.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/components/bars/CommandDropdownComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,KAAK,MAAM,gCAAgC,CAAC;AAoBnD,MAAM,OAAO,wBAAyB,SAAQ,KAAK,CAAC,SAAuF;IACvI,YAAmB,KAAqC;QACpD,KAAK,CAAC,KAAK,CAAC,CAAC;QAEb,IAAI,CAAC,KAAK,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;IACxD,CAAC;IAEM,MAAM;QACT,OAAO,CACH,8BACK,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,CACtB,cACI,SAAS,EAAE,KAAK,CAAC,sBAAsB,EACvC,OAAO,EAAE,GAAG,EAAE;wBACV,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;oBACzC,CAAC,GACE,CACV,EACD,eAAK,SAAS,EA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,YAAG,GAAG,GAAO,EACrE,CAAC,CAAC,QAAQ,IAAI,CACX,cAAK,SAAS,EAAE,KAAK,CAAC,QAAQ,YACzB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;oDAClB,OAAO,CACH,cAEI,SAAS,EAAE,KAAK,CAAC,OAAO,EACxB,OAAO,EAAE,GAAG,EAAE;4DACV,CAAC,CAAC,OAAQ,EAAE,CAAC;4DACb,IAAI,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;wDACzC,CAAC,YAED,wBAAM,CAAC,GAAO,IAPT,CAAC,CAQJ,CACT,CAAC;gDACN,CAAC,CAAC,GACA,CACT,KAjDI,CAAC,CAAC,KAAK,CAkDV,CACT,CAAC;iCACL;qCAAM;oCACH,OAAO,KAAC,uBAAuB,IAAe,KAAK,EAAC,MAAM,EAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,EAAE,MAAM,EAAC,OAAO,IAAxF,CAAC,CAAC,KAAK,CAAoF,CAAC;iCACpI;4BACL,CAAC,CAAC,GACA,CACT,IACC,IACP,CACN,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport { FileButtonLineComponent } from \"../lines/FileButtonLineComponent\";\r\nimport { JoinClassNames } from \"../classNames\";\r\n\r\nimport style from \"./CommandDropdown.modules.scss\";\r\n\r\ninterface ICommandDropdownComponentProps {\r\n icon?: string;\r\n tooltip: string;\r\n defaultValue?: string;\r\n items: {\r\n label: string;\r\n icon?: string;\r\n fileButton?: boolean;\r\n onClick?: () => void;\r\n onCheck?: (value: boolean) => void;\r\n storeKey?: string;\r\n isActive?: boolean;\r\n defaultValue?: boolean | string;\r\n subItems?: string[];\r\n }[];\r\n toRight?: boolean;\r\n}\r\n\r\nexport class CommandDropdownComponent extends React.Component<ICommandDropdownComponentProps, { isExpanded: boolean; activeState: string }> {\r\n public constructor(props: ICommandDropdownComponentProps) {\r\n super(props);\r\n\r\n this.state = { isExpanded: false, activeState: \"\" };\r\n }\r\n\r\n public render() {\r\n return (\r\n <>\r\n {this.state.isExpanded && (\r\n <div\r\n className={style.commandDropdownBlocker}\r\n onClick={() => {\r\n this.setState({ isExpanded: false });\r\n }}\r\n ></div>\r\n )}\r\n <div className={style.commandDropdownRoot}>\r\n <div\r\n className={JoinClassNames(style, \"commandDropdown\", this.state.isExpanded ? \"activated\" : \"\")}\r\n title={this.props.tooltip}\r\n onClick={() => {\r\n this.setState({ isExpanded: false });\r\n const newState = !this.state.isExpanded;\r\n const pgHost = document.getElementById(\"embed-host\");\r\n\r\n if (pgHost) {\r\n pgHost.style.zIndex = newState ? \"0\" : \"10\";\r\n }\r\n\r\n this.setState({ isExpanded: newState });\r\n }}\r\n >\r\n {this.props.icon && (\r\n <div className={style.commandDropdownIcon}>\r\n <img src={this.props.icon} />\r\n </div>\r\n )}\r\n {!this.props.icon && <div className={style.commandDropdownActive}></div>}\r\n </div>\r\n {this.state.isExpanded && (\r\n <div className={JoinClassNames(style, \"commandDropdownContent\", this.props.toRight ? \"toRight\" : \"\")}>\r\n {this.props.items.map((m) => {\r\n if (!m.fileButton) {\r\n return (\r\n <div\r\n className={JoinClassNames(style, \"commandDropdownLabel\", m.isActive ? \"active\" : \"\")}\r\n key={m.label}\r\n onClick={() => {\r\n if (!m.onClick) {\r\n this.forceUpdate();\r\n return;\r\n }\r\n if (!m.subItems) {\r\n m.onClick();\r\n\r\n this.setState({ isExpanded: false, activeState: m.label });\r\n }\r\n }}\r\n title={m.label}\r\n >\r\n {!m.icon && <div className={style.commandDropdownLabelText}>{(m.isActive ? \"> \" : \"\") + m.label}</div>}\r\n {m.icon && (\r\n <div className={style.commandDropdownIcon}>\r\n <img src={m.icon} />\r\n </div>\r\n )}\r\n {m.onCheck && (\r\n <input\r\n type=\"checkBox\"\r\n className={style.commandDropdownLabelCheck}\r\n onChange={(evt) => {\r\n this.forceUpdate();\r\n m.onCheck!(evt.target.checked);\r\n }}\r\n checked={false}\r\n />\r\n )}\r\n {m.subItems && <div className={style.commandDropdownArrow}>{\">\"}</div>}\r\n {m.subItems && (\r\n <div className={style.subItems}>\r\n {m.subItems.map((s) => {\r\n return (\r\n <div\r\n key={s}\r\n className={style.subItem}\r\n onClick={() => {\r\n m.onClick!();\r\n this.setState({ isExpanded: false });\r\n }}\r\n >\r\n <div>{s}</div>\r\n </div>\r\n );\r\n })}\r\n </div>\r\n )}\r\n </div>\r\n );\r\n } else {\r\n return <FileButtonLineComponent key={m.label} label=\"Load\" onClick={(file) => console.log(\"file btn clicked\")} accept=\".json\" />;\r\n }\r\n })}\r\n </div>\r\n )}\r\n </div>\r\n </>\r\n );\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"classNames.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/components/classNames.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,KAAU,EAAE,WAAgB;IACnD,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACtB,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE;YACb,MAAM,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;SACrC;KACJ;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,WAAgB,EAAE,GAAG,KAAe;IAC/D,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACtB,IAAI,IAAI,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE;YAC3B,MAAM,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;SACrC;KACJ;IACD,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["export function ClassNames(names: any, styleObject: any) {\r\n let string = \"\";\r\n for (const name in names) {\r\n if (names[name]) {\r\n string += styleObject[name] + \" \";\r\n }\r\n }\r\n return string;\r\n}\r\n\r\nexport function JoinClassNames(styleObject: any, ...names: string[]) {\r\n let string = \"\";\r\n for (const name of names) {\r\n if (name && styleObject[name]) {\r\n string += styleObject[name] + \" \";\r\n }\r\n }\r\n return string;\r\n}\r\n"]}
1
+ {"version":3,"file":"classNames.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/components/classNames.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,KAAU,EAAE,WAAgB;IACnD,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACtB,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE;YACb,MAAM,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;SACrC;KACJ;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,WAAgB,EAAE,GAAG,KAAe;IAC/D,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACtB,IAAI,IAAI,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE;YAC3B,MAAM,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC;SACrC;KACJ;IACD,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["export function ClassNames(names: any, styleObject: any) {\r\n let string = \"\";\r\n for (const name in names) {\r\n if (names[name]) {\r\n string += styleObject[name] + \" \";\r\n }\r\n }\r\n return string;\r\n}\r\n\r\nexport function JoinClassNames(styleObject: any, ...names: string[]) {\r\n let string = \"\";\r\n for (const name of names) {\r\n if (name && styleObject[name]) {\r\n string += styleObject[name] + \" \";\r\n }\r\n }\r\n return string;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ColorComponentEntry.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/components/colorPicker/ColorCompon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C,yBAAyB,YAC3C,gBACI,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,CAAC,EACP,SAAS,EAAC,eAAe,EACzB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,EAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAC1B,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EACrD,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAC/B,GACA,EACN,cAAK,SAAS,EAAE,KAAK,CAAC,yBAAyB,YAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAO,IACvE,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport type { LockObject } from \"../../tabs/propertyGrids/lockObject\";\r\nimport style from \"./ColorComponentEntry.modules.scss\";\r\n\r\nexport interface IColorComponentEntryProps {\r\n value: number;\r\n label: string;\r\n max?: number;\r\n min?: number;\r\n onChange: (value: number) => void;\r\n disabled?: boolean;\r\n lockObject: LockObject;\r\n}\r\n\r\nexport class ColorComponentEntry extends React.Component<IColorComponentEntryProps> {\r\n constructor(props: IColorComponentEntryProps) {\r\n super(props);\r\n }\r\n\r\n updateValue(valueString: string) {\r\n if (/[^0-9.-]/g.test(valueString)) {\r\n return;\r\n }\r\n\r\n let valueAsNumber = parseInt(valueString);\r\n\r\n if (isNaN(valueAsNumber)) {\r\n return;\r\n }\r\n if (this.props.max != undefined && valueAsNumber > this.props.max) {\r\n valueAsNumber = this.props.max;\r\n }\r\n if (this.props.min != undefined && valueAsNumber < this.props.min) {\r\n valueAsNumber = this.props.min;\r\n }\r\n\r\n this.props.onChange(valueAsNumber);\r\n }\r\n\r\n lock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = true;\r\n }\r\n }\r\n\r\n unlock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = false;\r\n }\r\n }\r\n\r\n public render() {\r\n return (\r\n <div className={style.colorPickerComponent}>\r\n <div className={style.colorPickerComponentValue}>\r\n <input\r\n type=\"number\"\r\n step={1}\r\n className=\"numeric-input\"\r\n value={this.props.value}\r\n onBlur={() => this.unlock()}\r\n onFocus={() => this.lock()}\r\n onChange={(evt) => this.updateValue(evt.target.value)}\r\n disabled={this.props.disabled}\r\n />\r\n </div>\r\n <div className={style.colorPickerComponentLabel}>{this.props.label}</div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ColorComponentEntry.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/components/colorPicker/ColorComponentEntry.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,MAAM,oCAAoC,CAAC;AAYvD,MAAM,OAAO,mBAAoB,SAAQ,KAAK,CAAC,SAAoC;IAC/E,YAAY,KAAgC;QACxC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED,WAAW,CAAC,WAAmB;QAC3B,IAAI,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE;YAC/B,OAAO;SACV;QAED,IAAI,aAAa,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;QAE1C,IAAI,KAAK,CAAC,aAAa,CAAC,EAAE;YACtB,OAAO;SACV;QACD,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,SAAS,IAAI,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;YAC/D,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;SAClC;QACD,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,SAAS,IAAI,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE;YAC/D,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;SAClC;QAED,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IACvC,CAAC;IAED,IAAI;QACA,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE;YACvB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;SACrC;IACL,CAAC;IAED,MAAM;QACF,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE;YACvB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,KAAK,CAAC;SACtC;IACL,CAAC;IAEM,MAAM;QACT,OAAO,CACH,eAAK,SAAS,EAAE,KAAK,CAAC,oBAAoB,aACtC,cAAK,SAAS,EAAE,KAAK,CAAC,yBAAyB,YAC3C,gBACI,IAAI,EAAC,QAAQ,EACb,IAAI,EAAE,CAAC,EACP,SAAS,EAAC,eAAe,EACzB,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EACvB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,EAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAC1B,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EACrD,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,GAC/B,GACA,EACN,cAAK,SAAS,EAAE,KAAK,CAAC,yBAAyB,YAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAO,IACvE,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport type { LockObject } from \"../../tabs/propertyGrids/lockObject\";\r\nimport style from \"./ColorComponentEntry.modules.scss\";\r\n\r\nexport interface IColorComponentEntryProps {\r\n value: number;\r\n label: string;\r\n max?: number;\r\n min?: number;\r\n onChange: (value: number) => void;\r\n disabled?: boolean;\r\n lockObject: LockObject;\r\n}\r\n\r\nexport class ColorComponentEntry extends React.Component<IColorComponentEntryProps> {\r\n constructor(props: IColorComponentEntryProps) {\r\n super(props);\r\n }\r\n\r\n updateValue(valueString: string) {\r\n if (/[^0-9.-]/g.test(valueString)) {\r\n return;\r\n }\r\n\r\n let valueAsNumber = parseInt(valueString);\r\n\r\n if (isNaN(valueAsNumber)) {\r\n return;\r\n }\r\n if (this.props.max != undefined && valueAsNumber > this.props.max) {\r\n valueAsNumber = this.props.max;\r\n }\r\n if (this.props.min != undefined && valueAsNumber < this.props.min) {\r\n valueAsNumber = this.props.min;\r\n }\r\n\r\n this.props.onChange(valueAsNumber);\r\n }\r\n\r\n lock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = true;\r\n }\r\n }\r\n\r\n unlock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = false;\r\n }\r\n }\r\n\r\n public render() {\r\n return (\r\n <div className={style.colorPickerComponent}>\r\n <div className={style.colorPickerComponentValue}>\r\n <input\r\n type=\"number\"\r\n step={1}\r\n className=\"numeric-input\"\r\n value={this.props.value}\r\n onBlur={() => this.unlock()}\r\n onFocus={() => this.lock()}\r\n onChange={(evt) => this.updateValue(evt.target.value)}\r\n disabled={this.props.disabled}\r\n />\r\n </div>\r\n <div className={style.colorPickerComponentLabel}>{this.props.label}</div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/components/colorPicker/ColorPicker.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,4CAA8B;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,KAAK,MAAM,4BAA4B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K,GAAG,KAAK,EAAE,CAAC,CAAC;oCACxC,IAAI,CAAC,WAAW,EAAE,CAAC;gCACvB,CAAC,GACH,GACA,IACJ,EACN,KAAC,QAAQ,IACL,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EACjC,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAChC,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;wBAChB,IAAI,QAAQ,EAAE;4BACV,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;4BAC3C,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;yBACvF;6BAAM;4BACH,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;yBACzD;oBACL,CAAC,GACH,EACD,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,CACtB,cAAK,SAAS,EAAE,KAAK,CAAC,kBAAkB,0IAElC,CACT,IACC,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport { Color3, Color4 } from \"core/Maths/math.color\";\r\nimport { ColorComponentEntry } from \"./ColorComponentEntry\";\r\nimport { HexColor } from \"./HexColor\";\r\nimport type { LockObject } from \"../../tabs/propertyGrids/lockObject\";\r\n\r\nimport style from \"./ColorPicker.modules.scss\";\r\nimport { ClassNames } from \"../classNames\";\r\n\r\n/**\r\n * Interface used to specify creation options for color picker\r\n */\r\nexport interface IColorPickerProps {\r\n color: Color3 | Color4;\r\n linearhint?: boolean;\r\n debugMode?: boolean;\r\n onColorChanged?: (color: Color3 | Color4) => void;\r\n lockObject: LockObject;\r\n backgroundColor?: string;\r\n}\r\n\r\n/**\r\n * Interface used to specify creation options for color picker\r\n */\r\nexport interface IColorPickerState {\r\n color: Color3;\r\n alpha: number;\r\n}\r\n\r\n/**\r\n * Class used to create a color picker\r\n */\r\nexport class ColorPicker extends React.Component<IColorPickerProps, IColorPickerState> {\r\n private _saturationRef: React.RefObject<HTMLDivElement>;\r\n private _hueRef: React.RefObject<HTMLDivElement>;\r\n private _isSaturationPointerDown: boolean;\r\n private _isHuePointerDown: boolean;\r\n\r\n constructor(props: IColorPickerProps) {\r\n super(props);\r\n if (this.props.color instanceof Color4) {\r\n this.state = { color: new Color3(this.props.color.r, this.props.color.g, this.props.color.b), alpha: this.props.color.a };\r\n } else {\r\n this.state = { color: this.props.color.clone(), alpha: 1 };\r\n }\r\n this._saturationRef = React.createRef();\r\n this._hueRef = React.createRef();\r\n }\r\n\r\n shouldComponentUpdate(nextProps: IColorPickerProps, nextState: IColorPickerState) {\r\n return nextProps.color.toHexString() !== this.props.color.toHexString() || nextState.color.toHexString() !== this.props.color.toHexString();\r\n }\r\n\r\n onSaturationPointerDown(evt: React.PointerEvent<HTMLDivElement>) {\r\n this._evaluateSaturation(evt);\r\n this._isSaturationPointerDown = true;\r\n\r\n evt.currentTarget.setPointerCapture(evt.pointerId);\r\n }\r\n\r\n onSaturationPointerUp(evt: React.PointerEvent<HTMLDivElement>) {\r\n this._isSaturationPointerDown = false;\r\n evt.currentTarget.releasePointerCapture(evt.pointerId);\r\n }\r\n\r\n onSaturationPointerMove(evt: React.PointerEvent<HTMLDivElement>) {\r\n if (!this._isSaturationPointerDown) {\r\n return;\r\n }\r\n this._evaluateSaturation(evt);\r\n }\r\n\r\n onHuePointerDown(evt: React.PointerEvent<HTMLDivElement>) {\r\n this._evaluateHue(evt);\r\n this._isHuePointerDown = true;\r\n\r\n evt.currentTarget.setPointerCapture(evt.pointerId);\r\n }\r\n\r\n onHuePointerUp(evt: React.PointerEvent<HTMLDivElement>) {\r\n this._isHuePointerDown = false;\r\n evt.currentTarget.releasePointerCapture(evt.pointerId);\r\n }\r\n\r\n onHuePointerMove(evt: React.PointerEvent<HTMLDivElement>) {\r\n if (!this._isHuePointerDown) {\r\n return;\r\n }\r\n this._evaluateHue(evt);\r\n }\r\n\r\n private _evaluateSaturation(evt: React.PointerEvent<HTMLDivElement>) {\r\n const left = evt.nativeEvent.offsetX;\r\n const top = evt.nativeEvent.offsetY;\r\n\r\n const saturation = Math.min(1, Math.max(0.0001, left / this._saturationRef.current!.clientWidth));\r\n const value = Math.min(1, Math.max(0.0001, 1 - top / this._saturationRef.current!.clientHeight));\r\n\r\n if (this.props.debugMode) {\r\n console.log(\"Saturation: \" + saturation);\r\n console.log(\"Value: \" + value);\r\n }\r\n\r\n const hsv = this.state.color.toHSV();\r\n Color3.HSVtoRGBToRef(hsv.r, saturation, value, this.state.color);\r\n if (this.state.alpha === 0) {\r\n this.setState({ alpha: 1 });\r\n }\r\n this.setState({ color: this.state.color });\r\n }\r\n\r\n private _evaluateHue(evt: React.PointerEvent<HTMLDivElement>) {\r\n const left = evt.nativeEvent.offsetX;\r\n\r\n const hue = 360 * Math.min(0.9999, Math.max(0.0001, left / this._hueRef.current!.clientWidth));\r\n\r\n if (this.props.debugMode) {\r\n console.log(\"Hue: \" + hue);\r\n }\r\n\r\n const hsv = this.state.color.toHSV();\r\n Color3.HSVtoRGBToRef(hue, Math.max(hsv.g, 0.01), Math.max(hsv.b, 0.01), this.state.color);\r\n this.setState({ color: this.state.color });\r\n }\r\n\r\n componentDidUpdate() {\r\n this.raiseOnColorChanged();\r\n }\r\n\r\n raiseOnColorChanged() {\r\n if (!this.props.onColorChanged) {\r\n return;\r\n }\r\n\r\n if (this.props.color instanceof Color4) {\r\n const newColor4 = Color4.FromColor3(this.state.color, this.state.alpha);\r\n\r\n this.props.onColorChanged(newColor4);\r\n\r\n return;\r\n }\r\n\r\n this.props.onColorChanged(this.state.color.clone());\r\n }\r\n\r\n public render() {\r\n const color4 = Color4.FromColor3(this.state.color);\r\n color4.a = this.state.alpha;\r\n const colorHex = color4.toHexString();\r\n const hsv = this.state.color.toHSV();\r\n const colorRef = new Color3();\r\n Color3.HSVtoRGBToRef(hsv.r, 1, 1, colorRef);\r\n const colorHexRef = colorRef.toHexString();\r\n const hasAlpha = this.props.color instanceof Color4;\r\n\r\n return (\r\n <div\r\n className={ClassNames({ colorPickerContainer: true, withHints: this.props.linearhint }, style)}\r\n style={{ backgroundColor: this.props.backgroundColor || \"inherit\" }}\r\n >\r\n <div\r\n className={style.colorPickerSaturation}\r\n onPointerMove={(e) => this.onSaturationPointerMove(e)}\r\n onPointerDown={(e) => this.onSaturationPointerDown(e)}\r\n onPointerUp={(e) => this.onSaturationPointerUp(e)}\r\n ref={this._saturationRef}\r\n style={{\r\n background: colorHexRef,\r\n }}\r\n >\r\n <div className={style.colorPickerSaturationWhite}></div>\r\n <div className={style.colorPickerSaturationBlack}></div>\r\n <div\r\n className={style.colorPickerSaturationCursor}\r\n style={{\r\n top: `${-(hsv.b * 100) + 100}%`,\r\n left: `${hsv.g * 100}%`,\r\n }}\r\n ></div>\r\n </div>\r\n <div className={style.colorPickerHue}>\r\n <div\r\n className={style.colorPickerHueColor}\r\n style={{\r\n background: colorHex,\r\n }}\r\n ></div>\r\n <div\r\n className={style.colorPickerHueSlider}\r\n ref={this._hueRef}\r\n onPointerMove={(e) => this.onHuePointerMove(e)}\r\n onPointerDown={(e) => this.onHuePointerDown(e)}\r\n onPointerUp={(e) => this.onHuePointerUp(e)}\r\n >\r\n <div\r\n className={style.colorPickerHueCursor}\r\n style={{\r\n left: `${(hsv.r / 360.0) * 100}%`,\r\n border: `1px solid ` + colorHexRef,\r\n }}\r\n ></div>\r\n </div>\r\n </div>\r\n {/* <div className=\"color-picker-alpha\"></div> */}\r\n <div className={style.colorPickerRgb}>\r\n <div className={style.red}>\r\n <ColorComponentEntry\r\n lockObject={this.props.lockObject}\r\n label=\"R\"\r\n min={0}\r\n max={255}\r\n value={Math.round(this.state.color.r * 255)}\r\n onChange={(value) => {\r\n this.state.color.r = value / 255.0;\r\n this.forceUpdate();\r\n }}\r\n />\r\n </div>\r\n <div className={style.green}>\r\n <ColorComponentEntry\r\n lockObject={this.props.lockObject}\r\n label=\"G\"\r\n min={0}\r\n max={255}\r\n value={Math.round(this.state.color.g * 255)}\r\n onChange={(value) => {\r\n this.state.color.g = value / 255.0;\r\n this.forceUpdate();\r\n }}\r\n />\r\n </div>\r\n <div className={style.blue}>\r\n <ColorComponentEntry\r\n lockObject={this.props.lockObject}\r\n label=\"B\"\r\n min={0}\r\n max={255}\r\n value={Math.round(this.state.color.b * 255)}\r\n onChange={(value) => {\r\n this.state.color.b = value / 255.0;\r\n this.forceUpdate();\r\n }}\r\n />\r\n </div>\r\n <div className={ClassNames({ alpha: true, grayed: hasAlpha }, style)}>\r\n <ColorComponentEntry\r\n lockObject={this.props.lockObject}\r\n label=\"A\"\r\n min={0}\r\n max={255}\r\n value={Math.round(this.state.alpha * 255)}\r\n onChange={(value) => {\r\n this.setState({ alpha: value / 255.0 });\r\n this.forceUpdate();\r\n }}\r\n />\r\n </div>\r\n </div>\r\n <HexColor\r\n lockObject={this.props.lockObject}\r\n expectedLength={hasAlpha ? 8 : 6}\r\n value={colorHex}\r\n onChange={(value) => {\r\n if (hasAlpha) {\r\n const color4 = Color4.FromHexString(value);\r\n this.setState({ color: new Color3(color4.r, color4.g, color4.b), alpha: color4.a });\r\n } else {\r\n this.setState({ color: Color3.FromHexString(value) });\r\n }\r\n }}\r\n />\r\n {this.props.linearhint && (\r\n <div className={style.colorPickerWarning}>\r\n (Note: color is stored in linear mode and was converted to gamma to be displayed here (toGammaSpace() / toLinearSpace()))\r\n </div>\r\n )}\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"ColorPicker.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/components/colorPicker/ColorPicker.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,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C,EACN,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,EACzC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;oCAChB,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,EAAE,CAAC,CAAC;oCACxC,IAAI,CAAC,WAAW,EAAE,CAAC;gCACvB,CAAC,GACH,GACA,IACJ,EACN,KAAC,QAAQ,IACL,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EACjC,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAChC,KAAK,EAAE,QAAQ,EACf,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;wBAChB,IAAI,QAAQ,EAAE;4BACV,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;4BAC3C,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;yBACvF;6BAAM;4BACH,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;yBACzD;oBACL,CAAC,GACH,EACD,IAAI,CAAC,KAAK,CAAC,UAAU,IAAI,CACtB,cAAK,SAAS,EAAE,KAAK,CAAC,kBAAkB,0IAElC,CACT,IACC,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport { Color3, Color4 } from \"core/Maths/math.color\";\r\nimport { ColorComponentEntry } from \"./ColorComponentEntry\";\r\nimport { HexColor } from \"./HexColor\";\r\nimport type { LockObject } from \"../../tabs/propertyGrids/lockObject\";\r\n\r\nimport style from \"./ColorPicker.modules.scss\";\r\nimport { ClassNames } from \"../classNames\";\r\n\r\n/**\r\n * Interface used to specify creation options for color picker\r\n */\r\nexport interface IColorPickerProps {\r\n color: Color3 | Color4;\r\n linearhint?: boolean;\r\n debugMode?: boolean;\r\n onColorChanged?: (color: Color3 | Color4) => void;\r\n lockObject: LockObject;\r\n backgroundColor?: string;\r\n}\r\n\r\n/**\r\n * Interface used to specify creation options for color picker\r\n */\r\nexport interface IColorPickerState {\r\n color: Color3;\r\n alpha: number;\r\n}\r\n\r\n/**\r\n * Class used to create a color picker\r\n */\r\nexport class ColorPicker extends React.Component<IColorPickerProps, IColorPickerState> {\r\n private _saturationRef: React.RefObject<HTMLDivElement>;\r\n private _hueRef: React.RefObject<HTMLDivElement>;\r\n private _isSaturationPointerDown: boolean;\r\n private _isHuePointerDown: boolean;\r\n\r\n constructor(props: IColorPickerProps) {\r\n super(props);\r\n if (this.props.color instanceof Color4) {\r\n this.state = { color: new Color3(this.props.color.r, this.props.color.g, this.props.color.b), alpha: this.props.color.a };\r\n } else {\r\n this.state = { color: this.props.color.clone(), alpha: 1 };\r\n }\r\n this._saturationRef = React.createRef();\r\n this._hueRef = React.createRef();\r\n }\r\n\r\n shouldComponentUpdate(nextProps: IColorPickerProps, nextState: IColorPickerState) {\r\n return nextProps.color.toHexString() !== this.props.color.toHexString() || nextState.color.toHexString() !== this.props.color.toHexString();\r\n }\r\n\r\n onSaturationPointerDown(evt: React.PointerEvent<HTMLDivElement>) {\r\n this._evaluateSaturation(evt);\r\n this._isSaturationPointerDown = true;\r\n\r\n evt.currentTarget.setPointerCapture(evt.pointerId);\r\n }\r\n\r\n onSaturationPointerUp(evt: React.PointerEvent<HTMLDivElement>) {\r\n this._isSaturationPointerDown = false;\r\n evt.currentTarget.releasePointerCapture(evt.pointerId);\r\n }\r\n\r\n onSaturationPointerMove(evt: React.PointerEvent<HTMLDivElement>) {\r\n if (!this._isSaturationPointerDown) {\r\n return;\r\n }\r\n this._evaluateSaturation(evt);\r\n }\r\n\r\n onHuePointerDown(evt: React.PointerEvent<HTMLDivElement>) {\r\n this._evaluateHue(evt);\r\n this._isHuePointerDown = true;\r\n\r\n evt.currentTarget.setPointerCapture(evt.pointerId);\r\n }\r\n\r\n onHuePointerUp(evt: React.PointerEvent<HTMLDivElement>) {\r\n this._isHuePointerDown = false;\r\n evt.currentTarget.releasePointerCapture(evt.pointerId);\r\n }\r\n\r\n onHuePointerMove(evt: React.PointerEvent<HTMLDivElement>) {\r\n if (!this._isHuePointerDown) {\r\n return;\r\n }\r\n this._evaluateHue(evt);\r\n }\r\n\r\n private _evaluateSaturation(evt: React.PointerEvent<HTMLDivElement>) {\r\n const left = evt.nativeEvent.offsetX;\r\n const top = evt.nativeEvent.offsetY;\r\n\r\n const saturation = Math.min(1, Math.max(0.0001, left / this._saturationRef.current!.clientWidth));\r\n const value = Math.min(1, Math.max(0.0001, 1 - top / this._saturationRef.current!.clientHeight));\r\n\r\n if (this.props.debugMode) {\r\n console.log(\"Saturation: \" + saturation);\r\n console.log(\"Value: \" + value);\r\n }\r\n\r\n const hsv = this.state.color.toHSV();\r\n Color3.HSVtoRGBToRef(hsv.r, saturation, value, this.state.color);\r\n if (this.state.alpha === 0) {\r\n this.setState({ alpha: 1 });\r\n }\r\n this.setState({ color: this.state.color });\r\n }\r\n\r\n private _evaluateHue(evt: React.PointerEvent<HTMLDivElement>) {\r\n const left = evt.nativeEvent.offsetX;\r\n\r\n const hue = 360 * Math.min(0.9999, Math.max(0.0001, left / this._hueRef.current!.clientWidth));\r\n\r\n if (this.props.debugMode) {\r\n console.log(\"Hue: \" + hue);\r\n }\r\n\r\n const hsv = this.state.color.toHSV();\r\n Color3.HSVtoRGBToRef(hue, Math.max(hsv.g, 0.01), Math.max(hsv.b, 0.01), this.state.color);\r\n this.setState({ color: this.state.color });\r\n }\r\n\r\n componentDidUpdate() {\r\n this.raiseOnColorChanged();\r\n }\r\n\r\n raiseOnColorChanged() {\r\n if (!this.props.onColorChanged) {\r\n return;\r\n }\r\n\r\n if (this.props.color instanceof Color4) {\r\n const newColor4 = Color4.FromColor3(this.state.color, this.state.alpha);\r\n\r\n this.props.onColorChanged(newColor4);\r\n\r\n return;\r\n }\r\n\r\n this.props.onColorChanged(this.state.color.clone());\r\n }\r\n\r\n public render() {\r\n const color4 = Color4.FromColor3(this.state.color);\r\n color4.a = this.state.alpha;\r\n const colorHex = color4.toHexString();\r\n const hsv = this.state.color.toHSV();\r\n const colorRef = new Color3();\r\n Color3.HSVtoRGBToRef(hsv.r, 1, 1, colorRef);\r\n const colorHexRef = colorRef.toHexString();\r\n const hasAlpha = this.props.color instanceof Color4;\r\n\r\n return (\r\n <div\r\n className={ClassNames({ colorPickerContainer: true, withHints: this.props.linearhint }, style)}\r\n style={{ backgroundColor: this.props.backgroundColor || \"inherit\" }}\r\n >\r\n <div\r\n className={style.colorPickerSaturation}\r\n onPointerMove={(e) => this.onSaturationPointerMove(e)}\r\n onPointerDown={(e) => this.onSaturationPointerDown(e)}\r\n onPointerUp={(e) => this.onSaturationPointerUp(e)}\r\n ref={this._saturationRef}\r\n style={{\r\n background: colorHexRef,\r\n }}\r\n >\r\n <div className={style.colorPickerSaturationWhite}></div>\r\n <div className={style.colorPickerSaturationBlack}></div>\r\n <div\r\n className={style.colorPickerSaturationCursor}\r\n style={{\r\n top: `${-(hsv.b * 100) + 100}%`,\r\n left: `${hsv.g * 100}%`,\r\n }}\r\n ></div>\r\n </div>\r\n <div className={style.colorPickerHue}>\r\n <div\r\n className={style.colorPickerHueColor}\r\n style={{\r\n background: colorHex,\r\n }}\r\n ></div>\r\n <div\r\n className={style.colorPickerHueSlider}\r\n ref={this._hueRef}\r\n onPointerMove={(e) => this.onHuePointerMove(e)}\r\n onPointerDown={(e) => this.onHuePointerDown(e)}\r\n onPointerUp={(e) => this.onHuePointerUp(e)}\r\n >\r\n <div\r\n className={style.colorPickerHueCursor}\r\n style={{\r\n left: `${(hsv.r / 360.0) * 100}%`,\r\n border: `1px solid ` + colorHexRef,\r\n }}\r\n ></div>\r\n </div>\r\n </div>\r\n {/* <div className=\"color-picker-alpha\"></div> */}\r\n <div className={style.colorPickerRgb}>\r\n <div className={style.red}>\r\n <ColorComponentEntry\r\n lockObject={this.props.lockObject}\r\n label=\"R\"\r\n min={0}\r\n max={255}\r\n value={Math.round(this.state.color.r * 255)}\r\n onChange={(value) => {\r\n this.state.color.r = value / 255.0;\r\n this.forceUpdate();\r\n }}\r\n />\r\n </div>\r\n <div className={style.green}>\r\n <ColorComponentEntry\r\n lockObject={this.props.lockObject}\r\n label=\"G\"\r\n min={0}\r\n max={255}\r\n value={Math.round(this.state.color.g * 255)}\r\n onChange={(value) => {\r\n this.state.color.g = value / 255.0;\r\n this.forceUpdate();\r\n }}\r\n />\r\n </div>\r\n <div className={style.blue}>\r\n <ColorComponentEntry\r\n lockObject={this.props.lockObject}\r\n label=\"B\"\r\n min={0}\r\n max={255}\r\n value={Math.round(this.state.color.b * 255)}\r\n onChange={(value) => {\r\n this.state.color.b = value / 255.0;\r\n this.forceUpdate();\r\n }}\r\n />\r\n </div>\r\n <div className={ClassNames({ alpha: true, grayed: hasAlpha }, style)}>\r\n <ColorComponentEntry\r\n lockObject={this.props.lockObject}\r\n label=\"A\"\r\n min={0}\r\n max={255}\r\n value={Math.round(this.state.alpha * 255)}\r\n onChange={(value) => {\r\n this.setState({ alpha: value / 255.0 });\r\n this.forceUpdate();\r\n }}\r\n />\r\n </div>\r\n </div>\r\n <HexColor\r\n lockObject={this.props.lockObject}\r\n expectedLength={hasAlpha ? 8 : 6}\r\n value={colorHex}\r\n onChange={(value) => {\r\n if (hasAlpha) {\r\n const color4 = Color4.FromHexString(value);\r\n this.setState({ color: new Color3(color4.r, color4.g, color4.b), alpha: color4.a });\r\n } else {\r\n this.setState({ color: Color3.FromHexString(value) });\r\n }\r\n }}\r\n />\r\n {this.props.linearhint && (\r\n <div className={style.colorPickerWarning}>\r\n (Note: color is stored in linear mode and was converted to gamma to be displayed here (toGammaSpace() / toLinearSpace()))\r\n </div>\r\n )}\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"HexColor.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/components/colorPicker/HexColor.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,MAAM,yBAAyB,CAAC;AAS5C,MAAM,OAAO,QAAS,SAAQ,KAAK,CAAC,SAA0C;IAC1E,YAAY,KAAqB;QAC7B,KAAK,CAAC,KAAK,CAAC,CAAC;QAEb,IAAI,CAAC,KAAK,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC;IAC5D,CAAC;IAED,qBAAqB,CAAC,SAAyB,EAAE,SAA0B;QACvE,IAAI,SAAS,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;YACtC,SAAS,CAAC,GAAG,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;SACpD;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,IAAI;QACA,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE;YACvB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;SACrC;IACL,CAAC;IAED,MAAM;QACF,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE;YACvB,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,GAAG,KAAK,CAAC;SACtC;IACL,CAAC;IAED,cAAc,CAAC,WAAmB;QAC9B,IAAI,WAAW,IAAI,EAAE,IAAI,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,KAAK,EAAE;YACnE,OAAO;SACV;QAED,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;QAEpC,IAAI,WAAW,CAAC,MAAM,KAAK,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE;YAClD,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,KAAK,CAAC,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC7D,WAAW,GAAG,WAAW,GAAG,IAAI,CAAC;aACpC;iBAAM;gBACH,OAAO;aACV;SACJ;QAED,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC;IAC3C,CAAC;IAEM,MAAM;QACT,OAAO,CACH,eAAK,SAAS,EAAE,KAAK,CAAC,cAAc,aAChC,cAAK,SAAS,EAAE,KAAK,CAAC,mBAAmB,oBAAW,EACpD,cAAK,SAAS,EAAE,KAAK,CAAC,mBAAmB,YACrC,gBACI,IAAI,EAAC,QAAQ;wBACb,wBAAwB;wBACxB,SAAS,EAAE,KAAK,CAAC,cAAc,EAC/B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,EACrB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,EAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAC1B,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAC1D,GACA,IACJ,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport type { LockObject } from \"../../tabs/propertyGrids/lockObject\";\r\nimport style from \"./HexColor.modules.scss\";\r\n\r\nexport interface IHexColorProps {\r\n value: string;\r\n expectedLength: number;\r\n onChange: (value: string) => void;\r\n lockObject: LockObject;\r\n}\r\n\r\nexport class HexColor extends React.Component<IHexColorProps, { hex: string }> {\r\n constructor(props: IHexColorProps) {\r\n super(props);\r\n\r\n this.state = { hex: this.props.value.replace(\"#\", \"\") };\r\n }\r\n\r\n shouldComponentUpdate(nextProps: IHexColorProps, nextState: { hex: string }) {\r\n if (nextProps.value !== this.props.value) {\r\n nextState.hex = nextProps.value.replace(\"#\", \"\");\r\n }\r\n\r\n return true;\r\n }\r\n\r\n lock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = true;\r\n }\r\n }\r\n\r\n unlock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = false;\r\n }\r\n }\r\n\r\n updateHexValue(valueString: string) {\r\n if (valueString != \"\" && /^[0-9A-Fa-f]+$/g.test(valueString) == false) {\r\n return;\r\n }\r\n\r\n this.setState({ hex: valueString });\r\n\r\n if (valueString.length !== this.props.expectedLength) {\r\n if (this.props.expectedLength === 8 && valueString.length === 6) {\r\n valueString = valueString + \"FF\";\r\n } else {\r\n return;\r\n }\r\n }\r\n\r\n this.props.onChange(\"#\" + valueString);\r\n }\r\n\r\n public render() {\r\n return (\r\n <div className={style.colorPickerHex}>\r\n <div className={style.colorPickerHexLabel}>Hex</div>\r\n <div className={style.colorPickerHexValue}>\r\n <input\r\n type=\"string\"\r\n // className=\"hex-input\"\r\n className={style.colorPickerHex}\r\n value={this.state.hex}\r\n onBlur={() => this.unlock()}\r\n onFocus={() => this.lock()}\r\n onChange={(evt) => this.updateHexValue(evt.target.value)}\r\n />\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"HexColor.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/components/colorPicker/HexColor.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,MAAM,yBAAyB,CAAC;AAS5C,MAAM,OAAO,QAAS,SAAQ,KAAK,CAAC,SAA0C;IAC1E,YAAY,KAAqB;QAC7B,KAAK,CAAC,KAAK,CAAC,CAAC;QAEb,IAAI,CAAC,KAAK,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC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AK,SAAS,EAAE,KAAK,CAAC,mBAAmB,oBAAW,EACpD,cAAK,SAAS,EAAE,KAAK,CAAC,mBAAmB,YACrC,gBACI,IAAI,EAAC,QAAQ;wBACb,wBAAwB;wBACxB,SAAS,EAAE,KAAK,CAAC,cAAc,EAC/B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,EACrB,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,EAC3B,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAC1B,QAAQ,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAC1D,GACA,IACJ,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport type { LockObject } from \"../../tabs/propertyGrids/lockObject\";\r\nimport style from \"./HexColor.modules.scss\";\r\n\r\nexport interface IHexColorProps {\r\n value: string;\r\n expectedLength: number;\r\n onChange: (value: string) => void;\r\n lockObject: LockObject;\r\n}\r\n\r\nexport class HexColor extends React.Component<IHexColorProps, { hex: string }> {\r\n constructor(props: IHexColorProps) {\r\n super(props);\r\n\r\n this.state = { hex: this.props.value.replace(\"#\", \"\") };\r\n }\r\n\r\n shouldComponentUpdate(nextProps: IHexColorProps, nextState: { hex: string }) {\r\n if (nextProps.value !== this.props.value) {\r\n nextState.hex = nextProps.value.replace(\"#\", \"\");\r\n }\r\n\r\n return true;\r\n }\r\n\r\n lock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = true;\r\n }\r\n }\r\n\r\n unlock() {\r\n if (this.props.lockObject) {\r\n this.props.lockObject.lock = false;\r\n }\r\n }\r\n\r\n updateHexValue(valueString: string) {\r\n if (valueString != \"\" && /^[0-9A-Fa-f]+$/g.test(valueString) == false) {\r\n return;\r\n }\r\n\r\n this.setState({ hex: valueString });\r\n\r\n if (valueString.length !== this.props.expectedLength) {\r\n if (this.props.expectedLength === 8 && valueString.length === 6) {\r\n valueString = valueString + \"FF\";\r\n } else {\r\n return;\r\n }\r\n }\r\n\r\n this.props.onChange(\"#\" + valueString);\r\n }\r\n\r\n public render() {\r\n return (\r\n <div className={style.colorPickerHex}>\r\n <div className={style.colorPickerHexLabel}>Hex</div>\r\n <div className={style.colorPickerHexValue}>\r\n <input\r\n type=\"string\"\r\n // className=\"hex-input\"\r\n className={style.colorPickerHex}\r\n value={this.state.hex}\r\n onBlur={() => this.unlock()}\r\n onFocus={() => this.lock()}\r\n onChange={(evt) => this.updateHexValue(evt.target.value)}\r\n />\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DraggableIcon.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/components/layout/DraggableIcon.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBpC;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAA4B,CAAC,KAAK,EAAE,EAAE;IAC5D,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAC5B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,OAAO,CAAC,OAAO;YACX,OAAO;gBACH,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE;aACrC,CAAC;QACN,CAAC;KACJ,CAAC,CAAC,CAAC;IACJ,OAAO,cAAK,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,GAAI,CAAC;AAC9C,CAAC,CAAC","sourcesContent":["import type { FC } from \"react\";\r\nimport { useDrag } from \"react-dnd\";\r\nimport type { ElementTypes, TabDrag } from \"./types\";\r\n\r\n/**\r\n * Arguments for the DraggableIcon component.\r\n */\r\nexport interface IDraggableIconProps {\r\n /**\r\n * Icon source\r\n */\r\n src: string;\r\n /**\r\n * Object that will be passed to the drag event\r\n */\r\n item: TabDrag;\r\n /**\r\n * Type of drag event\r\n */\r\n type: ElementTypes;\r\n}\r\n\r\n/**\r\n * An icon that can be dragged by the user\r\n */\r\nexport const DraggableIcon: FC<IDraggableIconProps> = (props) => {\r\n const [, drag] = useDrag(() => ({\r\n type: props.type,\r\n item: props.item,\r\n collect(monitor) {\r\n return {\r\n isDragging: !!monitor.isDragging(),\r\n };\r\n },\r\n }));\r\n return <img ref={drag} src={props.src} />;\r\n};\r\n"]}
1
+ {"version":3,"file":"DraggableIcon.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/components/layout/DraggableIcon.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBpC;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAA4B,CAAC,KAAK,EAAE,EAAE;IAC5D,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAC5B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,OAAO,CAAC,OAAO;YACX,OAAO;gBACH,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE;aACrC,CAAC;QACN,CAAC;KACJ,CAAC,CAAC,CAAC;IACJ,OAAO,cAAK,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,GAAI,CAAC;AAC9C,CAAC,CAAC","sourcesContent":["import type { FC } from \"react\";\r\nimport { useDrag } from \"react-dnd\";\r\nimport type { ElementTypes, TabDrag } from \"./types\";\r\n\r\n/**\r\n * Arguments for the DraggableIcon component.\r\n */\r\nexport interface IDraggableIconProps {\r\n /**\r\n * Icon source\r\n */\r\n src: string;\r\n /**\r\n * Object that will be passed to the drag event\r\n */\r\n item: TabDrag;\r\n /**\r\n * Type of drag event\r\n */\r\n type: ElementTypes;\r\n}\r\n\r\n/**\r\n * An icon that can be dragged by the user\r\n */\r\nexport const DraggableIcon: FC<IDraggableIconProps> = (props) => {\r\n const [, drag] = useDrag(() => ({\r\n type: props.type,\r\n item: props.item,\r\n collect(monitor) {\r\n return {\r\n isDragging: !!monitor.isDragging(),\r\n };\r\n },\r\n }));\r\n return <img ref={drag} src={props.src} />;\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FlexibleColumn.js","sourceRoot":"","sources":["../../../../../../dev/sharedUiComponents/src/components/layout/FlexibleColumn.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,+BAA+B,CAAC;AAYlD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAA6B,CAAC,KAAK,EAAE,EAAE;IAC9D,OAAO,CACH,cAAK,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,cAAc,YAC9D,KAAK,CAAC,QAAQ,GACb,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import type { FC } from \"react\";\r\nimport style from \"./FlexibleColumn.modules.scss\";\r\n\r\n/**\r\n * Arguments for the Column component.\r\n */\r\nexport interface IFlexibleColumnProps {\r\n /**\r\n * Width of column\r\n */\r\n width: string;\r\n}\r\n\r\n/**\r\n * This component represents a single column in the layout. It receives a width\r\n * that it occupies and the content to display\r\n * @param props\r\n * @returns\r\n */\r\nexport const FlexibleColumn: FC<IFlexibleColumnProps> = (props) => {\r\n return (\r\n <div style={{ width: props.width }} className={style.flexibleColumn}>\r\n {props.children}\r\n </div>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"FlexibleColumn.js","sourceRoot":"","sources":["../../../../../dev/sharedUiComponents/src/components/layout/FlexibleColumn.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,+BAA+B,CAAC;AAYlD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAA6B,CAAC,KAAK,EAAE,EAAE;IAC9D,OAAO,CACH,cAAK,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,cAAc,YAC9D,KAAK,CAAC,QAAQ,GACb,CACT,CAAC;AACN,CAAC,CAAC","sourcesContent":["import type { FC } from \"react\";\r\nimport style from \"./FlexibleColumn.modules.scss\";\r\n\r\n/**\r\n * Arguments for the Column component.\r\n */\r\nexport interface IFlexibleColumnProps {\r\n /**\r\n * Width of column\r\n */\r\n width: string;\r\n}\r\n\r\n/**\r\n * This component represents a single column in the layout. It receives a width\r\n * that it occupies and the content to display\r\n * @param props\r\n * @returns\r\n */\r\nexport const FlexibleColumn: FC<IFlexibleColumnProps> = (props) => {\r\n return (\r\n <div style={{ width: props.width }} className={style.flexibleColumn}>\r\n {props.children}\r\n </div>\r\n );\r\n};\r\n"]}