x-block-lib 0.6.26 → 0.6.28

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.
Files changed (2) hide show
  1. package/dist/index.js +15 -63
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1135,86 +1135,38 @@ function Te(e) {
1135
1135
  let t = "";
1136
1136
  if (e.type === "string") {
1137
1137
  let n = "";
1138
- typeof e.default == "string" && (n = e.default), t = `
1139
- <shadow type="text_v1">
1140
- <field name="TEXT">
1141
- ${n}
1142
- </field>
1143
- </shadow>
1144
- `;
1138
+ typeof e.default == "string" && (n = e.default), t = `<shadow type="text_v1"><field name="TEXT">${n}</field></shadow>`;
1145
1139
  } else if (e.type === "number") {
1146
1140
  let n = 0;
1147
- typeof e.default == "number" && (n = e.default), t = `
1148
- <shadow type="math_number_v1">
1149
- <field name="NUM">
1150
- ${n}
1151
- </field>
1152
- </shadow>
1153
- `;
1141
+ typeof e.default == "number" && (n = e.default), t = `<shadow type="math_number_v1"><field name="NUM">${n}</field></shadow>`;
1154
1142
  } else if (e.type === "boolean") {
1155
1143
  let n = "FALSE";
1156
- typeof e.default == "boolean" && (n = e.default ? "TRUE" : "FALSE"), t = `
1157
- <shadow type="logic_boolean_v1">
1158
- <field name="BOOL">
1159
- ${n}
1160
- </field>
1161
- </shadow>
1162
- `;
1163
- } else e.type === "comp" ? t = `
1164
- <shadow type="select_comp_v1">
1165
- </shadow>
1166
- ` : console.assert(!1, "invalid param type", e.type);
1144
+ typeof e.default == "boolean" && (n = e.default ? "TRUE" : "FALSE"), t = `<shadow type="logic_boolean_v1"><field name="BOOL">${n}</field></shadow>`;
1145
+ } else e.type === "comp" ? t = '<shadow type="select_comp_v1"></shadow>' : console.assert(!1, "invalid param type", e.type);
1167
1146
  return W.xml.textToDom(t);
1168
1147
  }
1169
1148
  function kr(e, t) {
1170
- const n = `
1171
- <block type="text_v1">
1172
- <field name="TEXT">
1173
- ${t}
1174
- </field>
1175
- </block>
1176
- `, o = W.xml.textToDom(n);
1149
+ const n = `<block type="text_v1"><field name="TEXT">${t}</field></block>`, o = W.xml.textToDom(n);
1177
1150
  return zt.domToBlock(o, e);
1178
1151
  }
1179
1152
  function Nr(e, t) {
1180
- const n = `
1181
- <block type="math_number_v1">
1182
- <field name="NUM">
1183
- ${t}
1184
- </field>
1185
- </block>
1186
- `, o = W.xml.textToDom(n);
1153
+ const n = `<block type="math_number_v1"><field name="NUM">${t}</field></block>`, o = W.xml.textToDom(n);
1187
1154
  return zt.domToBlock(o, e);
1188
1155
  }
1189
1156
  function Sr(e, t) {
1190
- const o = `
1191
- <block type="logic_boolean_v1">
1192
- <field name="BOOL">
1193
- ${t ? "TRUE" : "FALSE"}
1194
- </field>
1195
- </block>
1196
- `, i = W.xml.textToDom(o);
1157
+ const o = `<block type="logic_boolean_v1"><field name="BOOL">${t ? "TRUE" : "FALSE"}</field></block>`, i = W.xml.textToDom(o);
1197
1158
  return zt.domToBlock(i, e);
1198
1159
  }
1199
1160
  function Lr(e, t) {
1200
- const o = `
1201
- <block type="${jo(t)}">
1202
- </block>
1203
- `, i = W.xml.textToDom(o);
1161
+ const o = `<block type="${jo(t)}"></block>`, i = W.xml.textToDom(o);
1204
1162
  return zt.domToBlock(i, e);
1205
1163
  }
1206
1164
  function Br(e, t) {
1207
- const o = `
1208
- <block type="${jo(t)}">
1209
- </block>
1210
- `, i = W.xml.textToDom(o);
1165
+ const o = `<block type="${jo(t)}"></block>`, i = W.xml.textToDom(o);
1211
1166
  return zt.domToBlock(i, e);
1212
1167
  }
1213
1168
  function Rr(e) {
1214
- const n = W.xml.textToDom(`
1215
- <block type="select_comp_v1">
1216
- </block>
1217
- `);
1169
+ const n = W.xml.textToDom('<block type="select_comp_v1"></block>');
1218
1170
  return zt.domToBlock(n, e);
1219
1171
  }
