x-block-lib 0.10.4 → 0.10.6

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.
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@
8
8
  Touched: 2021
9
9
  */
10
10
  pre code.hljs{padding:1em;display:block;overflow-x:auto}code.hljs{padding:3px 5px}.hljs{color:#444;background:#f3f3f3}.hljs-comment{color:#697070}.hljs-punctuation,.hljs-tag{color:#444a}.hljs-tag .hljs-attr,.hljs-tag .hljs-name{color:#444}.hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-tag{font-weight:700}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type{color:#800}.hljs-section,.hljs-title{color:#800;font-weight:700}.hljs-link,.hljs-operator,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#ab5656}.hljs-literal{color:#695}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta .hljs-string{color:#38a}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.ghost[data-v-14e53948]{opacity:.4;pointer-events:none}.blocklyToolbox{width:56px;overflow-x:hidden}.blocklyMainBackground{stroke-width:0}.blocklyToolboxCategory{margin-bottom:12px!important}.blocklyToolboxCategoryIcon{display:none!important}.blocklyTreeRowContentContainer{place-items:center;height:28px;display:flex;overflow:hidden}.blocklyFlyout{z-index:21}
11
- /*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();import { A as Names, B as defineBlocksWithJsonArray, C as FieldCheckbox, D as FieldNumber, E as FieldLabel, F as Themes, G as inject$1, H as getMainWorkspace, I as Variables, J as serialization, K as inputs, L as WorkspaceSvg, M as ShortcutItems, N as ShortcutRegistry, O as FieldTextInput, P as Theme, Q as utils, R as Xml, S as Extensions, T as FieldImage, U as getSelected, V as dialog, W as icons, X as setParentContainer, Y as setLocale$1, Z as svgResize, _ as javascriptGenerator, a as lo, b as ContextMenuRegistry, c as require_dist, d as snakeCase_default, f as parseInt_default, g as Order, h as cloneDeep_default, i as require_dist$2, j as Procedures, k as Msg, l as encodeString, m as debounce_default, n as javascript, o as useResizeObserver, p as isEqual_default, q as registry, r as core_default, s as require_dist$1, t as highlightjs_vue_esm_min_default, u as upperCase_default, v as Blocks, w as FieldDropdown, x as Events, y as ContextMenu, z as common } from "./vendor.leasz44h.js";
11
+ /*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();import { A as Names, B as defineBlocksWithJsonArray, C as FieldCheckbox, D as FieldNumber, E as FieldLabel, F as Themes, G as inject$1, H as getMainWorkspace, I as Variables, J as serialization, K as inputs, L as WorkspaceSvg, M as ShortcutItems, N as ShortcutRegistry, O as FieldTextInput, P as Theme, Q as utils, R as Xml, S as Extensions, T as FieldImage, U as getSelected, V as dialog, W as icons, X as setParentContainer, Y as setLocale$1, Z as svgResize, _ as javascriptGenerator, a as lo, b as ContextMenuRegistry, c as require_dist, d as snakeCase_default, f as parseInt_default, g as Order, h as cloneDeep_default, i as require_dist$2, j as Procedures, k as Msg, l as encodeString, m as debounce_default, n as javascript, o as useResizeObserver, p as isEqual_default, q as registry, r as core_default, s as require_dist$1, t as highlightjs_vue_esm_min_default, u as upperCase_default, v as Blocks, w as FieldDropdown, x as Events, y as ContextMenu, z as common } from "./vendor.evszf9wa.js";
12
12
  import { globalState } from "x-state-lib";
13
13
  import { addIndent, finalProperties, getElement, getImplementMethodName, getTag, makeEventId, makeEventKeyOfCustomSlot, makeEventKeyOfElementSlot, makeMethodId, makeMethodKeyOfCustomSlot, makeMethodKeyOfElementSlot, makePropertyId, makePropertyKeyOfCustomSlot, makePropertyKeyOfElementSlot, makeTriggerId, parsePercentStr, parsePixelStr, pkgs, toEventName, toMethodName, toPropertyName, unwrapEventId, unwrapEventKeyOfCustomSlot, unwrapEventKeyOfElementSlot, unwrapMethodId, unwrapMethodKeyOfCustomSlot, unwrapMethodKeyOfElementSlot, unwrapPropertyId, unwrapPropertyKeyOfCustomSlot, unwrapPropertyKeyOfElementSlot, unwrapSlotId } from "x-runtime-lib";
14
14
  import { eventBus, globalObjects, messageWarning, openConfirmDlg, openPromptDlg, useColor, useSystem, useViewStack } from "x-essential-lib";
@@ -6660,7 +6660,7 @@ ${C}}\n`, w;
6660
6660
  tooltip: "%{BKY_LOOP_REPEAT_TOOLTIP}",
6661
6661
  helpUrl: "%{BKY_LOOP_REPEAT_HELPURL}"
6662
6662
  }]), javascriptGenerator.forBlock.repeat_v1 = function(y) {
6663
- let b = "";
6663
+ let b;
6664
6664
  b = y.getField("TIMES") ? String(Number(y.getFieldValue("TIMES"))) : javascriptGenerator.valueToCode(y, "TIMES", Order.ASSIGNMENT) || "0";
6665
6665
  let x = javascriptGenerator.addLoopTrap(javascriptGenerator.statementToCode(y, "DO"), y), S = "", C = javascriptGenerator.nameDB_.getDistinctName("count", Names.NameType.VARIABLE), w = b;
6666
6666
  return !b.match(/^\w+$/) && !utils.string.isNumber(b) && (w = javascriptGenerator.nameDB_.getDistinctName("repeat_end", Names.NameType.VARIABLE), S += `var ${w} = ${b};\n`), S += `for (var ${C} = 0; ${C} < ${w}; ${C}++) {\n${x}}\n`, S;
@@ -7934,7 +7934,7 @@ Extensions.register("text_append_tooltip_v1", Extensions.buildTooltipWithFieldTe
7934
7934
  UPPERCASE: ".toUpperCase()",
7935
7935
  LOWERCASE: ".toLowerCase()",
7936
7936
  TITLECASE: null
7937
- }[e.getFieldValue("CASE")], b = javascriptGenerator.valueToCode(e, "TEXT", y ? Order.MEMBER : Order.NONE) || "''", x = "";
7937
+ }[e.getFieldValue("CASE")], b = javascriptGenerator.valueToCode(e, "TEXT", y ? Order.MEMBER : Order.NONE) || "''", x;
7938
7938
  return x = y ? b + y : javascriptGenerator.provideFunction_("textToTitleCase", `
7939
7939
  function ${javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(str) {
7940
7940
  return str.slice(0, 1).toUpperCase() + str.slice(1).toLowerCase();