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

1 line
28 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","item","strings","langList","find","itm","ev","parts","this","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","start_marker","mid_marker","end_marker","remove","removeAttribute","value","x1","Number","x2","y1","y2","pline","addElem","element","points","stroke","fill","opacity","nam","batchCmd","BatchCommand","addSubCommand","RemoveElementCommand","parentNode","InsertElementCommand","after","clearSelection","addToSelection","addCommandToHistory","getElem","seType","refX","refY","viewBox","markerWidth","markerHeight","markerUnits","orient","style","mel","fillcolor","append","text","textContent","tb","getBBox","bb","x","y","width","pad","height","box","findDefs","on","toggle","ci","m","txtbox","lastChild","hide","svgEditor","children","addClass","siblings","removeClass","str","match","importLocale","_this","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","markerElems","elems","includes","selectedElement","multiselected","elementChanged","context_tools","map","contextTool","assign"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAe,CACbA,KAAM,UACAC,mBAAMC,0GAwDDC,EAmBAC,IAcAC,EAoCAC,EAsGAC,EA8CAC,EAgCAC,EAsBAC,EA2BAC,EAYMC,IAsCAC,IAiBNC,EAYAC,qGAAAA,kCACDC,EAAU,UAyBhBC,EAAEC,KAAKC,GAAQ,SAAUC,EAAGC,OACpBC,EAAWD,EAAM,eACnBE,GAAM,EACVC,OAAOC,KAAKC,GAAaC,SAAQ,SAAUC,OACnCC,EAAQf,EAASgB,OAAOF,IAC9BZ,EAAQe,KAAK,CACXH,GAAII,EAAWX,EAAM,IAAMO,EAC3BK,QAASL,EACTM,KAAM,WAAaN,EAAK,OACxBC,MAAAA,EACAM,KAAM,UACNC,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