1220
1172
  function rs(e, t, n, o) {
@@ -2442,7 +2394,7 @@ const wr = {
2442
2394
  };
2443
2395
  function Vr() {
2444
2396
  const { comps: e } = L.app.activeApp;
2445
- return [...e, wr];
2397
+ return [wr, ...e];
2446
2398
  }
2447
2399
  function fa(e) {
2448
2400
  return e === "" ? wr : L.app.activeApp.comps.find((t) => t.id === e);
@@ -3216,14 +3168,14 @@ const df = {
3216
3168
  n && n.dispose();
3217
3169
  let o = null;
3218
3170
  const i = e.raw;
3219
- i.ui === "dummy" ? console.assert(!0) : i.ui === "strInput" ? o = kr(this.workspace, i.default) : i.ui === "numInput" ? o = Nr(this.workspace, i.default) : i.ui === "switch" ? o = Sr(this.workspace, i.default) : i.ui === "select" ? o = Lr(this.workspace, i.items) : i.ui === "multiTypes" ? o = Br(this.workspace, i.types) : (i.ui === "compSelect" || i.ui === "slotSelect") && (o = Rr(this.workspace)), o && (t.connection.setCheck(null), t.connection.connect(o.outputConnection));
3171
+ i.ui === "dummy" ? console.assert(!0) : i.ui === "strInput" ? o = kr(this.workspace, i.default) : i.ui === "numInput" ? o = Nr(this.workspace, i.default) : i.ui === "switch" ? o = Sr(this.workspace, i.default) : i.ui === "select" ? o = Lr(this.workspace, i.items) : i.ui === "multiTypes" ? o = Br(this.workspace, i.types) : i.ui === "compSelect" && (o = Rr(this.workspace)), o && (t.connection.setCheck(null), t.connection.connect(o.outputConnection));
3220
3172
  },
3221
3173
  updateCheck_: function() {
3222
3174
  const e = Rt(this.node.id, this.prop.keys);
3223
3175
  if (!e)
3224
3176
  return;
3225
3177
  const t = this.getInput("VALUE"), n = e.raw;
3226
- n.ui === "strInput" ? t.setCheck("String") : n.ui === "numInput" ? t.setCheck("Number") : n.ui === "switch" ? t.setCheck("Boolean") : n.ui === "colorPicker" ? t.setCheck("Colour") : n.ui === "select" ? t.setCheck(gn(n.items)) : n.ui === "multiTypes" ? t.setCheck(gn(n.types)) : n.ui === "compSelect" || n.ui === "slotSelect" ? t.setCheck("Comp") : t.setCheck(null);
3178
+ n.ui === "strInput" ? t.setCheck("String") : n.ui === "numInput" ? t.setCheck("Number") : n.ui === "switch" ? t.setCheck("Boolean") : n.ui === "colorPicker" ? t.setCheck("Colour") : n.ui === "select" ? t.setCheck(gn(n.items)) : n.ui === "multiTypes" ? t.setCheck(gn(n.types)) : n.ui === "compSelect" ? t.setCheck("Comp") : t.setCheck(null);
3227
3179
  },
3228
3180
  checkWarning_: function() {
3229
3181
  const e = He(this.node.id);
@@ -3336,14 +3288,14 @@ const hf = {
3336
3288
  n && n.dispose();
3337
3289
  let o = null;
3338
3290
  const i = e.raw;
3339
- i.ui === "dummy" ? console.assert(!0) : i.ui === "strInput" ? o = kr(this.workspace, i.default) : i.ui === "numInput" ? o = Nr(this.workspace, i.default) : i.ui === "switch" ? o = Sr(this.workspace, i.default) : i.ui === "select" ? o = Lr(this.workspace, i.items) : i.ui === "multiTypes" ? o = Br(this.workspace, i.types) : (i.ui === "compSelect" || i.ui === "slotSelect") && (o = Rr(this.workspace)), o && (t.connection.setCheck(null), t.connection.connect(o.outputConnection));
3291
+ i.ui === "dummy" ? console.assert(!0) : i.ui === "strInput" ? o = kr(this.workspace, i.default) : i.ui === "numInput" ? o = Nr(this.workspace, i.default) : i.ui === "switch" ? o = Sr(this.workspace, i.default) : i.ui === "select" ? o = Lr(this.workspace, i.items) : i.ui === "multiTypes" ? o = Br(this.workspace, i.types) : i.ui === "compSelect" && (o = Rr(this.workspace)), o && (t.connection.setCheck(null), t.connection.connect(o.outputConnection));
3340
3292
  },
3341
3293
  updateCheck_: function() {
3342
3294
  const e = Bt(this.element.key, this.prop.keys);
3343
3295
  if (!e)
3344
3296
  return;
3345
3297
  const t = this.getInput("VALUE"), n = e.raw;
3346
- n.ui === "strInput" ? t.setCheck("String") : n.ui === "numInput" ? t.setCheck("Number") : n.ui === "switch" ? t.setCheck("Boolean") : n.ui === "colorPicker" ? t.setCheck("Colour") : n.ui === "select" ? t.setCheck(gn(n.items)) : n.ui === "multiTypes" ? t.setCheck(gn(n.types)) : n.ui === "compSelect" || n.ui === "slotSelect" ? t.setCheck("Comp") : t.setCheck(null);
3298
+ n.ui === "strInput" ? t.setCheck("String") : n.ui === "numInput" ? t.setCheck("Number") : n.ui === "switch" ? t.setCheck("Boolean") : n.ui === "colorPicker" ? t.setCheck("Colour") : n.ui === "select" ? t.setCheck(gn(n.items)) : n.ui === "multiTypes" ? t.setCheck(gn(n.types)) : n.ui === "compSelect" ? t.setCheck("Comp") : t.setCheck(null);
3347
3299
  },
3348
3300
  checkWarning_: function() {
3349
3301
  const e = Yt(this.element.key);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-block-lib",
3
3
  "private": false,
4
- "version": "0.6.26",
4
+ "version": "0.6.28",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -32,7 +32,7 @@
32
32
  "vue-draggable-plus": "^0.6.0",
33
33
  "vuetify": "^3.8.1",
34
34
  "x-essential-lib": "^0.8.6",
35
- "x-runtime-lib": "^0.6.33",
35
+ "x-runtime-lib": "^0.6.41",
36
36
  "x-state-lib": "^0.2.1"
37
37
  },
38
38
  "devDependencies": {