{"version":3,"file":"XRectNotes.min.mjs","sources":["../../../../src/shapes/canvasx/XRectNotes.ts"],"sourcesContent":["import { classRegistry } from '../../ClassRegistry';\nimport { XTextbase } from './XTextbase';\nimport type { TClassProperties, TOriginX, TOriginY } from '../../typedefs';\nimport { createRectNotesDefaultControls } from '../../controls/X_commonControls';\n\n\nimport { WidgetRectNotesInterface, EntityKeys } from './type/widget.entity.rectnote';\n// this will be a separated effort\nexport const rectNotesDefaultValues: Partial<TClassProperties<XRectNotes>> = {\n  minWidth: 20,\n  dynamicMinWidth: 2,\n  splitByGrapheme: true,\n  height: 138,\n  maxHeight: 138,\n  width: 230,\n  cornerStrokeColor: 'gray',\n  cornerStyle: 'circle',\n  cornerColor: 'white',\n  transparentCorners: false,\n};\n\n/**\n * Textbox class, based on IText, allows the user to resize the text rectangle\n * and wraps lines automatically. Textboxes have their Y scaling locked, the\n * user can only change width. Height is adjusted automatically based on the\n * wrapping of lines.\n */\n///@ts-ignore\nexport class XRectNotes extends XTextbase implements WidgetRectNotesInterface {\n  /**selectable\n   * Minimum width of textbox, in pixels.\n   * @type Number\n   * @default\n   */\n  declare minWidth: number;\n  static type = 'XRectNotes';\n  static objType = 'XRectNotes';\n  declare locked: boolean;\n  declare cornerStyle: any;\n  declare verticalAlign: string;\n  declare originX: TOriginX;\n  declare originY: TOriginY;\n  declare width: number;\n  declare cornerStrokeColor: string;\n\n  declare cornerColor: string;\n  declare transparentCorners: boolean;\n  declare zIndex: number;\n  declare height: number;\n  declare maxHeight: number;\n\n  declare id: string;\n  declare boardId: string;\n\n\n  /**\n   * Minimum calculated width of a textbox, in pixels.\n   * fixed to 2 so that an empty textbox cannot go to 0\n   * and is still selectable without text.\n   * @type Number\n   * @default\n   */\n  declare dynamicMinWidth: number;\n\n  /**\n   * Use this boolean property in order to split strings that have no white space concept.\n   * this is a cheap way to help with chinese/japanese\n   * @type Boolean\n   * @since 2.6.0\n   */\n  declare splitByGrapheme: boolean;\n\n  static textLayoutProperties = [...XTextbase.textLayoutProperties, 'width'];\n\n  static ownDefaults: Record<string, any> = rectNotesDefaultValues;\n\n  static getDefaults() {\n    return {\n      ...super.getDefaults(),\n\n      ...XRectNotes.ownDefaults,\n    };\n  }\n  constructor(\n    text: string,\n    options: Partial<TClassProperties<XRectNotes>> = {}\n  ) {\n\n    options.createdByName = options.createdByName ?? '';\n    options.fontFamily = options.fontFamily ?? 'Inter';\n    options.fontSize = options.fontSize ?? 12;\n    options.fontWeight = options.fontWeight ?? \"400\";\n    options.lineHeight = 1.2;\n    options.text = options.text ?? '';\n    options.textAlign = options.textAlign ?? 'center';\n    options.editable = options.editable ?? true;\n    options.fixedScaleChange = options.fixedScaleChange ?? false;\n    options.connectors = options.connectors ?? [];\n    options.id = options.id ?? '';\n    options.boardId = options.boardId ?? '';\n    options.backgroundColor = options.backgroundColor ?? '#FCEC8A';\n    options.left = options.left ?? 0;\n    options.locked = options.locked ?? false;\n    options.objType = options.objType ?? 'XRectNotes';\n    options.originX = options.originX ?? 'center';\n    options.originY = options.originY ?? 'center';\n    options.scaleX = options.scaleX ?? 1;\n    options.scaleY = options.scaleY ?? 1;\n    options.selectable = options.selectable ?? true;\n    options.top = options.top ?? 0;\n    options.userId = options.userId ?? '';\n    options.zIndex = options.zIndex ?? Date.now() * 100;\n    options.version = options.version ?? '1.0';\n    options.updatedAt = options.updatedAt ?? Date.now();\n    options.updatedBy = options.updatedBy ?? '';\n    options.updatedByName = options.updatedByName ?? '';\n    options.createdAt = options.createdAt ?? Date.now();\n    options.createdBy = options.createdBy ?? '';\n    options.visible = options.visible ?? true;\n    options.splitByGrapheme = true;\n\n    //fixed default value\n    options.perPixelTargetFind = false;\n    options.height = 138;\n    options.oneLine = false;\n\n    super(text, options);\n    this.maxHeight = 138;\n    Object.assign(this, {\n      controls: {\n        ...createRectNotesDefaultControls(this),\n        // mr: { /* add your desired value here */ },\n      },\n    });\n    // Object.assign(this, options);\n\n    this.splitByGrapheme = true;\n    this.dirty = true;\n    this.objType = 'XRectNotes';\n    // this.initializeEvent();\n  }\n\n  /**\n   * Unlike superclass's version of this function, Textbox does not update\n   * its width.\n   * @private\n   * @override\n   */\n  initDimensions() {\n    if (!this.initialized) {\n      return;\n    }\n    this.isEditing && this.initDelayedCursor();\n    this._clearCache();\n    // clear dynamicMinWidth as it will be different after we re-wrap line\n    this.dynamicMinWidth = 0;\n    // wrap lines\n    this._styleMap = this._generateStyleMap(this._splitText());\n    // if after wrapping, the width is smaller than dynamicMinWidth, change the width and re-wrap\n    if (this.dynamicMinWidth > this.width) {\n      this.set('fontSize', this.fontSize - 2);\n      this._splitTextIntoLines(this.text);\n      return;\n    }\n    if (this.textAlign.indexOf('justify') !== -1) {\n      // once text is measured we need to make space fatter to make justified text.\n      this.enlargeSpaces();\n    }\n    // clear cache and re-calculate height\n    const height = this.calcTextHeight();\n    if (height > this.maxHeight && this.fontSize > 6) {\n      this.set('fontSize', this.fontSize - 2);\n      this._splitTextIntoLines(this.text);\n      return;\n    }\n    if (height > 130 && this.fontSize === 6) {\n      const prenum = 125 / height;\n      const newText = this.text.substring(0, this.text.length * prenum - 5);\n      this.set('text', newText + '...');\n    }\n    this.height = this.maxHeight;\n    return this.height;\n  }\n\n  // /**\n  //  * Generate an object that translates the style object so that it is\n  //  * broken up by visual lines (new lines and automatic wrapping).\n  //  * The original text styles object is broken up by actual lines (new lines only),\n  //  * which is only sufficient for Text / IText\n  //  * @private\n  //  */\n  // _generateStyleMap(textInfo: any) {\n  //   let realLineCount = 0;\n  //   let realLineCharCount = 0;\n  //   let charCount = 0;\n  //   const map: any = {};\n\n  //   for (let i = 0; i < textInfo.graphemeLines.length; i++) {\n  //     if (textInfo.graphemeText[charCount] === '\\n' && i > 0) {\n  //       realLineCharCount = 0;\n  //       charCount++;\n  //       realLineCount++;\n  //     } else if (\n  //       !this.splitByGrapheme &&\n  //       this._reSpaceAndTab.test(textInfo.graphemeText[charCount]) &&\n  //       i > 0\n  //     ) {\n  //       // this case deals with space's that are removed from end of lines when wrapping\n  //       realLineCharCount++;\n  //       charCount++;\n  //     }\n\n  //     map[i] = {\n  //       line: realLineCount,\n  //       offset: realLineCharCount,\n  //     };\n\n  //     charCount += textInfo.graphemeLines[i].length;\n  //     realLineCharCount += textInfo.graphemeLines[i].length;\n  //   }\n\n  //   return map;\n  // }\n\n\n  getObject() {\n    const entityKeys: string[] = EntityKeys;\n    const result: Record<string, any> = {};\n\n    entityKeys.forEach((key) => {\n      if (key in this) {\n        result[key] = (this as any)[key];\n      }\n    });\n\n    return result;\n  }\n\n\n\n\n  /**\n   * Returns true if object has a style property or has it on a specified line\n   * @param {Number} lineIndex\n   * @return {Boolean}\n   */\n  styleHas(property: any, lineIndex: number): boolean {\n    if (this._styleMap && !this.isWrapping) {\n      const map = this._styleMap[lineIndex];\n      if (map) {\n        lineIndex = map.line;\n      }\n    }\n    return super.styleHas(property, lineIndex);\n  }\n\n  /**\n   * probably broken need a fix\n   * Returns the real style line that correspond to the wrapped lineIndex line\n   * Used just to verify if the line does exist or not.\n   * @param {Number} lineIndex\n   * @returns {Boolean} if the line exists or not\n   * @private\n   */\n  _getLineStyle(lineIndex: number): boolean {\n    const map = this._styleMap[lineIndex];\n    return !!this.styles[map.line];\n  }\n\n  /**\n   * Set the line style to an empty object so that is initialized\n   * @param {Number} lineIndex\n   * @param {Object} style\n   * @private\n   */\n  _setLineStyle(lineIndex: number) {\n    const map = this._styleMap[lineIndex];\n    this.styles[map.line] = {};\n  }\n  /*\n   * Override this method to customize word splitting\n   * Use with {@link Textbox#_measureWord}\n   * @param {string} value\n   * @returns {string[]} array of words\n   */\n  wordSplit(value: string): string[] {\n    return value.split(this._wordJoiners);\n  }\n\n  // /**\n  //  * Wraps a line of text using the width of the Textbox and a context.\n  //  * @param {Array} line The grapheme array that represent the line\n  //  * @param {Number} lineIndex\n  //  * @param {Number} desiredWidth width you want to wrap the line to\n  //  * @param {Number} reservedSpace space to remove from wrapping for custom functionalities\n  //  * @returns {Array} Array of line(s) into which the given text is wrapped\n  //  * to.\n  //  */\n\n  // graphemeSplitForRectNotes(textstring: string): string[] {\n  //   const graphemes = [];\n  //   const words = textstring.split(/\\b/);\n  //   for (let i = 0; i < words.length; i++) {\n  //     // 检查单词是否全为拉丁字母，长度不大于16\n  //     if (/^[a-zA-Z]{1,16}$/.test(words[i])) {\n  //       graphemes.push(words[i]);\n  //     } else {\n  //       for (let j = 0; j < words[i].length; j++) {\n  //         graphemes.push(words[i][j]);\n  //       }\n  //     }\n  //   }\n  //   return graphemes;\n  // }\n\n  /**\n   * Detect if the text line is ended with an hard break\n   * text and itext do not have wrapping, return false\n   * @param {Number} lineIndex text to split\n   * @return {Boolean}\n   */\n  isEndOfWrapping(lineIndex: number): boolean {\n    if (!this._styleMap[lineIndex + 1]) {\n      // is last line, return true;\n      return true;\n    }\n    if (this._styleMap[lineIndex + 1].line !== this._styleMap[lineIndex].line) {\n      // this is last line before a line break, return true;\n      return true;\n    }\n    return false;\n  }\n\n  /**\n   * Detect if a line has a linebreak and so we need to account for it when moving\n   * and counting style.\n   * @return Number\n   */\n  missingNewlineOffset(lineIndex: number) {\n    if (this.splitByGrapheme) {\n      return this.isEndOfWrapping(lineIndex) ? 1 : 0;\n    }\n    return 1;\n  }\n\n  /**\n   * Gets lines of text to render in the Textbox. This function calculates\n   * text wrapping on the fly every time it is called.\n   * @param {String} text text to split\n   * @returns {Array} Array of lines in the Textbox.\n   * @override\n   */\n  _splitTextIntoLines(text: string) {\n    const newText = super._splitTextIntoLines(text),\n      graphemeLines = this._wrapText(newText.lines, this.width),\n      lines = new Array(graphemeLines.length);\n    for (let i = 0; i < graphemeLines.length; i++) {\n      lines[i] = graphemeLines[i].join('');\n    }\n    newText.lines = lines;\n    newText.graphemeLines = graphemeLines;\n    return newText;\n  }\n\n  getMinWidth() {\n    return Math.max(this.minWidth, this.dynamicMinWidth);\n  }\n\n  /* caculate cusor positon in the middle of the textbox */\n  getCenteredTop(rectHeight: number) {\n    const textHeight = this.height;\n    return (rectHeight - textHeight) / 2;\n  }\n\n  _render(ctx: CanvasRenderingContext2D) {\n    const path: any = this.path;\n\n    path && !path.isNotVisible() && path._render(ctx);\n    this._setTextStyles(ctx);\n    this._renderTextLinesBackground(ctx);\n    this._renderTextDecoration(ctx, 'underline');\n    this._renderText(ctx);\n    this._renderTextDecoration(ctx, 'overline');\n    this._renderTextDecoration(ctx, 'linethrough');\n  }\n\n  _renderBackground(ctx: CanvasRenderingContext2D) {\n    if (!this.backgroundColor) {\n      return;\n    }\n    const dim = this._getNonTransformedDimensions();\n    ctx.fillStyle = this.backgroundColor;\n\n    // ctx.shadowBlur = 20;\n    // ctx.shadowOffsetX = 2 * this.scaleX * canvas.getZoom();\n    // ctx.shadowOffsetY = 6 * this.scaleY * canvas.getZoom();\n    // ctx.shadowColor = 'rgba(0,0,0,0.1)';\n    // ctx.shadowColor = 'rgba(0,0,0,1)';\n\n    ctx.fillRect(-dim.x / 2, -dim.y / 2, dim.x, dim.y);\n\n    // if there is background color no other shadows\n    // should be casted\n    // this._removeShadow(ctx);\n  }\n  _getTopOffset() {\n    return -this._getTotalLineHeights() / 2;\n  }\n  _getTotalLineHeights() {\n    return this._textLines.reduce(\n      (total, line, index) => total + this.getHeightOfLine(index),\n      0\n    );\n  }\n\n  _getTotalLineHeight() {\n    return this._textLines.reduce(\n      (total, _line, index) => total + this.getHeightOfLine(index),\n      0\n    );\n  }\n\n  _renderText(ctx: CanvasRenderingContext2D) {\n    ctx.shadowOffsetX = ctx.shadowOffsetY = ctx.shadowBlur = 0;\n    ctx.shadowColor = '';\n\n    if (this.paintFirst === 'stroke') {\n      this._renderTextStroke(ctx);\n      this._renderTextFill(ctx);\n    } else {\n      this._renderTextFill(ctx);\n      this._renderTextStroke(ctx);\n    }\n  }\n  drawRoundRectPath(\n    cxt: CanvasRenderingContext2D,\n    width: number,\n    height: number,\n    radius: number\n  ) {\n    cxt.beginPath();\n    //从右下角顺时针绘制，弧度从0到1/2PI\n    cxt.arc(width - radius, height - radius, radius, 0, Math.PI / 2);\n\n    //矩形下边线\n    cxt.lineTo(radius, height);\n\n    //左下角圆弧，弧度从1/2PI到PI\n    cxt.arc(radius, height - radius, radius, Math.PI / 2, Math.PI);\n\n    //矩形左边线\n    cxt.lineTo(0, radius);\n\n    //左上角圆弧，弧度从PI到3/2PI\n    cxt.arc(radius, radius, radius, Math.PI, (Math.PI * 3) / 2);\n\n    //上边线\n    cxt.lineTo(width - radius, 0);\n\n    //右上角圆弧\n    cxt.arc(width - radius, radius, radius, (Math.PI * 3) / 2, Math.PI * 2);\n\n    //右边线\n    cxt.lineTo(width, height - radius);\n    cxt.closePath();\n  }\n}\n\nclassRegistry.setClass(XRectNotes);\nclassRegistry.setSVGClass(XRectNotes, 'XRectNotes');\n"],"names":["rectNotesDefaultValues","minWidth","dynamicMinWidth","splitByGrapheme","height","maxHeight","width","cornerStrokeColor","cornerStyle","cornerColor","transparentCorners","XRectNotes","XTextbase","getDefaults","_objectSpread","super","ownDefaults","constructor","text","_options$createdByNam","_options$fontFamily","_options$fontSize","_options$fontWeight","_options$text","_options$textAlign","_options$editable","_options$fixedScaleCh","_options$connectors","_options$id","_options$boardId","_options$backgroundCo","_options$left","_options$locked","_options$objType","_options$originX","_options$originY","_options$scaleX","_options$scaleY","_options$selectable","_options$top","_options$userId","_options$zIndex","_options$version","_options$updatedAt","_options$updatedBy","_options$updatedByNam","_options$createdAt","_options$createdBy","_options$visible","options","arguments","length","undefined","createdByName","fontFamily","fontSize","fontWeight","lineHeight","textAlign","editable","fixedScaleChange","connectors","id","boardId","backgroundColor","left","locked","objType","originX","originY","scaleX","scaleY","selectable","top","userId","zIndex","Date","now","version","updatedAt","updatedBy","updatedByName","createdAt","createdBy","visible","perPixelTargetFind","oneLine","this","Object","assign","controls","createRectNotesDefaultControls","dirty","initDimensions","initialized","isEditing","initDelayedCursor","_clearCache","_styleMap","_generateStyleMap","_splitText","set","_splitTextIntoLines","indexOf","enlargeSpaces","calcTextHeight","prenum","newText","substring","getObject","result","EntityKeys","forEach","key","styleHas","property","lineIndex","isWrapping","map","line","_getLineStyle","styles","_setLineStyle","wordSplit","value","split","_wordJoiners","isEndOfWrapping","missingNewlineOffset","graphemeLines","_wrapText","lines","Array","i","join","getMinWidth","Math","max","getCenteredTop","rectHeight","_render","ctx","path","isNotVisible","_setTextStyles","_renderTextLinesBackground","_renderTextDecoration","_renderText","_renderBackground","dim","_getNonTransformedDimensions","fillStyle","fillRect","x","y","_getTopOffset","_getTotalLineHeights","_textLines","reduce","total","index","getHeightOfLine","_getTotalLineHeight","_line","shadowOffsetX","shadowOffsetY","shadowBlur","shadowColor","paintFirst","_renderTextStroke","_renderTextFill","drawRoundRectPath","cxt","radius","beginPath","arc","PI","lineTo","closePath","_defineProperty","textLayoutProperties","classRegistry","setClass","setSVGClass"],"mappings":"gXAQO,MAAMA,EAAgE,CAC3EC,SAAU,GACVC,gBAAiB,EACjBC,iBAAiB,EACjBC,OAAQ,IACRC,UAAW,IACXC,MAAO,IACPC,kBAAmB,OACnBC,YAAa,SACbC,YAAa,QACbC,oBAAoB,GAUf,MAAMC,UAAmBC,EAgD9B,kBAAOC,GACL,OAAAC,EAAAA,EAAA,GACKC,MAAMF,eAENF,EAAWK,YAElB,CACAC,WAAAA,CACEC,GAEA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAA,IADAC,EAA8CC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,CAAA,EAGjDD,EAAQI,cAAqClC,QAAxBA,EAAG8B,EAAQI,qBAAalC,IAAAA,EAAAA,EAAI,GACjD8B,EAAQK,WAA+BlC,QAArBA,EAAG6B,EAAQK,kBAAUlC,IAAAA,EAAAA,EAAI,QAC3C6B,EA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