x-block-lib 0.10.8 → 0.10.9

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.
@@ -3,6 +3,7 @@ type __VLS_Props = {
3
3
  title: string;
4
4
  desc: string;
5
5
  select: boolean;
6
+ first: boolean;
6
7
  };
7
8
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
9
  "x-click": (...args: any[]) => void;
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@
7
7
  License: see project LICENSE
8
8
  Touched: 2021
9
9
  */
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-a710550b]{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}
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-5e6d8079]{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
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";
@@ -8775,45 +8775,39 @@ var clean_default = /* @__PURE__ */ defineComponent({
8775
8775
  id: {},
8776
8776
  title: {},
8777
8777
  desc: {},
8778
- select: { type: Boolean }
8778
+ select: { type: Boolean },
8779
+ first: { type: Boolean }
8779
8780
  },
8780
8781
  emits: ["x-click"],
8781
8782
  setup(e, { emit: y }) {
8782
- let { primaryColor: b, backgroundColor2: x, highlightColor: S } = useColor(), C = e, w = y, T = ref(!1), E = computed(() => ({
8783
- position: "relative",
8784
- background: T.value ? S.value : x.value,
8785
- width: "100%",
8786
- height: "48px",
8787
- marginBottom: "1px",
8788
- userSelect: "none"
8789
- })), D = computed(() => ({
8790
- display: C.select ? "block" : "none",
8791
- position: "absolute",
8792
- top: "0px",
8793
- left: "0px",
8794
- width: "100%",
8795
- height: "100%",
8796
- border: "1px solid " + b.value,
8797
- pointerEvents: "none"
8798
- }));
8799
- return (e, y) => {
8800
- let b = resolveComponent("v-spacer"), x = resolveComponent("v-icon"), S = resolveDirective("ripple");
8783
+ let { primaryColor: b, backgroundColor2: x, highlightColor: S } = useColor(), C = y, w = ref(!1), T = computed(() => {
8784
+ let y = {
8785
+ position: "relative",
8786
+ background: w.value ? S.value : x.value,
8787
+ width: "100%",
8788
+ height: "48px",
8789
+ marginBottom: "1px",
8790
+ userSelect: "none"
8791
+ };
8792
+ return e.select ? (e.first && (y.marginTop = "1px"), y.outline = "1px solid " + b.value) : (y.marginTop = void 0, y.outline = void 0), y;
8793
+ });
8794
+ return (y, b) => {
8795
+ let x = resolveComponent("v-spacer"), S = resolveComponent("v-icon"), E = resolveDirective("ripple");
8801
8796
  return withDirectives((openBlock(), createElementBlock("div", {
8802
8797
  class: "d-flex align-center cursor-pointer",
8803
- style: normalizeStyle(E.value),
8804
- onClick: y[1] ||= (e) => w("x-click", C.id),
8805
- onMouseout: y[2] ||= (e) => T.value = !1,
8806
- onMouseover: y[3] ||= (e) => T.value = !0
8798
+ style: normalizeStyle(T.value),
8799
+ onClick: b[1] ||= (y) => C("x-click", e.id),
8800
+ onMouseout: b[2] ||= (e) => w.value = !1,
8801
+ onMouseover: b[3] ||= (e) => w.value = !0
8807
8802
  }, [
8808
- createElementVNode("div", _hoisted_1$4, [createElementVNode("span", _hoisted_2$1, toDisplayString(C.title), 1), C.desc ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(C.desc), 1)) : createCommentVNode("", !0)]),
8809
- createVNode(b),
8810
- createVNode(x, {
8803
+ createElementVNode("div", _hoisted_1$4, [createElementVNode("span", _hoisted_2$1, toDisplayString(e.title), 1), e.desc ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(e.desc), 1)) : createCommentVNode("", !0)]),
8804
+ createVNode(x),
8805
+ createVNode(S, {
8811
8806
  class: "x-handle cursor-move mr-3",
8812
8807
  icon: "mdi-drag-horizontal-variant",
8813
- onMousedown: y[0] ||= withModifiers(() => {}, ["stop"])
8814
- }),
8815
- createElementVNode("div", { style: normalizeStyle(D.value) }, null, 4)
8816
- ], 36)), [[S]]);
8808
+ onMousedown: b[0] ||= withModifiers(() => {}, ["stop"])
8809
+ })
8810
+ ], 36)), [[E]]);
8817
8811
  };
8818
8812
  }
8819
8813
  }), _hoisted_1$3 = {
@@ -8910,23 +8904,25 @@ var clean_default = /* @__PURE__ */ defineComponent({
8910
8904
  onMove: E,
8911
8905
  onStart: T
8912
8906
  }, {
8913
- default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(C.value, (e) => (openBlock(), createBlock(item_default, {
8907
+ default: withCtx(() => [(openBlock(!0), createElementBlock(Fragment, null, renderList(C.value, (e, y) => (openBlock(), createBlock(item_default, {
8914
8908
  id: e.id,
8915
8909
  key: e.id,
8916
8910
  desc: e.desc,
8917
8911
  select: e.select,
8918
8912
  title: e.name,
8913
+ first: y === 0,
8919
8914
  onXClick: O
8920
8915
  }, null, 8, [
8921
8916
  "id",
8922
8917
  "desc",
8923
8918
  "select",
8924
- "title"
8919
+ "title",
8920
+ "first"
8925
8921
  ]))), 128))]),
8926
8922
  _: 1
8927
8923
  }, 8, ["modelValue"])) : (openBlock(), createElementBlock("span", _hoisted_1$3, toDisplayString(unref(b)("x-block-lib.noOption")), 1));
8928
8924
  }
8929
- }), [["__scopeId", "data-v-a710550b"]]), blockTree_default = /* @__PURE__ */ defineComponent({
8925
+ }), [["__scopeId", "data-v-5e6d8079"]]), blockTree_default = /* @__PURE__ */ defineComponent({
8930
8926
  __name: "index",
8931
8927
  props: {
8932
8928
  modelValue: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-block-lib",
3
3
  "private": false,
4
- "version": "0.10.8",
4
+ "version": "0.10.9",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -42,8 +42,8 @@
42
42
  "peerDependencies": {
43
43
  "x-error-lib": "^0.5.15",
44
44
  "x-essential-lib": "^0.9.27",
45
- "x-runtime-lib": "^0.8.216",
46
- "x-state-lib": "^0.3.40"
45
+ "x-runtime-lib": "^0.8.221",
46
+ "x-state-lib": "^0.3.41"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@eslint/js": "^10.0.1",