Changeset 2763919
- Timestamp:
- 07/30/2022 08:49:13 PM (4 years ago)
- Location:
- terminal-block/trunk
- Files:
-
- 6 added
- 14 edited
-
assets (added)
-
assets/fonts (added)
-
assets/fonts/FiraMono-Regular.otf (added)
-
assets/fonts/OFL.txt (added)
-
assets/scripts (added)
-
assets/scripts/terminal.js (added)
-
build/block.json (modified) (2 diffs)
-
build/index.asset.php (modified) (1 diff)
-
build/index.js (modified) (6 diffs)
-
build/index.js.map (modified) (1 diff)
-
build/style-index.css (modified) (3 diffs)
-
build/style-index.css.map (modified) (1 diff)
-
package-lock.json (modified) (1 diff)
-
package.json (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
src/block.json (modified) (2 diffs)
-
src/edit.js (modified) (1 diff)
-
src/save.js (modified) (1 diff)
-
src/style.scss (modified) (4 diffs)
-
terminal-block.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
terminal-block/trunk/build/block.json
r2762884 r2763919 3 3 "apiVersion": 2, 4 4 "name": "codesue/terminal-block", 5 "version": "0.1. 0",5 "version": "0.1.1", 6 6 "title": "Terminal Block", 7 7 "category": "widgets", … … 33 33 "source": "html", 34 34 "selector": "div" 35 }, 36 "title": { 37 "type": "string", 38 "default": "bash" 35 39 } 36 40 }, 37 "textdomain": "terminal ",41 "textdomain": "terminal-block", 38 42 "editorScript": "file:./index.js", 39 43 "editorStyle": "file:./index.css", -
terminal-block/trunk/build/index.asset.php
r2762884 r2763919 1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp- data', 'wp-element', 'wp-i18n', 'wp-rich-text'), 'version' => '2a1cc23d69e4384dcb68');1 <?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => 'b27a2b7ea3393655834c'); -
terminal-block/trunk/build/index.js
r2762884 r2763919 18 18 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 19 19 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__); 20 /* harmony import */ var _wordpress_ data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "@wordpress/data");21 /* harmony import */ var _wordpress_ data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_data__WEBPACK_IMPORTED_MODULE_3__);20 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 21 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); 22 22 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 23 23 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); 24 /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/rich-text */ "@wordpress/rich-text"); 25 /* harmony import */ var _wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5__); 26 /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./editor.scss */ "./src/editor.scss"); 27 28 29 30 31 32 33 34 35 const PromptButton = _ref => { 36 let { 37 isActive, 38 onChange, 39 value 40 } = _ref; 41 const selectedBlock = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => { 42 return select("core/block-editor").getSelectedBlock(); 43 }, []); 44 45 if (selectedBlock && selectedBlock.name !== "codesue/terminal-block") { 46 return null; 47 } 48 49 const onClickPrompt = () => { 50 onChange((0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5__.toggleFormat)(value, { 51 type: "terminal-block/prompt" 52 })); 53 }; 54 55 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.RichTextToolbarButton, { 56 icon: "arrow-right-alt2", 57 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Set as prompt", "terminal-block"), 58 onClick: onClickPrompt, 59 isActive: isActive 60 }); 61 }; 62 63 (0,_wordpress_rich_text__WEBPACK_IMPORTED_MODULE_5__.registerFormatType)("terminal-block/prompt", { 64 title: "Prompt", 65 tagName: "span", 66 className: "prompt", 67 edit: PromptButton 68 }); 69 function edit(_ref2) { 24 /* harmony import */ var _inner_blocks_command__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./inner-blocks/command */ "./src/inner-blocks/command.js"); 25 /* harmony import */ var _inner_blocks_output__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./inner-blocks/output */ "./src/inner-blocks/output.js"); 26 /* harmony import */ var _inner_blocks_progress_bar__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./inner-blocks/progress-bar */ "./src/inner-blocks/progress-bar.js"); 27 /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./block.json */ "./src/block.json"); 28 29 30 31 32 33 34 35 36 37 function edit(_ref) { 70 38 let { 71 39 attributes, 72 40 setAttributes 73 } = _ref2; 74 75 const onChangeContent = content => { 41 } = _ref; 42 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)(); 43 44 const onChangeTitle = title => { 76 45 setAttributes({ 77 content46 title 78 47 }); 79 48 }; 80 49 81 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.RichText, (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.useBlockProps)(), { 82 tagName: "div", 83 onChange: onChangeContent, 84 value: attributes.content, 85 multiline: true, 86 allowedFormats: ["core/bold", "core/italic", "core/text-color", "terminal-block/prompt"], 87 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Write your text...", "terminal-block") 88 })); 50 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelBody, { 51 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Terminal Settings", _block_json__WEBPACK_IMPORTED_MODULE_8__.textdomain), 52 initialOpen: true 53 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.PanelRow, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.TextControl, { 54 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Title", _block_json__WEBPACK_IMPORTED_MODULE_8__.textdomain), 55 value: attributes.title, 56 onChange: onChangeTitle, 57 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Change the title. Defaults to bash", _block_json__WEBPACK_IMPORTED_MODULE_8__.textdomain) 58 })))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, blockProps, { 59 title: attributes.title 60 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_2__.InnerBlocks, { 61 allowedBlocks: ["core/spacer", "codesue/terminal-command-block", "codesue/terminal-output-block", "codesue/terminal-progress-bar-block"] 62 }))); 89 63 } 90 64 … … 112 86 edit: _edit__WEBPACK_IMPORTED_MODULE_1__["default"], 113 87 save: _save__WEBPACK_IMPORTED_MODULE_3__["default"] 88 }); 89 90 /***/ }), 91 92 /***/ "./src/inner-blocks/command.js": 93 /*!*************************************!*\ 94 !*** ./src/inner-blocks/command.js ***! 95 \*************************************/ 96 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 97 98 __webpack_require__.r(__webpack_exports__); 99 /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 100 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 101 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 102 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 103 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__); 104 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 105 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__); 106 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 107 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); 108 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 109 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__); 110 /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../block.json */ "./src/block.json"); 111 112 113 114 115 116 117 118 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.registerBlockType)("codesue/terminal-command-block", { 119 title: "Command", 120 parent: [_block_json__WEBPACK_IMPORTED_MODULE_6__.name], 121 icon: "arrow-right-alt2", 122 description: "Add a command to a terminal window.", 123 category: "text", 124 attributes: { 125 content: { 126 type: "string", 127 source: "html", 128 selector: "p" 129 }, 130 prompt: { 131 type: "string", 132 default: "$" 133 } 134 }, 135 example: { 136 attributes: { 137 content: "pip install spacy" 138 } 139 }, 140 141 edit(_ref) { 142 let { 143 attributes, 144 setAttributes 145 } = _ref; 146 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps)(); 147 148 const onChangeContent = content => { 149 setAttributes({ 150 content 151 }); 152 }; 153 154 const onChangePrompt = prompt => { 155 setAttributes({ 156 prompt 157 }); 158 }; 159 160 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelBody, { 161 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)("Prompt Settings", _block_json__WEBPACK_IMPORTED_MODULE_6__.textdomain), 162 initialOpen: true 163 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelRow, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.TextControl, { 164 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)("Prompt", _block_json__WEBPACK_IMPORTED_MODULE_6__.textdomain), 165 value: attributes.prompt, 166 onChange: onChangePrompt, 167 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)("Change the prompt. Defaults to $", _block_json__WEBPACK_IMPORTED_MODULE_6__.textdomain) 168 })))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.RichText, (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, blockProps, { 169 tagName: "p", 170 value: attributes.content, 171 prompt: attributes.prompt, 172 className: "display-prompt", 173 onChange: onChangeContent, 174 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)("Enter your command...", _block_json__WEBPACK_IMPORTED_MODULE_6__.textdomain), 175 allowedFormats: ["core/bold", "core/italic", "core/link", "core/text-color", "core/underline"] 176 }))); 177 }, 178 179 save(_ref2) { 180 let { 181 attributes 182 } = _ref2; 183 const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps.save(); 184 const { 185 content, 186 prompt 187 } = attributes; 188 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.RichText.Content, (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, blockProps, { 189 tagName: "p", 190 value: content, 191 prompt: prompt, 192 className: "display-prompt" 193 })); 194 }, 195 196 transforms: { 197 to: [{ 198 type: "block", 199 blocks: ["codesue/terminal-output-block"], 200 transform: _ref3 => { 201 let { 202 content 203 } = _ref3; 204 return (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.createBlock)("codesue/terminal-output-block", { 205 content: content 206 }); 207 } 208 }], 209 from: [{ 210 type: "block", 211 blocks: ["codesue/terminal-output-block"], 212 transform: _ref4 => { 213 let { 214 content 215 } = _ref4; 216 return (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.createBlock)("codesue/terminal-command-block", { 217 content: content 218 }); 219 } 220 }] 221 } 222 }); 223 224 /***/ }), 225 226 /***/ "./src/inner-blocks/output.js": 227 /*!************************************!*\ 228 !*** ./src/inner-blocks/output.js ***! 229 \************************************/ 230 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 231 232 __webpack_require__.r(__webpack_exports__); 233 /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 234 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 235 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 236 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 237 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__); 238 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 239 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__); 240 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 241 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); 242 /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../block.json */ "./src/block.json"); 243 244 245 246 247 248 249 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.registerBlockType)("codesue/terminal-output-block", { 250 title: "Output", 251 parent: [_block_json__WEBPACK_IMPORTED_MODULE_5__.name], 252 icon: "editor-paragraph", 253 description: "Add output text to a terminal window.", 254 category: "text", 255 attributes: { 256 content: { 257 type: "string", 258 source: "html", 259 selector: "p" 260 } 261 }, 262 example: { 263 attributes: { 264 content: "Successfully installed spacy" 265 } 266 }, 267 268 edit(_ref) { 269 let { 270 attributes, 271 setAttributes 272 } = _ref; 273 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps)(); 274 275 const onChangeContent = content => { 276 setAttributes({ 277 content 278 }); 279 }; 280 281 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.RichText, (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, blockProps, { 282 tagName: "p", 283 value: attributes.content, 284 onChange: onChangeContent, 285 placeholder: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)("Write your output...", _block_json__WEBPACK_IMPORTED_MODULE_5__.textdomain), 286 allowedFormats: ["core/bold", "core/italic", "core/link", "core/text-color", "core/underline"] 287 })); 288 }, 289 290 save(_ref2) { 291 let { 292 attributes 293 } = _ref2; 294 const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps.save(); 295 const { 296 content 297 } = attributes; 298 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.RichText.Content, (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, blockProps, { 299 tagName: "p", 300 value: content 301 })); 302 }, 303 304 transforms: { 305 to: [{ 306 type: "block", 307 blocks: ["codesue/terminal-command-block"], 308 transform: _ref3 => { 309 let { 310 content 311 } = _ref3; 312 return (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.createBlock)("codesue/terminal-command-block", { 313 content: content 314 }); 315 } 316 }], 317 from: [{ 318 type: "block", 319 blocks: ["codesue/terminal-command-block"], 320 transform: _ref4 => { 321 let { 322 content 323 } = _ref4; 324 return (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.createBlock)("codesue/terminal-output-block", { 325 content: content 326 }); 327 } 328 }] 329 } 330 }); 331 332 /***/ }), 333 334 /***/ "./src/inner-blocks/progress-bar.js": 335 /*!******************************************!*\ 336 !*** ./src/inner-blocks/progress-bar.js ***! 337 \******************************************/ 338 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 339 340 __webpack_require__.r(__webpack_exports__); 341 /* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "./node_modules/@babel/runtime/helpers/esm/extends.js"); 342 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); 343 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); 344 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); 345 /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__); 346 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); 347 /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__); 348 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); 349 /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__); 350 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); 351 /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__); 352 /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../block.json */ "./src/block.json"); 353 354 355 356 357 358 359 360 (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_2__.registerBlockType)("codesue/terminal-progress-bar-block", { 361 title: "Progress Bar", 362 parent: [_block_json__WEBPACK_IMPORTED_MODULE_6__.name], 363 icon: "chart-bar", 364 description: "Add a progress bar to a terminal window.", 365 category: "design", 366 supports: { 367 color: { 368 text: true, 369 background: false 370 } 371 }, 372 attributes: { 373 content: { 374 type: "string", 375 source: "html", 376 selector: "p" 377 }, 378 character: { 379 type: "string", 380 default: "█" 381 }, 382 percent: { 383 type: "number", 384 default: "100" 385 } 386 }, 387 example: { 388 attributes: { 389 content: "███████████████████ 100%" 390 } 391 }, 392 393 edit(_ref) { 394 let { 395 attributes, 396 setAttributes 397 } = _ref; 398 const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps)(); 399 400 const createProgressBar = (character, percent) => { 401 if (!character) return ""; 402 return `${character.repeat(percent / 2.5)} ${attributes.percent}%`; 403 }; 404 405 const onChangeContent = content => { 406 setAttributes({ 407 content: content 408 }); 409 }; 410 411 const onChangeCharacter = character => { 412 setAttributes({ 413 character 414 }); 415 createProgressBar(character, attributes.percent); 416 }; 417 418 const onChangePercent = percent => { 419 setAttributes({ 420 percent: parseInt(percent) 421 }); 422 createProgressBar(attributes.character, parseInt(percent)); 423 }; 424 425 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InspectorControls, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelBody, { 426 title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)("Progress Bar Settings", _block_json__WEBPACK_IMPORTED_MODULE_6__.textdomain), 427 initialOpen: true 428 }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelRow, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.TextControl, { 429 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)("Character", _block_json__WEBPACK_IMPORTED_MODULE_6__.textdomain), 430 value: attributes.character, 431 onChange: onChangeCharacter, 432 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)("Change the character. Defaults to █", _block_json__WEBPACK_IMPORTED_MODULE_6__.textdomain) 433 })), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.PanelRow, null, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__.__experimentalNumberControl, { 434 label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)("Percent", _block_json__WEBPACK_IMPORTED_MODULE_6__.textdomain), 435 labelPosition: "edge", 436 value: attributes.percent, 437 onChange: onChangePercent, 438 isDragEnabled: true, 439 min: 0, 440 max: 100, 441 step: 10, 442 help: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)("Change the percent. Defaults to 100", _block_json__WEBPACK_IMPORTED_MODULE_6__.textdomain) 443 })))), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.RichText, (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, blockProps, { 444 tagName: "p", 445 value: createProgressBar(attributes.character, attributes.percent), 446 character: attributes.character, 447 percent: attributes.percent, 448 onChange: onChangeContent, 449 allowedFormats: [] 450 }))); 451 }, 452 453 save(_ref2) { 454 let { 455 attributes 456 } = _ref2; 457 const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps.save(); 458 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.RichText.Content, (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, blockProps, { 459 tagName: "p", 460 value: attributes.content, 461 character: attributes.character, 462 percent: attributes.percent 463 })); 464 } 465 114 466 }); 115 467 … … 141 493 attributes 142 494 } = _ref; 143 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.RichText.Content, (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps.save(), {144 tagName: "div",145 value: attributes.content146 }) );495 const blockProps = _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.useBlockProps.save(); 496 return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, blockProps, { 497 title: attributes.title 498 }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_3__.InnerBlocks.Content, null)); 147 499 } 148 149 /***/ }),150 151 /***/ "./src/editor.scss":152 /*!*************************!*\153 !*** ./src/editor.scss ***!154 \*************************/155 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {156 157 __webpack_require__.r(__webpack_exports__);158 // extracted by mini-css-extract-plugin159 160 500 161 501 /***/ }), … … 193 533 /***/ }), 194 534 195 /***/ "@wordpress/ data":196 /*!****************************** !*\197 !*** external ["wp"," data"] ***!198 \****************************** /535 /***/ "@wordpress/components": 536 /*!************************************!*\ 537 !*** external ["wp","components"] ***! 538 \************************************/ 199 539 /***/ ((module) => { 200 540 201 module.exports = window["wp"][" data"];541 module.exports = window["wp"]["components"]; 202 542 203 543 /***/ }), … … 220 560 221 561 module.exports = window["wp"]["i18n"]; 222 223 /***/ }),224 225 /***/ "@wordpress/rich-text":226 /*!**********************************!*\227 !*** external ["wp","richText"] ***!228 \**********************************/229 /***/ ((module) => {230 231 module.exports = window["wp"]["richText"];232 562 233 563 /***/ }), … … 268 598 /***/ ((module) => { 269 599 270 module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"codesue/terminal-block","version":"0.1. 0","title":"Terminal Block","category":"widgets","icon":"editor-code","description":"Display rich text in a terminal window.","keywords":["code","terminal","documentation"],"supports":{"color":{"text":true,"background":true,"link":true},"spacing":{"margin":true,"padding":true},"typography":{"fontSize":true,"lineHeight":true}},"attributes":{"content":{"type":"string","source":"html","selector":"div"}},"textdomain":"terminal","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}');600 module.exports = JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"codesue/terminal-block","version":"0.1.1","title":"Terminal Block","category":"widgets","icon":"editor-code","description":"Display rich text in a terminal window.","keywords":["code","terminal","documentation"],"supports":{"color":{"text":true,"background":true,"link":true},"spacing":{"margin":true,"padding":true},"typography":{"fontSize":true,"lineHeight":true}},"attributes":{"content":{"type":"string","source":"html","selector":"div"},"title":{"type":"string","default":"bash"}},"textdomain":"terminal-block","editorScript":"file:./index.js","editorStyle":"file:./index.css","style":"file:./style-index.css"}'); 271 601 272 602 /***/ }) -
terminal-block/trunk/build/index.js.map
r2762884 r2763919 1 {"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;; AAAA;AAKA;AACA;AACA;AAEA;;AAEA,MAAMO,YAAY,GAAG,QAAmC;EAAA,IAAlC;IAAEC,QAAF;IAAYC,QAAZ;IAAsBC;EAAtB,CAAkC;EACvD,MAAMC,aAAa,GAAGR,0DAAS,CAAES,MAAD,IAAY;IAC3C,OAAOA,MAAM,CAAC,mBAAD,CAAN,CAA4BC,gBAA5B,EAAP;EACA,CAF8B,EAE5B,EAF4B,CAA/B;;EAIA,IAAIF,aAAa,IAAIA,aAAa,CAACG,IAAd,KAAuB,wBAA5C,EAAsE;IACrE,OAAO,IAAP;EACA;;EAED,MA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AEC,OAAO,EAAC,KAFT;IAGC,KAAK,EAAEqB,UAAU,CAACG;EAHnB,GADD;AAOA;;;;;;;;;;;ACXD;;;;;;;;;;;;ACAA;;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;;;;;ACAe;AACf;AACA,oBAAoB,sBAAsB;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;;;;UCfA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://terminal-block/./src/edit.js","webpack://terminal-block/./src/index.js","webpack://terminal-block/./src/save.js","webpack://terminal-block/./src/editor.scss?d4ae","webpack://terminal-block/./src/style.scss?5612","webpack://terminal-block/external window [\"wp\",\"blockEditor\"]","webpack://terminal-block/external window [\"wp\",\"blocks\"]","webpack://terminal-block/external window [\"wp\",\"data\"]","webpack://terminal-block/external window [\"wp\",\"element\"]","webpack://terminal-block/external window [\"wp\",\"i18n\"]","webpack://terminal-block/external window [\"wp\",\"richText\"]","webpack://terminal-block/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://terminal-block/webpack/bootstrap","webpack://terminal-block/webpack/runtime/chunk loaded","webpack://terminal-block/webpack/runtime/compat get default export","webpack://terminal-block/webpack/runtime/define property getters","webpack://terminal-block/webpack/runtime/hasOwnProperty shorthand","webpack://terminal-block/webpack/runtime/make namespace object","webpack://terminal-block/webpack/runtime/jsonp chunk loading","webpack://terminal-block/webpack/before-startup","webpack://terminal-block/webpack/startup","webpack://terminal-block/webpack/after-startup"],"sourcesContent":["import {\n\tuseBlockProps,\n\tRichText,\n\tRichTextToolbarButton,\n} from \"@wordpress/block-editor\";\nimport { useSelect } from \"@wordpress/data\";\nimport { __ } from \"@wordpress/i18n\";\nimport { registerFormatType, toggleFormat } from \"@wordpress/rich-text\";\n\nimport \"./editor.scss\";\n\nconst PromptButton = ({ isActive, onChange, value }) => {\n\tconst selectedBlock = useSelect((select) => {\n\t\treturn select(\"core/block-editor\").getSelectedBlock();\n\t}, []);\n\n\tif (selectedBlock && selectedBlock.name !== \"codesue/terminal-block\") {\n\t\treturn null;\n\t}\n\n\tconst onClickPrompt = () => {\n\t\tonChange(\n\t\t\ttoggleFormat(value, {\n\t\t\t\ttype: \"terminal-block/prompt\",\n\t\t\t})\n\t\t);\n\t};\n\n\treturn (\n\t\t<RichTextToolbarButton\n\t\t\ticon=\"arrow-right-alt2\"\n\t\t\ttitle={__(\"Set as prompt\", \"terminal-block\")}\n\t\t\tonClick={onClickPrompt}\n\t\t\tisActive={isActive}\n\t\t/>\n\t);\n};\n\nregisterFormatType(\"terminal-block/prompt\", {\n\ttitle: \"Prompt\",\n\ttagName: \"span\",\n\tclassName: \"prompt\",\n\tedit: PromptButton,\n});\n\nexport default function edit({ attributes, setAttributes }) {\n\tconst onChangeContent = (content) => {\n\t\tsetAttributes({ content });\n\t};\n\n\treturn (\n\t\t<RichText\n\t\t\t{...useBlockProps()}\n\t\t\ttagName=\"div\"\n\t\t\tonChange={onChangeContent}\n\t\t\tvalue={attributes.content}\n\t\t\tmultiline={true}\n\t\t\tallowedFormats={[\n\t\t\t\t\"core/bold\",\n\t\t\t\t\"core/italic\",\n\t\t\t\t\"core/text-color\",\n\t\t\t\t\"terminal-block/prompt\",\n\t\t\t]}\n\t\t\tplaceholder={__(\"Write your text...\", \"terminal-block\")}\n\t\t/>\n\t);\n}\n","import { registerBlockType } from \"@wordpress/blocks\";\n\nimport edit from \"./edit\";\nimport metadata from \"./block.json\";\nimport save from \"./save\";\n\nimport \"./style.scss\";\n\nregisterBlockType(metadata.name, {\n\tedit,\n\tsave,\n});\n","import { __ } from \"@wordpress/i18n\";\nimport { useBlockProps, RichText } from \"@wordpress/block-editor\";\n\nexport default function save({ attributes }) {\n\treturn (\n\t\t<RichText.Content\n\t\t\t{...useBlockProps.save()}\n\t\t\ttagName=\"div\"\n\t\t\tvalue={attributes.content}\n\t\t/>\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"data\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","module.exports = window[\"wp\"][\"richText\"];","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar 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\tvar 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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\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(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"index\": 0,\n\t\"./style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkterminal_block\"] = globalThis[\"webpackChunkterminal_block\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"./style-index\"], () => (__webpack_require__(\"./src/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["useBlockProps","RichText","RichTextToolbarButton","useSelect","__","registerFormatType","toggleFormat","PromptButton","isActive","onChange","value","selectedBlock","select","getSelectedBlock","name","onClickPrompt","type","title","tagName","className","edit","attributes","setAttributes","onChangeContent","content","registerBlockType","metadata","save"],"sourceRoot":""}1 {"version":3,"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAKA;AACA;AAEA;AACA;AACA;AAEA;AAEe,SAASQ,IAAT,OAA6C;EAAA,IAA/B;IAAEC,UAAF;IAAcC;EAAd,CAA+B;EAC3D,MAAMC,UAAU,GAAGX,sEAAa,EAAhC;;EACA,MAAMY,aAAa,GAAIC,KAAD,IAAW;IAChCH,aAAa,CAAC;MAAEG;IAAF,CAAD,CAAb;EACA,CAFD;;EAGA,OACC,kIACC,kEAAC,sEAAD,QACC,kEAAC,4DAAD;IACC,KAAK,EAAEP,mDAAE,CAAC,mBAAD,EAAsBC,mDAAtB,CADV;IAEC,WAAW,EAAE;EAFd,GAIC,kEAAC,2DAAD,QACC,kEAAC,8DAAD;IACC,KAAK,EAAED,mDAAE,CAAC,OAAD,EAAUC,mDAAV,CADV;IAEC,KAAK,EAAEE,UAAU,CAACI,KAFnB;IAGC,QAAQ,EAAED,aAHX;IAIC,IAAI,EAAEN,mDAAE,CACP,oCADO,EAEPC,mDAFO;EAJT,EADD,CAJD,CADD,CADD,EAmBC,wJAASI,U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,IAAhB;IAAEP;EAAF,CAAgB;EAC5C,MAAME,UAAU,GAAGX,uEAAA,EAAnB;EACA,OACC,wJAASW,UAAT;IAAqB,KAAK,EAAEF,UAAU,CAACI;EAAvC,IACC,kEAAC,wEAAD,OADD,CADD;AAKA;;;;;;;;;;;ACVD;;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;ACAA;;;;;;;;;;;;;;ACAe;AACf;AACA,oBAAoB,sBAAsB;AAC1C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;;;;UCfA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;;;;;UEjDA;UACA;UACA;UACA;UACA","sources":["webpack://terminal-block/./src/edit.js","webpack://terminal-block/./src/index.js","webpack://terminal-block/./src/inner-blocks/command.js","webpack://terminal-block/./src/inner-blocks/output.js","webpack://terminal-block/./src/inner-blocks/progress-bar.js","webpack://terminal-block/./src/save.js","webpack://terminal-block/./src/style.scss?5612","webpack://terminal-block/external window [\"wp\",\"blockEditor\"]","webpack://terminal-block/external window [\"wp\",\"blocks\"]","webpack://terminal-block/external window [\"wp\",\"components\"]","webpack://terminal-block/external window [\"wp\",\"element\"]","webpack://terminal-block/external window [\"wp\",\"i18n\"]","webpack://terminal-block/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://terminal-block/webpack/bootstrap","webpack://terminal-block/webpack/runtime/chunk loaded","webpack://terminal-block/webpack/runtime/compat get default export","webpack://terminal-block/webpack/runtime/define property getters","webpack://terminal-block/webpack/runtime/hasOwnProperty shorthand","webpack://terminal-block/webpack/runtime/make namespace object","webpack://terminal-block/webpack/runtime/jsonp chunk loading","webpack://terminal-block/webpack/before-startup","webpack://terminal-block/webpack/startup","webpack://terminal-block/webpack/after-startup"],"sourcesContent":["import {\n\tuseBlockProps,\n\tInnerBlocks,\n\tInspectorControls,\n} from \"@wordpress/block-editor\";\nimport { TextControl, PanelBody, PanelRow } from \"@wordpress/components\";\nimport { __ } from \"@wordpress/i18n\";\n\nimport \"./inner-blocks/command\";\nimport \"./inner-blocks/output\";\nimport \"./inner-blocks/progress-bar\";\n\nimport metadata from \"./block.json\";\n\nexport default function edit({ attributes, setAttributes }) {\n\tconst blockProps = useBlockProps();\n\tconst onChangeTitle = (title) => {\n\t\tsetAttributes({ title });\n\t};\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody\n\t\t\t\t\ttitle={__(\"Terminal Settings\", metadata.textdomain)}\n\t\t\t\t\tinitialOpen={true}\n\t\t\t\t>\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\tlabel={__(\"Title\", metadata.textdomain)}\n\t\t\t\t\t\t\tvalue={attributes.title}\n\t\t\t\t\t\t\tonChange={onChangeTitle}\n\t\t\t\t\t\t\thelp={__(\n\t\t\t\t\t\t\t\t\"Change the title. Defaults to bash\",\n\t\t\t\t\t\t\t\tmetadata.textdomain\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PanelRow>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div {...blockProps} title={attributes.title}>\n\t\t\t\t<InnerBlocks\n\t\t\t\t\tallowedBlocks={[\n\t\t\t\t\t\t\"core/spacer\",\n\t\t\t\t\t\t\"codesue/terminal-command-block\",\n\t\t\t\t\t\t\"codesue/terminal-output-block\",\n\t\t\t\t\t\t\"codesue/terminal-progress-bar-block\",\n\t\t\t\t\t]}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n","import { registerBlockType } from \"@wordpress/blocks\";\n\nimport edit from \"./edit\";\nimport metadata from \"./block.json\";\nimport save from \"./save\";\n\nimport \"./style.scss\";\n\nregisterBlockType(metadata.name, {\n\tedit,\n\tsave,\n});\n","import { createBlock, registerBlockType } from \"@wordpress/blocks\";\nimport {\n\tuseBlockProps,\n\tInspectorControls,\n\tRichText,\n} from \"@wordpress/block-editor\";\nimport { PanelBody, PanelRow, TextControl } from \"@wordpress/components\";\nimport { __ } from \"@wordpress/i18n\";\n\nimport metadata from \"../block.json\";\n\nregisterBlockType(\"codesue/terminal-command-block\", {\n\ttitle: \"Command\",\n\tparent: [metadata.name],\n\ticon: \"arrow-right-alt2\",\n\tdescription: \"Add a command to a terminal window.\",\n\tcategory: \"text\",\n\tattributes: {\n\t\tcontent: {\n\t\t\ttype: \"string\",\n\t\t\tsource: \"html\",\n\t\t\tselector: \"p\",\n\t\t},\n\t\tprompt: {\n\t\t\ttype: \"string\",\n\t\t\tdefault: \"$\",\n\t\t},\n\t},\n\texample: {\n\t\tattributes: {\n\t\t\tcontent: \"pip install spacy\",\n\t\t},\n\t},\n\n\tedit({ attributes, setAttributes }) {\n\t\tconst blockProps = useBlockProps();\n\t\tconst onChangeContent = (content) => {\n\t\t\tsetAttributes({ content });\n\t\t};\n\t\tconst onChangePrompt = (prompt) => {\n\t\t\tsetAttributes({ prompt });\n\t\t};\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\ttitle={__(\"Prompt Settings\", metadata.textdomain)}\n\t\t\t\t\t\tinitialOpen={true}\n\t\t\t\t\t>\n\t\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tlabel={__(\"Prompt\", metadata.textdomain)}\n\t\t\t\t\t\t\t\tvalue={attributes.prompt}\n\t\t\t\t\t\t\t\tonChange={onChangePrompt}\n\t\t\t\t\t\t\t\thelp={__(\n\t\t\t\t\t\t\t\t\t\"Change the prompt. Defaults to $\",\n\t\t\t\t\t\t\t\t\tmetadata.textdomain\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PanelRow>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</InspectorControls>\n\t\t\t\t<RichText\n\t\t\t\t\t{...blockProps}\n\t\t\t\t\ttagName=\"p\"\n\t\t\t\t\tvalue={attributes.content}\n\t\t\t\t\tprompt={attributes.prompt}\n\t\t\t\t\tclassName=\"display-prompt\"\n\t\t\t\t\tonChange={onChangeContent}\n\t\t\t\t\tplaceholder={__(\"Enter your command...\", metadata.textdomain)}\n\t\t\t\t\tallowedFormats={[\n\t\t\t\t\t\t\"core/bold\",\n\t\t\t\t\t\t\"core/italic\",\n\t\t\t\t\t\t\"core/link\",\n\t\t\t\t\t\t\"core/text-color\",\n\t\t\t\t\t\t\"core/underline\",\n\t\t\t\t\t]}\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t},\n\n\tsave({ attributes }) {\n\t\tconst blockProps = useBlockProps.save();\n\t\tconst { content, prompt } = attributes;\n\t\treturn (\n\t\t\t<RichText.Content\n\t\t\t\t{...blockProps}\n\t\t\t\ttagName=\"p\"\n\t\t\t\tvalue={content}\n\t\t\t\tprompt={prompt}\n\t\t\t\tclassName=\"display-prompt\"\n\t\t\t/>\n\t\t);\n\t},\n\n\ttransforms: {\n\t\tto: [\n\t\t\t{\n\t\t\t\ttype: \"block\",\n\t\t\t\tblocks: [\"codesue/terminal-output-block\"],\n\t\t\t\ttransform: ({ content }) => {\n\t\t\t\t\treturn createBlock(\"codesue/terminal-output-block\", {\n\t\t\t\t\t\tcontent: content,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tfrom: [\n\t\t\t{\n\t\t\t\ttype: \"block\",\n\t\t\t\tblocks: [\"codesue/terminal-output-block\"],\n\t\t\t\ttransform: ({ content }) => {\n\t\t\t\t\treturn createBlock(\"codesue/terminal-command-block\", {\n\t\t\t\t\t\tcontent: content,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n});\n","import { createBlock, registerBlockType } from \"@wordpress/blocks\";\nimport { useBlockProps, RichText } from \"@wordpress/block-editor\";\nimport { __ } from \"@wordpress/i18n\";\n\nimport metadata from \"../block.json\";\n\nregisterBlockType(\"codesue/terminal-output-block\", {\n\ttitle: \"Output\",\n\tparent: [metadata.name],\n\ticon: \"editor-paragraph\",\n\tdescription: \"Add output text to a terminal window.\",\n\tcategory: \"text\",\n\tattributes: {\n\t\tcontent: {\n\t\t\ttype: \"string\",\n\t\t\tsource: \"html\",\n\t\t\tselector: \"p\",\n\t\t},\n\t},\n\texample: {\n\t\tattributes: {\n\t\t\tcontent: \"Successfully installed spacy\",\n\t\t},\n\t},\n\n\tedit({ attributes, setAttributes }) {\n\t\tconst blockProps = useBlockProps();\n\t\tconst onChangeContent = (content) => {\n\t\t\tsetAttributes({ content });\n\t\t};\n\t\treturn (\n\t\t\t<RichText\n\t\t\t\t{...blockProps}\n\t\t\t\ttagName=\"p\"\n\t\t\t\tvalue={attributes.content}\n\t\t\t\tonChange={onChangeContent}\n\t\t\t\tplaceholder={__(\"Write your output...\", metadata.textdomain)}\n\t\t\t\tallowedFormats={[\n\t\t\t\t\t\"core/bold\",\n\t\t\t\t\t\"core/italic\",\n\t\t\t\t\t\"core/link\",\n\t\t\t\t\t\"core/text-color\",\n\t\t\t\t\t\"core/underline\",\n\t\t\t\t]}\n\t\t\t/>\n\t\t);\n\t},\n\n\tsave({ attributes }) {\n\t\tconst blockProps = useBlockProps.save();\n\t\tconst { content } = attributes;\n\t\treturn <RichText.Content {...blockProps} tagName=\"p\" value={content} />;\n\t},\n\n\ttransforms: {\n\t\tto: [\n\t\t\t{\n\t\t\t\ttype: \"block\",\n\t\t\t\tblocks: [\"codesue/terminal-command-block\"],\n\t\t\t\ttransform: ({ content }) => {\n\t\t\t\t\treturn createBlock(\"codesue/terminal-command-block\", {\n\t\t\t\t\t\tcontent: content,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\tfrom: [\n\t\t\t{\n\t\t\t\ttype: \"block\",\n\t\t\t\tblocks: [\"codesue/terminal-command-block\"],\n\t\t\t\ttransform: ({ content }) => {\n\t\t\t\t\treturn createBlock(\"codesue/terminal-output-block\", {\n\t\t\t\t\t\tcontent: content,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n});\n","import { registerBlockType } from \"@wordpress/blocks\";\nimport {\n\tuseBlockProps,\n\tInspectorControls,\n\tRichText,\n} from \"@wordpress/block-editor\";\nimport {\n\t__experimentalNumberControl as NumberControl,\n\tPanelBody,\n\tPanelRow,\n\tTextControl,\n} from \"@wordpress/components\";\nimport { __ } from \"@wordpress/i18n\";\n\nimport metadata from \"../block.json\";\n\nregisterBlockType(\"codesue/terminal-progress-bar-block\", {\n\ttitle: \"Progress Bar\",\n\tparent: [metadata.name],\n\ticon: \"chart-bar\",\n\tdescription: \"Add a progress bar to a terminal window.\",\n\tcategory: \"design\",\n\tsupports: {\n\t\tcolor: {\n\t\t\ttext: true,\n\t\t\tbackground: false,\n\t\t},\n\t},\n\tattributes: {\n\t\tcontent: {\n\t\t\ttype: \"string\",\n\t\t\tsource: \"html\",\n\t\t\tselector: \"p\",\n\t\t},\n\t\tcharacter: {\n\t\t\ttype: \"string\",\n\t\t\tdefault: \"█\",\n\t\t},\n\t\tpercent: {\n\t\t\ttype: \"number\",\n\t\t\tdefault: \"100\",\n\t\t},\n\t},\n\texample: {\n\t\tattributes: {\n\t\t\tcontent: \"███████████████████ 100%\",\n\t\t},\n\t},\n\n\tedit({ attributes, setAttributes }) {\n\t\tconst blockProps = useBlockProps();\n\n\t\tconst createProgressBar = (character, percent) => {\n\t\t\tif (!character) return \"\";\n\t\t\treturn `${character.repeat(percent / 2.5)} ${attributes.percent}%`;\n\t\t};\n\t\tconst onChangeContent = (content) => {\n\t\t\tsetAttributes({ content: content });\n\t\t};\n\t\tconst onChangeCharacter = (character) => {\n\t\t\tsetAttributes({ character });\n\t\t\tcreateProgressBar(character, attributes.percent);\n\t\t};\n\t\tconst onChangePercent = (percent) => {\n\t\t\tsetAttributes({ percent: parseInt(percent) });\n\t\t\tcreateProgressBar(attributes.character, parseInt(percent));\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<InspectorControls>\n\t\t\t\t\t<PanelBody\n\t\t\t\t\t\ttitle={__(\"Progress Bar Settings\", metadata.textdomain)}\n\t\t\t\t\t\tinitialOpen={true}\n\t\t\t\t\t>\n\t\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\tlabel={__(\"Character\", metadata.textdomain)}\n\t\t\t\t\t\t\t\tvalue={attributes.character}\n\t\t\t\t\t\t\t\tonChange={onChangeCharacter}\n\t\t\t\t\t\t\t\thelp={__(\n\t\t\t\t\t\t\t\t\t\"Change the character. Defaults to █\",\n\t\t\t\t\t\t\t\t\tmetadata.textdomain\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PanelRow>\n\t\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\t\tlabel={__(\"Percent\", metadata.textdomain)}\n\t\t\t\t\t\t\t\tlabelPosition=\"edge\"\n\t\t\t\t\t\t\t\tvalue={attributes.percent}\n\t\t\t\t\t\t\t\tonChange={onChangePercent}\n\t\t\t\t\t\t\t\tisDragEnabled={true}\n\t\t\t\t\t\t\t\tmin={0}\n\t\t\t\t\t\t\t\tmax={100}\n\t\t\t\t\t\t\t\tstep={10}\n\t\t\t\t\t\t\t\thelp={__(\n\t\t\t\t\t\t\t\t\t\"Change the percent. Defaults to 100\",\n\t\t\t\t\t\t\t\t\tmetadata.textdomain\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PanelRow>\n\t\t\t\t\t</PanelBody>\n\t\t\t\t</InspectorControls>\n\t\t\t\t<RichText\n\t\t\t\t\t{...blockProps}\n\t\t\t\t\ttagName=\"p\"\n\t\t\t\t\tvalue={createProgressBar(attributes.character, attributes.percent)}\n\t\t\t\t\tcharacter={attributes.character}\n\t\t\t\t\tpercent={attributes.percent}\n\t\t\t\t\tonChange={onChangeContent}\n\t\t\t\t\tallowedFormats={[]}\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t},\n\n\tsave({ attributes }) {\n\t\tconst blockProps = useBlockProps.save();\n\t\treturn (\n\t\t\t<RichText.Content\n\t\t\t\t{...blockProps}\n\t\t\t\ttagName=\"p\"\n\t\t\t\tvalue={attributes.content}\n\t\t\t\tcharacter={attributes.character}\n\t\t\t\tpercent={attributes.percent}\n\t\t\t/>\n\t\t);\n\t},\n});\n","import { __ } from \"@wordpress/i18n\";\nimport { useBlockProps, InnerBlocks } from \"@wordpress/block-editor\";\n\nexport default function save({ attributes }) {\n\tconst blockProps = useBlockProps.save();\n\treturn (\n\t\t<div {...blockProps} title={attributes.title}>\n\t\t\t<InnerBlocks.Content />\n\t\t</div>\n\t);\n}\n","// extracted by mini-css-extract-plugin\nexport {};","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"blocks\"];","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"element\"];","module.exports = window[\"wp\"][\"i18n\"];","export default function _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n return _extends.apply(this, arguments);\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar 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\tvar 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// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\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(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"index\": 0,\n\t\"./style-index\": 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkterminal_block\"] = globalThis[\"webpackChunkterminal_block\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [\"./style-index\"], () => (__webpack_require__(\"./src/index.js\")))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n",""],"names":["useBlockProps","InnerBlocks","InspectorControls","TextControl","PanelBody","PanelRow","__","metadata","edit","attributes","setAttributes","blockProps","onChangeTitle","title","textdomain","registerBlockType","save","name","createBlock","RichText","parent","icon","description","category","content","type","source","selector","prompt","default","example","onChangeContent","onChangePrompt","transforms","to","blocks","transform","from","__experimentalNumberControl","NumberControl","supports","color","text","background","character","percent","createProgressBar","repeat","onChangeCharacter","onChangePercent","parseInt"],"sourceRoot":""} -
terminal-block/trunk/build/style-index.css
r2762884 r2763919 6 6 * Adapted from termynal.js CSS version 0.0.1 by Ines Montani <ines@ines.io>, licensed under MIT license. 7 7 */ 8 @font-face { 9 font-family: "Fira Mono"; 10 src: url(fonts/FiraMono-Regular.85c5f914.otf); 11 } 8 12 .wp-block-codesue-terminal-block { 9 13 --wp--default--terminal--block--color--background: #252a33; 10 14 --wp--default--terminal--block--color--text: #eee; 11 --wp--default--terminal--block-- color--text--subtle: #a2a2a2;15 --wp--default--terminal--block--opacity--subtle: 0.5; 12 16 width: 750px; 13 17 max-width: 100%; … … 37 41 38 42 .wp-block-codesue-terminal-block::after { 39 content: "bash";43 content: attr(title); 40 44 position: absolute; 41 color: var(--wp--default--terminal--block--color--text--subtle);45 opacity: var(--wp--default--terminal--block--opacity--subtle); 42 46 top: 5px; 43 47 left: 0; … … 58 62 } 59 63 60 .wp-block-codesue-terminal-block .prompt { 64 .wp-block-codesue-terminal-block p.display-prompt::before { 65 content: attr(prompt); 61 66 margin-right: 0.75em; 62 color: var(--wp--default--terminal--block--color--text--subtle); 63 -webkit-user-select: none; 64 -moz-user-select: none; 65 user-select: none; 67 opacity: var(--wp--default--terminal--block--opacity--subtle); 66 68 } 67 69 68 .wp-block-codesue-terminal-block.display-prompt-auto p::before { 69 content: "$"; 70 margin-right: 0.75em; 71 color: var(--wp--default--terminal--block--color--text--subtle); 72 } 73 74 .wp-block-codesue-terminal-block.display-cursor p:last-of-type::after { 70 .wp-block-codesue-terminal-command-block.display-cursor::after { 75 71 content: "▋"; 76 72 font-family: monospace; -
terminal-block/trunk/build/style-index.css.map
r2762884 r2763919 1 {"version":3,"file":"./style-index.css","mappings":";;;AAAA,gBAAgB;AAAf;;CAAA;AA GD;EACC;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEE;AACH;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEE;AACH;;AAEA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;AACD;;AAEA;EACC;EACA;AACD;;AAEA;EACC;EACA;EACA;EACA;AACD;;AAEA;EACI;EACA;EACH;EACA;OAAA;AACD;;AAEA;EACC;EACG;EACA;AACJ;;AAEA;EACI;EACA;EACA;EACA;EACQ;AACZ;;AAGA;AAEA;EACI;IACI;EADN;AACF;AAIA;EACI;IACI;EAFN;AACF,C","sources":["webpack://terminal-block/./src/style.scss"],"sourcesContent":[" /**\n * Adapted from termynal.js CSS version 0.0.1 by Ines Montani <ines@ines.io>, licensed under MIT license.\n */\n.wp-block-codesue-terminal-block {\n\t--wp--default--terminal--block--color--background: #252a33;\n\t--wp--default--terminal--block--color--text: #eee;\n\t--wp--default--terminal--block--color--text--subtle: #a2a2a2;\n\n\twidth: 750px;\n\tmax-width: 100%;\n\tbackground: var(--wp--default--terminal--block--color--background);\n\tcolor: var(--wp--default--terminal--block--color--text);\n\tfont-size: 18px;\n\tfont-family: 'Fira Mono', Consolas, Menlo, Monaco, 'Courier New', Courier, monospace;\n\tborder-radius: 4px;\n\tpadding: 75px 45px 35px;\n\tposition: relative;\n\t-webkit-box-sizing: border-box;\n\t\t\tbox-sizing: border-box;\n}\n\n.wp-block-codesue-terminal-block::before {\n\tcontent: '';\n\tposition: absolute;\n\ttop: 15px;\n\tleft: 15px;\n\tdisplay: inline-block;\n\twidth: 15px;\n\theight: 15px;\n\tborder-radius: 50%;\n\t/* A little hack to display the window buttons in one pseudo element. */\n\tbackground: #d9515d;\n\t-webkit-box-shadow: 25px 0 0 #f4c025, 50px 0 0 #3ec930;\n\t\t\tbox-shadow: 25px 0 0 #f4c025, 50px 0 0 #3ec930;\n}\n\n.wp-block-codesue-terminal-block::after {\n\tcontent: 'bash';\n\tposition: absolute;\n\tcolor: var(--wp--default--terminal--block--color--text--subtle);\n\ttop: 5px;\n\tleft: 0;\n\twidth: 100%;\n\ttext-align: center;\n}\n\n.wp-block-codesue-terminal-block p {\n\tdisplay: block;\n\tline-height: 1;\n}\n\n.wp-block-codesue-terminal-block p::before {\n\t/* Set up defaults and ensure empty lines are displayed. */\n\tcontent: '';\n\tdisplay: inline-block;\n\tvertical-align: middle;\n}\n\n.wp-block-codesue-terminal-block .prompt {\n margin-right: 0.75em;\n color: var(--wp--default--terminal--block--color--text--subtle);\n\t-webkit-user-select: none;\n\tuser-select: none;\n}\n\n.wp-block-codesue-terminal-block.display-prompt-auto p::before {\n\tcontent: '$';\n margin-right: 0.75em;\n color: var(--wp--default--terminal--block--color--text--subtle);\n}\n\n.wp-block-codesue-terminal-block.display-cursor p:last-of-type::after {\n content: '▋';\n font-family: monospace;\n margin-left: 0.5em;\n -webkit-animation: blink 1s infinite;\n animation: blink 1s infinite;\n}\n\n\n/* Cursor animation */\n\n@-webkit-keyframes blink {\n 50% {\n opacity: 0;\n }\n}\n\n@keyframes blink {\n 50% {\n opacity: 0;\n }\n}\n"],"names":[],"sourceRoot":""}1 {"version":3,"file":"./style-index.css","mappings":";;;AAAA,gBAAgB;AAAf;;CAAA;AAID;EACI;EACA;AACJ;AAEA;EACC;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEE;AADH;;AAIA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EAEE;AADH;;AAIA;EACC;EACA;EACA;EACA;EACA;EACA;EACA;AADD;;AAIA;EACC;EACA;AADD;;AAIA;EACC;EACA;EACA;EACA;AADD;;AAIA;EACC;EACG;EACH;AADD;;AAIA;EACI;EACA;EACA;EACA;EACQ;AADZ;;AAIA;AAEA;EACI;IACI;EAFN;AACF;AAKA;EACI;IACI;EAHN;AACF,C","sources":["webpack://terminal-block/./src/style.scss"],"sourcesContent":[" /**\n * Adapted from termynal.js CSS version 0.0.1 by Ines Montani <ines@ines.io>, licensed under MIT license.\n */\n\n@font-face {\n font-family: 'Fira Mono';\n src: url( ../assets/fonts/FiraMono-Regular.otf );\n}\n\n.wp-block-codesue-terminal-block {\n\t--wp--default--terminal--block--color--background: #252a33;\n\t--wp--default--terminal--block--color--text: #eee;\n\t--wp--default--terminal--block--opacity--subtle: 0.5;\n\n\twidth: 750px;\n\tmax-width: 100%;\n\tbackground: var(--wp--default--terminal--block--color--background);\n\tcolor: var(--wp--default--terminal--block--color--text);\n\tfont-size: 18px;\n\tfont-family: 'Fira Mono', Consolas, Menlo, Monaco, 'Courier New', Courier, monospace;\n\tborder-radius: 4px;\n\tpadding: 75px 45px 35px;\n\tposition: relative;\n\t-webkit-box-sizing: border-box;\n\t\t\tbox-sizing: border-box;\n}\n\n.wp-block-codesue-terminal-block::before {\n\tcontent: '';\n\tposition: absolute;\n\ttop: 15px;\n\tleft: 15px;\n\tdisplay: inline-block;\n\twidth: 15px;\n\theight: 15px;\n\tborder-radius: 50%;\n\t/* A little hack to display the window buttons in one pseudo element. */\n\tbackground: #d9515d;\n\t-webkit-box-shadow: 25px 0 0 #f4c025, 50px 0 0 #3ec930;\n\t\t\tbox-shadow: 25px 0 0 #f4c025, 50px 0 0 #3ec930;\n}\n\n.wp-block-codesue-terminal-block::after {\n\tcontent: attr(title);\n\tposition: absolute;\n\topacity: var(--wp--default--terminal--block--opacity--subtle);\n\ttop: 5px;\n\tleft: 0;\n\twidth: 100%;\n\ttext-align: center;\n}\n\n.wp-block-codesue-terminal-block p {\n\tdisplay: block;\n\tline-height: 1;\n}\n\n.wp-block-codesue-terminal-block p::before {\n\t/* Set up defaults and ensure empty lines are displayed. */\n\tcontent: '';\n\tdisplay: inline-block;\n\tvertical-align: middle;\n}\n\n.wp-block-codesue-terminal-block p.display-prompt::before {\n\tcontent: attr(prompt);\n margin-right: 0.75em;\n\topacity: var(--wp--default--terminal--block--opacity--subtle);\n}\n\n.wp-block-codesue-terminal-command-block.display-cursor::after {\n content: '▋';\n font-family: monospace;\n margin-left: 0.5em;\n -webkit-animation: blink 1s infinite;\n animation: blink 1s infinite;\n}\n\n/* Cursor animation */\n\n@-webkit-keyframes blink {\n 50% {\n opacity: 0;\n }\n}\n\n@keyframes blink {\n 50% {\n opacity: 0;\n }\n}\n"],"names":[],"sourceRoot":""} -
terminal-block/trunk/package-lock.json
r2762884 r2763919 3950 3950 "dev": true 3951 3951 }, 3952 "classnames": { 3953 "version": "2.3.1", 3954 "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.1.tgz", 3955 "integrity": "sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA==" 3956 }, 3952 3957 "clean-webpack-plugin": { 3953 3958 "version": "3.0.0", -
terminal-block/trunk/package.json
r2762884 r2763919 1 1 { 2 2 "name": "terminal-block", 3 "version": "0.1. 0",3 "version": "0.1.1", 4 4 "description": "Display rich text in a terminal window.", 5 5 "author": "Suzen Fylke", … … 17 17 "devDependencies": { 18 18 "@wordpress/scripts": "^23.5.0" 19 }, 20 "dependencies": { 21 "classnames": "^2.3.1" 19 22 } 20 23 } -
terminal-block/trunk/readme.txt
r2762884 r2763919 3 3 Tags: gutenberg, block, blocks, terminal, code, documentation 4 4 Tested up to: 6.0 5 Stable tag: 0.1. 05 Stable tag: 0.1.1 6 6 License: GPL-2.0-or-later 7 7 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 13 13 Display rich text in a terminal window. 14 14 15 Set specific text as a using the "Set as prompt" text format button or set the Additional CSS class `display-prompt-auto` to prefix each line with "$". 16 Set the Additional CSS class `display-cursor` to show a blinking cursor on the last line. 17 18 This block's style is adapted from [termynal.js](https://github.com/ines/termynal) version 0.0.1 by [Ines Montani](ines.io), licensed under MIT license. 15 This block's style and animation are adapted from [termynal.js](https://github.com/ines/termynal) version 0.0.1 by [Ines Montani](ines.io), licensed under MIT license. 19 16 20 17 The plugin icon is [terminal icons](https://www.flaticon.com/free-icons/terminal) created by Bharat Icons - Flaticon. … … 31 28 = Does this block use similar typing animations to termynal.js? = 32 29 33 No, right now, the only animation is a blinking cursor.30 Yes, typing animations are supported as of version 0.1.1. 34 31 35 32 == Screenshots == 36 33 37 1. Set the Additional CSS class `display-prompt-auto` to prefix each linewith "$".38 2. Set the Additional CSS class `display-cursor` to show a blinking cursor on the last line.34 1. By default, each command line is prefixed with "$". 35 2. You can also use custom prompts. 39 36 40 37 == Changelog == 41 38 39 = 0.1.1 = 40 * Use inner blocks for terminal inputs, outputs, and progress bars 41 * Add animation 42 * Add Fira Mono font 43 42 44 = 0.1.0 = 43 45 * Initial release -
terminal-block/trunk/src/block.json
r2762884 r2763919 3 3 "apiVersion": 2, 4 4 "name": "codesue/terminal-block", 5 "version": "0.1. 0",5 "version": "0.1.1", 6 6 "title": "Terminal Block", 7 7 "category": "widgets", … … 29 29 "source": "html", 30 30 "selector": "div" 31 }, 32 "title": { 33 "type":"string", 34 "default": "bash" 31 35 } 32 36 }, 33 "textdomain": "terminal ",37 "textdomain": "terminal-block", 34 38 "editorScript": "file:./index.js", 35 39 "editorStyle": "file:./index.css", -
terminal-block/trunk/src/edit.js
r2762884 r2763919 1 1 import { 2 2 useBlockProps, 3 RichText,4 RichTextToolbarButton,3 InnerBlocks, 4 InspectorControls, 5 5 } from "@wordpress/block-editor"; 6 import { useSelect } from "@wordpress/data";6 import { TextControl, PanelBody, PanelRow } from "@wordpress/components"; 7 7 import { __ } from "@wordpress/i18n"; 8 import { registerFormatType, toggleFormat } from "@wordpress/rich-text";9 8 10 import "./editor.scss"; 9 import "./inner-blocks/command"; 10 import "./inner-blocks/output"; 11 import "./inner-blocks/progress-bar"; 11 12 12 const PromptButton = ({ isActive, onChange, value }) => { 13 const selectedBlock = useSelect((select) => { 14 return select("core/block-editor").getSelectedBlock(); 15 }, []); 16 17 if (selectedBlock && selectedBlock.name !== "codesue/terminal-block") { 18 return null; 19 } 20 21 const onClickPrompt = () => { 22 onChange( 23 toggleFormat(value, { 24 type: "terminal-block/prompt", 25 }) 26 ); 27 }; 28 29 return ( 30 <RichTextToolbarButton 31 icon="arrow-right-alt2" 32 title={__("Set as prompt", "terminal-block")} 33 onClick={onClickPrompt} 34 isActive={isActive} 35 /> 36 ); 37 }; 38 39 registerFormatType("terminal-block/prompt", { 40 title: "Prompt", 41 tagName: "span", 42 className: "prompt", 43 edit: PromptButton, 44 }); 13 import metadata from "./block.json"; 45 14 46 15 export default function edit({ attributes, setAttributes }) { 47 const onChangeContent = (content) => { 48 setAttributes({ content }); 16 const blockProps = useBlockProps(); 17 const onChangeTitle = (title) => { 18 setAttributes({ title }); 49 19 }; 50 51 20 return ( 52 <RichText 53 {...useBlockProps()} 54 tagName="div" 55 onChange={onChangeContent} 56 value={attributes.content} 57 multiline={true} 58 allowedFormats={[ 59 "core/bold", 60 "core/italic", 61 "core/text-color", 62 "terminal-block/prompt", 63 ]} 64 placeholder={__("Write your text...", "terminal-block")} 65 /> 21 <> 22 <InspectorControls> 23 <PanelBody 24 title={__("Terminal Settings", metadata.textdomain)} 25 initialOpen={true} 26 > 27 <PanelRow> 28 <TextControl 29 label={__("Title", metadata.textdomain)} 30 value={attributes.title} 31 onChange={onChangeTitle} 32 help={__( 33 "Change the title. Defaults to bash", 34 metadata.textdomain 35 )} 36 /> 37 </PanelRow> 38 </PanelBody> 39 </InspectorControls> 40 <div {...blockProps} title={attributes.title}> 41 <InnerBlocks 42 allowedBlocks={[ 43 "core/spacer", 44 "codesue/terminal-command-block", 45 "codesue/terminal-output-block", 46 "codesue/terminal-progress-bar-block", 47 ]} 48 /> 49 </div> 50 </> 66 51 ); 67 52 } -
terminal-block/trunk/src/save.js
r2762884 r2763919 1 1 import { __ } from "@wordpress/i18n"; 2 import { useBlockProps, RichText} from "@wordpress/block-editor";2 import { useBlockProps, InnerBlocks } from "@wordpress/block-editor"; 3 3 4 4 export default function save({ attributes }) { 5 const blockProps = useBlockProps.save(); 5 6 return ( 6 <RichText.Content 7 {...useBlockProps.save()} 8 tagName="div" 9 value={attributes.content} 10 /> 7 <div {...blockProps} title={attributes.title}> 8 <InnerBlocks.Content /> 9 </div> 11 10 ); 12 11 } -
terminal-block/trunk/src/style.scss
r2762884 r2763919 2 2 * Adapted from termynal.js CSS version 0.0.1 by Ines Montani <ines@ines.io>, licensed under MIT license. 3 3 */ 4 5 @font-face { 6 font-family: 'Fira Mono'; 7 src: url( ../assets/fonts/FiraMono-Regular.otf ); 8 } 9 4 10 .wp-block-codesue-terminal-block { 5 11 --wp--default--terminal--block--color--background: #252a33; 6 12 --wp--default--terminal--block--color--text: #eee; 7 --wp--default--terminal--block-- color--text--subtle: #a2a2a2;13 --wp--default--terminal--block--opacity--subtle: 0.5; 8 14 9 15 width: 750px; … … 36 42 37 43 .wp-block-codesue-terminal-block::after { 38 content: 'bash';44 content: attr(title); 39 45 position: absolute; 40 color: var(--wp--default--terminal--block--color--text--subtle);46 opacity: var(--wp--default--terminal--block--opacity--subtle); 41 47 top: 5px; 42 48 left: 0; … … 57 63 } 58 64 59 .wp-block-codesue-terminal-block .prompt { 65 .wp-block-codesue-terminal-block p.display-prompt::before { 66 content: attr(prompt); 60 67 margin-right: 0.75em; 61 color: var(--wp--default--terminal--block--color--text--subtle); 62 -webkit-user-select: none; 63 user-select: none; 68 opacity: var(--wp--default--terminal--block--opacity--subtle); 64 69 } 65 70 66 .wp-block-codesue-terminal-block.display-prompt-auto p::before { 67 content: '$'; 68 margin-right: 0.75em; 69 color: var(--wp--default--terminal--block--color--text--subtle); 70 } 71 72 .wp-block-codesue-terminal-block.display-cursor p:last-of-type::after { 71 .wp-block-codesue-terminal-command-block.display-cursor::after { 73 72 content: '▋'; 74 73 font-family: monospace; … … 77 76 animation: blink 1s infinite; 78 77 } 79 80 78 81 79 /* Cursor animation */ -
terminal-block/trunk/terminal-block.php
r2762884 r2763919 5 5 * Requires at least: 5.9 6 6 * Requires PHP: 7.0 7 * Version: 0.1. 07 * Version: 0.1.1 8 8 * Author: Suzen Fylke 9 9 * Author URI: codesue.com … … 19 19 } 20 20 add_action( 'init', 'codesue_terminal_block_init' ); 21 22 function codesue_terminal_block_enqueue_scripts() { 23 wp_enqueue_script( 24 'codesue-terminal-block-script', 25 plugins_url( '/assets/scripts/terminal.js', __FILE__ ), 26 [], 27 false, 28 true 29 ); 30 } 31 add_action( 'wp_enqueue_scripts', 'codesue_terminal_block_enqueue_scripts' );
Note: See TracChangeset
for help on using the changeset viewer.