@blockly/field-multilineinput 13.2.2-beta.2 → 13.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -51,7 +51,7 @@ export declare class FieldMultilineInput extends Blockly.FieldTextInput {
|
|
|
51
51
|
* null to abort the change.
|
|
52
52
|
* @param config A map of options used to configure the field.
|
|
53
53
|
* See the [field creation documentation]{@link
|
|
54
|
-
* https://
|
|
54
|
+
* https://www.npmjs.com/package/@blockly/field-multilineinput}
|
|
55
55
|
* for a list of properties this parameter supports.
|
|
56
56
|
*/
|
|
57
57
|
constructor(value?: string | typeof Blockly.Field.SKIP_SETUP, validator?: FieldMultilineInputValidator, config?: FieldMultilineInputConfig);
|
|
@@ -229,7 +229,7 @@ export interface FieldMultilineInputFromJsonConfig extends FieldMultilineInputCo
|
|
|
229
229
|
* A function that is called to validate changes to the field's value before
|
|
230
230
|
* they are set.
|
|
231
231
|
*
|
|
232
|
-
* @see {@link https://
|
|
232
|
+
* @see {@link https://docs.blockly.com/guides/create-custom-blocks/fields/validators/#return-values}
|
|
233
233
|
* @param newValue The value to be validated.
|
|
234
234
|
* @returns One of three instructions for setting the new value: `T`, `null`,
|
|
235
235
|
* or `undefined`.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","mappings":";CAAA,SAAAA,EAAAC,GACA,oBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,EAAAG,QAAA,gBAAAA,QAAA,gBAAAA,QAAA,sBAAAA,QAAA,eAAAA,QAAA,eAAAA,QAAA,wBACA,sBAAAC,QAAAA,OAAAC,IACAD,OAAA,kGAAAJ,OACA,CACA,IAAAM,EAAA,iBAAAL,QAAAD,EAAAG,QAAA,gBAAAA,QAAA,gBAAAA,QAAA,sBAAAA,QAAA,eAAAA,QAAA,eAAAA,QAAA,mBAAAH,EAAAD,EAAA,QAAAA,EAAA,gBAAAA,EAAA,sBAAA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,EAAMG,EAChB,CAEA,MAAMiB,EAAkBxN,EAAAyN,OAAcC,oCAAoC,CACxElC,IAIWmC,EAAkBH,EAAgBjC,GAQxC,SAASqC,EAAaC,EAAmB,IAC9C1C,IACAnL,EAAAyN,OAAcK,aAAaN,GACvBK,EAAKE,aAAYF,EAAKE,WAAWC,SAASzC,GAAcW,GACxD2B,EAAKI,OAAMJ,EAAKI,KAAKD,SAASzC,GAAcsB,GAC5CgB,EAAKK,MAAKL,EAAKK,IAAIF,SAASzC,GAAcyB,GAC1Ca,EAAKM,MAAKN,EAAKM,IAAIH,SAASzC,GAAc4B,GAC1CU,EAAKO,SAAQP,EAAKO,OAAOJ,SAASzC,GAAc+B,EACtD,CCzJO,MAAMe,EAAmBT","sources":["webpack://@blockly/field-multilineinput/webpack/universalModuleDefinition","webpack://@blockly/field-multilineinput/external umd {\"root\":\"Blockly\",\"commonjs\":\"blockly/core\",\"commonjs2\":\"blockly/core\",\"amd\":\"blockly/core\"}","webpack://@blockly/field-multilineinput/external umd {\"root\":\"Blockly.Dart\",\"commonjs\":\"blockly/dart\",\"commonjs2\":\"blockly/dart\",\"amd\":\"blockly/dart\"}","webpack://@blockly/field-multilineinput/external umd {\"root\":\"Blockly.JavaScript\",\"commonjs\":\"blockly/javascript\",\"commonjs2\":\"blockly/javascript\",\"amd\":\"blockly/javascript\"}","webpack://@blockly/field-multilineinput/external umd {\"root\":\"Blockly.Lua\",\"commonjs\":\"blockly/lua\",\"commonjs2\":\"blockly/lua\",\"amd\":\"blockly/lua\"}","webpack://@blockly/field-multilineinput/external umd {\"root\":\"Blockly.PHP\",\"commonjs\":\"blockly/php\",\"commonjs2\":\"blockly/php\",\"amd\":\"blockly/php\"}","webpack://@blockly/field-multilineinput/external umd {\"root\":\"Blockly.Python\",\"commonjs\":\"blockly/python\",\"commonjs2\":\"blockly/python\",\"amd\":\"blockly/python\"}","webpack://@blockly/field-multilineinput/webpack/bootstrap","webpack://@blockly/field-multilineinput/webpack/runtime/define property getters","webpack://@blockly/field-multilineinput/webpack/runtime/hasOwnProperty shorthand","webpack://@blockly/field-multilineinput/webpack/runtime/make namespace object","webpack://@blockly/field-multilineinput/./src/field_multilineinput.ts","webpack://@blockly/field-multilineinput/./src/blocks/textMultiline.ts","webpack://@blockly/field-multilineinput/./src/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"blockly/core\"), require(\"blockly/dart\"), require(\"blockly/javascript\"), require(\"blockly/lua\"), require(\"blockly/php\"), require(\"blockly/python\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"blockly/core\", \"blockly/dart\", \"blockly/javascript\", \"blockly/lua\", \"blockly/php\", \"blockly/python\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"blockly/core\"), require(\"blockly/dart\"), require(\"blockly/javascript\"), require(\"blockly/lua\"), require(\"blockly/php\"), require(\"blockly/python\")) : factory(root[\"Blockly\"], root[\"Blockly.Dart\"], root[\"Blockly.JavaScript\"], root[\"Blockly.Lua\"], root[\"Blockly.PHP\"], root[\"Blockly.Python\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, (__WEBPACK_EXTERNAL_MODULE__370__, __WEBPACK_EXTERNAL_MODULE__379__, __WEBPACK_EXTERNAL_MODULE__127__, __WEBPACK_EXTERNAL_MODULE__157__, __WEBPACK_EXTERNAL_MODULE__537__, __WEBPACK_EXTERNAL_MODULE__557__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__370__;","module.exports = __WEBPACK_EXTERNAL_MODULE__379__;","module.exports = __WEBPACK_EXTERNAL_MODULE__127__;","module.exports = __WEBPACK_EXTERNAL_MODULE__157__;","module.exports = __WEBPACK_EXTERNAL_MODULE__537__;","module.exports = __WEBPACK_EXTERNAL_MODULE__557__;","// The module cache\nconst __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tconst cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tconst module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter/value functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tif(Array.isArray(definition)) {\n\t\tvar i = 0;\n\t\twhile(i < definition.length) {\n\t\t\tvar key = definition[i++];\n\t\t\tvar binding = definition[i++];\n\t\t\tif(!__webpack_require__.o(exports, key)) {\n\t\t\t\tif(binding === 0) {\n\t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, value: definition[i++] });\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: binding });\n\t\t\t\t}\n\t\t\t} else if(binding === 0) { i++; }\n\t\t}\n\t} else {\n\t\tfor(var key in definition) {\n\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t\t}\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Multiline text input field.\n */\n\nimport * as Blockly from 'blockly/core';\n\n/**\n * Class for an editable text area input field.\n */\nexport class FieldMultilineInput extends Blockly.FieldTextInput {\n /**\n * Minimum editor width (in SVG/workspace units) when the field is open.\n * Prevents narrow editors when the initial text is very short.\n */\n\n static readonly EDITOR_MIN_WIDTH = 150;\n\n /**\n * The SVG group element that will contain a text element for each text row\n * when initialized.\n */\n textGroup: SVGGElement | null = null;\n\n /**\n * Defines the maximum number of lines of field.\n * If exceeded, scrolling functionality is enabled.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected maxLines_ = Infinity;\n\n /** Whether Y overflow is currently occurring. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected isOverflowedY_ = false;\n\n /** Whether pressing Enter commits the value (default) or inserts a newline. */\n static enterCommits = true;\n\n /** Whether to show the keyboard-shortcut hint bar in the editor. */\n static showHint = true;\n\n /** The hint bar DOM element while the editor is open. */\n private hintElement: HTMLDivElement | null = null;\n\n /**\n * Cached natural width of the hint bar in px, keyed by scale.\n * Invalidated when zoom changes to avoid stale measurements.\n */\n private cachedHintWidth: {scale: number; widthPx: number} | null = null;\n\n /**\n * @param value The initial content of the field. Should cast to a string.\n * Defaults to an empty string if null or undefined. Also accepts\n * Field.SKIP_SETUP if you wish to skip setup (only used by subclasses\n * that want to handle configuration and setting the field value after\n * their own constructors have run).\n * @param validator An optional function that is called to validate any\n * constraints on what the user entered. Takes the new text as an\n * argument and returns either the accepted text, a replacement text, or\n * null to abort the change.\n * @param config A map of options used to configure the field.\n * See the [field creation documentation]{@link\n * https://developers.google.com/blockly/guides/create-custom-blocks/fields/built-in-fields/multiline-text-input#creation}\n * for a list of properties this parameter supports.\n */\n constructor(\n value?: string | typeof Blockly.Field.SKIP_SETUP,\n validator?: FieldMultilineInputValidator,\n config?: FieldMultilineInputConfig,\n ) {\n super(Blockly.Field.SKIP_SETUP);\n\n if (value === Blockly.Field.SKIP_SETUP) return;\n if (config) {\n this.configure_(config);\n }\n this.setValue(value);\n if (validator) {\n this.setValidator(validator);\n }\n }\n\n /**\n * Configure the field based on the given map of options.\n *\n * @param config A map of options to configure the field based on.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected override configure_(config: FieldMultilineInputConfig) {\n super.configure_(config);\n if (config.maxLines) this.setMaxLines(config.maxLines);\n }\n\n /**\n * Serializes this field's value to XML.\n * Should only be called by Blockly.Xml.\n *\n * @param fieldElement The element to populate with info about the field's\n * state.\n * @returns The element containing info about the field's state.\n */\n override toXml(fieldElement: Element): Element {\n // Replace '\\n' characters with HTML-escaped equivalent '
'. This is\n // needed so the plain-text representation of the XML produced by\n // `Blockly.Xml.domToText` will appear on a single line (this is a\n // limitation of the plain-text format).\n fieldElement.textContent = (this.getValue() as string).replace(\n /\\n/g,\n ' ',\n );\n return fieldElement;\n }\n\n /**\n * Sets the field's value based on the given XML element. Should only be\n * called by Blockly.Xml.\n *\n * @param fieldElement The element containing info about the field's state.\n */\n override fromXml(fieldElement: Element) {\n this.setValue((fieldElement.textContent as string).replace(/ /g, '\\n'));\n }\n\n /**\n * Saves this field's value.\n * This function only exists for subclasses of FieldMultilineInput which\n * predate the load/saveState API and only define to/fromXml.\n *\n * @returns The state of this field.\n */\n override saveState() {\n const legacyState = this.saveLegacyState(FieldMultilineInput);\n if (legacyState !== null) {\n return legacyState;\n }\n return this.getValue();\n }\n\n /**\n * Sets the field's value based on the given state.\n * This function only exists for subclasses of FieldMultilineInput which\n * predate the load/saveState API and only define to/fromXml.\n *\n * @param state The state of the variable to assign to this variable field.\n */\n override loadState(state: unknown) {\n if (this.loadLegacyState(Blockly.Field, state)) {\n return;\n }\n this.setValue(state);\n }\n\n /**\n * Create the block UI for this field.\n */\n override initView() {\n this.createBorderRect_();\n this.textGroup = Blockly.utils.dom.createSvgElement(\n Blockly.utils.Svg.G,\n {\n class: 'blocklyEditableField',\n },\n this.fieldGroup_,\n );\n if (this.fieldGroup_) {\n Blockly.utils.dom.addClass(this.fieldGroup_, 'blocklyField');\n }\n }\n\n /**\n * Get the text from this field as displayed on screen. May differ from\n * getText due to ellipsis, and other formatting.\n *\n * @returns Currently displayed text.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected override getDisplayText_(): string {\n const block = this.getSourceBlock();\n if (!block) {\n throw new Error(\n 'The field has not yet been attached to its input. ' +\n 'Call appendField to attach it.',\n );\n }\n let textLines = this.getText();\n if (!textLines) {\n // Prevent the field from disappearing if empty.\n return Blockly.Field.NBSP;\n }\n const lines = textLines.split('\\n');\n textLines = '';\n const displayLinesNumber = this.isOverflowedY_\n ? this.maxLines_\n : lines.length;\n for (let i = 0; i < displayLinesNumber; i++) {\n let text = lines[i];\n if (text.length > this.maxDisplayLength) {\n // Truncate displayed string and add an ellipsis ('...').\n text = text.substring(0, this.maxDisplayLength - 4) + '...';\n } else if (this.isOverflowedY_ && i === displayLinesNumber - 1) {\n text = text.substring(0, text.length - 3) + '...';\n }\n // Replace whitespace with non-breaking spaces so the text doesn't\n // collapse.\n text = text.replace(/\\s/g, Blockly.Field.NBSP);\n\n textLines += text;\n if (i !== displayLinesNumber - 1) {\n textLines += '\\n';\n }\n }\n if (block.RTL) {\n // The SVG is LTR, force value to be RTL.\n textLines += '\\u200F';\n }\n return textLines;\n }\n\n /**\n * Called by setValue if the text input is valid. Updates the value of the\n * field, and updates the text of the field if it is not currently being\n * edited (i.e. handled by the htmlInput_). Is being redefined here to update\n * overflow state of the field.\n *\n * @param newValue The value to be saved. The default validator guarantees\n * that this is a string.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected override doValueUpdate_(newValue: string) {\n super.doValueUpdate_(newValue);\n if (this.value_ !== null) {\n this.isOverflowedY_ = this.value_.split('\\n').length > this.maxLines_;\n }\n }\n\n /** Updates the text of the textElement. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected override render_() {\n const block = this.getSourceBlock();\n if (!block) {\n throw new Error(\n 'The field has not yet been attached to its input. ' +\n 'Call appendField to attach it.',\n );\n }\n // Remove all text group children.\n let currentChild;\n const textGroup = this.textGroup as SVGElement;\n while ((currentChild = textGroup.firstChild)) {\n textGroup.removeChild(currentChild);\n }\n\n const constants = this.getConstants();\n // This can't happen, but TypeScript thinks it can and lint forbids `!.`.\n if (!constants) throw Error('Constants not found');\n // Add in text elements into the group.\n const lines = this.getDisplayText_().split('\\n');\n let y = 0;\n for (let i = 0; i < lines.length; i++) {\n const lineHeight =\n constants.FIELD_TEXT_HEIGHT + constants.FIELD_BORDER_RECT_Y_PADDING;\n const span = Blockly.utils.dom.createSvgElement(\n Blockly.utils.Svg.TEXT,\n {\n class: 'blocklyText blocklyMultilineText',\n x: constants.FIELD_BORDER_RECT_X_PADDING,\n y: y + constants.FIELD_BORDER_RECT_Y_PADDING,\n dy: constants.FIELD_TEXT_BASELINE,\n },\n textGroup,\n );\n span.appendChild(document.createTextNode(lines[i]));\n y += lineHeight;\n }\n\n if (this.isBeingEdited_) {\n const htmlInput = this.htmlInput_ as HTMLElement;\n if (this.isOverflowedY_) {\n Blockly.utils.dom.addClass(\n htmlInput,\n 'blocklyHtmlTextAreaInputOverflowedY',\n );\n } else {\n Blockly.utils.dom.removeClass(\n htmlInput,\n 'blocklyHtmlTextAreaInputOverflowedY',\n );\n }\n }\n\n this.updateSize_();\n\n if (this.isBeingEdited_) {\n if (block.RTL) {\n // in RTL, we need to let the browser reflow before resizing\n // in order to get the correct bounding box of the borderRect\n // avoiding issue #2777.\n setTimeout(this.resizeEditor_.bind(this), 0);\n } else {\n this.resizeEditor_();\n }\n const htmlInput = this.htmlInput_ as HTMLElement;\n if (!this.isTextValid_) {\n Blockly.utils.dom.addClass(htmlInput, 'blocklyInvalidInput');\n Blockly.utils.aria.setState(\n htmlInput,\n Blockly.utils.aria.State.INVALID,\n true,\n );\n } else {\n Blockly.utils.dom.removeClass(htmlInput, 'blocklyInvalidInput');\n Blockly.utils.aria.setState(\n htmlInput,\n Blockly.utils.aria.State.INVALID,\n false,\n );\n }\n }\n }\n\n /** Updates the size of the field based on the text. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected override updateSize_() {\n const constants = this.getConstants();\n // This can't happen, but TypeScript thinks it can and lint forbids `!.`.\n if (!constants) throw Error('Constants not found');\n const nodes = (this.textGroup as SVGElement).childNodes;\n let totalWidth = 0;\n let totalHeight = 0;\n for (let i = 0; i < nodes.length; i++) {\n const tspan = nodes[i] as SVGTextElement;\n const textWidth = Blockly.utils.dom.getTextWidth(tspan);\n if (textWidth > totalWidth) {\n totalWidth = textWidth;\n }\n totalHeight +=\n constants.FIELD_TEXT_HEIGHT +\n (i > 0 ? constants.FIELD_BORDER_RECT_Y_PADDING : 0);\n }\n if (this.isBeingEdited_) {\n // The default width is based on the longest line in the display text,\n // but when it's being edited, width should be calculated based on the\n // absolute longest line, even if it would be truncated after editing.\n // Otherwise we would get wrong editor width when there are more\n // lines than this.maxLines_.\n const actualEditorLines = String(this.value_).split('\\n');\n const dummyTextElement = Blockly.utils.dom.createSvgElement(\n Blockly.utils.Svg.TEXT,\n {class: 'blocklyText blocklyMultilineText'},\n );\n\n for (let i = 0; i < actualEditorLines.length; i++) {\n if (actualEditorLines[i].length > this.maxDisplayLength) {\n actualEditorLines[i] = actualEditorLines[i].substring(\n 0,\n this.maxDisplayLength,\n );\n }\n dummyTextElement.textContent = actualEditorLines[i];\n const lineWidth = Blockly.utils.dom.getTextWidth(dummyTextElement);\n if (lineWidth > totalWidth) {\n totalWidth = lineWidth;\n }\n }\n\n const htmlInput = this.htmlInput_ as HTMLElement;\n const scrollbarWidth = htmlInput.offsetWidth - htmlInput.clientWidth;\n totalWidth += scrollbarWidth;\n\n if (FieldMultilineInput.showHint) {\n // Reserve a row at the bottom of the editor for the keyboard hint bar.\n // The textarea's padding-bottom (set in widgetCreate_) keeps the text\n // and caret out of this reserved strip.\n totalHeight +=\n constants.FIELD_TEXT_HEIGHT + constants.FIELD_BORDER_RECT_Y_PADDING;\n }\n }\n if (this.borderRect_) {\n totalHeight += constants.FIELD_BORDER_RECT_Y_PADDING * 2;\n // NOTE: Adding 1 extra px to prevent wrapping. Based on browser zoom,\n // the rounding of the calculated value can result in the line wrapping\n // unintentionally.\n totalWidth += constants.FIELD_BORDER_RECT_X_PADDING * 2 + 1;\n }\n if (this.isBeingEdited_) {\n totalWidth = Math.max(totalWidth, FieldMultilineInput.EDITOR_MIN_WIDTH);\n\n // Measure the hint bar's natural width to make sure the editor is wide enough.\n if (FieldMultilineInput.showHint && this.hintElement?.isConnected) {\n const scale = (this.workspace_ as Blockly.WorkspaceSvg).getScale();\n if (!this.cachedHintWidth || this.cachedHintWidth.scale !== scale) {\n // Temporarily let the element size to its content to measure its\n // natural width, unaffected by the current WidgetDiv width.\n this.hintElement.style.width = 'max-content';\n const widthPx = this.hintElement.offsetWidth;\n this.hintElement.style.width = '';\n if (widthPx > 0) this.cachedHintWidth = {scale, widthPx};\n }\n if (this.cachedHintWidth) {\n totalWidth = Math.max(\n totalWidth,\n this.cachedHintWidth.widthPx / scale,\n );\n }\n }\n }\n if (this.borderRect_) {\n this.borderRect_.setAttribute('width', `${totalWidth}`);\n this.borderRect_.setAttribute('height', `${totalHeight}`);\n }\n this.size_.width = totalWidth;\n this.size_.height = totalHeight;\n\n this.positionBorderRect_();\n }\n\n /**\n * Show the inline free-text editor on top of the text.\n * Overrides the default behaviour to force rerender in order to\n * correct block size, based on editor text.\n *\n * @param e Optional mouse event that triggered the field to open, or\n * undefined if triggered programmatically.\n * @param quietInput True if editor should be created without focus.\n * Defaults to false.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n override showEditor_(e?: Event, quietInput?: boolean) {\n super.showEditor_(e, quietInput);\n this.forceRerender();\n }\n\n /**\n * Create the text input editor widget.\n *\n * @returns The newly created text input editor.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected override widgetCreate_(): HTMLTextAreaElement {\n const div = Blockly.WidgetDiv.getDiv() as HTMLDivElement;\n const scale = (this.workspace_ as Blockly.WorkspaceSvg).getScale();\n const constants = this.getConstants();\n // This can't happen, but TypeScript thinks it can and lint forbids `!.`.\n if (!constants) throw Error('Constants not found');\n\n const htmlInput = document.createElement('textarea');\n htmlInput.className = 'blocklyHtmlInput blocklyHtmlTextAreaInput';\n htmlInput.setAttribute('spellcheck', String(this.spellcheck_));\n const fontSize = constants.FIELD_TEXT_FONTSIZE * scale + 'pt';\n div.style.fontSize = fontSize;\n htmlInput.style.fontSize = fontSize;\n const borderRadius = Blockly.FieldTextInput.BORDERRADIUS * scale + 'px';\n htmlInput.style.borderRadius = borderRadius;\n const paddingX = constants.FIELD_BORDER_RECT_X_PADDING * scale;\n const paddingY = (constants.FIELD_BORDER_RECT_Y_PADDING * scale) / 2;\n const lineHeight =\n constants.FIELD_TEXT_HEIGHT + constants.FIELD_BORDER_RECT_Y_PADDING;\n const hintHeightPx = Math.ceil(lineHeight * scale);\n // When the hint bar is visible it occupies one text row at the bottom;\n // pad the textarea by that row so we don't edit text underneath it.\n const paddingBottomPx = FieldMultilineInput.showHint\n ? paddingY + hintHeightPx\n : paddingY;\n htmlInput.style.padding = `${paddingY}px ${paddingX}px ${paddingBottomPx}px ${paddingX}px`;\n htmlInput.style.lineHeight = lineHeight * scale + 'px';\n div.appendChild(htmlInput);\n\n htmlInput.value = htmlInput.defaultValue = this.getEditorText_(this.value_);\n htmlInput.setAttribute('data-untyped-default-value', String(this.value_));\n htmlInput.setAttribute('data-old-value', '');\n if (Blockly.utils.userAgent.GECKO) {\n // In FF, ensure the browser reflows before resizing to avoid issue #2777.\n setTimeout(this.resizeEditor_.bind(this), 0);\n } else {\n this.resizeEditor_();\n }\n\n this.bindInputEvents_(htmlInput);\n\n if (FieldMultilineInput.showHint) {\n this.hintElement = this.createHint(hintHeightPx);\n this.hintElement.style.fontFamily = constants.FIELD_TEXT_FONTFAMILY;\n div.appendChild(this.hintElement);\n }\n\n return htmlInput;\n }\n\n /**\n * Creates the keyboard hint bar shown at the bottom of the editor.\n *\n * Keys are rendered as keycaps (bordered boxes).\n *\n * @param heightPx The height of the hint bar in pixels.\n * @returns The hint bar element.\n */\n private createHint(heightPx: number): HTMLDivElement {\n const shiftKey = '⇧';\n const enterKey = '⏎';\n const hint = document.createElement('div');\n hint.className = 'blocklyMultilineHint';\n hint.setAttribute('aria-hidden', 'true');\n hint.style.height = heightPx + 'px';\n\n // Plain Enter\n const enterGroup = document.createElement('div');\n enterGroup.className = 'blocklyMultilineHintGroup';\n enterGroup.appendChild(this.createHintKeycap(enterKey));\n enterGroup.appendChild(this.createHintColon());\n enterGroup.appendChild(\n this.createHintLabel(\n FieldMultilineInput.enterCommits ? 'commit' : 'newline',\n ),\n );\n hint.appendChild(enterGroup);\n\n // Modifier+Enter\n const modEnterGroup = document.createElement('div');\n modEnterGroup.className = 'blocklyMultilineHintGroup';\n modEnterGroup.appendChild(this.createHintKeycap(shiftKey));\n modEnterGroup.appendChild(this.createHintKeycap(enterKey));\n modEnterGroup.appendChild(this.createHintColon());\n modEnterGroup.appendChild(\n this.createHintLabel(\n FieldMultilineInput.enterCommits ? 'newline' : 'commit',\n ),\n );\n hint.appendChild(modEnterGroup);\n\n return hint;\n }\n\n /**\n * Creates a colon separator element used between keycaps and the action icon.\n *\n * @returns The colon element.\n */\n private createHintColon(): HTMLSpanElement {\n const colon = document.createElement('span');\n colon.className = 'blocklyMultilineHintColon';\n colon.textContent = ':';\n return colon;\n }\n\n /**\n * Creates a keycap element displaying a single key label.\n *\n * @param label The key symbol to display.\n * @returns The keycap element.\n */\n private createHintKeycap(label: string): HTMLSpanElement {\n const key = document.createElement('span');\n key.className = 'blocklyMultilineHintKey';\n key.textContent = label;\n return key;\n }\n\n /**\n * Creates a text label describing the result of a key action.\n *\n * Uses Blockly.Msg for i18n with hardcoded English fallbacks.\n *\n * @param type Either 'commit' or 'newline'.\n * @returns The label element.\n */\n private createHintLabel(type: 'commit' | 'newline'): HTMLSpanElement {\n const label = document.createElement('span');\n label.className = 'blocklyMultilineHintLabel';\n label.textContent =\n type === 'commit'\n ? Blockly.Msg['FIELD_MULTILINEINPUT_FINISH_EDITING'] || 'Finish editing'\n : Blockly.Msg['FIELD_MULTILINEINPUT_NEW_LINE'] || 'New line';\n return label;\n }\n\n /**\n * Sets the maxLines config for this field.\n *\n * @param maxLines Defines the maximum number of lines allowed, before\n * scrolling functionality is enabled.\n */\n setMaxLines(maxLines: number) {\n if (\n typeof maxLines === 'number' &&\n maxLines > 0 &&\n maxLines !== this.maxLines_\n ) {\n this.maxLines_ = maxLines;\n this.forceRerender();\n }\n }\n\n /**\n * Returns the maxLines config of this field.\n *\n * @returns The maxLines config value.\n */\n getMaxLines(): number {\n return this.maxLines_;\n }\n\n /**\n * Handle key down to the editor.\n *\n * Enter commits the value and closes the editor (matching FieldTextInput).\n * Shift+Enter inserts a newline at the cursor.\n * All other keys are handled by the parent class (Escape reverts, Tab navigates).\n *\n * @param e Keyboard event.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected override onHtmlInputKeyDown_(e: KeyboardEvent) {\n if (e.key === 'Enter') {\n if (e.isComposing) {\n // Let the IME (input method editor) finalize its composition naturally;\n // don't commit or insert a newline ourselves.\n return;\n }\n const shiftPressed = e.shiftKey;\n const shouldCommit = FieldMultilineInput.enterCommits\n ? !shiftPressed\n : shiftPressed;\n if (shouldCommit) {\n super.onHtmlInputKeyDown_(e);\n } else {\n this.insertNewline();\n e.preventDefault();\n e.stopPropagation();\n }\n } else {\n super.onHtmlInputKeyDown_(e);\n }\n }\n\n /**\n * Inserts a newline character at the current cursor position in the textarea.\n *\n * The browser's default Enter-key behavior inserts a newline, but\n * Shift+Enter has no default character-insertion action, so we handle it\n * manually here. After splicing the character we dispatch an `input` event\n * to trigger Blockly's onHtmlInputChange handler (programmatic `.value`\n * assignment doesn't fire `input` on its own).\n */\n private insertNewline() {\n const htmlInput = this.htmlInput_;\n if (!htmlInput) return;\n const start = htmlInput.selectionStart ?? htmlInput.value.length;\n const end = htmlInput.selectionEnd ?? start;\n htmlInput.value =\n htmlInput.value.substring(0, start) +\n '\\n' +\n htmlInput.value.substring(end);\n htmlInput.selectionStart = htmlInput.selectionEnd = start + 1;\n htmlInput.dispatchEvent(new Event('input'));\n }\n\n /**\n * Construct a FieldMultilineInput from a JSON arg object,\n * dereferencing any string table references.\n *\n * @param options A JSON object with options (text, and spellcheck).\n * @returns The new field instance.\n * @nocollapse\n */\n static override fromJson(\n options: FieldMultilineInputFromJsonConfig,\n ): FieldMultilineInput {\n const text = Blockly.utils.parsing.replaceMessageReferences(options.text);\n // `this` might be a subclass of FieldMultilineInput if that class doesn't\n // override the static fromJson method.\n return new this(text, undefined, options);\n }\n}\n\n/**\n * Register the field and any dependencies.\n */\nexport function registerFieldMultilineInput() {\n Blockly.fieldRegistry.register('field_multilinetext', FieldMultilineInput);\n}\n\n/**\n * CSS for multiline field.\n */\nBlockly.Css.register(`\n.blocklyHtmlTextAreaInput {\n font-family: monospace;\n resize: none;\n overflow: hidden;\n height: 100%;\n text-align: left;\n}\n\n.blocklyHtmlTextAreaInputOverflowedY {\n overflow-y: scroll;\n}\n\n.blocklyMultilineHint {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n display: flex;\n justify-content: space-around;\n align-items: center;\n padding: 0 4px;\n box-sizing: border-box;\n font-size: 0.85em;\n color: rgba(0, 0, 0, 0.6);\n background-color: white;\n border-top: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 0 0 4px 4px;\n user-select: none;\n pointer-events: none;\n}\n\n.blocklyMultilineHintGroup {\n display: inline-flex;\n align-items: center;\n}\n\n.blocklyMultilineHintKey {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 1.3em;\n height: 1.3em;\n padding: 0 0.25em;\n margin: 0 0.1em;\n border: 1px solid rgba(0, 0, 0, 0.35);\n border-radius: 3px;\n background-color: #f5f5f5;\n line-height: 1;\n box-sizing: border-box;\n}\n\n.blocklyMultilineHintColon {\n margin: 0 0.15em;\n}\n\n.blocklyMultilineHintLabel {\n white-space: nowrap;\n}\n`);\n\n/**\n * Config options for the multiline input field.\n */\nexport interface FieldMultilineInputConfig\n extends Blockly.FieldTextInputConfig {\n maxLines?: number;\n}\n\n/**\n * fromJson config options for the multiline input field.\n */\nexport interface FieldMultilineInputFromJsonConfig extends FieldMultilineInputConfig {\n text?: string;\n}\n\n/**\n * A function that is called to validate changes to the field's value before\n * they are set.\n *\n * @see {@link https://developers.google.com/blockly/guides/create-custom-blocks/fields/validators#return_values}\n * @param newValue The value to be validated.\n * @returns One of three instructions for setting the new value: `T`, `null`,\n * or `undefined`.\n *\n * - `T` to set this function's returned value instead of `newValue`.\n *\n * - `null` to invoke `doValueInvalid_` and not set a value.\n *\n * - `undefined` to set `newValue` as is.\n */\nexport type FieldMultilineInputValidator = Blockly.FieldTextInputValidator;\n","/**\n * @license\n * Copyright 2024 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {Block, common as BlocklyCommon} from 'blockly/core';\nimport {\n JavascriptGenerator,\n Order as JavascriptOrder,\n} from 'blockly/javascript';\nimport {DartGenerator, Order as DartOrder} from 'blockly/dart';\nimport {LuaGenerator, Order as LuaOrder} from 'blockly/lua';\nimport {PhpGenerator, Order as PhpOrder} from 'blockly/php';\nimport {PythonGenerator, Order as PythonOrder} from 'blockly/python';\nimport {registerFieldMultilineInput} from '../field_multilineinput';\nimport {Generators} from './generatorsType';\n\n/** The name this block is registered under. */\nexport const BLOCK_NAME = 'text_multiline';\n\n// Block for multiline text input.\nconst jsonDefinition = {\n type: BLOCK_NAME,\n message0: '%1 %2',\n args0: [\n {\n type: 'field_image',\n src:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpP' +\n 'U2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0' +\n 'U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjm' +\n 'RIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z88' +\n '73zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5luj' +\n 'nYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiD' +\n 'MYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYX' +\n 'fwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4z' +\n 'wA5X2Z9AYnQrEAAAAASUVORK5CYII=',\n width: 12,\n height: 17,\n alt: '\\u00B6',\n },\n {\n type: 'field_multilinetext',\n name: 'TEXT',\n text: '',\n },\n ],\n output: 'String',\n style: 'text_blocks',\n helpUrl: '%{BKY_TEXT_TEXT_HELPURL}',\n tooltip: '%{BKY_TEXT_TEXT_TOOLTIP}',\n extensions: ['parent_tooltip_when_inline'],\n};\n\n/**\n * Javascript block generator function.\n *\n * @param block The Block instance to generate code for.\n * @param generator The JavascriptGenerator calling the function.\n * @returns A tuple containing the code string and precedence.\n */\nexport function toJavascript(\n block: Block,\n generator: JavascriptGenerator,\n): [string, JavascriptOrder] {\n // Text value.\n const code = generator.multiline_quote_(block.getFieldValue('TEXT'));\n const order =\n code.indexOf('+') !== -1\n ? JavascriptOrder.ADDITION\n : JavascriptOrder.ATOMIC;\n return [code, order];\n}\n\n/**\n * Dart block generator function.\n *\n * @param block The Block instance to generate code for.\n * @param generator The DartGenerator calling the function.\n * @returns A tuple containing the code string and precedence.\n */\nexport function toDart(\n block: Block,\n generator: DartGenerator,\n): [string, DartOrder] {\n // Text value.\n const code = generator.multiline_quote_(block.getFieldValue('TEXT'));\n const order =\n code.indexOf('+') !== -1 ? DartOrder.ADDITIVE : DartOrder.ATOMIC;\n return [code, order];\n}\n\n/**\n * Lua block generator function.\n *\n * @param block The Block instance to generate code for.\n * @param generator The LuaGenerator calling the function.\n * @returns A tuple containing the code string and precedence.\n */\nexport function toLua(\n block: Block,\n generator: LuaGenerator,\n): [string, LuaOrder] {\n // Text value.\n const code = generator.multiline_quote_(block.getFieldValue('TEXT'));\n const order =\n code.indexOf('..') !== -1 ? LuaOrder.CONCATENATION : LuaOrder.ATOMIC;\n return [code, order];\n}\n\n/**\n * PHP block generator function.\n *\n * @param block The Block instance to generate code for.\n * @param generator The PhpGenerator calling the function.\n * @returns A tuple containing the code string and precedence.\n */\nexport function toPhp(\n block: Block,\n generator: PhpGenerator,\n): [string, PhpOrder] {\n // Text value.\n const code = generator.multiline_quote_(block.getFieldValue('TEXT'));\n const order =\n code.indexOf('.') !== -1 ? PhpOrder.STRING_CONCAT : PhpOrder.ATOMIC;\n return [code, order];\n}\n\n/**\n * Python block generator function.\n *\n * @param block The Block instance to generate code for.\n * @param generator The PythonGenerator calling the function.\n * @returns A tuple containing the code string and precedence.\n */\nexport function toPython(\n block: Block,\n generator: PythonGenerator,\n): [string, PythonOrder] {\n // Text value.\n const code = generator.multiline_quote_(block.getFieldValue('TEXT'));\n const order =\n code.indexOf('+') !== -1 ? PythonOrder.ADDITIVE : PythonOrder.ATOMIC;\n return [code, order];\n}\n\nconst definitionsDict = BlocklyCommon.createBlockDefinitionsFromJsonArray([\n jsonDefinition,\n]);\n\n/** The text_multiline BlockDefinition. */\nexport const blockDefinition = definitionsDict[BLOCK_NAME];\n\n/**\n * Install the `text_multiline` block and all of its dependencies.\n *\n * @param gens The CodeGenerators to install per-block\n * generators on.\n */\nexport function installBlock(gens: Generators = {}) {\n registerFieldMultilineInput();\n BlocklyCommon.defineBlocks(definitionsDict);\n if (gens.javascript) gens.javascript.forBlock[BLOCK_NAME] = toJavascript;\n if (gens.dart) gens.dart.forBlock[BLOCK_NAME] = toDart;\n if (gens.lua) gens.lua.forBlock[BLOCK_NAME] = toLua;\n if (gens.php) gens.php.forBlock[BLOCK_NAME] = toPhp;\n if (gens.python) gens.python.forBlock[BLOCK_NAME] = toPython;\n}\n","/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport * as textMultiline from './blocks/textMultiline';\n\nexport * from './field_multilineinput';\n\n// Re-export all parts of the block definition.\nexport * as textMultiline from './blocks/textMultiline';\n\n// This package currently exports a single block. More may\n// be added later.\nexport const installAllBlocks = textMultiline.installBlock;\n"],"names":["root","factory","exports","module","require","define","amd","a","i","this","__WEBPACK_EXTERNAL_MODULE__370__","__WEBPACK_EXTERNAL_MODULE__379__","__WEBPACK_EXTERNAL_MODULE__127__","__WEBPACK_EXTERNAL_MODULE__157__","__WEBPACK_EXTERNAL_MODULE__537__","__WEBPACK_EXTERNAL_MODULE__557__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","Array","isArray","length","key","binding","o","Object","defineProperty","enumerable","value","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","FieldMultilineInput","core_","FieldTextInput","constructor","validator","config","super","Field","SKIP_SETUP","textGroup","maxLines_","Infinity","isOverflowedY_","hintElement","cachedHintWidth","configure_","setValue","setValidator","maxLines","setMaxLines","toXml","fieldElement","textContent","getValue","replace","fromXml","saveState","legacyState","saveLegacyState","loadState","state","loadLegacyState","initView","createBorderRect_","utils","dom","createSvgElement","Svg","G","class","fieldGroup_","addClass","getDisplayText_","block","getSourceBlock","Error","textLines","getText","NBSP","lines","split","displayLinesNumber","text","maxDisplayLength","substring","RTL","doValueUpdate_","newValue","value_","render_","currentChild","firstChild","removeChild","constants","getConstants","y","lineHeight","FIELD_TEXT_HEIGHT","FIELD_BORDER_RECT_Y_PADDING","TEXT","x","FIELD_BORDER_RECT_X_PADDING","dy","FIELD_TEXT_BASELINE","appendChild","document","createTextNode","isBeingEdited_","htmlInput","htmlInput_","removeClass","updateSize_","setTimeout","resizeEditor_","bind","isTextValid_","aria","setState","State","INVALID","nodes","childNodes","totalWidth","totalHeight","tspan","textWidth","getTextWidth","actualEditorLines","String","dummyTextElement","lineWidth","offsetWidth","clientWidth","showHint","borderRect_","Math","max","EDITOR_MIN_WIDTH","_a","isConnected","scale","workspace_","getScale","style","width","widthPx","setAttribute","size_","height","positionBorderRect_","showEditor_","e","quietInput","forceRerender","widgetCreate_","div","WidgetDiv","getDiv","createElement","className","spellcheck_","fontSize","FIELD_TEXT_FONTSIZE","borderRadius","BORDERRADIUS","paddingX","paddingY","hintHeightPx","ceil","paddingBottomPx","padding","defaultValue","getEditorText_","userAgent","GECKO","bindInputEvents_","createHint","fontFamily","FIELD_TEXT_FONTFAMILY","heightPx","hint","enterGroup","createHintKeycap","createHintColon","createHintLabel","enterCommits","modEnterGroup","colon","label","type","Msg","getMaxLines","onHtmlInputKeyDown_","isComposing","shiftPressed","shiftKey","insertNewline","preventDefault","stopPropagation","start","selectionStart","end","_b","selectionEnd","dispatchEvent","Event","fromJson","options","parsing","replaceMessageReferences","registerFieldMultilineInput","fieldRegistry","register","Css","BLOCK_NAME","jsonDefinition","message0","args0","src","alt","name","output","helpUrl","tooltip","extensions","toJavascript","generator","code","multiline_quote_","getFieldValue","order","indexOf","javascript_","Order","ADDITION","ATOMIC","toDart","dart_","ADDITIVE","toLua","lua_","CONCATENATION","toPhp","php_","STRING_CONCAT","toPython","python_","definitionsDict","common","createBlockDefinitionsFromJsonArray","blockDefinition","installBlock","gens","defineBlocks","javascript","forBlock","dart","lua","php","python","installAllBlocks"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"index.js","mappings":";CAAA,SAAAA,EAAAC,GACA,oBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,EAAAG,QAAA,gBAAAA,QAAA,gBAAAA,QAAA,sBAAAA,QAAA,eAAAA,QAAA,eAAAA,QAAA,wBACA,sBAAAC,QAAAA,OAAAC,IACAD,OAAA,kGAAAJ,OACA,CACA,IAAAM,EAAA,iBAAAL,QAAAD,EAAAG,QAAA,gBAAAA,QAAA,gBAAAA,QAAA,sBAAAA,QAAA,eAAAA,QAAA,eAAAA,QAAA,mBAAAH,EAAAD,EAAA,QAAAA,EAAA,gBAAAA,EAAA,sBAAAA,EAAA,eAAAA,EAAA,eAAAA,EAAA,mBACA,QAAAQ,KAAAD,GAAA,iBAAAL,QAAAA,QAA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kBH,EAAgBjC,GAQxC,SAASqC,EAAaC,EAAmB,IAC9C1C,IACAnL,EAAAyN,OAAcK,aAAaN,GACvBK,EAAKE,aAAYF,EAAKE,WAAWC,SAASzC,GAAcW,GACxD2B,EAAKI,OAAMJ,EAAKI,KAAKD,SAASzC,GAAcsB,GAC5CgB,EAAKK,MAAKL,EAAKK,IAAIF,SAASzC,GAAcyB,GAC1Ca,EAAKM,MAAKN,EAAKM,IAAIH,SAASzC,GAAc4B,GAC1CU,EAAKO,SAAQP,EAAKO,OAAOJ,SAASzC,GAAc+B,EACtD,CCzJO,MAAMe,EAAmBT","sources":["webpack://@blockly/field-multilineinput/webpack/universalModuleDefinition","webpack://@blockly/field-multilineinput/external umd {\"root\":\"Blockly\",\"commonjs\":\"blockly/core\",\"commonjs2\":\"blockly/core\",\"amd\":\"blockly/core\"}","webpack://@blockly/field-multilineinput/external umd {\"root\":\"Blockly.Dart\",\"commonjs\":\"blockly/dart\",\"commonjs2\":\"blockly/dart\",\"amd\":\"blockly/dart\"}","webpack://@blockly/field-multilineinput/external umd {\"root\":\"Blockly.JavaScript\",\"commonjs\":\"blockly/javascript\",\"commonjs2\":\"blockly/javascript\",\"amd\":\"blockly/javascript\"}","webpack://@blockly/field-multilineinput/external umd {\"root\":\"Blockly.Lua\",\"commonjs\":\"blockly/lua\",\"commonjs2\":\"blockly/lua\",\"amd\":\"blockly/lua\"}","webpack://@blockly/field-multilineinput/external umd {\"root\":\"Blockly.PHP\",\"commonjs\":\"blockly/php\",\"commonjs2\":\"blockly/php\",\"amd\":\"blockly/php\"}","webpack://@blockly/field-multilineinput/external umd {\"root\":\"Blockly.Python\",\"commonjs\":\"blockly/python\",\"commonjs2\":\"blockly/python\",\"amd\":\"blockly/python\"}","webpack://@blockly/field-multilineinput/webpack/bootstrap","webpack://@blockly/field-multilineinput/webpack/runtime/define property getters","webpack://@blockly/field-multilineinput/webpack/runtime/hasOwnProperty shorthand","webpack://@blockly/field-multilineinput/webpack/runtime/make namespace object","webpack://@blockly/field-multilineinput/./src/field_multilineinput.ts","webpack://@blockly/field-multilineinput/./src/blocks/textMultiline.ts","webpack://@blockly/field-multilineinput/./src/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"blockly/core\"), require(\"blockly/dart\"), require(\"blockly/javascript\"), require(\"blockly/lua\"), require(\"blockly/php\"), require(\"blockly/python\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"blockly/core\", \"blockly/dart\", \"blockly/javascript\", \"blockly/lua\", \"blockly/php\", \"blockly/python\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"blockly/core\"), require(\"blockly/dart\"), require(\"blockly/javascript\"), require(\"blockly/lua\"), require(\"blockly/php\"), require(\"blockly/python\")) : factory(root[\"Blockly\"], root[\"Blockly.Dart\"], root[\"Blockly.JavaScript\"], root[\"Blockly.Lua\"], root[\"Blockly.PHP\"], root[\"Blockly.Python\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, (__WEBPACK_EXTERNAL_MODULE__370__, __WEBPACK_EXTERNAL_MODULE__379__, __WEBPACK_EXTERNAL_MODULE__127__, __WEBPACK_EXTERNAL_MODULE__157__, __WEBPACK_EXTERNAL_MODULE__537__, __WEBPACK_EXTERNAL_MODULE__557__) => {\nreturn ","module.exports = __WEBPACK_EXTERNAL_MODULE__370__;","module.exports = __WEBPACK_EXTERNAL_MODULE__379__;","module.exports = __WEBPACK_EXTERNAL_MODULE__127__;","module.exports = __WEBPACK_EXTERNAL_MODULE__157__;","module.exports = __WEBPACK_EXTERNAL_MODULE__537__;","module.exports = __WEBPACK_EXTERNAL_MODULE__557__;","// The module cache\nconst __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tconst cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tconst module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter/value functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tif(Array.isArray(definition)) {\n\t\tvar i = 0;\n\t\twhile(i < definition.length) {\n\t\t\tvar key = definition[i++];\n\t\t\tvar binding = definition[i++];\n\t\t\tif(!__webpack_require__.o(exports, key)) {\n\t\t\t\tif(binding === 0) {\n\t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, value: definition[i++] });\n\t\t\t\t} else {\n\t\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: binding });\n\t\t\t\t}\n\t\t\t} else if(binding === 0) { i++; }\n\t\t}\n\t} else {\n\t\tfor(var key in definition) {\n\t\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t\t}\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * @fileoverview Multiline text input field.\n */\n\nimport * as Blockly from 'blockly/core';\n\n/**\n * Class for an editable text area input field.\n */\nexport class FieldMultilineInput extends Blockly.FieldTextInput {\n /**\n * Minimum editor width (in SVG/workspace units) when the field is open.\n * Prevents narrow editors when the initial text is very short.\n */\n\n static readonly EDITOR_MIN_WIDTH = 150;\n\n /**\n * The SVG group element that will contain a text element for each text row\n * when initialized.\n */\n textGroup: SVGGElement | null = null;\n\n /**\n * Defines the maximum number of lines of field.\n * If exceeded, scrolling functionality is enabled.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected maxLines_ = Infinity;\n\n /** Whether Y overflow is currently occurring. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected isOverflowedY_ = false;\n\n /** Whether pressing Enter commits the value (default) or inserts a newline. */\n static enterCommits = true;\n\n /** Whether to show the keyboard-shortcut hint bar in the editor. */\n static showHint = true;\n\n /** The hint bar DOM element while the editor is open. */\n private hintElement: HTMLDivElement | null = null;\n\n /**\n * Cached natural width of the hint bar in px, keyed by scale.\n * Invalidated when zoom changes to avoid stale measurements.\n */\n private cachedHintWidth: {scale: number; widthPx: number} | null = null;\n\n /**\n * @param value The initial content of the field. Should cast to a string.\n * Defaults to an empty string if null or undefined. Also accepts\n * Field.SKIP_SETUP if you wish to skip setup (only used by subclasses\n * that want to handle configuration and setting the field value after\n * their own constructors have run).\n * @param validator An optional function that is called to validate any\n * constraints on what the user entered. Takes the new text as an\n * argument and returns either the accepted text, a replacement text, or\n * null to abort the change.\n * @param config A map of options used to configure the field.\n * See the [field creation documentation]{@link\n * https://www.npmjs.com/package/@blockly/field-multilineinput}\n * for a list of properties this parameter supports.\n */\n constructor(\n value?: string | typeof Blockly.Field.SKIP_SETUP,\n validator?: FieldMultilineInputValidator,\n config?: FieldMultilineInputConfig,\n ) {\n super(Blockly.Field.SKIP_SETUP);\n\n if (value === Blockly.Field.SKIP_SETUP) return;\n if (config) {\n this.configure_(config);\n }\n this.setValue(value);\n if (validator) {\n this.setValidator(validator);\n }\n }\n\n /**\n * Configure the field based on the given map of options.\n *\n * @param config A map of options to configure the field based on.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected override configure_(config: FieldMultilineInputConfig) {\n super.configure_(config);\n if (config.maxLines) this.setMaxLines(config.maxLines);\n }\n\n /**\n * Serializes this field's value to XML.\n * Should only be called by Blockly.Xml.\n *\n * @param fieldElement The element to populate with info about the field's\n * state.\n * @returns The element containing info about the field's state.\n */\n override toXml(fieldElement: Element): Element {\n // Replace '\\n' characters with HTML-escaped equivalent '
'. This is\n // needed so the plain-text representation of the XML produced by\n // `Blockly.Xml.domToText` will appear on a single line (this is a\n // limitation of the plain-text format).\n fieldElement.textContent = (this.getValue() as string).replace(\n /\\n/g,\n ' ',\n );\n return fieldElement;\n }\n\n /**\n * Sets the field's value based on the given XML element. Should only be\n * called by Blockly.Xml.\n *\n * @param fieldElement The element containing info about the field's state.\n */\n override fromXml(fieldElement: Element) {\n this.setValue((fieldElement.textContent as string).replace(/ /g, '\\n'));\n }\n\n /**\n * Saves this field's value.\n * This function only exists for subclasses of FieldMultilineInput which\n * predate the load/saveState API and only define to/fromXml.\n *\n * @returns The state of this field.\n */\n override saveState() {\n const legacyState = this.saveLegacyState(FieldMultilineInput);\n if (legacyState !== null) {\n return legacyState;\n }\n return this.getValue();\n }\n\n /**\n * Sets the field's value based on the given state.\n * This function only exists for subclasses of FieldMultilineInput which\n * predate the load/saveState API and only define to/fromXml.\n *\n * @param state The state of the variable to assign to this variable field.\n */\n override loadState(state: unknown) {\n if (this.loadLegacyState(Blockly.Field, state)) {\n return;\n }\n this.setValue(state);\n }\n\n /**\n * Create the block UI for this field.\n */\n override initView() {\n this.createBorderRect_();\n this.textGroup = Blockly.utils.dom.createSvgElement(\n Blockly.utils.Svg.G,\n {\n class: 'blocklyEditableField',\n },\n this.fieldGroup_,\n );\n if (this.fieldGroup_) {\n Blockly.utils.dom.addClass(this.fieldGroup_, 'blocklyField');\n }\n }\n\n /**\n * Get the text from this field as displayed on screen. May differ from\n * getText due to ellipsis, and other formatting.\n *\n * @returns Currently displayed text.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected override getDisplayText_(): string {\n const block = this.getSourceBlock();\n if (!block) {\n throw new Error(\n 'The field has not yet been attached to its input. ' +\n 'Call appendField to attach it.',\n );\n }\n let textLines = this.getText();\n if (!textLines) {\n // Prevent the field from disappearing if empty.\n return Blockly.Field.NBSP;\n }\n const lines = textLines.split('\\n');\n textLines = '';\n const displayLinesNumber = this.isOverflowedY_\n ? this.maxLines_\n : lines.length;\n for (let i = 0; i < displayLinesNumber; i++) {\n let text = lines[i];\n if (text.length > this.maxDisplayLength) {\n // Truncate displayed string and add an ellipsis ('...').\n text = text.substring(0, this.maxDisplayLength - 4) + '...';\n } else if (this.isOverflowedY_ && i === displayLinesNumber - 1) {\n text = text.substring(0, text.length - 3) + '...';\n }\n // Replace whitespace with non-breaking spaces so the text doesn't\n // collapse.\n text = text.replace(/\\s/g, Blockly.Field.NBSP);\n\n textLines += text;\n if (i !== displayLinesNumber - 1) {\n textLines += '\\n';\n }\n }\n if (block.RTL) {\n // The SVG is LTR, force value to be RTL.\n textLines += '\\u200F';\n }\n return textLines;\n }\n\n /**\n * Called by setValue if the text input is valid. Updates the value of the\n * field, and updates the text of the field if it is not currently being\n * edited (i.e. handled by the htmlInput_). Is being redefined here to update\n * overflow state of the field.\n *\n * @param newValue The value to be saved. The default validator guarantees\n * that this is a string.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected override doValueUpdate_(newValue: string) {\n super.doValueUpdate_(newValue);\n if (this.value_ !== null) {\n this.isOverflowedY_ = this.value_.split('\\n').length > this.maxLines_;\n }\n }\n\n /** Updates the text of the textElement. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected override render_() {\n const block = this.getSourceBlock();\n if (!block) {\n throw new Error(\n 'The field has not yet been attached to its input. ' +\n 'Call appendField to attach it.',\n );\n }\n // Remove all text group children.\n let currentChild;\n const textGroup = this.textGroup as SVGElement;\n while ((currentChild = textGroup.firstChild)) {\n textGroup.removeChild(currentChild);\n }\n\n const constants = this.getConstants();\n // This can't happen, but TypeScript thinks it can and lint forbids `!.`.\n if (!constants) throw Error('Constants not found');\n // Add in text elements into the group.\n const lines = this.getDisplayText_().split('\\n');\n let y = 0;\n for (let i = 0; i < lines.length; i++) {\n const lineHeight =\n constants.FIELD_TEXT_HEIGHT + constants.FIELD_BORDER_RECT_Y_PADDING;\n const span = Blockly.utils.dom.createSvgElement(\n Blockly.utils.Svg.TEXT,\n {\n class: 'blocklyText blocklyMultilineText',\n x: constants.FIELD_BORDER_RECT_X_PADDING,\n y: y + constants.FIELD_BORDER_RECT_Y_PADDING,\n dy: constants.FIELD_TEXT_BASELINE,\n },\n textGroup,\n );\n span.appendChild(document.createTextNode(lines[i]));\n y += lineHeight;\n }\n\n if (this.isBeingEdited_) {\n const htmlInput = this.htmlInput_ as HTMLElement;\n if (this.isOverflowedY_) {\n Blockly.utils.dom.addClass(\n htmlInput,\n 'blocklyHtmlTextAreaInputOverflowedY',\n );\n } else {\n Blockly.utils.dom.removeClass(\n htmlInput,\n 'blocklyHtmlTextAreaInputOverflowedY',\n );\n }\n }\n\n this.updateSize_();\n\n if (this.isBeingEdited_) {\n if (block.RTL) {\n // in RTL, we need to let the browser reflow before resizing\n // in order to get the correct bounding box of the borderRect\n // avoiding issue #2777.\n setTimeout(this.resizeEditor_.bind(this), 0);\n } else {\n this.resizeEditor_();\n }\n const htmlInput = this.htmlInput_ as HTMLElement;\n if (!this.isTextValid_) {\n Blockly.utils.dom.addClass(htmlInput, 'blocklyInvalidInput');\n Blockly.utils.aria.setState(\n htmlInput,\n Blockly.utils.aria.State.INVALID,\n true,\n );\n } else {\n Blockly.utils.dom.removeClass(htmlInput, 'blocklyInvalidInput');\n Blockly.utils.aria.setState(\n htmlInput,\n Blockly.utils.aria.State.INVALID,\n false,\n );\n }\n }\n }\n\n /** Updates the size of the field based on the text. */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected override updateSize_() {\n const constants = this.getConstants();\n // This can't happen, but TypeScript thinks it can and lint forbids `!.`.\n if (!constants) throw Error('Constants not found');\n const nodes = (this.textGroup as SVGElement).childNodes;\n let totalWidth = 0;\n let totalHeight = 0;\n for (let i = 0; i < nodes.length; i++) {\n const tspan = nodes[i] as SVGTextElement;\n const textWidth = Blockly.utils.dom.getTextWidth(tspan);\n if (textWidth > totalWidth) {\n totalWidth = textWidth;\n }\n totalHeight +=\n constants.FIELD_TEXT_HEIGHT +\n (i > 0 ? constants.FIELD_BORDER_RECT_Y_PADDING : 0);\n }\n if (this.isBeingEdited_) {\n // The default width is based on the longest line in the display text,\n // but when it's being edited, width should be calculated based on the\n // absolute longest line, even if it would be truncated after editing.\n // Otherwise we would get wrong editor width when there are more\n // lines than this.maxLines_.\n const actualEditorLines = String(this.value_).split('\\n');\n const dummyTextElement = Blockly.utils.dom.createSvgElement(\n Blockly.utils.Svg.TEXT,\n {class: 'blocklyText blocklyMultilineText'},\n );\n\n for (let i = 0; i < actualEditorLines.length; i++) {\n if (actualEditorLines[i].length > this.maxDisplayLength) {\n actualEditorLines[i] = actualEditorLines[i].substring(\n 0,\n this.maxDisplayLength,\n );\n }\n dummyTextElement.textContent = actualEditorLines[i];\n const lineWidth = Blockly.utils.dom.getTextWidth(dummyTextElement);\n if (lineWidth > totalWidth) {\n totalWidth = lineWidth;\n }\n }\n\n const htmlInput = this.htmlInput_ as HTMLElement;\n const scrollbarWidth = htmlInput.offsetWidth - htmlInput.clientWidth;\n totalWidth += scrollbarWidth;\n\n if (FieldMultilineInput.showHint) {\n // Reserve a row at the bottom of the editor for the keyboard hint bar.\n // The textarea's padding-bottom (set in widgetCreate_) keeps the text\n // and caret out of this reserved strip.\n totalHeight +=\n constants.FIELD_TEXT_HEIGHT + constants.FIELD_BORDER_RECT_Y_PADDING;\n }\n }\n if (this.borderRect_) {\n totalHeight += constants.FIELD_BORDER_RECT_Y_PADDING * 2;\n // NOTE: Adding 1 extra px to prevent wrapping. Based on browser zoom,\n // the rounding of the calculated value can result in the line wrapping\n // unintentionally.\n totalWidth += constants.FIELD_BORDER_RECT_X_PADDING * 2 + 1;\n }\n if (this.isBeingEdited_) {\n totalWidth = Math.max(totalWidth, FieldMultilineInput.EDITOR_MIN_WIDTH);\n\n // Measure the hint bar's natural width to make sure the editor is wide enough.\n if (FieldMultilineInput.showHint && this.hintElement?.isConnected) {\n const scale = (this.workspace_ as Blockly.WorkspaceSvg).getScale();\n if (!this.cachedHintWidth || this.cachedHintWidth.scale !== scale) {\n // Temporarily let the element size to its content to measure its\n // natural width, unaffected by the current WidgetDiv width.\n this.hintElement.style.width = 'max-content';\n const widthPx = this.hintElement.offsetWidth;\n this.hintElement.style.width = '';\n if (widthPx > 0) this.cachedHintWidth = {scale, widthPx};\n }\n if (this.cachedHintWidth) {\n totalWidth = Math.max(\n totalWidth,\n this.cachedHintWidth.widthPx / scale,\n );\n }\n }\n }\n if (this.borderRect_) {\n this.borderRect_.setAttribute('width', `${totalWidth}`);\n this.borderRect_.setAttribute('height', `${totalHeight}`);\n }\n this.size_.width = totalWidth;\n this.size_.height = totalHeight;\n\n this.positionBorderRect_();\n }\n\n /**\n * Show the inline free-text editor on top of the text.\n * Overrides the default behaviour to force rerender in order to\n * correct block size, based on editor text.\n *\n * @param e Optional mouse event that triggered the field to open, or\n * undefined if triggered programmatically.\n * @param quietInput True if editor should be created without focus.\n * Defaults to false.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n override showEditor_(e?: Event, quietInput?: boolean) {\n super.showEditor_(e, quietInput);\n this.forceRerender();\n }\n\n /**\n * Create the text input editor widget.\n *\n * @returns The newly created text input editor.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected override widgetCreate_(): HTMLTextAreaElement {\n const div = Blockly.WidgetDiv.getDiv() as HTMLDivElement;\n const scale = (this.workspace_ as Blockly.WorkspaceSvg).getScale();\n const constants = this.getConstants();\n // This can't happen, but TypeScript thinks it can and lint forbids `!.`.\n if (!constants) throw Error('Constants not found');\n\n const htmlInput = document.createElement('textarea');\n htmlInput.className = 'blocklyHtmlInput blocklyHtmlTextAreaInput';\n htmlInput.setAttribute('spellcheck', String(this.spellcheck_));\n const fontSize = constants.FIELD_TEXT_FONTSIZE * scale + 'pt';\n div.style.fontSize = fontSize;\n htmlInput.style.fontSize = fontSize;\n const borderRadius = Blockly.FieldTextInput.BORDERRADIUS * scale + 'px';\n htmlInput.style.borderRadius = borderRadius;\n const paddingX = constants.FIELD_BORDER_RECT_X_PADDING * scale;\n const paddingY = (constants.FIELD_BORDER_RECT_Y_PADDING * scale) / 2;\n const lineHeight =\n constants.FIELD_TEXT_HEIGHT + constants.FIELD_BORDER_RECT_Y_PADDING;\n const hintHeightPx = Math.ceil(lineHeight * scale);\n // When the hint bar is visible it occupies one text row at the bottom;\n // pad the textarea by that row so we don't edit text underneath it.\n const paddingBottomPx = FieldMultilineInput.showHint\n ? paddingY + hintHeightPx\n : paddingY;\n htmlInput.style.padding = `${paddingY}px ${paddingX}px ${paddingBottomPx}px ${paddingX}px`;\n htmlInput.style.lineHeight = lineHeight * scale + 'px';\n div.appendChild(htmlInput);\n\n htmlInput.value = htmlInput.defaultValue = this.getEditorText_(this.value_);\n htmlInput.setAttribute('data-untyped-default-value', String(this.value_));\n htmlInput.setAttribute('data-old-value', '');\n if (Blockly.utils.userAgent.GECKO) {\n // In FF, ensure the browser reflows before resizing to avoid issue #2777.\n setTimeout(this.resizeEditor_.bind(this), 0);\n } else {\n this.resizeEditor_();\n }\n\n this.bindInputEvents_(htmlInput);\n\n if (FieldMultilineInput.showHint) {\n this.hintElement = this.createHint(hintHeightPx);\n this.hintElement.style.fontFamily = constants.FIELD_TEXT_FONTFAMILY;\n div.appendChild(this.hintElement);\n }\n\n return htmlInput;\n }\n\n /**\n * Creates the keyboard hint bar shown at the bottom of the editor.\n *\n * Keys are rendered as keycaps (bordered boxes).\n *\n * @param heightPx The height of the hint bar in pixels.\n * @returns The hint bar element.\n */\n private createHint(heightPx: number): HTMLDivElement {\n const shiftKey = '⇧';\n const enterKey = '⏎';\n const hint = document.createElement('div');\n hint.className = 'blocklyMultilineHint';\n hint.setAttribute('aria-hidden', 'true');\n hint.style.height = heightPx + 'px';\n\n // Plain Enter\n const enterGroup = document.createElement('div');\n enterGroup.className = 'blocklyMultilineHintGroup';\n enterGroup.appendChild(this.createHintKeycap(enterKey));\n enterGroup.appendChild(this.createHintColon());\n enterGroup.appendChild(\n this.createHintLabel(\n FieldMultilineInput.enterCommits ? 'commit' : 'newline',\n ),\n );\n hint.appendChild(enterGroup);\n\n // Modifier+Enter\n const modEnterGroup = document.createElement('div');\n modEnterGroup.className = 'blocklyMultilineHintGroup';\n modEnterGroup.appendChild(this.createHintKeycap(shiftKey));\n modEnterGroup.appendChild(this.createHintKeycap(enterKey));\n modEnterGroup.appendChild(this.createHintColon());\n modEnterGroup.appendChild(\n this.createHintLabel(\n FieldMultilineInput.enterCommits ? 'newline' : 'commit',\n ),\n );\n hint.appendChild(modEnterGroup);\n\n return hint;\n }\n\n /**\n * Creates a colon separator element used between keycaps and the action icon.\n *\n * @returns The colon element.\n */\n private createHintColon(): HTMLSpanElement {\n const colon = document.createElement('span');\n colon.className = 'blocklyMultilineHintColon';\n colon.textContent = ':';\n return colon;\n }\n\n /**\n * Creates a keycap element displaying a single key label.\n *\n * @param label The key symbol to display.\n * @returns The keycap element.\n */\n private createHintKeycap(label: string): HTMLSpanElement {\n const key = document.createElement('span');\n key.className = 'blocklyMultilineHintKey';\n key.textContent = label;\n return key;\n }\n\n /**\n * Creates a text label describing the result of a key action.\n *\n * Uses Blockly.Msg for i18n with hardcoded English fallbacks.\n *\n * @param type Either 'commit' or 'newline'.\n * @returns The label element.\n */\n private createHintLabel(type: 'commit' | 'newline'): HTMLSpanElement {\n const label = document.createElement('span');\n label.className = 'blocklyMultilineHintLabel';\n label.textContent =\n type === 'commit'\n ? Blockly.Msg['FIELD_MULTILINEINPUT_FINISH_EDITING'] || 'Finish editing'\n : Blockly.Msg['FIELD_MULTILINEINPUT_NEW_LINE'] || 'New line';\n return label;\n }\n\n /**\n * Sets the maxLines config for this field.\n *\n * @param maxLines Defines the maximum number of lines allowed, before\n * scrolling functionality is enabled.\n */\n setMaxLines(maxLines: number) {\n if (\n typeof maxLines === 'number' &&\n maxLines > 0 &&\n maxLines !== this.maxLines_\n ) {\n this.maxLines_ = maxLines;\n this.forceRerender();\n }\n }\n\n /**\n * Returns the maxLines config of this field.\n *\n * @returns The maxLines config value.\n */\n getMaxLines(): number {\n return this.maxLines_;\n }\n\n /**\n * Handle key down to the editor.\n *\n * Enter commits the value and closes the editor (matching FieldTextInput).\n * Shift+Enter inserts a newline at the cursor.\n * All other keys are handled by the parent class (Escape reverts, Tab navigates).\n *\n * @param e Keyboard event.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n protected override onHtmlInputKeyDown_(e: KeyboardEvent) {\n if (e.key === 'Enter') {\n if (e.isComposing) {\n // Let the IME (input method editor) finalize its composition naturally;\n // don't commit or insert a newline ourselves.\n return;\n }\n const shiftPressed = e.shiftKey;\n const shouldCommit = FieldMultilineInput.enterCommits\n ? !shiftPressed\n : shiftPressed;\n if (shouldCommit) {\n super.onHtmlInputKeyDown_(e);\n } else {\n this.insertNewline();\n e.preventDefault();\n e.stopPropagation();\n }\n } else {\n super.onHtmlInputKeyDown_(e);\n }\n }\n\n /**\n * Inserts a newline character at the current cursor position in the textarea.\n *\n * The browser's default Enter-key behavior inserts a newline, but\n * Shift+Enter has no default character-insertion action, so we handle it\n * manually here. After splicing the character we dispatch an `input` event\n * to trigger Blockly's onHtmlInputChange handler (programmatic `.value`\n * assignment doesn't fire `input` on its own).\n */\n private insertNewline() {\n const htmlInput = this.htmlInput_;\n if (!htmlInput) return;\n const start = htmlInput.selectionStart ?? htmlInput.value.length;\n const end = htmlInput.selectionEnd ?? start;\n htmlInput.value =\n htmlInput.value.substring(0, start) +\n '\\n' +\n htmlInput.value.substring(end);\n htmlInput.selectionStart = htmlInput.selectionEnd = start + 1;\n htmlInput.dispatchEvent(new Event('input'));\n }\n\n /**\n * Construct a FieldMultilineInput from a JSON arg object,\n * dereferencing any string table references.\n *\n * @param options A JSON object with options (text, and spellcheck).\n * @returns The new field instance.\n * @nocollapse\n */\n static override fromJson(\n options: FieldMultilineInputFromJsonConfig,\n ): FieldMultilineInput {\n const text = Blockly.utils.parsing.replaceMessageReferences(options.text);\n // `this` might be a subclass of FieldMultilineInput if that class doesn't\n // override the static fromJson method.\n return new this(text, undefined, options);\n }\n}\n\n/**\n * Register the field and any dependencies.\n */\nexport function registerFieldMultilineInput() {\n Blockly.fieldRegistry.register('field_multilinetext', FieldMultilineInput);\n}\n\n/**\n * CSS for multiline field.\n */\nBlockly.Css.register(`\n.blocklyHtmlTextAreaInput {\n font-family: monospace;\n resize: none;\n overflow: hidden;\n height: 100%;\n text-align: left;\n}\n\n.blocklyHtmlTextAreaInputOverflowedY {\n overflow-y: scroll;\n}\n\n.blocklyMultilineHint {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n display: flex;\n justify-content: space-around;\n align-items: center;\n padding: 0 4px;\n box-sizing: border-box;\n font-size: 0.85em;\n color: rgba(0, 0, 0, 0.6);\n background-color: white;\n border-top: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 0 0 4px 4px;\n user-select: none;\n pointer-events: none;\n}\n\n.blocklyMultilineHintGroup {\n display: inline-flex;\n align-items: center;\n}\n\n.blocklyMultilineHintKey {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 1.3em;\n height: 1.3em;\n padding: 0 0.25em;\n margin: 0 0.1em;\n border: 1px solid rgba(0, 0, 0, 0.35);\n border-radius: 3px;\n background-color: #f5f5f5;\n line-height: 1;\n box-sizing: border-box;\n}\n\n.blocklyMultilineHintColon {\n margin: 0 0.15em;\n}\n\n.blocklyMultilineHintLabel {\n white-space: nowrap;\n}\n`);\n\n/**\n * Config options for the multiline input field.\n */\nexport interface FieldMultilineInputConfig\n extends Blockly.FieldTextInputConfig {\n maxLines?: number;\n}\n\n/**\n * fromJson config options for the multiline input field.\n */\nexport interface FieldMultilineInputFromJsonConfig extends FieldMultilineInputConfig {\n text?: string;\n}\n\n/**\n * A function that is called to validate changes to the field's value before\n * they are set.\n *\n * @see {@link https://docs.blockly.com/guides/create-custom-blocks/fields/validators/#return-values}\n * @param newValue The value to be validated.\n * @returns One of three instructions for setting the new value: `T`, `null`,\n * or `undefined`.\n *\n * - `T` to set this function's returned value instead of `newValue`.\n *\n * - `null` to invoke `doValueInvalid_` and not set a value.\n *\n * - `undefined` to set `newValue` as is.\n */\nexport type FieldMultilineInputValidator = Blockly.FieldTextInputValidator;\n","/**\n * @license\n * Copyright 2024 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {Block, common as BlocklyCommon} from 'blockly/core';\nimport {\n JavascriptGenerator,\n Order as JavascriptOrder,\n} from 'blockly/javascript';\nimport {DartGenerator, Order as DartOrder} from 'blockly/dart';\nimport {LuaGenerator, Order as LuaOrder} from 'blockly/lua';\nimport {PhpGenerator, Order as PhpOrder} from 'blockly/php';\nimport {PythonGenerator, Order as PythonOrder} from 'blockly/python';\nimport {registerFieldMultilineInput} from '../field_multilineinput';\nimport {Generators} from './generatorsType';\n\n/** The name this block is registered under. */\nexport const BLOCK_NAME = 'text_multiline';\n\n// Block for multiline text input.\nconst jsonDefinition = {\n type: BLOCK_NAME,\n message0: '%1 %2',\n args0: [\n {\n type: 'field_image',\n src:\n 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAARCAYAAADpP' +\n 'U2iAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAdhgAAHYYBXaITgQAAABh0RVh0' +\n 'U29mdHdhcmUAcGFpbnQubmV0IDQuMS42/U4J6AAAAP1JREFUOE+Vks0KQUEYhjm' +\n 'RIja4ABtZ2dm5A3t3Ia6AUm7CylYuQRaUhZSlLZJiQbFAyRnPN33y01HOW08z88' +\n '73zpwzM4F3GWOCruvGIE4/rLaV+Nq1hVGMBqzhqlxgCys4wJA65xnogMHsQ5luj' +\n 'nYHTejBBCK2mE4abjCgMGhNxHgDFWjDSG07kdfVa2pZMf4ZyMAdWmpZMfYOsLiD' +\n 'MYMjlMB+K613QISRhTnITnsYg5yUd0DETmEoMlkFOeIT/A58iyK5E18BuTBfgYX' +\n 'fwNJv4P9/oEBerLylOnRhygmGdPpTTBZAPkde61lbQe4moWUvYUZYLfUNftIY4z' +\n 'wA5X2Z9AYnQrEAAAAASUVORK5CYII=',\n width: 12,\n height: 17,\n alt: '\\u00B6',\n },\n {\n type: 'field_multilinetext',\n name: 'TEXT',\n text: '',\n },\n ],\n output: 'String',\n style: 'text_blocks',\n helpUrl: '%{BKY_TEXT_TEXT_HELPURL}',\n tooltip: '%{BKY_TEXT_TEXT_TOOLTIP}',\n extensions: ['parent_tooltip_when_inline'],\n};\n\n/**\n * Javascript block generator function.\n *\n * @param block The Block instance to generate code for.\n * @param generator The JavascriptGenerator calling the function.\n * @returns A tuple containing the code string and precedence.\n */\nexport function toJavascript(\n block: Block,\n generator: JavascriptGenerator,\n): [string, JavascriptOrder] {\n // Text value.\n const code = generator.multiline_quote_(block.getFieldValue('TEXT'));\n const order =\n code.indexOf('+') !== -1\n ? JavascriptOrder.ADDITION\n : JavascriptOrder.ATOMIC;\n return [code, order];\n}\n\n/**\n * Dart block generator function.\n *\n * @param block The Block instance to generate code for.\n * @param generator The DartGenerator calling the function.\n * @returns A tuple containing the code string and precedence.\n */\nexport function toDart(\n block: Block,\n generator: DartGenerator,\n): [string, DartOrder] {\n // Text value.\n const code = generator.multiline_quote_(block.getFieldValue('TEXT'));\n const order =\n code.indexOf('+') !== -1 ? DartOrder.ADDITIVE : DartOrder.ATOMIC;\n return [code, order];\n}\n\n/**\n * Lua block generator function.\n *\n * @param block The Block instance to generate code for.\n * @param generator The LuaGenerator calling the function.\n * @returns A tuple containing the code string and precedence.\n */\nexport function toLua(\n block: Block,\n generator: LuaGenerator,\n): [string, LuaOrder] {\n // Text value.\n const code = generator.multiline_quote_(block.getFieldValue('TEXT'));\n const order =\n code.indexOf('..') !== -1 ? LuaOrder.CONCATENATION : LuaOrder.ATOMIC;\n return [code, order];\n}\n\n/**\n * PHP block generator function.\n *\n * @param block The Block instance to generate code for.\n * @param generator The PhpGenerator calling the function.\n * @returns A tuple containing the code string and precedence.\n */\nexport function toPhp(\n block: Block,\n generator: PhpGenerator,\n): [string, PhpOrder] {\n // Text value.\n const code = generator.multiline_quote_(block.getFieldValue('TEXT'));\n const order =\n code.indexOf('.') !== -1 ? PhpOrder.STRING_CONCAT : PhpOrder.ATOMIC;\n return [code, order];\n}\n\n/**\n * Python block generator function.\n *\n * @param block The Block instance to generate code for.\n * @param generator The PythonGenerator calling the function.\n * @returns A tuple containing the code string and precedence.\n */\nexport function toPython(\n block: Block,\n generator: PythonGenerator,\n): [string, PythonOrder] {\n // Text value.\n const code = generator.multiline_quote_(block.getFieldValue('TEXT'));\n const order =\n code.indexOf('+') !== -1 ? PythonOrder.ADDITIVE : PythonOrder.ATOMIC;\n return [code, order];\n}\n\nconst definitionsDict = BlocklyCommon.createBlockDefinitionsFromJsonArray([\n jsonDefinition,\n]);\n\n/** The text_multiline BlockDefinition. */\nexport const blockDefinition = definitionsDict[BLOCK_NAME];\n\n/**\n * Install the `text_multiline` block and all of its dependencies.\n *\n * @param gens The CodeGenerators to install per-block\n * generators on.\n */\nexport function installBlock(gens: Generators = {}) {\n registerFieldMultilineInput();\n BlocklyCommon.defineBlocks(definitionsDict);\n if (gens.javascript) gens.javascript.forBlock[BLOCK_NAME] = toJavascript;\n if (gens.dart) gens.dart.forBlock[BLOCK_NAME] = toDart;\n if (gens.lua) gens.lua.forBlock[BLOCK_NAME] = toLua;\n if (gens.php) gens.php.forBlock[BLOCK_NAME] = toPhp;\n if (gens.python) gens.python.forBlock[BLOCK_NAME] = toPython;\n}\n","/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport * as textMultiline from './blocks/textMultiline';\n\nexport * from './field_multilineinput';\n\n// Re-export all parts of the block definition.\nexport * as textMultiline from './blocks/textMultiline';\n\n// This package currently exports a single block. More may\n// be added later.\nexport const installAllBlocks = textMultiline.installBlock;\n"],"names":["root","factory","exports","module","require","define","amd","a","i","this","__WEBPACK_EXTERNAL_MODULE__370__","__WEBPACK_EXTERNAL_MODULE__379__","__WEBPACK_EXTERNAL_MODULE__127__","__WEBPACK_EXTERNAL_MODULE__157__","__WEBPACK_EXTERNAL_MODULE__537__","__WEBPACK_EXTERNAL_MODULE__557__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","Array","isArray","length","key","binding","o","Object","defineProperty","enumerable","value","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","FieldMultilineInput","core_","FieldTextInput","constructor","validator","config","super","Field","SKIP_SETUP","textGroup","maxLines_","Infinity","isOverflowedY_","hintElement","cachedHintWidth","configure_","setValue","setValidator","maxLines","setMaxLines","toXml","fieldElement","textContent","getValue","replace","fromXml","saveState","legacyState","saveLegacyState","loadState","state","loadLegacyState","initView","createBorderRect_","utils","dom","createSvgElement","Svg","G","class","fieldGroup_","addClass","getDisplayText_","block","getSourceBlock","Error","textLines","getText","NBSP","lines","split","displayLinesNumber","text","maxDisplayLength","substring","RTL","doValueUpdate_","newValue","value_","render_","currentChild","firstChild","removeChild","constants","getConstants","y","lineHeight","FIELD_TEXT_HEIGHT","FIELD_BORDER_RECT_Y_PADDING","TEXT","x","FIELD_BORDER_RECT_X_PADDING","dy","FIELD_TEXT_BASELINE","appendChild","document","createTextNode","isBeingEdited_","htmlInput","htmlInput_","removeClass","updateSize_","setTimeout","resizeEditor_","bind","isTextValid_","aria","setState","State","INVALID","nodes","childNodes","totalWidth","totalHeight","tspan","textWidth","getTextWidth","actualEditorLines","String","dummyTextElement","lineWidth","offsetWidth","clientWidth","showHint","borderRect_","Math","max","EDITOR_MIN_WIDTH","_a","isConnected","scale","workspace_","getScale","style","width","widthPx","setAttribute","size_","height","positionBorderRect_","showEditor_","e","quietInput","forceRerender","widgetCreate_","div","WidgetDiv","getDiv","createElement","className","spellcheck_","fontSize","FIELD_TEXT_FONTSIZE","borderRadius","BORDERRADIUS","paddingX","paddingY","hintHeightPx","ceil","paddingBottomPx","padding","defaultValue","getEditorText_","userAgent","GECKO","bindInputEvents_","createHint","fontFamily","FIELD_TEXT_FONTFAMILY","heightPx","hint","enterGroup","createHintKeycap","createHintColon","createHintLabel","enterCommits","modEnterGroup","colon","label","type","Msg","getMaxLines","onHtmlInputKeyDown_","isComposing","shiftPressed","shiftKey","insertNewline","preventDefault","stopPropagation","start","selectionStart","end","_b","selectionEnd","dispatchEvent","Event","fromJson","options","parsing","replaceMessageReferences","registerFieldMultilineInput","fieldRegistry","register","Css","BLOCK_NAME","jsonDefinition","message0","args0","src","alt","name","output","helpUrl","tooltip","extensions","toJavascript","generator","code","multiline_quote_","getFieldValue","order","indexOf","javascript_","Order","ADDITION","ATOMIC","toDart","dart_","ADDITIVE","toLua","lua_","CONCATENATION","toPhp","php_","STRING_CONCAT","toPython","python_","definitionsDict","common","createBlockDefinitionsFromJsonArray","blockDefinition","installBlock","gens","defineBlocks","javascript","forBlock","dart","lua","php","python","installAllBlocks"],"sourceRoot":""}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blockly/field-multilineinput",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.3.0",
|
|
4
4
|
"description": "A Blockly multilineinput field.",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"audit
|
|
6
|
+
"audit-fix": "blockly-scripts auditFix",
|
|
7
7
|
"build": "blockly-scripts build",
|
|
8
8
|
"clean": "blockly-scripts clean",
|
|
9
9
|
"lint": "eslint .",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"src"
|
|
41
41
|
],
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@blockly/dev-scripts": "^13.
|
|
44
|
-
"@blockly/dev-tools": "^13.
|
|
43
|
+
"@blockly/dev-scripts": "^13.3.0",
|
|
44
|
+
"@blockly/dev-tools": "^13.3.0",
|
|
45
45
|
"chai": "^6.2.2",
|
|
46
|
-
"sinon": "^22.
|
|
46
|
+
"sinon": "^22.1.0",
|
|
47
47
|
"typescript": "^6.0.3"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "bf35c82fce034a7728d07c7827a513b2a3073a1b"
|
|
56
56
|
}
|
|
@@ -65,7 +65,7 @@ export class FieldMultilineInput extends Blockly.FieldTextInput {
|
|
|
65
65
|
* null to abort the change.
|
|
66
66
|
* @param config A map of options used to configure the field.
|
|
67
67
|
* See the [field creation documentation]{@link
|
|
68
|
-
* https://
|
|
68
|
+
* https://www.npmjs.com/package/@blockly/field-multilineinput}
|
|
69
69
|
* for a list of properties this parameter supports.
|
|
70
70
|
*/
|
|
71
71
|
constructor(
|
|
@@ -767,7 +767,7 @@ export interface FieldMultilineInputFromJsonConfig extends FieldMultilineInputCo
|
|
|
767
767
|
* A function that is called to validate changes to the field's value before
|
|
768
768
|
* they are set.
|
|
769
769
|
*
|
|
770
|
-
* @see {@link https://
|
|
770
|
+
* @see {@link https://docs.blockly.com/guides/create-custom-blocks/fields/validators/#return-values}
|
|
771
771
|
* @param newValue The value to be validated.
|
|
772
772
|
* @returns One of three instructions for setting the new value: `T`, `null`,
|
|
773
773
|
* or `undefined`.
|