Hello all,
I am using the Smart Edit widget in Esri's Web AppBuilder in my application. Overall this widget is a major improvement from the standard edit widget that was originally provided before the Smart Editor Widget. One of the features that we found was missing from the new edit widget was the ability to choose the shape of the edit that you wanted to make. (Only applied to Polygons and Polylines.)
In the original Edit widget you could use the toolbar to define the shape desired :

The Smart Editor Widget, however, does not have an option to choose. I have downloaded the Web AppBuilder Developer Edition (Link) and have changed the Smart Editor widget's code to create a popup box to prompt the user to choose the editing shape that is desired.
Here is what happens with my edits:

Here is the code that makes this happen (Inside the Smart Editor widget's Widget.js file):
_activateTemplateToolbar<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">function</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>templatePicker<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">var</SPAN> selectedTemplate <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>templatePicker<SPAN class="punctuation token">.</SPAN><SPAN class="token function">getSelected</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN>selectedTemplate <SPAN class="operator token">&&</SPAN> selectedTemplate <SPAN class="operator token">!==</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">switch</SPAN> <SPAN class="punctuation token">(</SPAN>selectedTemplate<SPAN class="punctuation token">.</SPAN>template<SPAN class="punctuation token">.</SPAN>drawingTool<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">case</SPAN> <SPAN class="string token">"esriFeatureEditToolNone"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">switch</SPAN> <SPAN class="punctuation token">(</SPAN>selectedTemplate<SPAN class="punctuation token">.</SPAN>featureLayer<SPAN class="punctuation token">.</SPAN>geometryType<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">case</SPAN> <SPAN class="string token">"esriGeometryPoint"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">activate</SPAN><SPAN class="punctuation token">(</SPAN>Draw<SPAN class="punctuation token">.</SPAN>POINT<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">case</SPAN> <SPAN class="string token">"esriGeometryPolyline"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">activate</SPAN><SPAN class="punctuation token">(</SPAN>Draw<SPAN class="punctuation token">.</SPAN>POLYLINE<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">case</SPAN> <SPAN class="string token">"esriGeometryPolygon"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">activate</SPAN><SPAN class="punctuation token">(</SPAN>Draw<SPAN class="punctuation token">.</SPAN>POLYGON<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">case</SPAN> <SPAN class="string token">"esriFeatureEditToolPoint"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">activate</SPAN><SPAN class="punctuation token">(</SPAN>Draw<SPAN class="punctuation token">.</SPAN>POINT<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">case</SPAN> <SPAN class="string token">"esriFeatureEditToolLine"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">promptPolylineDrawType</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="comment token">// Edit</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">case</SPAN> <SPAN class="string token">"esriFeatureEditToolAutoCompletePolygon"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">case</SPAN> <SPAN class="string token">"esriFeatureEditToolPolygon"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="token function">promptPolygonDrawType</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="comment token">//Edit</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">case</SPAN> <SPAN class="string token">"esriFeatureEditToolCircle"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">activate</SPAN><SPAN class="punctuation token">(</SPAN>Draw<SPAN class="punctuation token">.</SPAN>CIRCLE<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">case</SPAN> <SPAN class="string token">"esriFeatureEditToolEllipse"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">activate</SPAN><SPAN class="punctuation token">(</SPAN>Draw<SPAN class="punctuation token">.</SPAN>ELLIPSE<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">case</SPAN> <SPAN class="string token">"esriFeatureEditToolRectangle"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">activate</SPAN><SPAN class="punctuation token">(</SPAN>Draw<SPAN class="punctuation token">.</SPAN>RECTANGLE<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">case</SPAN> <SPAN class="string token">"esriFeatureEditToolFreehand"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">switch</SPAN> <SPAN class="punctuation token">(</SPAN>selectedTemplate<SPAN class="punctuation token">.</SPAN>featureLayer<SPAN class="punctuation token">.</SPAN>geometryType<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">case</SPAN> <SPAN class="string token">"esriGeometryPoint"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">activate</SPAN><SPAN class="punctuation token">(</SPAN>Draw<SPAN class="punctuation token">.</SPAN>POINT<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">case</SPAN> <SPAN class="string token">"esriGeometryPolyline"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">activate</SPAN><SPAN class="punctuation token">(</SPAN>Draw<SPAN class="punctuation token">.</SPAN>FREEHAND_POLYLINE<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">case</SPAN> <SPAN class="string token">"esriGeometryPolygon"</SPAN><SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">activate</SPAN><SPAN class="punctuation token">(</SPAN>Draw<SPAN class="punctuation token">.</SPAN>FREEHAND_POLYGON<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">break</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">else</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">deactivate</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">else</SPAN> <SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">deactivate</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="comment token">// *****************************MY EDITS BEGIN HERE***********************************************</SPAN>
promptPolylineDrawType<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">function</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">var</SPAN> dialog <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Popup</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN>
titleLabel<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Select Drawing Method"</SPAN><SPAN class="punctuation token">,</SPAN>
width<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">500</SPAN><SPAN class="punctuation token">,</SPAN>
maxHeight<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">200</SPAN><SPAN class="punctuation token">,</SPAN>
autoHeight<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">,</SPAN>
content<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Please select the shape desired."</SPAN><SPAN class="punctuation token">,</SPAN>
buttons<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">{</SPAN>
label<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Polyline"</SPAN><SPAN class="punctuation token">,</SPAN>
classNames<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">'jimu-btn'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
onClick<SPAN class="punctuation token">:</SPAN> lang<SPAN class="punctuation token">.</SPAN><SPAN class="token function">hitch</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">function</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">activate</SPAN><SPAN class="punctuation token">(</SPAN>Draw<SPAN class="punctuation token">.</SPAN>POLYLINE<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
dialog<SPAN class="punctuation token">.</SPAN><SPAN class="token function">close</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">{</SPAN>
label<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Freehand Polyline"</SPAN><SPAN class="punctuation token">,</SPAN>
classNames<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">'jimu-btn'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
onClick<SPAN class="punctuation token">:</SPAN> lang<SPAN class="punctuation token">.</SPAN><SPAN class="token function">hitch</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">function</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">activate</SPAN><SPAN class="punctuation token">(</SPAN>Draw<SPAN class="punctuation token">.</SPAN>FREEHAND_POLYLINE<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
dialog<SPAN class="punctuation token">.</SPAN><SPAN class="token function">close</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
onClose<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">function</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">deactivate</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
promptPolygonDrawType<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">function</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">var</SPAN> dialog <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">Popup</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN>
titleLabel<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Select Drawing Method"</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="comment token">//width: 600,</SPAN>
maxHeight<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">200</SPAN><SPAN class="punctuation token">,</SPAN>
autoHeight<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">,</SPAN>
content<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Please select the shape desired."</SPAN><SPAN class="punctuation token">,</SPAN>
buttons<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">{</SPAN>
label<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Polygon"</SPAN><SPAN class="punctuation token">,</SPAN>
classNames<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">'jimu-btn'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
onClick<SPAN class="punctuation token">:</SPAN> lang<SPAN class="punctuation token">.</SPAN><SPAN class="token function">hitch</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">function</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">activate</SPAN><SPAN class="punctuation token">(</SPAN>Draw<SPAN class="punctuation token">.</SPAN>POLYGON<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
dialog<SPAN class="punctuation token">.</SPAN><SPAN class="token function">close</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">{</SPAN>
label<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Triangle"</SPAN><SPAN class="punctuation token">,</SPAN>
classNames<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">'jimu-btn'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
onClick<SPAN class="punctuation token">:</SPAN> lang<SPAN class="punctuation token">.</SPAN><SPAN class="token function">hitch</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">function</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">activate</SPAN><SPAN class="punctuation token">(</SPAN>Draw<SPAN class="punctuation token">.</SPAN>TRIANGLE<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
dialog<SPAN class="punctuation token">.</SPAN><SPAN class="token function">close</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">{</SPAN>
label<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Freehand Polygon"</SPAN><SPAN class="punctuation token">,</SPAN>
classNames<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">'jimu-btn'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
onClick<SPAN class="punctuation token">:</SPAN> lang<SPAN class="punctuation token">.</SPAN><SPAN class="token function">hitch</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">function</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">activate</SPAN><SPAN class="punctuation token">(</SPAN>Draw<SPAN class="punctuation token">.</SPAN>FREEHAND_POLYGON<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
dialog<SPAN class="punctuation token">.</SPAN><SPAN class="token function">close</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">{</SPAN>
label<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Circle"</SPAN><SPAN class="punctuation token">,</SPAN>
classNames<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">'jimu-btn'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
onClick<SPAN class="punctuation token">:</SPAN> lang<SPAN class="punctuation token">.</SPAN><SPAN class="token function">hitch</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">function</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">activate</SPAN><SPAN class="punctuation token">(</SPAN>Draw<SPAN class="punctuation token">.</SPAN>CIRCLE<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
dialog<SPAN class="punctuation token">.</SPAN><SPAN class="token function">close</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">{</SPAN>
label<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"Rectangle"</SPAN><SPAN class="punctuation token">,</SPAN>
classNames<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">'jimu-btn'</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
onClick<SPAN class="punctuation token">:</SPAN> lang<SPAN class="punctuation token">.</SPAN><SPAN class="token function">hitch</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">function</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">activate</SPAN><SPAN class="punctuation token">(</SPAN>Draw<SPAN class="punctuation token">.</SPAN>RECTANGLE<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
dialog<SPAN class="punctuation token">.</SPAN><SPAN class="token function">close</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">,</SPAN>
onClose<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>drawToolbar<SPAN class="punctuation token">.</SPAN><SPAN class="token function">deactivate</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="comment token">//**********************************MY EDITS END HERE *******************************************************</SPAN>
_templatePickerNeedsToBeCreated<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">function</SPAN> <SPAN class="punctuation token">(</SPAN>layers<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>templatePicker <SPAN class="operator token">===</SPAN> undefined <SPAN class="operator token">||</SPAN> <SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>templatePicker <SPAN class="operator token">===</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">return</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">if</SPAN> <SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">this</SPAN><SPAN class="punctuation token">.</SPAN>templatePicker<SPAN class="punctuation token">.</SPAN>featureLayers<SPAN class="punctuation token">.</SPAN>length <SPAN class="operator token">!==</SPAN> layers<SPAN class="punctuation token">.</SPAN>length<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">return</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>It is still a work in progress, but this will allow you to choose the shape that you desire for editing in the Smart Editor Widget.
Any feedback or suggestions are welcome!
Thanks,
Chris
P.S. Unlike the standard Edit widget, the smart editor widget does not utilize the Editor Class of the Esri JavaScript API.
It uses the Edit and Draw classes.