svgedit/dist/editor/extensions/ext-markers.js.map

1 line
41 KiB
Plaintext

{"version":3,"file":"ext-markers.js","sources":["../../../src/editor/extensions/ext-markers.js"],"sourcesContent":["/**\n * @file ext-markers.js\n *\n * @license Apache-2.0\n *\n * @copyright 2010 Will Schleter based on ext-arrows.js by Copyright(c) 2010 Alexis Deveria\n *\n * This extension provides for the addition of markers to the either end\n * or the middle of a line, polyline, path, polygon.\n *\n * Markers may be either a graphic or arbitary text\n *\n * to simplify the coding and make the implementation as robust as possible,\n * markers are not shared - every object has its own set of markers.\n * this relationship is maintained by a naming convention between the\n * ids of the markers and the ids of the object\n *\n * The following restrictions exist for simplicty of use and programming\n * objects and their markers to have the same color\n * marker size is fixed\n * text marker font, size, and attributes are fixed\n * an application specific attribute - se_type - is added to each marker element\n * to store the type of marker\n *\n * @todo\n * remove some of the restrictions above\n * add option for keeping text aligned to horizontal\n * add support for dimension extension lines\n *\n*/\n\nexport default {\n name: 'markers',\n async init (S) {\n const strings = await S.importLocale();\n const svgEditor = this;\n const {$} = S;\n const svgCanvas = svgEditor.canvas;\n const // {svgcontent} = S,\n addElem = svgCanvas.addSVGElementFromJson;\n const mtypes = ['start', 'mid', 'end'];\n const markerPrefix = 'se_marker_';\n const idPrefix = 'mkr_';\n\n // note - to add additional marker types add them below with a unique id\n // and add the associated icon(s) to marker-icons.svg\n // the geometry is normalized to a 100x100 box with the origin at lower left\n // Safari did not like negative values for low left of viewBox\n // remember that the coordinate system has +y downward\n const markerTypes = {\n nomarker: {},\n leftarrow:\n {element: 'path', attr: {d: 'M0,50 L100,90 L70,50 L100,10 Z'}},\n rightarrow:\n {element: 'path', attr: {d: 'M100,50 L0,90 L30,50 L0,10 Z'}},\n textmarker:\n {element: 'text', attr: {\n x: 0, y: 0, 'stroke-width': 0, stroke: 'none',\n 'font-size': 75, 'font-family': 'serif', 'text-anchor': 'left',\n 'xml:space': 'preserve'\n }},\n forwardslash:\n {element: 'path', attr: {d: 'M30,100 L70,0'}},\n reverseslash:\n {element: 'path', attr: {d: 'M30,0 L70,100'}},\n verticalslash:\n {element: 'path', attr: {d: 'M50,0 L50,100'}},\n box:\n {element: 'path', attr: {d: 'M20,20 L20,80 L80,80 L80,20 Z'}},\n star:\n {element: 'path', attr: {d: 'M10,30 L90,30 L20,90 L50,10 L80,90 Z'}},\n xmark:\n {element: 'path', attr: {d: 'M20,80 L80,20 M80,80 L20,20'}},\n triangle:\n {element: 'path', attr: {d: 'M10,80 L50,20 L80,80 Z'}},\n mcircle:\n {element: 'circle', attr: {r: 30, cx: 50, cy: 50}}\n };\n\n // duplicate shapes to support unfilled (open) marker types with an _o suffix\n ['leftarrow', 'rightarrow', 'box', 'star', 'mcircle', 'triangle'].forEach((v) => {\n markerTypes[v + '_o'] = markerTypes[v];\n });\n\n /**\n * @param {Element} elem - A graphic element will have an attribute like marker-start\n * @param {\"marker-start\"|\"marker-mid\"|\"marker-end\"} attr\n * @returns {Element} The marker element that is linked to the graphic element\n */\n function getLinked (elem, attr) {\n const str = elem.getAttribute(attr);\n if (!str) { return null; }\n const m = str.match(/\\(#(.*)\\)/);\n // const m = str.match(/\\(#(?<id>.+)\\)/);\n // if (!m || !m.groups.id) {\n if (!m || m.length !== 2) {\n return null;\n }\n return svgCanvas.getElem(m[1]);\n // return svgCanvas.getElem(m.groups.id);\n }\n\n /**\n *\n * @param {\"start\"|\"mid\"|\"end\"} pos\n * @param {string} id\n * @returns {void}\n */\n function setIcon (pos, id) {\n if (id.substr(0, 1) !== '\\\\') { id = '\\\\textmarker'; }\n const ci = '#' + idPrefix + pos + '_' + id.substr(1);\n svgEditor.setIcon('#cur_' + pos + '_marker_list', $(ci).children());\n $(ci).addClass('current').siblings().removeClass('current');\n }\n\n let selElems;\n /**\n * Toggles context tool panel off/on. Sets the controls with the\n * selected element's settings.\n * @param {boolean} on\n * @returns {void}\n */\n function showPanel (on) {\n $('#marker_panel').toggle(on);\n\n if (on) {\n const el = selElems[0];\n\n let val, ci;\n $.each(mtypes, function (i, pos) {\n const m = getLinked(el, 'marker-' + pos);\n const txtbox = $('#' + pos + '_marker');\n if (!m) {\n val = '\\\\nomarker';\n ci = val;\n txtbox.hide(); // hide text box\n } else {\n if (!m.attributes.se_type) { return; } // not created by this extension\n val = '\\\\' + m.attributes.se_type.textContent;\n ci = val;\n if (val === '\\\\textmarker') {\n val = m.lastChild.textContent;\n // txtbox.show(); // show text box\n } else {\n txtbox.hide(); // hide text box\n }\n }\n txtbox.val(val);\n setIcon(pos, ci);\n });\n }\n }\n\n /**\n * @param {string} id\n * @param {\"\"|\"\\\\nomarker\"|\"nomarker\"|\"leftarrow\"|\"rightarrow\"|\"textmarker\"|\"forwardslash\"|\"reverseslash\"|\"verticalslash\"|\"box\"|\"star\"|\"xmark\"|\"triangle\"|\"mcircle\"} val\n * @returns {SVGMarkerElement}\n */\n function addMarker (id, val) {\n const txtBoxBg = '#ffffff';\n const txtBoxBorder = 'none';\n const txtBoxStrokeWidth = 0;\n\n let marker = svgCanvas.getElem(id);\n if (marker) { return undefined; }\n\n if (val === '' || val === '\\\\nomarker') { return undefined; }\n\n const el = selElems[0];\n const color = el.getAttribute('stroke');\n // NOTE: Safari didn't like a negative value in viewBox\n // so we use a standardized 0 0 100 100\n // with 50 50 being mapped to the marker position\n const strokeWidth = 10;\n let refX = 50;\n let refY = 50;\n let viewBox = '0 0 100 100';\n let markerWidth = 5;\n let markerHeight = 5;\n let seType;\n if (val.substr(0, 1) === '\\\\') {\n seType = val.substr(1);\n } else { seType = 'textmarker'; }\n\n if (!markerTypes[seType]) { return undefined; } // an unknown type!\n\n // create a generic marker\n marker = addElem({\n element: 'marker',\n attr: {\n id,\n markerUnits: 'strokeWidth',\n orient: 'auto',\n style: 'pointer-events:none',\n se_type: seType\n }\n });\n\n if (seType !== 'textmarker') {\n const mel = addElem(markerTypes[seType]);\n const fillcolor = (seType.substr(-2) === '_o')\n ? 'none'\n : color;\n\n mel.setAttribute('fill', fillcolor);\n mel.setAttribute('stroke', color);\n mel.setAttribute('stroke-width', strokeWidth);\n marker.append(mel);\n } else {\n const text = addElem(markerTypes[seType]);\n // have to add text to get bounding box\n text.textContent = val;\n const tb = text.getBBox();\n // alert(tb.x + ' ' + tb.y + ' ' + tb.width + ' ' + tb.height);\n const pad = 1;\n const bb = tb;\n bb.x = 0;\n bb.y = 0;\n bb.width += pad * 2;\n bb.height += pad * 2;\n // shift text according to its size\n text.setAttribute('x', pad);\n text.setAttribute('y', bb.height - pad - tb.height / 4); // kludge?\n text.setAttribute('fill', color);\n refX = bb.width / 2 + pad;\n refY = bb.height / 2 + pad;\n viewBox = bb.x + ' ' + bb.y + ' ' + bb.width + ' ' + bb.height;\n markerWidth = bb.width / 10;\n markerHeight = bb.height / 10;\n\n const box = addElem({\n element: 'rect',\n attr: {\n x: bb.x,\n y: bb.y,\n width: bb.width,\n height: bb.height,\n fill: txtBoxBg,\n stroke: txtBoxBorder,\n 'stroke-width': txtBoxStrokeWidth\n }\n });\n marker.setAttribute('orient', 0);\n marker.append(box, text);\n }\n\n marker.setAttribute('viewBox', viewBox);\n marker.setAttribute('markerWidth', markerWidth);\n marker.setAttribute('markerHeight', markerHeight);\n marker.setAttribute('refX', refX);\n marker.setAttribute('refY', refY);\n svgCanvas.findDefs().append(marker);\n\n return marker;\n }\n\n /**\n * @param {Element} elem\n * @returns {SVGPolylineElement}\n */\n function convertline (elem) {\n // this routine came from the connectors extension\n // it is needed because midpoint markers don't work with line elements\n if (elem.tagName !== 'line') { return elem; }\n\n // Convert to polyline to accept mid-arrow\n\n const x1 = Number(elem.getAttribute('x1'));\n const x2 = Number(elem.getAttribute('x2'));\n const y1 = Number(elem.getAttribute('y1'));\n const y2 = Number(elem.getAttribute('y2'));\n const {id} = elem;\n\n const midPt = (' ' + ((x1 + x2) / 2) + ',' + ((y1 + y2) / 2) + ' ');\n const pline = addElem({\n element: 'polyline',\n attr: {\n points: (x1 + ',' + y1 + midPt + x2 + ',' + y2),\n stroke: elem.getAttribute('stroke'),\n 'stroke-width': elem.getAttribute('stroke-width'),\n fill: 'none',\n opacity: elem.getAttribute('opacity') || 1\n }\n });\n $.each(mtypes, function (i, pos) { // get any existing marker definitions\n const nam = 'marker-' + pos;\n const m = elem.getAttribute(nam);\n if (m) { pline.setAttribute(nam, elem.getAttribute(nam)); }\n });\n\n const batchCmd = new S.BatchCommand();\n batchCmd.addSubCommand(new S.RemoveElementCommand(elem, elem.parentNode));\n batchCmd.addSubCommand(new S.InsertElementCommand(pline));\n\n $(elem).after(pline).remove();\n svgCanvas.clearSelection();\n pline.id = id;\n svgCanvas.addToSelection([pline]);\n S.addCommandToHistory(batchCmd);\n return pline;\n }\n\n /**\n *\n * @returns {void}\n */\n function setMarker () {\n const poslist = {start_marker: 'start', mid_marker: 'mid', end_marker: 'end'};\n const pos = poslist[this.id];\n const markerName = 'marker-' + pos;\n const el = selElems[0];\n const marker = getLinked(el, markerName);\n if (marker) { $(marker).remove(); }\n el.removeAttribute(markerName);\n let val = this.value;\n if (val === '') { val = '\\\\nomarker'; }\n if (val === '\\\\nomarker') {\n setIcon(pos, val);\n svgCanvas.call('changed', selElems);\n return;\n }\n // Set marker on element\n const id = markerPrefix + pos + '_' + el.id;\n addMarker(id, val);\n svgCanvas.changeSelectedAttribute(markerName, 'url(#' + id + ')');\n if (el.tagName === 'line' && pos === 'mid') {\n convertline(el);\n }\n svgCanvas.call('changed', selElems);\n setIcon(pos, val);\n }\n\n /**\n * Called when the main system modifies an object. This routine changes\n * the associated markers to be the same color.\n * @param {Element} elem\n * @returns {void}\n */\n function colorChanged (elem) {\n const color = elem.getAttribute('stroke');\n\n $.each(mtypes, function (i, pos) {\n const marker = getLinked(elem, 'marker-' + pos);\n if (!marker) { return; }\n if (!marker.attributes.se_type) { return; } // not created by this extension\n const ch = marker.lastElementChild;\n if (!ch) { return; }\n const curfill = ch.getAttribute('fill');\n const curstroke = ch.getAttribute('stroke');\n if (curfill && curfill !== 'none') { ch.setAttribute('fill', color); }\n if (curstroke && curstroke !== 'none') { ch.setAttribute('stroke', color); }\n });\n }\n\n /**\n * Called when the main system creates or modifies an object.\n * Its primary purpose is to create new markers for cloned objects.\n * @param {Element} el\n * @returns {void}\n */\n function updateReferences (el) {\n $.each(mtypes, function (i, pos) {\n const id = markerPrefix + pos + '_' + el.id;\n const markerName = 'marker-' + pos;\n const marker = getLinked(el, markerName);\n if (!marker || !marker.attributes.se_type) { return; } // not created by this extension\n const url = el.getAttribute(markerName);\n if (url) {\n const len = el.id.length;\n const linkid = url.substr(-len - 1, len);\n if (el.id !== linkid) {\n const val = $('#' + pos + '_marker').attr('value');\n addMarker(id, val);\n svgCanvas.changeSelectedAttribute(markerName, 'url(#' + id + ')');\n if (el.tagName === 'line' && pos === 'mid') { el = convertline(el); }\n svgCanvas.call('changed', selElems);\n }\n }\n });\n }\n\n // simulate a change event a text box that stores the current element's marker type\n /**\n * @param {\"start\"|\"mid\"|\"end\"} pos\n * @param {string} val\n * @returns {void}\n */\n function triggerTextEntry (pos, val) {\n $('#' + pos + '_marker').val(val);\n $('#' + pos + '_marker').change();\n // const txtbox = $('#'+pos+'_marker');\n // if (val.substr(0,1)=='\\\\') {txtbox.hide();}\n // else {txtbox.show();}\n }\n\n /**\n * @param {\"start\"|\"mid\"|\"end\"} pos\n * @returns {Promise<void>} Resolves to `undefined`\n */\n async function showTextPrompt (pos) {\n let def = $('#' + pos + '_marker').val();\n if (def.substr(0, 1) === '\\\\') { def = ''; }\n const txt = await $.prompt('Enter text for ' + pos + ' marker', def);\n if (txt) {\n triggerTextEntry(pos, txt);\n }\n }\n\n /*\n function setMarkerSet(obj) {\n const parts = this.id.split('_');\n const set = parts[2];\n switch (set) {\n case 'off':\n triggerTextEntry('start','\\\\nomarker');\n triggerTextEntry('mid','\\\\nomarker');\n triggerTextEntry('end','\\\\nomarker');\n break;\n case 'dimension':\n triggerTextEntry('start','\\\\leftarrow');\n triggerTextEntry('end','\\\\rightarrow');\n await showTextPrompt('mid');\n break;\n case 'label':\n triggerTextEntry('mid','\\\\nomarker');\n triggerTextEntry('end','\\\\rightarrow');\n await showTextPrompt('start');\n break;\n }\n }\n */\n\n // callback function for a toolbar button click\n /**\n * @param {Event} ev\n * @returns {Promise<void>} Resolves to `undefined`\n */\n async function setArrowFromButton (ev) {\n const parts = this.id.split('_');\n const pos = parts[1];\n let val = parts[2];\n if (parts[3]) { val += '_' + parts[3]; }\n\n if (val !== 'textmarker') {\n triggerTextEntry(pos, '\\\\' + val);\n } else {\n await showTextPrompt(pos);\n }\n }\n\n /**\n * @param {\"nomarker\"|\"leftarrow\"|\"rightarrow\"|\"textmarker\"|\"forwardslash\"|\"reverseslash\"|\"verticalslash\"|\"box\"|\"star\"|\"xmark\"|\"triangle\"|\"mcircle\"} id\n * @returns {string}\n */\n function getTitle (id) {\n const {langList} = strings;\n const item = langList.find((itm) => {\n return itm.id === id;\n });\n return item ? item.title : id;\n }\n\n /**\n * Build the toolbar button array from the marker definitions.\n * @returns {module:SVGEditor.Button[]}\n */\n function buildButtonList () {\n const buttons = [];\n // const i = 0;\n /*\n buttons.push({\n id: idPrefix + 'markers_off',\n title: 'Turn off all markers',\n type: 'context',\n events: { click: setMarkerSet },\n panel: 'marker_panel'\n });\n buttons.push({\n id: idPrefix + 'markers_dimension',\n title: 'Dimension',\n type: 'context',\n events: { click: setMarkerSet },\n panel: 'marker_panel'\n });\n buttons.push({\n id: idPrefix + 'markers_label',\n title: 'Label',\n type: 'context',\n events: { click: setMarkerSet },\n panel: 'marker_panel'\n });\n */\n $.each(mtypes, function (k, pos) {\n const listname = pos + '_marker_list';\n let def = true;\n Object.keys(markerTypes).forEach(function (id) {\n const title = getTitle(String(id));\n buttons.push({\n id: idPrefix + pos + '_' + id,\n svgicon: id,\n icon: 'markers-' + id + '.png',\n title,\n type: 'context',\n events: {click: setArrowFromButton},\n panel: 'marker_panel',\n list: listname,\n isDefault: def\n });\n def = false;\n });\n });\n return buttons;\n }\n\n const contextTools = [\n {\n type: 'input',\n panel: 'marker_panel',\n id: 'start_marker',\n size: 3,\n events: {change: setMarker}\n }, {\n type: 'button-select',\n panel: 'marker_panel',\n id: 'start_marker_list',\n colnum: 3,\n events: {change: setArrowFromButton}\n }, {\n type: 'input',\n panel: 'marker_panel',\n id: 'mid_marker',\n defval: '',\n size: 3,\n events: {change: setMarker}\n }, {\n type: 'button-select',\n panel: 'marker_panel',\n id: 'mid_marker_list',\n colnum: 3,\n events: {change: setArrowFromButton}\n }, {\n type: 'input',\n panel: 'marker_panel',\n id: 'end_marker',\n size: 3,\n events: {change: setMarker}\n }, {\n type: 'button-select',\n panel: 'marker_panel',\n id: 'end_marker_list',\n colnum: 3,\n events: {change: setArrowFromButton}\n }\n ];\n\n return {\n name: strings.name,\n svgicons: 'markers-icons.xml',\n callback () {\n $('#marker_panel').addClass('toolset').hide();\n },\n /* async */ addLangData ({importLocale, lang}) {\n return {data: strings.langList};\n },\n selectedChanged (opts) {\n // Use this to update the current selected elements\n // console.log('selectChanged',opts);\n selElems = opts.elems;\n\n const markerElems = ['line', 'path', 'polyline', 'polygon'];\n\n let i = selElems.length;\n while (i--) {\n const elem = selElems[i];\n if (elem && markerElems.includes(elem.tagName)) {\n if (opts.selectedElement && !opts.multiselected) {\n showPanel(true);\n } else {\n showPanel(false);\n }\n } else {\n showPanel(false);\n }\n }\n },\n\n elementChanged (opts) {\n // console.log('elementChanged',opts);\n const elem = opts.elems[0];\n if (elem && (\n elem.getAttribute('marker-start') ||\n elem.getAttribute('marker-mid') ||\n elem.getAttribute('marker-end')\n )) {\n colorChanged(elem);\n updateReferences(elem);\n }\n // changing_flag = false; // Not apparently in use\n },\n buttons: buildButtonList(),\n context_tools: strings.contextTools.map((contextTool, i) => {\n return Object.assign(contextTools[i], contextTool);\n })\n };\n }\n};\n"],"names":["name","init","S","getLinked","setIcon","showPanel","addMarker","convertline","setMarker","colorChanged","updateReferences","triggerTextEntry","showTextPrompt","setArrowFromButton","getTitle","buildButtonList","buttons","$","each","mtypes","k","pos","listname","def","Object","keys","markerTypes","forEach","id","title","String","push","idPrefix","svgicon","icon","type","events","click","panel","list","isDefault","langList","strings","item","find","itm","ev","parts","split","val","substr","prompt","txt","change","el","i","markerPrefix","markerName","marker","attributes","se_type","url","getAttribute","len","length","linkid","attr","svgCanvas","changeSelectedAttribute","tagName","call","selElems","elem","color","ch","lastElementChild","curfill","curstroke","setAttribute","poslist","start_marker","mid_marker","end_marker","remove","removeAttribute","value","x1","Number","x2","y1","y2","midPt","pline","addElem","element","points","stroke","fill","opacity","nam","m","batchCmd","BatchCommand","addSubCommand","RemoveElementCommand","parentNode","InsertElementCommand","after","clearSelection","addToSelection","addCommandToHistory","txtBoxBg","txtBoxBorder","txtBoxStrokeWidth","getElem","undefined","strokeWidth","refX","refY","viewBox","markerWidth","markerHeight","seType","markerUnits","orient","style","mel","fillcolor","append","text","textContent","tb","getBBox","pad","bb","x","y","width","height","box","findDefs","on","toggle","ci","txtbox","hide","lastChild","svgEditor","children","addClass","siblings","removeClass","str","match","importLocale","canvas","addSVGElementFromJson","nomarker","leftarrow","d","rightarrow","textmarker","forwardslash","reverseslash","verticalslash","star","xmark","triangle","mcircle","r","cx","cy","v","contextTools","size","colnum","defval","svgicons","callback","addLangData","lang","data","selectedChanged","opts","elems","markerElems","includes","selectedElement","multiselected","elementChanged","context_tools","map","contextTool","assign"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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