{"version":3,"file":"ext-placemark.js","sources":["../../../src/editor/extensions/ext-placemark.js"],"sourcesContent":["/**\n * @file ext-placemark.js\n *\n *\n * @copyright 2010 CloudCanvas, Inc. All rights reserved\n *\n */\nexport default {\n name: 'placemark',\n async init (S) {\n const svgEditor = this;\n const svgCanvas = svgEditor.canvas;\n const addElem = svgCanvas.addSVGElementFromJson;\n const {$, importLocale} = S; // {svgcontent},\n let\n selElems,\n // editingitex = false,\n // svgdoc = S.svgroot.parentNode.ownerDocument,\n started,\n newPM;\n // edg = 0,\n // newFOG, newFOGParent, newDef, newImageName, newMaskID,\n // undoCommand = 'Not image',\n // modeChangeG, ccZoom, wEl, hEl, wOffset, hOffset, ccRgbEl, brushW, brushH;\n const strings = await importLocale();\n const markerTypes = {\n nomarker: {},\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 xmark:\n {element: 'path', attr: {d: 'M20,80 L80,20 M80,80 L20,20'}},\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 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 mcircle:\n {element: 'circle', attr: {r: 30, cx: 50, cy: 50}},\n triangle:\n {element: 'path', attr: {d: 'M10,80 L50,20 L80,80 Z'}}\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 *\n * @param {boolean} on\n * @returns {void}\n */\n function showPanel (on) {\n $('#placemark_panel').toggle(on);\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 if (!elem) { return null; }\n const str = elem.getAttribute(attr);\n if (!str) { return null; }\n\n // const m = str.match(/\\(#(?.+)\\)/);\n // if (!m || !m.groups.id) {\n const m = str.match(/\\(#(.*)\\)/);\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 * Called when text is changed.\n * @param {string} txt\n * @returns {void}\n */\n function updateText (txt) {\n const items = txt.split(';');\n selElems.forEach((elem) => {\n if (elem && elem.getAttribute('class').includes('placemark')) {\n $(elem).children().each((_, i) => {\n const [, , type, n] = i.id.split('_');\n if (type === 'txt') {\n $(i).text(items[n]);\n }\n });\n }\n });\n }\n /**\n * Called when font is changed.\n * @param {string} font\n * @returns {void}\n */\n function updateFont (font) {\n font = font.split(' ');\n const fontSize = Number.parseInt(font.pop());\n font = font.join(' ');\n selElems.forEach((elem) => {\n if (elem && elem.getAttribute('class').includes('placemark')) {\n $(elem).children().each((_, i) => {\n const [, , type] = i.id.split('_');\n if (type === 'txt') {\n $(i).attr({'font-family': font, 'font-size': fontSize});\n }\n });\n }\n });\n }\n /**\n * @param {string} id\n * @param {\"\"|\"\\\\nomarker\"|\"nomarker\"|\"leftarrow\"|\"rightarrow\"|\"textmarker\"|\"textmarker_top\"|\"textmarker_bottom\"|\"forwardslash\"|\"reverseslash\"|\"verticalslash\"|\"box\"|\"star\"|\"xmark\"|\"triangle\"|\"mcircle\"} val\n * @returns {SVGMarkerElement}\n */\n function addMarker (id, val) {\n let marker = svgCanvas.getElem(id);\n if (marker) { return undefined; }\n // console.log(id);\n if (val === '' || val === 'nomarker') { return undefined; }\n const color = svgCanvas.getColor('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 scale = 2;// parseFloat($('#marker_size').val());\n const strokeWidth = 10;\n let refX = 50;\n const refY = 50;\n const viewBox = '0 0 100 100';\n const markerWidth = 5 * scale;\n const markerHeight = 5 * scale;\n const seType = val;\n\n if (!markerTypes[seType]) { return undefined; } // an unknown type!\n // positional markers(arrows) at end of line\n if (seType.includes('left')) refX = 0;\n if (seType.includes('right')) refX = 100;\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 class: seType\n }\n });\n\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\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 * @param {Element} el\n * @param {string} val\n * @returns {void}\n */\n function setMarker (el, val) {\n const markerName = 'marker-start';\n const marker = getLinked(el, markerName);\n if (marker) { $(marker).remove(); }\n el.removeAttribute(markerName);\n if (val === 'nomarker') {\n svgCanvas.call('changed', [el]);\n return;\n }\n // Set marker on element\n const id = 'placemark_marker_' + el.id;\n addMarker(id, val);\n el.setAttribute(markerName, 'url(#' + id + ')');\n svgCanvas.call('changed', [el]);\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} el\n * @returns {void}\n */\n function colorChanged (el) {\n const color = el.getAttribute('stroke');\n const marker = getLinked(el, 'marker-start');\n // console.log(marker);\n if (!marker) { return; }\n if (!marker.attributes.class) { 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 * 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 const id = 'placemark_marker_' + el.id;\n const markerName = 'marker-start';\n const marker = getLinked(el, markerName);\n if (!marker || !marker.attributes.class) { 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 = $('#placemark_marker').attr('value') || 'leftarrow';\n addMarker(id, val);\n svgCanvas.changeSelectedAttribute(markerName, 'url(#' + id + ')');\n svgCanvas.call('changed', selElems);\n }\n }\n }\n /**\n * @param {Event} ev\n * @returns {void}\n */\n function setArrowFromButton (ev) {\n const parts = this.id.split('_');\n let val = parts[2];\n if (parts[3]) { val += '_' + parts[3]; }\n $('#placemark_marker').attr('value', val);\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 * @param {module:SVGEditor.Button[]} buttons\n * @returns {module:SVGEditor.Button[]}\n */\n function addMarkerButtons (buttons) {\n Object.keys(markerTypes).forEach(function (id) {\n const title = getTitle(String(id));\n buttons.push({\n id: 'placemark_marker_' + id,\n svgicon: id,\n icon: 'markers-' + id + '.png',\n title,\n type: 'context',\n events: {click: setArrowFromButton},\n panel: 'placemark_panel',\n list: 'placemark_marker',\n isDefault: id === 'leftarrow'\n });\n });\n return buttons;\n }\n\n const buttons = [{\n id: 'tool_placemark',\n icon: 'placemark.png',\n type: 'mode',\n position: 12,\n events: {\n click () {\n showPanel(true);\n svgCanvas.setMode('placemark');\n }\n }\n }];\n const contextTools = [\n {\n type: 'button-select',\n panel: 'placemark_panel',\n id: 'placemark_marker',\n colnum: 3,\n events: {change: setArrowFromButton}\n },\n {\n type: 'input',\n panel: 'placemark_panel',\n id: 'placemarkText',\n size: 20,\n defval: '',\n events: {\n change () {\n updateText(this.value);\n }\n }\n }, {\n type: 'input',\n panel: 'placemark_panel',\n id: 'placemarkFont',\n size: 7,\n defval: 'Arial 10',\n events: {\n change () {\n updateFont(this.value);\n }\n }\n }\n ];\n\n return {\n name: strings.name,\n svgicons: 'placemark-icons.xml',\n buttons: addMarkerButtons(strings.buttons.map((button, i) => {\n return Object.assign(buttons[i], button);\n })),\n context_tools: strings.contextTools.map((contextTool, i) => {\n return Object.assign(contextTools[i], contextTool);\n }),\n callback () {\n $('#placemark_panel').hide();\n // const endChanges = function(){};\n },\n mouseDown (opts) {\n // const rgb = svgCanvas.getColor('fill');\n const sRgb = svgCanvas.getColor('stroke');\n const sWidth = svgCanvas.getStrokeWidth();\n\n if (svgCanvas.getMode() === 'placemark') {\n started = true;\n const id = svgCanvas.getNextId();\n const items = $('#placemarkText').val().split(';');\n let font = $('#placemarkFont').val().split(' ');\n const fontSize = Number.parseInt(font.pop());\n font = font.join(' ');\n const x0 = opts.start_x + 10, y0 = opts.start_y + 10;\n let maxlen = 0;\n const children = [{\n element: 'line',\n attr: {\n id: id + '_pline_0',\n fill: 'none',\n stroke: sRgb,\n 'stroke-width': sWidth,\n 'stroke-linecap': 'round',\n x1: opts.start_x,\n y1: opts.start_y,\n x2: x0,\n y2: y0\n }\n }];\n items.forEach((i, n) => {\n maxlen = Math.max(maxlen, i.length);\n children.push({\n element: 'line',\n attr: {\n id: id + '_tline_' + n,\n fill: 'none',\n stroke: sRgb,\n 'stroke-width': sWidth,\n 'stroke-linecap': 'round',\n x1: x0,\n y1: y0 + (fontSize + 6) * n,\n x2: x0 + i.length * fontSize * 0.5 + fontSize,\n y2: y0 + (fontSize + 6) * n\n }\n });\n children.push({\n element: 'text',\n attr: {\n id: id + '_txt_' + n,\n fill: sRgb,\n stroke: 'none',\n 'stroke-width': 0,\n x: x0 + 3,\n y: y0 - 3 + (fontSize + 6) * n,\n 'font-family': font,\n 'font-size': fontSize,\n 'text-anchor': 'start'\n },\n children: [i]\n });\n });\n if (items.length > 0) {\n children.push({\n element: 'line',\n attr: {\n id: id + '_vline_0',\n fill: 'none',\n stroke: sRgb,\n 'stroke-width': sWidth,\n 'stroke-linecap': 'round',\n x1: x0,\n y1: y0,\n x2: x0,\n y2: y0 + (fontSize + 6) * (items.length - 1)\n }\n });\n }\n newPM = svgCanvas.addSVGElementFromJson({\n element: 'g',\n attr: {\n id,\n class: 'placemark',\n fontSize,\n maxlen,\n lines: items.length,\n x: opts.start_x,\n y: opts.start_y,\n px: opts.start_x,\n py: opts.start_y\n },\n children\n });\n setMarker(\n newPM.firstElementChild,\n $('#placemark_marker').attr('value') || 'leftarrow'\n );\n return {\n started: true\n };\n }\n return undefined;\n },\n mouseMove (opts) {\n if (!started) {\n return undefined;\n }\n if (svgCanvas.getMode() === 'placemark') {\n const x = opts.mouse_x / svgCanvas.getZoom();\n const y = opts.mouse_y / svgCanvas.getZoom();\n const {fontSize, maxlen, lines, px, py} = $(newPM).attr(\n ['fontSize', 'maxlen', 'lines', 'px', 'py']\n );\n $(newPM).attr({x, y});\n $(newPM).children().each((_, i) => {\n const [, , type, n] = i.id.split('_');\n const y0 = y + (fontSize + 6) * n,\n x0 = x + maxlen * fontSize * 0.5 + fontSize;\n const nx = (x + (x0 - x) / 2 < px) ? x0 : x;\n const ny = (y + ((fontSize + 6) * (lines - 1)) / 2 < py)\n ? y + (fontSize + 6) * (lines - 1)\n : y;\n if (type === 'pline') {\n i.setAttribute('x2', nx);\n i.setAttribute('y2', ny);\n }\n if (type === 'tline') {\n i.setAttribute('x1', x);\n i.setAttribute('y1', y0);\n i.setAttribute('x2', x0);\n i.setAttribute('y2', y0);\n }\n if (type === 'vline') {\n i.setAttribute('x1', nx);\n i.setAttribute('y1', y);\n i.setAttribute('x2', nx);\n i.setAttribute('y2', y + (fontSize + 6) * (lines - 1));\n }\n if (type === 'txt') {\n i.setAttribute('x', x + fontSize / 2);\n i.setAttribute('y', y0 - 3);\n }\n });\n return {\n started: true\n };\n }\n return undefined;\n },\n mouseUp () {\n if (svgCanvas.getMode() === 'placemark') {\n const {x, y, px, py} = $(newPM).attr(['x', 'y', 'px', 'py']);\n return {\n keep: (x != px && y != py), // eslint-disable-line eqeqeq\n element: newPM\n };\n }\n return undefined;\n },\n selectedChanged (opts) {\n // Use this to update the current selected elements\n selElems = opts.elems;\n selElems.forEach((elem) => {\n if (elem && elem.getAttribute('class').includes('placemark')) {\n const txt = [];\n $(elem).children().each((n, i) => {\n const [, , type] = i.id.split('_');\n if (type === 'txt') {\n $('#placemarkFont').val(\n i.getAttribute('font-family') + ' ' + i.getAttribute('font-size')\n );\n txt.push($(i).text());\n }\n });\n $('#placemarkText').val(txt.join(';'));\n showPanel(true);\n } else {\n showPanel(false);\n }\n });\n },\n elementChanged (opts) {\n opts.elems.forEach((elem) => {\n if (elem.id.includes('pline_0')) { // need update marker of pline_0\n colorChanged(elem);\n updateReferences(elem);\n }\n });\n }\n };\n }\n};\n"],"names":["name","init","S","showPanel","getLinked","updateText","updateFont","addMarker","setMarker","colorChanged","updateReferences","setArrowFromButton","getTitle","addMarkerButtons","buttons","Object","keys","markerTypes","forEach","id","title","String","push","svgicon","icon","type","events","click","panel","list","isDefault","langList","strings","item","find","itm","ev","parts","split","val","$","attr","el","markerName","marker","attributes","url","getAttribute","len","length","linkid","substr","svgCanvas","changeSelectedAttribute","call","selElems","color","ch","lastElementChild","curfill","curstroke","setAttribute","remove","removeAttribute","getElem","undefined","getColor","scale","strokeWidth","refX","refY","viewBox","markerWidth","markerHeight","seType","includes","addElem","element","markerUnits","orient","style","mel","fillcolor","append","findDefs","font","fontSize","Number","parseInt","pop","join","elem","children","each","_","i","txt","items","n","text","str","m","match","on","toggle","svgEditor","canvas","addSVGElementFromJson","importLocale","nomarker","forwardslash","d","reverseslash","verticalslash","xmark","leftarrow","rightarrow","box","star","mcircle","r","cx","cy","triangle","v","position","setMode","contextTools","colnum","change","size","defval","value","svgicons","map","button","assign","context_tools","contextTool","callback","hide","mouseDown","opts","sRgb","sWidth","getStrokeWidth","getMode","started","getNextId","x0","start_x","y0","start_y","maxlen","fill","stroke","x1","y1","x2","y2","Math","max","x","y","newPM","lines","px","py","firstElementChild","mouseMove","mouse_x","getZoom","mouse_y","nx","ny","mouseUp","keep","selectedChanged","elems","elementChanged"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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