x-block-lib 0.4.22 → 0.4.23
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/blockly-jce3d2r3.js +15890 -0
- package/dist/components/blockly/navigator/blockList/item.vue.d.ts +0 -1
- package/dist/components/blockly/navigator/blockTree/index.vue.d.ts +2 -0
- package/dist/components/blockly/navigator/index.vue.d.ts +4 -1
- package/dist/components/blockly/workspace.d.ts +1 -1
- package/dist/index.js +922 -918
- package/package.json +1 -1
- package/dist/blockly-ou5p4kro.js +0 -15892
package/dist/index.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.id="x-block-lib",o.appendChild(document.createTextNode(".ghost[data-v-
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var he = (e, o, t) =>
|
|
5
|
-
import { getCurrentScope as
|
|
6
|
-
import { d as g, j as a, O as
|
|
7
|
-
import { storeToRefs as
|
|
8
|
-
import { openConfirmDlg as
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.id="x-block-lib",o.appendChild(document.createTextNode(".ghost[data-v-91f61557]{opacity:.4;pointer-events:none}.blocklyToolboxDiv{overflow-x:hidden;width:56px}.blocklyMainBackground{stroke-width:0}.blocklyToolboxCategory{margin-bottom:10px}.blocklyTreeRow{height:28px;display:flex;align-items:center;border-left-width:6px!important;border-right-width:6px!important}.blocklyTreeIcon{display:none!important}.blocklyFlyout{z-index:21}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
+
var xn = Object.defineProperty;
|
|
3
|
+
var Pn = (e, o, t) => o in e ? xn(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
4
|
+
var he = (e, o, t) => Pn(e, typeof o != "symbol" ? o + "" : o, t);
|
|
5
|
+
import { getCurrentScope as wn, onScopeDispose as Vn, unref as N, computed as ue, watch as He, ref as Je, getCurrentInstance as Pt, onMounted as ze, defineComponent as we, onBeforeUnmount as Nt, resolveComponent as oe, openBlock as J, createBlock as Le, withCtx as je, createVNode as ne, mergeProps as mo, useModel as co, toRefs as Un, reactive as Yn, h as Kn, onUnmounted as Fn, nextTick as go, isRef as vt, resolveDirective as Hn, withDirectives as Gn, createElementBlock as ke, normalizeStyle as Ne, createElementVNode as ve, toDisplayString as Eo, withModifiers as yt, Fragment as Zo, renderList as Xn, withKeys as $n, createCommentVNode as nt, mergeModels as Lo, useTemplateRef as jn } from "vue";
|
|
6
|
+
import { d as g, j as a, O as c, u as m, X as Wn, B as _e, E as F, M as j, i as wt, a as De, b as V, C as en, F as vo, c as Jn, P as uo, N as yo, V as bt, e as zn, f as tn, s as qn, g as Pe, S as z, h as Jt, k as Ke, l as _t, m as zt, n as Qe, o as xe, p as ko, G as qt, q as Qn, r as Zn, t as Qt, U as pt, D as dt, v as Ve, w as ei, T as Vt, x as on, y as ti, z as oi, A as No, H as ni } from "./blockly-jce3d2r3.js";
|
|
7
|
+
import { storeToRefs as ii } from "pinia";
|
|
8
|
+
import { openConfirmDlg as ri, openPromptDlg as li, eventBus as Te, useColor as nn, useViewStack as bo, useSystem as ai, useGlobalStore as si } from "x-essential-lib";
|
|
9
9
|
import { useI18n as Ut } from "vue-i18n";
|
|
10
|
-
import { useDisplay as
|
|
11
|
-
var
|
|
12
|
-
function Ti(e) {
|
|
13
|
-
return Pn() ? (wn(e), !0) : !1;
|
|
14
|
-
}
|
|
10
|
+
import { useDisplay as ci } from "vuetify";
|
|
11
|
+
var ui = "M19.36,2.72L20.78,4.14L15.06,9.85C16.13,11.39 16.28,13.24 15.38,14.44L9.06,8.12C10.26,7.22 12.11,7.37 13.65,8.44L19.36,2.72M5.93,17.57C3.92,15.56 2.69,13.16 2.35,10.92L7.23,8.83L14.67,16.27L12.58,21.15C10.34,20.81 7.94,19.58 5.93,17.57Z", _i = "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z", pi = "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z", di = "M21 11H3V9H21V11M21 13H3V15H21V13Z", fi = "M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z", hi = "M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6C4.89,22 4,21.1 4,20V10A2,2 0 0,1 6,8H15V6A3,3 0 0,0 12,3A3,3 0 0,0 9,6H7A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,17A2,2 0 0,0 14,15A2,2 0 0,0 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17Z", Ti = "M21 3L3 10.53V11.5L9.84 14.16L12.5 21H13.46L21 3Z";
|
|
15
12
|
function mi(e) {
|
|
13
|
+
return wn() ? (Vn(e), !0) : !1;
|
|
14
|
+
}
|
|
15
|
+
function gi(e) {
|
|
16
16
|
return typeof e == "function" ? e() : N(e);
|
|
17
17
|
}
|
|
18
|
-
const
|
|
18
|
+
const Ei = typeof window < "u" && typeof document < "u";
|
|
19
19
|
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
20
20
|
function So(e) {
|
|
21
21
|
var o;
|
|
22
|
-
const t =
|
|
22
|
+
const t = gi(e);
|
|
23
23
|
return (o = t == null ? void 0 : t.$el) != null ? o : t;
|
|
24
24
|
}
|
|
25
|
-
const
|
|
26
|
-
function
|
|
27
|
-
const e =
|
|
28
|
-
return o &&
|
|
25
|
+
const vi = Ei ? window : void 0;
|
|
26
|
+
function yi() {
|
|
27
|
+
const e = Je(!1), o = Pt();
|
|
28
|
+
return o && ze(() => {
|
|
29
29
|
e.value = !0;
|
|
30
30
|
}, o), e;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
const o =
|
|
32
|
+
function bi(e) {
|
|
33
|
+
const o = yi();
|
|
34
34
|
return ue(() => (o.value, !!e()));
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
const { window: n =
|
|
36
|
+
function Oi(e, o, t = {}) {
|
|
37
|
+
const { window: n = vi, ...i } = t;
|
|
38
38
|
let r;
|
|
39
|
-
const l =
|
|
39
|
+
const l = bi(() => n && "ResizeObserver" in n), s = () => {
|
|
40
40
|
r && (r.disconnect(), r = void 0);
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
(
|
|
44
|
-
if (
|
|
41
|
+
}, u = ue(() => Array.isArray(e) ? e.map((p) => So(p)) : [So(e)]), _ = He(
|
|
42
|
+
u,
|
|
43
|
+
(p) => {
|
|
44
|
+
if (s(), l.value && n) {
|
|
45
45
|
r = new ResizeObserver(o);
|
|
46
|
-
for (const T of
|
|
46
|
+
for (const T of p)
|
|
47
47
|
T && r.observe(T, i);
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
{ immediate: !0, flush: "post" }
|
|
51
|
-
),
|
|
52
|
-
|
|
51
|
+
), d = () => {
|
|
52
|
+
s(), _();
|
|
53
53
|
};
|
|
54
|
-
return
|
|
54
|
+
return mi(d), {
|
|
55
55
|
isSupported: l,
|
|
56
|
-
stop:
|
|
56
|
+
stop: d
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
g([
|
|
@@ -87,7 +87,7 @@ g([
|
|
|
87
87
|
}
|
|
88
88
|
]);
|
|
89
89
|
a.forBlock.color_blend_v1 = function(e) {
|
|
90
|
-
const o = a.valueToCode(e, "COLOR1",
|
|
90
|
+
const o = a.valueToCode(e, "COLOR1", c.NONE) || "'#ffffff'", t = a.valueToCode(e, "COLOR2", c.NONE) || "'#000000'", n = a.valueToCode(e, "RATIO", c.NONE) || 0.5;
|
|
91
91
|
return [`${a.provideFunction_(
|
|
92
92
|
"colorBlend",
|
|
93
93
|
`
|
|
@@ -108,7 +108,7 @@ function ${a.FUNCTION_NAME_PLACEHOLDER_}(c1, c2, ratio) {
|
|
|
108
108
|
return '#' + r + g + b;
|
|
109
109
|
}
|
|
110
110
|
`
|
|
111
|
-
)}(${o}, ${t}, ${n})`,
|
|
111
|
+
)}(${o}, ${t}, ${n})`, c.FUNCTION_CALL];
|
|
112
112
|
};
|
|
113
113
|
g([
|
|
114
114
|
{
|
|
@@ -128,7 +128,7 @@ g([
|
|
|
128
128
|
}
|
|
129
129
|
]);
|
|
130
130
|
a.forBlock.color_picker_v1 = function(e) {
|
|
131
|
-
return [a.quote_(e.getFieldValue("COLOR")),
|
|
131
|
+
return [a.quote_(e.getFieldValue("COLOR")), c.ATOMIC];
|
|
132
132
|
};
|
|
133
133
|
g([
|
|
134
134
|
{
|
|
@@ -149,7 +149,7 @@ function ${a.FUNCTION_NAME_PLACEHOLDER_}() {
|
|
|
149
149
|
return '#' + ('00000' + num.toString(16)).substr(-6);
|
|
150
150
|
}
|
|
151
151
|
`
|
|
152
|
-
)}()`,
|
|
152
|
+
)}()`, c.FUNCTION_CALL];
|
|
153
153
|
};
|
|
154
154
|
g([
|
|
155
155
|
{
|
|
@@ -182,7 +182,7 @@ g([
|
|
|
182
182
|
}
|
|
183
183
|
]);
|
|
184
184
|
a.forBlock.color_rgb_v1 = function(e) {
|
|
185
|
-
const o = a.valueToCode(e, "RED",
|
|
185
|
+
const o = a.valueToCode(e, "RED", c.NONE) || 0, t = a.valueToCode(e, "GREEN", c.NONE) || 0, n = a.valueToCode(e, "BLUE", c.NONE) || 0;
|
|
186
186
|
return [`${a.provideFunction_(
|
|
187
187
|
"colorRgb",
|
|
188
188
|
`
|
|
@@ -196,9 +196,9 @@ function ${a.FUNCTION_NAME_PLACEHOLDER_}(r, g, b) {
|
|
|
196
196
|
return '#' + r + g + b;
|
|
197
197
|
}
|
|
198
198
|
`
|
|
199
|
-
)}(${o}, ${t}, ${n})`,
|
|
199
|
+
)}(${o}, ${t}, ${n})`, c.FUNCTION_CALL];
|
|
200
200
|
};
|
|
201
|
-
const
|
|
201
|
+
const Ii = function() {
|
|
202
202
|
if (!window.blocklyState) {
|
|
203
203
|
const e = {
|
|
204
204
|
runtime: {
|
|
@@ -228,7 +228,7 @@ const Oi = function() {
|
|
|
228
228
|
}
|
|
229
229
|
return window.blocklyState;
|
|
230
230
|
}();
|
|
231
|
-
function
|
|
231
|
+
function ft(e) {
|
|
232
232
|
let o = "";
|
|
233
233
|
if (e.type === "string") {
|
|
234
234
|
let t = "";
|
|
@@ -244,10 +244,10 @@ function dt(e) {
|
|
|
244
244
|
return m.xml.textToDom(o);
|
|
245
245
|
}
|
|
246
246
|
function rn(e, o, t) {
|
|
247
|
-
const n = `<xml><block type="parameter_v1"><mutation key="${o}" name="${t}"/></block></xml>`, i = m.xml.textToDom(n), r =
|
|
247
|
+
const n = `<xml><block type="parameter_v1"><mutation key="${o}" name="${t}"/></block></xml>`, i = m.xml.textToDom(n), r = Wn.domToWorkspace(i, e);
|
|
248
248
|
return e.getBlockById(r[0]);
|
|
249
249
|
}
|
|
250
|
-
const
|
|
250
|
+
const Ci = m.xml, Ai = [
|
|
251
251
|
{
|
|
252
252
|
type: "call_func_v1",
|
|
253
253
|
prefixInputs: ["OUTPUT"]
|
|
@@ -277,17 +277,17 @@ const Ii = m.xml, Ci = [
|
|
|
277
277
|
prefixInputs: ["ARG"]
|
|
278
278
|
}
|
|
279
279
|
];
|
|
280
|
-
function
|
|
280
|
+
function Li(e, o) {
|
|
281
281
|
var n, i;
|
|
282
|
-
const t =
|
|
282
|
+
const t = Ai.find((r) => r.type === e);
|
|
283
283
|
return t ? !!((n = t.prefixInputs) != null && n.some((r) => o.startsWith(r)) || (i = t.inputs) != null && i.some((r) => r === o)) : !1;
|
|
284
284
|
}
|
|
285
|
-
const
|
|
285
|
+
const ki = {
|
|
286
286
|
init: function() {
|
|
287
287
|
this.key = "", this.name = "", this.appendDummyInput().appendField("", "LABEL"), this.setOutput(!0), this.setColour(220);
|
|
288
288
|
},
|
|
289
289
|
mutationToDom: function() {
|
|
290
|
-
const e =
|
|
290
|
+
const e = Ci.createElement("mutation");
|
|
291
291
|
return e.setAttribute("key", this.key), e.setAttribute("name", this.name), e;
|
|
292
292
|
},
|
|
293
293
|
domToMutation: function(e) {
|
|
@@ -306,7 +306,7 @@ const Li = {
|
|
|
306
306
|
this.key = e, this.name = o, this.updateShape_();
|
|
307
307
|
},
|
|
308
308
|
onchange: function(e) {
|
|
309
|
-
if (e.type ===
|
|
309
|
+
if (e.type === F.BLOCK_MOVE) {
|
|
310
310
|
const o = e;
|
|
311
311
|
if (o.blockId !== this.id)
|
|
312
312
|
return;
|
|
@@ -316,39 +316,39 @@ const Li = {
|
|
|
316
316
|
tryDuplicate_: function(e) {
|
|
317
317
|
var t;
|
|
318
318
|
const o = this.workspace.getBlockById(e.oldParentId);
|
|
319
|
-
if (o &&
|
|
319
|
+
if (o && Li(o.type, e.oldInputName))
|
|
320
320
|
try {
|
|
321
|
-
|
|
321
|
+
F.disable();
|
|
322
322
|
const n = (t = o.getInput(e.oldInputName)) == null ? void 0 : t.connection;
|
|
323
323
|
if (n) {
|
|
324
324
|
const i = rn(this.workspace, this.key, this.name);
|
|
325
325
|
n.connect(i.outputConnection);
|
|
326
326
|
}
|
|
327
327
|
} finally {
|
|
328
|
-
|
|
328
|
+
F.enable();
|
|
329
329
|
}
|
|
330
330
|
},
|
|
331
331
|
updateShape_: function() {
|
|
332
332
|
this.name ? this.setFieldValue(j[this.name], "LABEL") : this.setFieldValue(this.key, "LABEL");
|
|
333
333
|
}
|
|
334
334
|
};
|
|
335
|
-
_e.parameter_v1 =
|
|
335
|
+
_e.parameter_v1 = ki;
|
|
336
336
|
a.forBlock.parameter_v1 = function(e) {
|
|
337
|
-
return [e.key,
|
|
337
|
+
return [e.key, c.ATOMIC];
|
|
338
338
|
};
|
|
339
|
-
const
|
|
339
|
+
const Ni = m.xml, Si = {
|
|
340
340
|
init: function() {
|
|
341
341
|
this.appendDummyInput().appendField("%{BKY_LIST_V1_CREATE_CONTAINER_TITLE}"), this.appendStatementInput("STACK"), this.setStyle("list_blocks"), this.contextMenu = !1;
|
|
342
342
|
}
|
|
343
343
|
};
|
|
344
|
-
_e.list_create_container_v1 =
|
|
345
|
-
const
|
|
344
|
+
_e.list_create_container_v1 = Si;
|
|
345
|
+
const Bi = {
|
|
346
346
|
init: function() {
|
|
347
347
|
this.appendDummyInput().appendField("%{BKY_LIST_V1_CREATE_ITEM_TITLE}"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("list_blocks"), this.contextMenu = !1;
|
|
348
348
|
}
|
|
349
349
|
};
|
|
350
|
-
_e.list_create_item_v1 =
|
|
351
|
-
const
|
|
350
|
+
_e.list_create_item_v1 = Bi;
|
|
351
|
+
const Ri = {
|
|
352
352
|
init: function() {
|
|
353
353
|
this.itemCount_ = 0, this.setMutator(
|
|
354
354
|
new wt.MutatorIcon(
|
|
@@ -358,7 +358,7 @@ const Bi = {
|
|
|
358
358
|
), this.setOutput(!0, "Array"), this.setStyle("list_blocks"), this.setTooltip("%{BKY_LIST_V1_CREATE_TOOLTIP}"), this.setHelpUrl("%{BKY_LIST_V1_CREATE_HELPURL}");
|
|
359
359
|
},
|
|
360
360
|
mutationToDom: function() {
|
|
361
|
-
const e =
|
|
361
|
+
const e = Ni.createElement("mutation");
|
|
362
362
|
return e.setAttribute("items", String(this.itemCount_)), e;
|
|
363
363
|
},
|
|
364
364
|
domToMutation: function(e) {
|
|
@@ -426,18 +426,18 @@ const Bi = {
|
|
|
426
426
|
for (let e = 0; e < this.itemCount_; e++)
|
|
427
427
|
if (!this.getInput("ADD" + e)) {
|
|
428
428
|
const o = this.appendValueInput("ADD" + e);
|
|
429
|
-
e === 0 && (o.setAlign(
|
|
429
|
+
e === 0 && (o.setAlign(De.Align.RIGHT), o.appendField("%{BKY_LIST_V1_CREATE_TITLE}"));
|
|
430
430
|
}
|
|
431
431
|
for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
|
|
432
432
|
this.removeInput("ADD" + e);
|
|
433
433
|
}
|
|
434
434
|
};
|
|
435
|
-
_e.list_create_v1 =
|
|
435
|
+
_e.list_create_v1 = Ri;
|
|
436
436
|
a.forBlock.list_create_v1 = function(e) {
|
|
437
437
|
const o = e, t = new Array(o.itemCount_);
|
|
438
438
|
for (let i = 0; i < o.itemCount_; i++)
|
|
439
|
-
t[i] = a.valueToCode(o, "ADD" + i,
|
|
440
|
-
return ["[" + t.join(", ") + "]",
|
|
439
|
+
t[i] = a.valueToCode(o, "ADD" + i, c.NONE) || "null";
|
|
440
|
+
return ["[" + t.join(", ") + "]", c.ATOMIC];
|
|
441
441
|
};
|
|
442
442
|
g([
|
|
443
443
|
{
|
|
@@ -464,7 +464,7 @@ g([
|
|
|
464
464
|
}
|
|
465
465
|
]);
|
|
466
466
|
a.forBlock.list_delete_v1 = function(e) {
|
|
467
|
-
const o = a.valueToCode(e, "VALUE",
|
|
467
|
+
const o = a.valueToCode(e, "VALUE", c.MEMBER) || "[]", t = a.getAdjusted(e, "AT");
|
|
468
468
|
return `${o}.splice(${t}, 1)`;
|
|
469
469
|
};
|
|
470
470
|
g([
|
|
@@ -491,8 +491,8 @@ g([
|
|
|
491
491
|
}
|
|
492
492
|
]);
|
|
493
493
|
a.forBlock.list_get_v1 = function(e) {
|
|
494
|
-
const o = a.valueToCode(e, "VALUE",
|
|
495
|
-
return [`${o}[${t}]`,
|
|
494
|
+
const o = a.valueToCode(e, "VALUE", c.MEMBER) || "[]", t = a.getAdjusted(e, "AT");
|
|
495
|
+
return [`${o}[${t}]`, c.MEMBER];
|
|
496
496
|
};
|
|
497
497
|
g([
|
|
498
498
|
{
|
|
@@ -523,8 +523,8 @@ g([
|
|
|
523
523
|
}
|
|
524
524
|
]);
|
|
525
525
|
a.forBlock.list_get_sublist_v1 = function(e) {
|
|
526
|
-
const o = a.valueToCode(e, "LIST",
|
|
527
|
-
return [`${o}.slice(${t}, ${n})`,
|
|
526
|
+
const o = a.valueToCode(e, "LIST", c.MEMBER) || "[]", t = a.getAdjusted(e, "START"), n = a.getAdjusted(e, "END", 1);
|
|
527
|
+
return [`${o}.slice(${t}, ${n})`, c.FUNCTION_CALL];
|
|
528
528
|
};
|
|
529
529
|
g([
|
|
530
530
|
{
|
|
@@ -544,7 +544,7 @@ g([
|
|
|
544
544
|
}
|
|
545
545
|
]);
|
|
546
546
|
a.forBlock.list_is_empty_v1 = function(e) {
|
|
547
|
-
return [`!${a.valueToCode(e, "VALUE",
|
|
547
|
+
return [`!${a.valueToCode(e, "VALUE", c.MEMBER) || "[]"}.length`, c.LOGICAL_NOT];
|
|
548
548
|
};
|
|
549
549
|
g([
|
|
550
550
|
{
|
|
@@ -570,8 +570,8 @@ g([
|
|
|
570
570
|
}
|
|
571
571
|
]);
|
|
572
572
|
a.forBlock.list_join_v1 = function(e) {
|
|
573
|
-
const o = a.valueToCode(e, "LIST",
|
|
574
|
-
return [`${o}.join(${t})`,
|
|
573
|
+
const o = a.valueToCode(e, "LIST", c.MEMBER) || "[]", t = a.valueToCode(e, "DELIM", c.NONE) || "''";
|
|
574
|
+
return [`${o}.join(${t})`, c.FUNCTION_CALL];
|
|
575
575
|
};
|
|
576
576
|
g([
|
|
577
577
|
{
|
|
@@ -591,7 +591,7 @@ g([
|
|
|
591
591
|
}
|
|
592
592
|
]);
|
|
593
593
|
a.forBlock.list_length_v1 = function(e) {
|
|
594
|
-
return [`${a.valueToCode(e, "VALUE",
|
|
594
|
+
return [`${a.valueToCode(e, "VALUE", c.MEMBER) || "[]"}.length`, c.MEMBER];
|
|
595
595
|
};
|
|
596
596
|
g([
|
|
597
597
|
{
|
|
@@ -612,7 +612,7 @@ g([
|
|
|
612
612
|
}
|
|
613
613
|
]);
|
|
614
614
|
a.forBlock.list_reverse_v1 = function(e) {
|
|
615
|
-
return [`${a.valueToCode(e, "LIST",
|
|
615
|
+
return [`${a.valueToCode(e, "LIST", c.NONE) || "[]"}.slice().reverse()`, c.FUNCTION_CALL];
|
|
616
616
|
};
|
|
617
617
|
g([
|
|
618
618
|
{
|
|
@@ -644,11 +644,11 @@ g([
|
|
|
644
644
|
}
|
|
645
645
|
]);
|
|
646
646
|
a.forBlock.list_set_v1 = function(e) {
|
|
647
|
-
const o = a.valueToCode(e, "LIST",
|
|
647
|
+
const o = a.valueToCode(e, "LIST", c.MEMBER) || "[]", t = a.getAdjusted(e, "AT"), n = a.valueToCode(e, "VALUE", c.ASSIGNMENT) || "null";
|
|
648
648
|
return `${o}[${t}] = ${n};
|
|
649
649
|
`;
|
|
650
650
|
};
|
|
651
|
-
const
|
|
651
|
+
const Mi = {
|
|
652
652
|
// logic_compare
|
|
653
653
|
EQ: "%{BKY_LOGIC_V1_COMPARE_TOOLTIP_EQ}",
|
|
654
654
|
NEQ: "%{BKY_LOGIC_V1_COMPARE_TOOLTIP_NEQ}",
|
|
@@ -662,7 +662,7 @@ const Ri = {
|
|
|
662
662
|
};
|
|
663
663
|
V.register(
|
|
664
664
|
"logic_op_tooltip_v1",
|
|
665
|
-
V.buildTooltipForDropdown("OP",
|
|
665
|
+
V.buildTooltipForDropdown("OP", Mi)
|
|
666
666
|
);
|
|
667
667
|
g([
|
|
668
668
|
{
|
|
@@ -685,9 +685,9 @@ g([
|
|
|
685
685
|
}
|
|
686
686
|
]);
|
|
687
687
|
a.forBlock.logic_boolean_v1 = function(e) {
|
|
688
|
-
return [e.getFieldValue("BOOL") === "TRUE" ? "true" : "false",
|
|
688
|
+
return [e.getFieldValue("BOOL") === "TRUE" ? "true" : "false", c.ATOMIC];
|
|
689
689
|
};
|
|
690
|
-
const
|
|
690
|
+
const Di = {
|
|
691
691
|
onchange: function(e) {
|
|
692
692
|
this.prevBlocks_ || (this.prevBlocks_ = [null, null]);
|
|
693
693
|
const o = this.getInputTargetBlock("A"), t = this.getInputTargetBlock("B");
|
|
@@ -695,11 +695,11 @@ const Mi = {
|
|
|
695
695
|
o.outputConnection,
|
|
696
696
|
t.outputConnection
|
|
697
697
|
)) {
|
|
698
|
-
|
|
698
|
+
F.setGroup(e.group);
|
|
699
699
|
const n = this.prevBlocks_[0];
|
|
700
700
|
n !== o && (o.unplug(), n && !n.isDisposed() && !n.isShadow() && this.getInput("A").connection.connect(n.outputConnection));
|
|
701
701
|
const i = this.prevBlocks_[1];
|
|
702
|
-
i !== t && (t.unplug(), i && !i.isDisposed() && !i.isShadow() && this.getInput("B").connection.connect(i.outputConnection)), this.bumpNeighbours(),
|
|
702
|
+
i !== t && (t.unplug(), i && !i.isDisposed() && !i.isShadow() && this.getInput("B").connection.connect(i.outputConnection)), this.bumpNeighbours(), F.setGroup(!1);
|
|
703
703
|
}
|
|
704
704
|
this.prevBlocks_[0] = this.getInputTargetBlock("A"), this.prevBlocks_[1] = this.getInputTargetBlock("B");
|
|
705
705
|
}
|
|
@@ -707,7 +707,7 @@ const Mi = {
|
|
|
707
707
|
V.register(
|
|
708
708
|
"logic_compare_v1",
|
|
709
709
|
function() {
|
|
710
|
-
this.mixin(
|
|
710
|
+
this.mixin(Di);
|
|
711
711
|
}
|
|
712
712
|
);
|
|
713
713
|
g([
|
|
@@ -752,12 +752,12 @@ a.forBlock.logic_compare_v1 = function(e) {
|
|
|
752
752
|
GT: ">",
|
|
753
753
|
GTE: ">="
|
|
754
754
|
}[e.getFieldValue("OP")];
|
|
755
|
-
let n =
|
|
756
|
-
(t === "==" || t === "!=") && (n =
|
|
755
|
+
let n = c.RELATIONAL;
|
|
756
|
+
(t === "==" || t === "!=") && (n = c.EQUALITY);
|
|
757
757
|
const i = a.valueToCode(e, "A", n) || "0", r = a.valueToCode(e, "B", n) || "0";
|
|
758
758
|
return [`${i} ${t} ${r}`, n];
|
|
759
759
|
};
|
|
760
|
-
const
|
|
760
|
+
const xi = {
|
|
761
761
|
elseIfCount_: 0,
|
|
762
762
|
hasElse_: !1,
|
|
763
763
|
mutationToDom: function() {
|
|
@@ -885,7 +885,7 @@ const Di = {
|
|
|
885
885
|
};
|
|
886
886
|
V.registerMutator(
|
|
887
887
|
"logic_if_v1_mutator",
|
|
888
|
-
|
|
888
|
+
xi,
|
|
889
889
|
void 0,
|
|
890
890
|
["logic_if_else_if_v1", "logic_if_else_v1"]
|
|
891
891
|
);
|
|
@@ -944,7 +944,7 @@ a.forBlock.logic_if_v1 = function(e) {
|
|
|
944
944
|
e
|
|
945
945
|
));
|
|
946
946
|
do {
|
|
947
|
-
const n = a.valueToCode(e, "IF" + o,
|
|
947
|
+
const n = a.valueToCode(e, "IF" + o, c.NONE) || "false";
|
|
948
948
|
let i = a.statementToCode(e, "DO" + o);
|
|
949
949
|
a.STATEMENT_SUFFIX && (i = a.prefixLines(
|
|
950
950
|
a.injectId(
|
|
@@ -987,7 +987,7 @@ g([
|
|
|
987
987
|
}
|
|
988
988
|
]);
|
|
989
989
|
a.forBlock.logic_negate_v1 = function(e) {
|
|
990
|
-
return [`!${a.valueToCode(e, "BOOL",
|
|
990
|
+
return [`!${a.valueToCode(e, "BOOL", c.LOGICAL_NOT) || "true"}`, c.LOGICAL_NOT];
|
|
991
991
|
};
|
|
992
992
|
g([
|
|
993
993
|
{
|
|
@@ -1021,7 +1021,7 @@ g([
|
|
|
1021
1021
|
}
|
|
1022
1022
|
]);
|
|
1023
1023
|
a.forBlock.logic_operation_v1 = function(e) {
|
|
1024
|
-
const o = e.getFieldValue("OP") === "AND" ? "&&" : "||", t = o === "&&" ?
|
|
1024
|
+
const o = e.getFieldValue("OP") === "AND" ? "&&" : "||", t = o === "&&" ? c.LOGICAL_AND : c.LOGICAL_OR;
|
|
1025
1025
|
let n = a.valueToCode(e, "A", t), i = a.valueToCode(e, "B", t);
|
|
1026
1026
|
if (!n && !i)
|
|
1027
1027
|
n = "false", i = "false";
|
|
@@ -1031,7 +1031,7 @@ a.forBlock.logic_operation_v1 = function(e) {
|
|
|
1031
1031
|
}
|
|
1032
1032
|
return [`${n} ${o} ${i}`, t];
|
|
1033
1033
|
};
|
|
1034
|
-
const
|
|
1034
|
+
const Pi = {
|
|
1035
1035
|
prevParentConnection_: null,
|
|
1036
1036
|
onchange: function(e) {
|
|
1037
1037
|
const o = this.getInputTargetBlock("THEN"), t = this.getInputTargetBlock("ELSE"), n = this.outputConnection.targetConnection;
|
|
@@ -1041,12 +1041,12 @@ const xi = {
|
|
|
1041
1041
|
r && !r.workspace.connectionChecker.doTypeChecks(
|
|
1042
1042
|
r.outputConnection,
|
|
1043
1043
|
n
|
|
1044
|
-
) && (
|
|
1044
|
+
) && (F.setGroup(e.group), n === this.prevParentConnection_ ? (this.unplug(), n.getSourceBlock().bumpNeighbours()) : (r.unplug(), r.bumpNeighbours()), F.setGroup(!1));
|
|
1045
1045
|
}
|
|
1046
1046
|
this.prevParentConnection_ = n;
|
|
1047
1047
|
}
|
|
1048
1048
|
};
|
|
1049
|
-
V.registerMixin("logic_ternary_v1",
|
|
1049
|
+
V.registerMixin("logic_ternary_v1", Pi);
|
|
1050
1050
|
g([
|
|
1051
1051
|
{
|
|
1052
1052
|
type: "logic_ternary_v1",
|
|
@@ -1080,10 +1080,10 @@ g([
|
|
|
1080
1080
|
}
|
|
1081
1081
|
]);
|
|
1082
1082
|
a.forBlock.logic_ternary_v1 = function(e) {
|
|
1083
|
-
const o = a.valueToCode(e, "IF",
|
|
1084
|
-
return [o + " ? " + t + " : " + n,
|
|
1083
|
+
const o = a.valueToCode(e, "IF", c.CONDITIONAL) || "false", t = a.valueToCode(e, "THEN", c.CONDITIONAL) || "null", n = a.valueToCode(e, "ELSE", c.CONDITIONAL) || "null";
|
|
1084
|
+
return [o + " ? " + t + " : " + n, c.CONDITIONAL];
|
|
1085
1085
|
};
|
|
1086
|
-
const
|
|
1086
|
+
const wi = {
|
|
1087
1087
|
customContextMenu: function(e) {
|
|
1088
1088
|
if (this.isInFlyout)
|
|
1089
1089
|
return;
|
|
@@ -1105,7 +1105,7 @@ const Pi = {
|
|
|
1105
1105
|
};
|
|
1106
1106
|
V.registerMixin(
|
|
1107
1107
|
"contextMenu_newGetVariableBlock_v1",
|
|
1108
|
-
|
|
1108
|
+
wi
|
|
1109
1109
|
);
|
|
1110
1110
|
V.register(
|
|
1111
1111
|
"flow_control_tooltip_v1",
|
|
@@ -1114,16 +1114,16 @@ V.register(
|
|
|
1114
1114
|
CONTINUE: "%{BKY_LOOP_V1_FLOW_CONTROL_TOOLTIP_CONTINUE}"
|
|
1115
1115
|
})
|
|
1116
1116
|
);
|
|
1117
|
-
const
|
|
1117
|
+
const Vi = /* @__PURE__ */ new Set([
|
|
1118
1118
|
"repeat_v1",
|
|
1119
1119
|
"for_each_v1",
|
|
1120
1120
|
"for_v1",
|
|
1121
1121
|
"while_until_v1"
|
|
1122
|
-
]),
|
|
1122
|
+
]), Ui = {
|
|
1123
1123
|
getSurroundLoop: function() {
|
|
1124
1124
|
let e = this;
|
|
1125
1125
|
do {
|
|
1126
|
-
if (
|
|
1126
|
+
if (Vi.has(e.type))
|
|
1127
1127
|
return !0;
|
|
1128
1128
|
e = e == null ? void 0 : e.getSurroundParent();
|
|
1129
1129
|
} while (e);
|
|
@@ -1131,22 +1131,22 @@ const wi = /* @__PURE__ */ new Set([
|
|
|
1131
1131
|
},
|
|
1132
1132
|
onchange: function(e) {
|
|
1133
1133
|
const o = this.workspace;
|
|
1134
|
-
if (!o.isDragging || o.isDragging() || e.type !==
|
|
1134
|
+
if (!o.isDragging || o.isDragging() || e.type !== F.BLOCK_MOVE && e.type !== F.BLOCK_CREATE)
|
|
1135
1135
|
return;
|
|
1136
1136
|
const t = this.getSurroundLoop();
|
|
1137
1137
|
if (console.log(e.type, t), this.setWarningText(
|
|
1138
1138
|
t ? null : j.LOOP_FLOW_CONTROL_WARNING
|
|
1139
1139
|
), !this.isInFlyout)
|
|
1140
1140
|
try {
|
|
1141
|
-
|
|
1141
|
+
F.setRecordUndo(!1), this.setDisabledReason(!t, "FLOW_CONTROL_NOT_IN_LOOP");
|
|
1142
1142
|
} finally {
|
|
1143
|
-
|
|
1143
|
+
F.setRecordUndo(!0);
|
|
1144
1144
|
}
|
|
1145
1145
|
}
|
|
1146
1146
|
};
|
|
1147
1147
|
V.registerMixin(
|
|
1148
1148
|
"flow_control_in_loop_check_v1",
|
|
1149
|
-
|
|
1149
|
+
Ui
|
|
1150
1150
|
);
|
|
1151
1151
|
g([
|
|
1152
1152
|
{
|
|
@@ -1302,7 +1302,7 @@ a.forBlock.loop_while_until_v1 = function(e) {
|
|
|
1302
1302
|
let t = a.valueToCode(
|
|
1303
1303
|
e,
|
|
1304
1304
|
"CONDITION",
|
|
1305
|
-
o === "UNTIL" ?
|
|
1305
|
+
o === "UNTIL" ? c.LOGICAL_NOT : c.NONE
|
|
1306
1306
|
) || "false";
|
|
1307
1307
|
o === "UNTIL" && (t = "!" + t);
|
|
1308
1308
|
const n = a.statementToCode(e, "HANDLE");
|
|
@@ -1311,7 +1311,7 @@ ${n}
|
|
|
1311
1311
|
}
|
|
1312
1312
|
`;
|
|
1313
1313
|
};
|
|
1314
|
-
const
|
|
1314
|
+
const Yi = {
|
|
1315
1315
|
// math_arithmetic
|
|
1316
1316
|
ADD: "%{BKY_MATH_V1_ARITHMETIC_TOOLTIP_ADD}",
|
|
1317
1317
|
SUBTRACT: "%{BKY_MATH_V1_ARITHMETIC_TOOLTIP_SUBTRACT}",
|
|
@@ -1345,7 +1345,7 @@ const Ui = {
|
|
|
1345
1345
|
};
|
|
1346
1346
|
V.register(
|
|
1347
1347
|
"math_op_tooltip_v1",
|
|
1348
|
-
V.buildTooltipForDropdown("OP",
|
|
1348
|
+
V.buildTooltipForDropdown("OP", Yi)
|
|
1349
1349
|
);
|
|
1350
1350
|
g([
|
|
1351
1351
|
{
|
|
@@ -1383,13 +1383,13 @@ g([
|
|
|
1383
1383
|
]);
|
|
1384
1384
|
a.forBlock.math_arithmetic_v1 = function(e) {
|
|
1385
1385
|
const o = {
|
|
1386
|
-
ADD: [" + ",
|
|
1387
|
-
SUBTRACT: [" - ",
|
|
1388
|
-
MULTIPLY: [" * ",
|
|
1389
|
-
DIVIDE: [" / ",
|
|
1390
|
-
POWER: [null,
|
|
1386
|
+
ADD: [" + ", c.ADDITION],
|
|
1387
|
+
SUBTRACT: [" - ", c.SUBTRACTION],
|
|
1388
|
+
MULTIPLY: [" * ", c.MULTIPLICATION],
|
|
1389
|
+
DIVIDE: [" / ", c.DIVISION],
|
|
1390
|
+
POWER: [null, c.NONE]
|
|
1391
1391
|
}, [t, n] = o[e.getFieldValue("OP")], i = a.valueToCode(e, "A", n) || "0", r = a.valueToCode(e, "B", n) || "0";
|
|
1392
|
-
return t ? [i + t + r, n] : [`Math.pow(${i}, ${r})`,
|
|
1392
|
+
return t ? [i + t + r, n] : [`Math.pow(${i}, ${r})`, c.FUNCTION_CALL];
|
|
1393
1393
|
};
|
|
1394
1394
|
g([
|
|
1395
1395
|
{
|
|
@@ -1417,12 +1417,12 @@ g([
|
|
|
1417
1417
|
]);
|
|
1418
1418
|
a.forBlock.math_constant_v1 = function(e) {
|
|
1419
1419
|
return {
|
|
1420
|
-
PI: ["Math.PI",
|
|
1421
|
-
E: ["Math.E",
|
|
1422
|
-
GOLDEN_RATIO: ["(1 + Math.sqrt(5)) / 2",
|
|
1423
|
-
SQRT2: ["Math.SQRT2",
|
|
1424
|
-
SQRT1_2: ["Math.SQRT1_2",
|
|
1425
|
-
INFINITY: ["Infinity",
|
|
1420
|
+
PI: ["Math.PI", c.MEMBER],
|
|
1421
|
+
E: ["Math.E", c.MEMBER],
|
|
1422
|
+
GOLDEN_RATIO: ["(1 + Math.sqrt(5)) / 2", c.DIVISION],
|
|
1423
|
+
SQRT2: ["Math.SQRT2", c.MEMBER],
|
|
1424
|
+
SQRT1_2: ["Math.SQRT1_2", c.MEMBER],
|
|
1425
|
+
INFINITY: ["Infinity", c.ATOMIC]
|
|
1426
1426
|
}[e.getFieldValue("CONSTANT")];
|
|
1427
1427
|
};
|
|
1428
1428
|
g([
|
|
@@ -1454,8 +1454,8 @@ g([
|
|
|
1454
1454
|
}
|
|
1455
1455
|
]);
|
|
1456
1456
|
a.forBlock.math_constrain_v1 = function(e) {
|
|
1457
|
-
const o = a.valueToCode(e, "VALUE",
|
|
1458
|
-
return [`Math.min(Math.max(${o}, ${t}), ${n})`,
|
|
1457
|
+
const o = a.valueToCode(e, "VALUE", c.NONE) || "0", t = a.valueToCode(e, "LOW", c.NONE) || "0", n = a.valueToCode(e, "HIGH", c.NONE) || "Infinity";
|
|
1458
|
+
return [`Math.min(Math.max(${o}, ${t}), ${n})`, c.FUNCTION_CALL];
|
|
1459
1459
|
};
|
|
1460
1460
|
g([
|
|
1461
1461
|
{
|
|
@@ -1481,8 +1481,8 @@ g([
|
|
|
1481
1481
|
}
|
|
1482
1482
|
]);
|
|
1483
1483
|
a.forBlock.math_modulo_v1 = function(e) {
|
|
1484
|
-
const o = a.valueToCode(e, "DIVIDEND",
|
|
1485
|
-
return [o + " % " + t,
|
|
1484
|
+
const o = a.valueToCode(e, "DIVIDEND", c.MODULUS) || "0", t = a.valueToCode(e, "DIVISOR", c.MODULUS) || "0";
|
|
1485
|
+
return [o + " % " + t, c.MODULUS];
|
|
1486
1486
|
};
|
|
1487
1487
|
g([
|
|
1488
1488
|
{
|
|
@@ -1503,7 +1503,7 @@ g([
|
|
|
1503
1503
|
}
|
|
1504
1504
|
]);
|
|
1505
1505
|
a.forBlock.math_number_v1 = function(e) {
|
|
1506
|
-
const o = Number(e.getFieldValue("NUM")), t = o >= 0 ?
|
|
1506
|
+
const o = Number(e.getFieldValue("NUM")), t = o >= 0 ? c.ATOMIC : c.UNARY_NEGATION;
|
|
1507
1507
|
return [String(o), t];
|
|
1508
1508
|
};
|
|
1509
1509
|
g([
|
|
@@ -1538,17 +1538,17 @@ g([
|
|
|
1538
1538
|
]);
|
|
1539
1539
|
a.forBlock.math_number_property_v1 = function(e) {
|
|
1540
1540
|
const o = {
|
|
1541
|
-
EVEN: [" % 2 === 0",
|
|
1542
|
-
ODD: [" % 2 === 1",
|
|
1543
|
-
WHOLE: [" % 1 === 0",
|
|
1544
|
-
POSITIVE: [" > 0",
|
|
1545
|
-
NEGATIVE: [" < 0",
|
|
1546
|
-
DIVISIBLE_BY: [null,
|
|
1547
|
-
PRIME: [null,
|
|
1541
|
+
EVEN: [" % 2 === 0", c.MODULUS, c.EQUALITY],
|
|
1542
|
+
ODD: [" % 2 === 1", c.MODULUS, c.EQUALITY],
|
|
1543
|
+
WHOLE: [" % 1 === 0", c.MODULUS, c.EQUALITY],
|
|
1544
|
+
POSITIVE: [" > 0", c.RELATIONAL, c.RELATIONAL],
|
|
1545
|
+
NEGATIVE: [" < 0", c.RELATIONAL, c.RELATIONAL],
|
|
1546
|
+
DIVISIBLE_BY: [null, c.MODULUS, c.EQUALITY],
|
|
1547
|
+
PRIME: [null, c.NONE, c.FUNCTION_CALL]
|
|
1548
1548
|
}, t = e.getFieldValue("PROPERTY"), [n, i, r] = o[e.getFieldValue("PROPERTY")], l = a.valueToCode(e, "NUMBER_TO_CHECK", i) || "0";
|
|
1549
|
-
let
|
|
1549
|
+
let s;
|
|
1550
1550
|
if (t === "PRIME")
|
|
1551
|
-
|
|
1551
|
+
s = a.provideFunction_(
|
|
1552
1552
|
"mathIsPrime",
|
|
1553
1553
|
`
|
|
1554
1554
|
function ${a.FUNCTION_NAME_PLACEHOLDER_}(n) {
|
|
@@ -1572,11 +1572,11 @@ function ${a.FUNCTION_NAME_PLACEHOLDER_}(n) {
|
|
|
1572
1572
|
`
|
|
1573
1573
|
) + "(" + l + ")";
|
|
1574
1574
|
else if (t === "DIVISIBLE_BY") {
|
|
1575
|
-
const
|
|
1576
|
-
|
|
1575
|
+
const u = a.valueToCode(e, "DIVISOR", c.MODULUS) || "0";
|
|
1576
|
+
s = l + " % " + u + " === 0";
|
|
1577
1577
|
} else
|
|
1578
|
-
|
|
1579
|
-
return [
|
|
1578
|
+
s = l + n;
|
|
1579
|
+
return [s, r];
|
|
1580
1580
|
};
|
|
1581
1581
|
g([
|
|
1582
1582
|
{
|
|
@@ -1614,13 +1614,13 @@ a.forBlock.math_on_list_v1 = function(e) {
|
|
|
1614
1614
|
let t, n;
|
|
1615
1615
|
switch (o) {
|
|
1616
1616
|
case "SUM":
|
|
1617
|
-
t = a.valueToCode(e, "LIST",
|
|
1617
|
+
t = a.valueToCode(e, "LIST", c.MEMBER) || "[]", n = t + ".reduce(function(x, y) {return x + y;}, 0)";
|
|
1618
1618
|
break;
|
|
1619
1619
|
case "MIN":
|
|
1620
|
-
t = a.valueToCode(e, "LIST",
|
|
1620
|
+
t = a.valueToCode(e, "LIST", c.NONE) || "[]", n = "Math.min.apply(null, " + t + ")";
|
|
1621
1621
|
break;
|
|
1622
1622
|
case "MAX":
|
|
1623
|
-
t = a.valueToCode(e, "LIST",
|
|
1623
|
+
t = a.valueToCode(e, "LIST", c.NONE) || "[]", n = "Math.max.apply(null, " + t + ")";
|
|
1624
1624
|
break;
|
|
1625
1625
|
case "AVERAGE": {
|
|
1626
1626
|
const i = a.provideFunction_(
|
|
@@ -1631,7 +1631,7 @@ function ${a.FUNCTION_NAME_PLACEHOLDER_}(myList) {
|
|
|
1631
1631
|
}
|
|
1632
1632
|
`
|
|
1633
1633
|
);
|
|
1634
|
-
t = a.valueToCode(e, "LIST",
|
|
1634
|
+
t = a.valueToCode(e, "LIST", c.NONE) || "[]", n = i + "(" + t + ")";
|
|
1635
1635
|
break;
|
|
1636
1636
|
}
|
|
1637
1637
|
case "MEDIAN": {
|
|
@@ -1650,7 +1650,7 @@ function ${a.FUNCTION_NAME_PLACEHOLDER_}(myList) {
|
|
|
1650
1650
|
}
|
|
1651
1651
|
`
|
|
1652
1652
|
);
|
|
1653
|
-
t = a.valueToCode(e, "LIST",
|
|
1653
|
+
t = a.valueToCode(e, "LIST", c.NONE) || "[]", n = i + "(" + t + ")";
|
|
1654
1654
|
break;
|
|
1655
1655
|
}
|
|
1656
1656
|
case "MODE": {
|
|
@@ -1687,7 +1687,7 @@ function ${a.FUNCTION_NAME_PLACEHOLDER_}(values) {
|
|
|
1687
1687
|
}
|
|
1688
1688
|
`
|
|
1689
1689
|
);
|
|
1690
|
-
t = a.valueToCode(e, "LIST",
|
|
1690
|
+
t = a.valueToCode(e, "LIST", c.NONE) || "[]", n = i + "(" + t + ")";
|
|
1691
1691
|
break;
|
|
1692
1692
|
}
|
|
1693
1693
|
case "STD_DEV": {
|
|
@@ -1707,7 +1707,7 @@ function ${a.FUNCTION_NAME_PLACEHOLDER_}(numbers) {
|
|
|
1707
1707
|
}
|
|
1708
1708
|
`
|
|
1709
1709
|
);
|
|
1710
|
-
t = a.valueToCode(e, "LIST",
|
|
1710
|
+
t = a.valueToCode(e, "LIST", c.NONE) || "[]", n = i + "(" + t + ")";
|
|
1711
1711
|
break;
|
|
1712
1712
|
}
|
|
1713
1713
|
case "RANDOM": {
|
|
@@ -1720,13 +1720,13 @@ function ${a.FUNCTION_NAME_PLACEHOLDER_}(list) {
|
|
|
1720
1720
|
}
|
|
1721
1721
|
`
|
|
1722
1722
|
);
|
|
1723
|
-
t = a.valueToCode(e, "LIST",
|
|
1723
|
+
t = a.valueToCode(e, "LIST", c.NONE) || "[]", n = i + "(" + t + ")";
|
|
1724
1724
|
break;
|
|
1725
1725
|
}
|
|
1726
1726
|
default:
|
|
1727
1727
|
throw Error("Unknown operator: " + o);
|
|
1728
1728
|
}
|
|
1729
|
-
return [n,
|
|
1729
|
+
return [n, c.FUNCTION_CALL];
|
|
1730
1730
|
};
|
|
1731
1731
|
g([
|
|
1732
1732
|
{
|
|
@@ -1739,7 +1739,7 @@ g([
|
|
|
1739
1739
|
}
|
|
1740
1740
|
]);
|
|
1741
1741
|
a.forBlock.math_random_float_v1 = function() {
|
|
1742
|
-
return ["Math.random()",
|
|
1742
|
+
return ["Math.random()", c.FUNCTION_CALL];
|
|
1743
1743
|
};
|
|
1744
1744
|
g([
|
|
1745
1745
|
{
|
|
@@ -1765,7 +1765,7 @@ g([
|
|
|
1765
1765
|
}
|
|
1766
1766
|
]);
|
|
1767
1767
|
a.forBlock.math_random_int_v1 = function(e) {
|
|
1768
|
-
const o = a.valueToCode(e, "FROM",
|
|
1768
|
+
const o = a.valueToCode(e, "FROM", c.NONE) || "0", t = a.valueToCode(e, "TO", c.NONE) || "0";
|
|
1769
1769
|
return [a.provideFunction_(
|
|
1770
1770
|
"mathRandomInt",
|
|
1771
1771
|
`
|
|
@@ -1779,7 +1779,7 @@ function ${a.FUNCTION_NAME_PLACEHOLDER_}(a, b) {
|
|
|
1779
1779
|
return Math.floor(Math.random() * (b - a + 1) + a);
|
|
1780
1780
|
}
|
|
1781
1781
|
`
|
|
1782
|
-
) + "(" + o + ", " + t + ")",
|
|
1782
|
+
) + "(" + o + ", " + t + ")", c.FUNCTION_CALL];
|
|
1783
1783
|
};
|
|
1784
1784
|
g([
|
|
1785
1785
|
{
|
|
@@ -1808,7 +1808,7 @@ g([
|
|
|
1808
1808
|
}
|
|
1809
1809
|
]);
|
|
1810
1810
|
a.forBlock.math_round_v1 = function(e) {
|
|
1811
|
-
const o = e.getFieldValue("OP"), t = a.valueToCode(e, "NUM",
|
|
1811
|
+
const o = e.getFieldValue("OP"), t = a.valueToCode(e, "NUM", c.NONE) || "0";
|
|
1812
1812
|
let n = "";
|
|
1813
1813
|
switch (o) {
|
|
1814
1814
|
case "ROUND":
|
|
@@ -1821,7 +1821,7 @@ a.forBlock.math_round_v1 = function(e) {
|
|
|
1821
1821
|
n = `Math.floor(${t})`;
|
|
1822
1822
|
break;
|
|
1823
1823
|
}
|
|
1824
|
-
return [n,
|
|
1824
|
+
return [n, c.FUNCTION_CALL];
|
|
1825
1825
|
};
|
|
1826
1826
|
g([
|
|
1827
1827
|
{
|
|
@@ -1857,8 +1857,8 @@ a.forBlock.math_single_v1 = function(e) {
|
|
|
1857
1857
|
const o = e.getFieldValue("OP");
|
|
1858
1858
|
let t, n;
|
|
1859
1859
|
if (o === "NEG")
|
|
1860
|
-
return n = a.valueToCode(e, "NUM",
|
|
1861
|
-
switch (n = a.valueToCode(e, "NUM",
|
|
1860
|
+
return n = a.valueToCode(e, "NUM", c.UNARY_NEGATION) || "0", n[0] === "-" && (n = " " + n), t = "-" + n, [t, c.UNARY_NEGATION];
|
|
1861
|
+
switch (n = a.valueToCode(e, "NUM", c.NONE) || "0", o) {
|
|
1862
1862
|
case "ROOT":
|
|
1863
1863
|
t = `Math.sqrt(${n})`;
|
|
1864
1864
|
break;
|
|
@@ -1876,7 +1876,7 @@ a.forBlock.math_single_v1 = function(e) {
|
|
|
1876
1876
|
break;
|
|
1877
1877
|
}
|
|
1878
1878
|
if (t)
|
|
1879
|
-
return [t,
|
|
1879
|
+
return [t, c.FUNCTION_CALL];
|
|
1880
1880
|
switch (o) {
|
|
1881
1881
|
case "LOG10":
|
|
1882
1882
|
t = `Math.log(${n}) / Math.log(10)`;
|
|
@@ -1884,7 +1884,7 @@ a.forBlock.math_single_v1 = function(e) {
|
|
|
1884
1884
|
default:
|
|
1885
1885
|
throw Error("Unknown math operator: " + o);
|
|
1886
1886
|
}
|
|
1887
|
-
return [t,
|
|
1887
|
+
return [t, c.DIVISION];
|
|
1888
1888
|
};
|
|
1889
1889
|
g([
|
|
1890
1890
|
{
|
|
@@ -1918,7 +1918,7 @@ g([
|
|
|
1918
1918
|
a.forBlock.math_trig_v1 = function(e) {
|
|
1919
1919
|
let o;
|
|
1920
1920
|
const t = e.getFieldValue("OP");
|
|
1921
|
-
t === "SIN" || t === "COS" || t === "TAN" ? o = a.valueToCode(e, "NUM",
|
|
1921
|
+
t === "SIN" || t === "COS" || t === "TAN" ? o = a.valueToCode(e, "NUM", c.DIVISION) || "0" : o = a.valueToCode(e, "NUM", c.NONE) || "0";
|
|
1922
1922
|
let n;
|
|
1923
1923
|
switch (t) {
|
|
1924
1924
|
case "SIN":
|
|
@@ -1932,7 +1932,7 @@ a.forBlock.math_trig_v1 = function(e) {
|
|
|
1932
1932
|
break;
|
|
1933
1933
|
}
|
|
1934
1934
|
if (n)
|
|
1935
|
-
return [n,
|
|
1935
|
+
return [n, c.FUNCTION_CALL];
|
|
1936
1936
|
switch (t) {
|
|
1937
1937
|
case "ASIN":
|
|
1938
1938
|
n = `Math.asin(${o}) / Math.PI * 180`;
|
|
@@ -1946,23 +1946,23 @@ a.forBlock.math_trig_v1 = function(e) {
|
|
|
1946
1946
|
default:
|
|
1947
1947
|
throw Error("Unknown math operator: " + t);
|
|
1948
1948
|
}
|
|
1949
|
-
return [n,
|
|
1949
|
+
return [n, c.DIVISION];
|
|
1950
1950
|
};
|
|
1951
|
-
const
|
|
1951
|
+
const Ki = m.xml, Fi = {
|
|
1952
1952
|
init: function() {
|
|
1953
1953
|
this.appendDummyInput().appendField(
|
|
1954
1954
|
"%{BKY_OBJECT_V1_CREATE_CONTAINER_TITLE}"
|
|
1955
1955
|
), this.appendStatementInput("STACK"), this.setStyle("object_blocks"), this.contextMenu = !1;
|
|
1956
1956
|
}
|
|
1957
1957
|
};
|
|
1958
|
-
_e.object_create_container_v1 =
|
|
1959
|
-
const
|
|
1958
|
+
_e.object_create_container_v1 = Fi;
|
|
1959
|
+
const Hi = {
|
|
1960
1960
|
init: function() {
|
|
1961
1961
|
this.appendDummyInput().appendField("%{BKY_OBJECT_V1_CREATE_ITEM_TITLE}"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("object_blocks"), this.contextMenu = !1;
|
|
1962
1962
|
}
|
|
1963
1963
|
};
|
|
1964
|
-
_e.object_create_item_v1 =
|
|
1965
|
-
const
|
|
1964
|
+
_e.object_create_item_v1 = Hi;
|
|
1965
|
+
const Gi = {
|
|
1966
1966
|
init: function() {
|
|
1967
1967
|
this.itemCount_ = 0, this.appendDummyInput().appendField("%{BKY_OBJECT_V1_CREATE_TITLE}"), this.setMutator(
|
|
1968
1968
|
new wt.MutatorIcon(
|
|
@@ -1972,7 +1972,7 @@ const Hi = {
|
|
|
1972
1972
|
), this.setOutput(!0, "Object"), this.setStyle("object_blocks"), this.setTooltip("%{BKY_OBJECT_V1_CREATE_TOOLTIP}"), this.setHelpUrl("%{BKY_OBJECT_V1_CREATE_HELPURL}");
|
|
1973
1973
|
},
|
|
1974
1974
|
mutationToDom: function() {
|
|
1975
|
-
const e =
|
|
1975
|
+
const e = Ki.createElement("mutation");
|
|
1976
1976
|
return e.setAttribute("items", String(this.itemCount_)), e;
|
|
1977
1977
|
},
|
|
1978
1978
|
domToMutation: function(e) {
|
|
@@ -2037,20 +2037,20 @@ const Hi = {
|
|
|
2037
2037
|
},
|
|
2038
2038
|
updateShape_: function() {
|
|
2039
2039
|
for (let e = 0; e < this.itemCount_; e++)
|
|
2040
|
-
this.getInput("ADD" + e) || this.appendValueInput("ADD" + e).setAlign(
|
|
2040
|
+
this.getInput("ADD" + e) || this.appendValueInput("ADD" + e).setAlign(De.Align.RIGHT).appendField(new vo("key"), "KEY" + e);
|
|
2041
2041
|
for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
|
|
2042
2042
|
this.removeInput("ADD" + e);
|
|
2043
2043
|
}
|
|
2044
2044
|
};
|
|
2045
|
-
_e.object_create_v1 =
|
|
2045
|
+
_e.object_create_v1 = Gi;
|
|
2046
2046
|
a.forBlock.object_create_v1 = function(e) {
|
|
2047
2047
|
const o = e;
|
|
2048
2048
|
let t = "{";
|
|
2049
2049
|
for (let n = 0; n < o.itemCount_; n++) {
|
|
2050
|
-
const i = o.getFieldValue("KEY" + n), r = a.valueToCode(o, "ADD" + n,
|
|
2050
|
+
const i = o.getFieldValue("KEY" + n), r = a.valueToCode(o, "ADD" + n, c.ATOMIC) || null;
|
|
2051
2051
|
t += a.quote_(i) + ": " + r, n < o.itemCount_ - 1 && (t += ", ");
|
|
2052
2052
|
}
|
|
2053
|
-
return t += "}", [t,
|
|
2053
|
+
return t += "}", [t, c.ATOMIC];
|
|
2054
2054
|
};
|
|
2055
2055
|
g([
|
|
2056
2056
|
{
|
|
@@ -2115,7 +2115,7 @@ function ${a.FUNCTION_NAME_PLACEHOLDER_}(obj, key) {
|
|
|
2115
2115
|
}
|
|
2116
2116
|
}
|
|
2117
2117
|
`
|
|
2118
|
-
), t = a.valueToCode(e, "OBJECT",
|
|
2118
|
+
), t = a.valueToCode(e, "OBJECT", c.ATOMIC) || "null", n = a.valueToCode(e, "KEY", c.ATOMIC) || "''";
|
|
2119
2119
|
return `${o}(${t}, ${n});
|
|
2120
2120
|
`;
|
|
2121
2121
|
};
|
|
@@ -2138,7 +2138,7 @@ g([
|
|
|
2138
2138
|
}
|
|
2139
2139
|
]);
|
|
2140
2140
|
a.forBlock.object_from_json_v1 = function(e) {
|
|
2141
|
-
return [`__parseJsonV1__(${a.valueToCode(e, "JSON",
|
|
2141
|
+
return [`__parseJsonV1__(${a.valueToCode(e, "JSON", c.NONE) || "''"})`, c.FUNCTION_CALL];
|
|
2142
2142
|
};
|
|
2143
2143
|
g([
|
|
2144
2144
|
{
|
|
@@ -2202,8 +2202,8 @@ function ${a.FUNCTION_NAME_PLACEHOLDER_}(obj, key) {
|
|
|
2202
2202
|
}
|
|
2203
2203
|
}
|
|
2204
2204
|
`
|
|
2205
|
-
), t = a.valueToCode(e, "OBJECT",
|
|
2206
|
-
return [`${o}(${t}, ${n})`,
|
|
2205
|
+
), t = a.valueToCode(e, "OBJECT", c.ATOMIC) || "null", n = a.valueToCode(e, "KEY", c.ATOMIC) || "''";
|
|
2206
|
+
return [`${o}(${t}, ${n})`, c.FUNCTION_CALL];
|
|
2207
2207
|
};
|
|
2208
2208
|
g([
|
|
2209
2209
|
{
|
|
@@ -2275,7 +2275,7 @@ function ${a.FUNCTION_NAME_PLACEHOLDER_}(obj, key, val) {
|
|
|
2275
2275
|
}
|
|
2276
2276
|
}
|
|
2277
2277
|
`
|
|
2278
|
-
), t = a.valueToCode(e, "OBJECT",
|
|
2278
|
+
), t = a.valueToCode(e, "OBJECT", c.ATOMIC) || "null", n = a.valueToCode(e, "KEY", c.ATOMIC) || "''", i = a.valueToCode(e, "TO", c.ATOMIC) || "null";
|
|
2279
2279
|
return `${o}(${t}, ${n}, ${i});
|
|
2280
2280
|
`;
|
|
2281
2281
|
};
|
|
@@ -2298,15 +2298,15 @@ g([
|
|
|
2298
2298
|
}
|
|
2299
2299
|
]);
|
|
2300
2300
|
a.forBlock.object_to_json_v1 = function(e) {
|
|
2301
|
-
return [`__jsonStringifyV1__(${a.valueToCode(e, "OBJECT",
|
|
2301
|
+
return [`__jsonStringifyV1__(${a.valueToCode(e, "OBJECT", c.NONE) || "null"})`, c.FUNCTION_CALL];
|
|
2302
2302
|
};
|
|
2303
|
-
const Bo = m.xml,
|
|
2303
|
+
const Bo = m.xml, Xi = {
|
|
2304
2304
|
init: function() {
|
|
2305
|
-
this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_CONTAINER_TITLE}").appendField(new
|
|
2305
|
+
this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_CONTAINER_TITLE}").appendField(new Jn(!1), "WITHRETURN"), this.appendStatementInput("STACK"), this.setStyle("procedure_blocks"), this.contextMenu = !1;
|
|
2306
2306
|
}
|
|
2307
2307
|
};
|
|
2308
|
-
_e.procedure_def_container_v1 =
|
|
2309
|
-
const
|
|
2308
|
+
_e.procedure_def_container_v1 = Xi;
|
|
2309
|
+
const $i = {
|
|
2310
2310
|
init: function() {
|
|
2311
2311
|
const e = new vo(uo.DEFAULT_ARG);
|
|
2312
2312
|
e.setValidator(this.validator_), this.appendDummyInput().appendField("%{BKY_PROCEDURE_V1_DEF_ITEM_TITLE}").appendField(e, "NAME"), this.setPreviousStatement(!0), this.setNextStatement(!0), this.setStyle("procedure_blocks"), this.contextMenu = !1;
|
|
@@ -2328,8 +2328,8 @@ const Xi = {
|
|
|
2328
2328
|
return e;
|
|
2329
2329
|
}
|
|
2330
2330
|
};
|
|
2331
|
-
_e.procedure_def_item_v1 =
|
|
2332
|
-
const
|
|
2331
|
+
_e.procedure_def_item_v1 = $i;
|
|
2332
|
+
const ji = {
|
|
2333
2333
|
init: function() {
|
|
2334
2334
|
this.withReturn = !1, this.args = [];
|
|
2335
2335
|
const e = new vo(
|
|
@@ -2422,20 +2422,20 @@ const $i = {
|
|
|
2422
2422
|
n.setKeyName(o.name, "");
|
|
2423
2423
|
else
|
|
2424
2424
|
try {
|
|
2425
|
-
|
|
2425
|
+
F.disable(), n = rn(this.workspace, o.name, ""), n.outputConnection.connect(t);
|
|
2426
2426
|
} finally {
|
|
2427
|
-
|
|
2427
|
+
F.enable();
|
|
2428
2428
|
}
|
|
2429
2429
|
}
|
|
2430
2430
|
}
|
|
2431
2431
|
};
|
|
2432
|
-
_e.procedure_def_v1 =
|
|
2433
|
-
const
|
|
2432
|
+
_e.procedure_def_v1 = ji;
|
|
2433
|
+
const Wi = m.xml, Ji = {
|
|
2434
2434
|
init: function() {
|
|
2435
2435
|
this.withReturn = !1, this.appendDummyInput("DUMMY").appendField("%{BKY_PROCEDURE_RETURN}"), this.appendValueInput("VALUE").appendField("%{BKY_PROCEDURE_RETURN}").setVisible(!1), this.setPreviousStatement(!0), this.setStyle("procedure_blocks"), this.setTooltip("%{BKY_PROCEDURE_V1_RETURN_TOOLTIP}"), this.setHelpUrl("%{BKY_PROCEDURE_V1_RETURN_HELPURL}");
|
|
2436
2436
|
},
|
|
2437
2437
|
mutationToDom: function() {
|
|
2438
|
-
const e =
|
|
2438
|
+
const e = Wi.createElement("mutation");
|
|
2439
2439
|
return e.setAttribute("withreturn", this.withReturn ? "TRUE" : "FALSE"), e;
|
|
2440
2440
|
},
|
|
2441
2441
|
domToMutation: function(e) {
|
|
@@ -2455,7 +2455,7 @@ const ji = m.xml, Wi = {
|
|
|
2455
2455
|
},
|
|
2456
2456
|
onchange: function(e) {
|
|
2457
2457
|
var o;
|
|
2458
|
-
if (e.type ===
|
|
2458
|
+
if (e.type === F.BLOCK_DRAG) {
|
|
2459
2459
|
const t = e;
|
|
2460
2460
|
if (t.isStart || !((o = t.blocks) != null && o.find((n) => n.id === this.id)))
|
|
2461
2461
|
return;
|
|
@@ -2486,10 +2486,10 @@ const ji = m.xml, Wi = {
|
|
|
2486
2486
|
e.type === "procedure_def_v1" || e.type === "func_entry_v1" ? this.setWarningText(null) : this.setWarningText("the block can only be used in procedure block");
|
|
2487
2487
|
}
|
|
2488
2488
|
};
|
|
2489
|
-
_e.procedure_return_v1 =
|
|
2489
|
+
_e.procedure_return_v1 = Ji;
|
|
2490
2490
|
a.forBlock.procedure_return_v1 = function(e) {
|
|
2491
2491
|
const o = e;
|
|
2492
|
-
return o.withReturn ? `return ${a.valueToCode(o, "VALUE",
|
|
2492
|
+
return o.withReturn ? `return ${a.valueToCode(o, "VALUE", c.NONE) || "null"};
|
|
2493
2493
|
` : `return;
|
|
2494
2494
|
`;
|
|
2495
2495
|
};
|
|
@@ -2512,11 +2512,11 @@ g([
|
|
|
2512
2512
|
}
|
|
2513
2513
|
]);
|
|
2514
2514
|
a.forBlock.text_v1 = function(e) {
|
|
2515
|
-
return [a.quote_(e.getFieldValue("TEXT")),
|
|
2515
|
+
return [a.quote_(e.getFieldValue("TEXT")), c.ATOMIC];
|
|
2516
2516
|
};
|
|
2517
|
-
const
|
|
2517
|
+
const zi = /^\s*'([^']|\\')*'\s*$/;
|
|
2518
2518
|
function Ot(e) {
|
|
2519
|
-
return
|
|
2519
|
+
return zi.test(e) ? [e, c.ATOMIC] : [`String(${e})`, c.FUNCTION_CALL];
|
|
2520
2520
|
}
|
|
2521
2521
|
V.register(
|
|
2522
2522
|
"text_append_tooltip_v1",
|
|
@@ -2551,7 +2551,7 @@ a.forBlock.text_append_v1 = function(e) {
|
|
|
2551
2551
|
const o = (n = a.nameDB_) == null ? void 0 : n.getName(
|
|
2552
2552
|
e.getFieldValue("VAR"),
|
|
2553
2553
|
yo.NameType.VARIABLE
|
|
2554
|
-
), t = a.valueToCode(e, "TEXT",
|
|
2554
|
+
), t = a.valueToCode(e, "TEXT", c.NONE) || "''";
|
|
2555
2555
|
return `${o} += ${Ot(t)};
|
|
2556
2556
|
`;
|
|
2557
2557
|
};
|
|
@@ -2589,7 +2589,7 @@ a.forBlock.text_change_case_v1 = function(e) {
|
|
|
2589
2589
|
}[e.getFieldValue("CASE")], n = a.valueToCode(
|
|
2590
2590
|
e,
|
|
2591
2591
|
"TEXT",
|
|
2592
|
-
t ?
|
|
2592
|
+
t ? c.MEMBER : c.NONE
|
|
2593
2593
|
) || "''";
|
|
2594
2594
|
let i = "";
|
|
2595
2595
|
return t ? i = n + t : i = a.provideFunction_(
|
|
@@ -2599,7 +2599,7 @@ function ${a.FUNCTION_NAME_PLACEHOLDER_}(str) {
|
|
|
2599
2599
|
return str.slice(0, 1).toUpperCase() + str.slice(1).toLowerCase();
|
|
2600
2600
|
}
|
|
2601
2601
|
`
|
|
2602
|
-
) + "(" + n + ")", [i,
|
|
2602
|
+
) + "(" + n + ")", [i, c.FUNCTION_CALL];
|
|
2603
2603
|
};
|
|
2604
2604
|
g([
|
|
2605
2605
|
{
|
|
@@ -2625,8 +2625,8 @@ g([
|
|
|
2625
2625
|
}
|
|
2626
2626
|
]);
|
|
2627
2627
|
a.forBlock.text_char_at_v1 = function(e) {
|
|
2628
|
-
const o = a.valueToCode(e, "VALUE",
|
|
2629
|
-
return [`${o}.charAt(${t})`,
|
|
2628
|
+
const o = a.valueToCode(e, "VALUE", c.MEMBER) || "[]", t = a.getAdjusted(e, "AT");
|
|
2629
|
+
return [`${o}.charAt(${t})`, c.FUNCTION_CALL];
|
|
2630
2630
|
};
|
|
2631
2631
|
g([
|
|
2632
2632
|
{
|
|
@@ -2652,7 +2652,7 @@ g([
|
|
|
2652
2652
|
}
|
|
2653
2653
|
]);
|
|
2654
2654
|
a.forBlock.text_count_v1 = function(e) {
|
|
2655
|
-
const o = a.valueToCode(e, "TEXT",
|
|
2655
|
+
const o = a.valueToCode(e, "TEXT", c.NONE) || "''", t = a.valueToCode(e, "SUBSTR", c.NONE) || "''";
|
|
2656
2656
|
return [`${a.provideFunction_(
|
|
2657
2657
|
"textCount",
|
|
2658
2658
|
`
|
|
@@ -2664,7 +2664,7 @@ function ${a.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle) {
|
|
|
2664
2664
|
}
|
|
2665
2665
|
}
|
|
2666
2666
|
`
|
|
2667
|
-
)}(${o}, ${t})`,
|
|
2667
|
+
)}(${o}, ${t})`, c.FUNCTION_CALL];
|
|
2668
2668
|
};
|
|
2669
2669
|
g([
|
|
2670
2670
|
{
|
|
@@ -2698,8 +2698,8 @@ g([
|
|
|
2698
2698
|
}
|
|
2699
2699
|
]);
|
|
2700
2700
|
a.forBlock.text_index_of_v1 = function(e) {
|
|
2701
|
-
const o = e.getFieldValue("OP") === "FIRST" ? "indexOf" : "lastIndexOf", t = a.valueToCode(e, "TEXT",
|
|
2702
|
-
return [`${t}.${o}(${n})`,
|
|
2701
|
+
const o = e.getFieldValue("OP") === "FIRST" ? "indexOf" : "lastIndexOf", t = a.valueToCode(e, "TEXT", c.MEMBER) || "''", n = a.valueToCode(e, "SUBSTR", c.NONE) || "''";
|
|
2702
|
+
return [`${t}.${o}(${n})`, c.FUNCTION_CALL];
|
|
2703
2703
|
};
|
|
2704
2704
|
g([
|
|
2705
2705
|
{
|
|
@@ -2719,12 +2719,12 @@ g([
|
|
|
2719
2719
|
}
|
|
2720
2720
|
]);
|
|
2721
2721
|
a.forBlock.text_is_empty_v1 = function(e) {
|
|
2722
|
-
return [`!${a.valueToCode(e, "VALUE",
|
|
2722
|
+
return [`!${a.valueToCode(e, "VALUE", c.MEMBER) || "''"}.length`, c.LOGICAL_NOT];
|
|
2723
2723
|
};
|
|
2724
|
-
const
|
|
2724
|
+
const qi = m.xml, Qi = {
|
|
2725
2725
|
itemCount_: 0,
|
|
2726
2726
|
mutationToDom: function() {
|
|
2727
|
-
const e =
|
|
2727
|
+
const e = qi.createElement("mutation");
|
|
2728
2728
|
return e.setAttribute("items", `${this.itemCount_}`), e;
|
|
2729
2729
|
},
|
|
2730
2730
|
domToMutation: function(e) {
|
|
@@ -2789,20 +2789,20 @@ const zi = m.xml, qi = {
|
|
|
2789
2789
|
for (let e = 0; e < this.itemCount_; e++)
|
|
2790
2790
|
if (!this.getInput("ADD" + e)) {
|
|
2791
2791
|
const o = this.appendValueInput("ADD" + e).setAlign(
|
|
2792
|
-
|
|
2792
|
+
De.Align.RIGHT
|
|
2793
2793
|
);
|
|
2794
2794
|
e === 0 && o.appendField("%{BKY_TEXT_V1_JOIN_TITLE}");
|
|
2795
2795
|
}
|
|
2796
2796
|
for (let e = this.itemCount_; this.getInput("ADD" + e); e++)
|
|
2797
2797
|
this.removeInput("ADD" + e);
|
|
2798
2798
|
}
|
|
2799
|
-
},
|
|
2799
|
+
}, Zi = function() {
|
|
2800
2800
|
this.itemCount_ = 2, this.updateShape_(), this.setMutator(new wt.MutatorIcon(["text_join_item_v1"], this));
|
|
2801
2801
|
};
|
|
2802
2802
|
V.registerMutator(
|
|
2803
2803
|
"text_join_mutator_v1",
|
|
2804
|
-
|
|
2805
|
-
|
|
2804
|
+
Qi,
|
|
2805
|
+
Zi
|
|
2806
2806
|
);
|
|
2807
2807
|
g([
|
|
2808
2808
|
{
|
|
@@ -2842,20 +2842,20 @@ a.forBlock.text_join_v1 = function(e) {
|
|
|
2842
2842
|
const o = e;
|
|
2843
2843
|
switch (o.itemCount_) {
|
|
2844
2844
|
case 0:
|
|
2845
|
-
return ["''",
|
|
2845
|
+
return ["''", c.ATOMIC];
|
|
2846
2846
|
case 1: {
|
|
2847
|
-
const t = a.valueToCode(o, "ADD0",
|
|
2847
|
+
const t = a.valueToCode(o, "ADD0", c.NONE) || "''";
|
|
2848
2848
|
return Ot(t);
|
|
2849
2849
|
}
|
|
2850
2850
|
case 2: {
|
|
2851
|
-
const t = a.valueToCode(o, "ADD0",
|
|
2852
|
-
return [Ot(t)[0] + " + " + Ot(n)[0],
|
|
2851
|
+
const t = a.valueToCode(o, "ADD0", c.NONE) || "''", n = a.valueToCode(o, "ADD1", c.NONE) || "''";
|
|
2852
|
+
return [Ot(t)[0] + " + " + Ot(n)[0], c.ADDITION];
|
|
2853
2853
|
}
|
|
2854
2854
|
default: {
|
|
2855
2855
|
const t = new Array(o.itemCount_);
|
|
2856
2856
|
for (let i = 0; i < o.itemCount_; i++)
|
|
2857
|
-
t[i] = a.valueToCode(o, "ADD" + i,
|
|
2858
|
-
return ["[" + t.join(",") + "].join('')",
|
|
2857
|
+
t[i] = a.valueToCode(o, "ADD" + i, c.NONE) || "''";
|
|
2858
|
+
return ["[" + t.join(",") + "].join('')", c.FUNCTION_CALL];
|
|
2859
2859
|
}
|
|
2860
2860
|
}
|
|
2861
2861
|
};
|
|
@@ -2877,7 +2877,7 @@ g([
|
|
|
2877
2877
|
}
|
|
2878
2878
|
]);
|
|
2879
2879
|
a.forBlock.text_length_v1 = function(e) {
|
|
2880
|
-
return [`${a.valueToCode(e, "VALUE",
|
|
2880
|
+
return [`${a.valueToCode(e, "VALUE", c.MEMBER) || "''"}.length`, c.MEMBER];
|
|
2881
2881
|
};
|
|
2882
2882
|
g([
|
|
2883
2883
|
{
|
|
@@ -2908,7 +2908,7 @@ g([
|
|
|
2908
2908
|
}
|
|
2909
2909
|
]);
|
|
2910
2910
|
a.forBlock.text_replace_v1 = function(e) {
|
|
2911
|
-
const o = a.valueToCode(e, "TEXT",
|
|
2911
|
+
const o = a.valueToCode(e, "TEXT", c.NONE) || "''", t = a.valueToCode(e, "FROM", c.NONE) || "''", n = a.valueToCode(e, "TO", c.NONE) || "''";
|
|
2912
2912
|
return [`${a.provideFunction_(
|
|
2913
2913
|
"textReplace",
|
|
2914
2914
|
`
|
|
@@ -2918,7 +2918,7 @@ function ${a.FUNCTION_NAME_PLACEHOLDER_}(haystack, needle, replacement) {
|
|
|
2918
2918
|
return haystack.replace(new RegExp(needle, 'g'), replacement);
|
|
2919
2919
|
}
|
|
2920
2920
|
`
|
|
2921
|
-
)}(${o}, ${t}, ${n})`,
|
|
2921
|
+
)}(${o}, ${t}, ${n})`, c.FUNCTION_CALL];
|
|
2922
2922
|
};
|
|
2923
2923
|
g([
|
|
2924
2924
|
{
|
|
@@ -2939,7 +2939,7 @@ g([
|
|
|
2939
2939
|
}
|
|
2940
2940
|
]);
|
|
2941
2941
|
a.forBlock.text_reverse_v1 = function(e) {
|
|
2942
|
-
return [(a.valueToCode(e, "TEXT",
|
|
2942
|
+
return [(a.valueToCode(e, "TEXT", c.MEMBER) || "''") + ".split('').reverse().join('')", c.FUNCTION_CALL];
|
|
2943
2943
|
};
|
|
2944
2944
|
g([
|
|
2945
2945
|
{
|
|
@@ -2965,8 +2965,8 @@ g([
|
|
|
2965
2965
|
}
|
|
2966
2966
|
]);
|
|
2967
2967
|
a.forBlock.text_split_v1 = function(e) {
|
|
2968
|
-
const o = a.valueToCode(e, "TEXT",
|
|
2969
|
-
return [`${o}.split(${t})`,
|
|
2968
|
+
const o = a.valueToCode(e, "TEXT", c.MEMBER) || "''", t = a.valueToCode(e, "DELIM", c.NONE) || "''";
|
|
2969
|
+
return [`${o}.split(${t})`, c.FUNCTION_CALL];
|
|
2970
2970
|
};
|
|
2971
2971
|
g([
|
|
2972
2972
|
{
|
|
@@ -2997,8 +2997,8 @@ g([
|
|
|
2997
2997
|
}
|
|
2998
2998
|
]);
|
|
2999
2999
|
a.forBlock.text_substring_v1 = function(e) {
|
|
3000
|
-
const o = a.valueToCode(e, "TEXT",
|
|
3001
|
-
return [`${o}.slice(${t}, ${n})`,
|
|
3000
|
+
const o = a.valueToCode(e, "TEXT", c.MEMBER) || "''", t = a.getAdjusted(e, "START"), n = a.getAdjusted(e, "END", 1);
|
|
3001
|
+
return [`${o}.slice(${t}, ${n})`, c.FUNCTION_CALL];
|
|
3002
3002
|
};
|
|
3003
3003
|
g([
|
|
3004
3004
|
{
|
|
@@ -3027,14 +3027,14 @@ g([
|
|
|
3027
3027
|
}
|
|
3028
3028
|
]);
|
|
3029
3029
|
a.forBlock.text_trim_v1 = function(e) {
|
|
3030
|
-
const o = a.valueToCode(e, "TEXT",
|
|
3030
|
+
const o = a.valueToCode(e, "TEXT", c.NONE) || "''", n = {
|
|
3031
3031
|
BOTH: 0,
|
|
3032
3032
|
LEFT: 1,
|
|
3033
3033
|
RIGHT: 2
|
|
3034
3034
|
}[e.getFieldValue("MODE")];
|
|
3035
|
-
return [`__trimV1__(${o}, ${n})`,
|
|
3035
|
+
return [`__trimV1__(${o}, ${n})`, c.ATOMIC];
|
|
3036
3036
|
};
|
|
3037
|
-
const
|
|
3037
|
+
const er = {
|
|
3038
3038
|
init: function() {
|
|
3039
3039
|
this.appendDummyInput().appendField("%{BKY_TIME_V1_CREATE_TIMER_TITLE}"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setStyle("time_blocks"), this.setTooltip("%{BKY_TIME_V1_CREATE_TIMER_TOOLTIP}"), this.setHelpUrl("%{BKY_TIME_V1_CREATE_TIMER_HELPURL}");
|
|
3040
3040
|
},
|
|
@@ -3045,24 +3045,24 @@ const Zi = {
|
|
|
3045
3045
|
this.updateShape_(), this.updateShadow_();
|
|
3046
3046
|
},
|
|
3047
3047
|
updateShape_: function() {
|
|
3048
|
-
this.getInput("CALLBACK") || this.appendStatementInput("CALLBACK").appendField("%{BKY_TIME_DO}"), this.getInput("IMMEDIATE") || (this.appendValueInput("IMMEDIATE").setCheck("Boolean").setAlign(
|
|
3048
|
+
this.getInput("CALLBACK") || this.appendStatementInput("CALLBACK").appendField("%{BKY_TIME_DO}"), this.getInput("IMMEDIATE") || (this.appendValueInput("IMMEDIATE").setCheck("Boolean").setAlign(De.Align.RIGHT).appendField("%{BKY_TIME_IMMEDIATE}"), this.moveInputBefore("IMMEDIATE", "CALLBACK")), this.getInput("COUNT") || (this.appendValueInput("COUNT").setCheck("Number").setAlign(De.Align.RIGHT).appendField("%{BKY_TIME_COUNT}"), this.moveInputBefore("COUNT", "IMMEDIATE")), this.getInput("LOOP") || (this.appendValueInput("LOOP").setCheck("Boolean").setAlign(De.Align.RIGHT).appendField("%{BKY_TIME_LOOP}"), this.moveInputBefore("LOOP", "COUNT")), this.getInput("INTERVAL") || (this.appendValueInput("INTERVAL").setCheck("Number").setAlign(De.Align.RIGHT).appendField("%{BKY_TIME_INTERVAL_MS}"), this.moveInputBefore("INTERVAL", "LOOP"));
|
|
3049
3049
|
},
|
|
3050
3050
|
updateShadow_: function() {
|
|
3051
|
-
var e, o, t, n, i, r, l,
|
|
3051
|
+
var e, o, t, n, i, r, l, s;
|
|
3052
3052
|
this.isInsertionMarker() || ((o = (e = this.getInput("INTERVAL")) == null ? void 0 : e.connection) == null || o.setShadowDom(
|
|
3053
|
-
|
|
3053
|
+
ft({ type: "number", default: 1e3 })
|
|
3054
3054
|
), (n = (t = this.getInput("LOOP")) == null ? void 0 : t.connection) == null || n.setShadowDom(
|
|
3055
|
-
|
|
3055
|
+
ft({ type: "boolean", default: !1 })
|
|
3056
3056
|
), (r = (i = this.getInput("COUNT")) == null ? void 0 : i.connection) == null || r.setShadowDom(
|
|
3057
|
-
|
|
3058
|
-
), (
|
|
3059
|
-
|
|
3057
|
+
ft({ type: "number", default: 1 })
|
|
3058
|
+
), (s = (l = this.getInput("IMMEDIATE")) == null ? void 0 : l.connection) == null || s.setShadowDom(
|
|
3059
|
+
ft({ type: "boolean", default: !1 })
|
|
3060
3060
|
));
|
|
3061
3061
|
}
|
|
3062
3062
|
};
|
|
3063
|
-
_e.create_timer_v1 =
|
|
3063
|
+
_e.create_timer_v1 = er;
|
|
3064
3064
|
a.forBlock.create_timer_v1 = function(e) {
|
|
3065
|
-
const o = a.valueToCode(e, "INTERVAL",
|
|
3065
|
+
const o = a.valueToCode(e, "INTERVAL", c.ATOMIC) || "1000", t = a.valueToCode(e, "LOOP", c.ATOMIC) || "false", n = a.valueToCode(e, "COUNT", c.ATOMIC) || "1", i = a.valueToCode(e, "IMMEDIATE", c.ATOMIC) || "false", r = a.statementToCode(e, "CALLBACK");
|
|
3066
3066
|
return `__createTimerV1__(${o}, ${t}, ${n}, ${i}, function() {
|
|
3067
3067
|
${r}
|
|
3068
3068
|
});
|
|
@@ -3087,21 +3087,21 @@ g([
|
|
|
3087
3087
|
}
|
|
3088
3088
|
]);
|
|
3089
3089
|
a.forBlock.delay_v1 = function(e) {
|
|
3090
|
-
return `__delayV1__(${a.valueToCode(e, "MS",
|
|
3090
|
+
return `__delayV1__(${a.valueToCode(e, "MS", c.ATOMIC) || "0"});
|
|
3091
3091
|
`;
|
|
3092
3092
|
};
|
|
3093
|
-
const
|
|
3093
|
+
const tr = {
|
|
3094
3094
|
customContextMenu: function(e) {
|
|
3095
3095
|
if (this.isInFlyout) {
|
|
3096
3096
|
if (this.type === "variables_get_v1" || this.type === "variables_get_v1_reporter") {
|
|
3097
3097
|
const o = {
|
|
3098
3098
|
text: j.RENAME_VARIABLE,
|
|
3099
3099
|
enabled: !0,
|
|
3100
|
-
callback:
|
|
3100
|
+
callback: or(this)
|
|
3101
3101
|
}, t = this.getField("VAR").getText(), n = {
|
|
3102
3102
|
text: j.DELETE_VARIABLE.replace("%1", t),
|
|
3103
3103
|
enabled: !0,
|
|
3104
|
-
callback:
|
|
3104
|
+
callback: nr(this)
|
|
3105
3105
|
};
|
|
3106
3106
|
e.unshift(o), e.unshift(n);
|
|
3107
3107
|
}
|
|
@@ -3119,12 +3119,12 @@ const er = {
|
|
|
3119
3119
|
});
|
|
3120
3120
|
}
|
|
3121
3121
|
}
|
|
3122
|
-
},
|
|
3122
|
+
}, or = function(e) {
|
|
3123
3123
|
return function() {
|
|
3124
3124
|
const o = e.workspace, n = e.getField("VAR").getVariable();
|
|
3125
3125
|
bt.renameVariable(o, n);
|
|
3126
3126
|
};
|
|
3127
|
-
},
|
|
3127
|
+
}, nr = function(e) {
|
|
3128
3128
|
return function() {
|
|
3129
3129
|
const o = e.workspace, n = e.getField("VAR").getVariable();
|
|
3130
3130
|
o.deleteVariableById(n.getId()), o.refreshToolboxSelection();
|
|
@@ -3132,7 +3132,7 @@ const er = {
|
|
|
3132
3132
|
};
|
|
3133
3133
|
V.registerMixin(
|
|
3134
3134
|
"context_menu_variable_v1",
|
|
3135
|
-
|
|
3135
|
+
tr
|
|
3136
3136
|
);
|
|
3137
3137
|
g([
|
|
3138
3138
|
{
|
|
@@ -3155,7 +3155,7 @@ a.forBlock.variable_get_v1 = function(e) {
|
|
|
3155
3155
|
return [a.nameDB_.getName(
|
|
3156
3156
|
e.getFieldValue("VAR"),
|
|
3157
3157
|
yo.NameType.VARIABLE
|
|
3158
|
-
),
|
|
3158
|
+
), c.ATOMIC];
|
|
3159
3159
|
};
|
|
3160
3160
|
g([
|
|
3161
3161
|
{
|
|
@@ -3184,12 +3184,12 @@ a.forBlock.variable_set_v1 = function(e) {
|
|
|
3184
3184
|
const o = a.nameDB_.getName(
|
|
3185
3185
|
e.getFieldValue("VAR"),
|
|
3186
3186
|
yo.NameType.VARIABLE
|
|
3187
|
-
), t = a.valueToCode(e, "VALUE",
|
|
3187
|
+
), t = a.valueToCode(e, "VALUE", c.ASSIGNMENT) || "0";
|
|
3188
3188
|
return `${o} = ${t};
|
|
3189
3189
|
`;
|
|
3190
3190
|
};
|
|
3191
3191
|
const Ro = m.xml;
|
|
3192
|
-
function
|
|
3192
|
+
function ir() {
|
|
3193
3193
|
const e = [];
|
|
3194
3194
|
{
|
|
3195
3195
|
const o = Ro.createElement("label");
|
|
@@ -3203,9 +3203,9 @@ function nr() {
|
|
|
3203
3203
|
}
|
|
3204
3204
|
const ln = {
|
|
3205
3205
|
name: "INTERFACE_CATEGORY",
|
|
3206
|
-
callback:
|
|
3206
|
+
callback: ir
|
|
3207
3207
|
}, Ze = m.xml;
|
|
3208
|
-
function
|
|
3208
|
+
function rr() {
|
|
3209
3209
|
const e = [];
|
|
3210
3210
|
{
|
|
3211
3211
|
const o = Ze.createElement("label");
|
|
@@ -3232,18 +3232,18 @@ function ir() {
|
|
|
3232
3232
|
}
|
|
3233
3233
|
const se = {
|
|
3234
3234
|
name: "PROCEDURE_CATEGORY",
|
|
3235
|
-
callback:
|
|
3235
|
+
callback: rr
|
|
3236
3236
|
};
|
|
3237
|
-
function
|
|
3238
|
-
const { args: e } =
|
|
3237
|
+
function lr() {
|
|
3238
|
+
const { args: e } = Ii.app.view, o = [];
|
|
3239
3239
|
return e == null || e.forEach(({ id: t, name: n, type: i }) => {
|
|
3240
3240
|
o.push({ id: t, name: n, type: i });
|
|
3241
3241
|
}), o;
|
|
3242
3242
|
}
|
|
3243
3243
|
const Mo = m.xml;
|
|
3244
|
-
function
|
|
3244
|
+
function ar() {
|
|
3245
3245
|
const e = [];
|
|
3246
|
-
if (
|
|
3246
|
+
if (lr().length > 0) {
|
|
3247
3247
|
{
|
|
3248
3248
|
const o = Mo.createElement("label");
|
|
3249
3249
|
o.setAttribute("text", "%{BKY_LABEL_ARGUMENT}"), e.push(o);
|
|
@@ -3255,14 +3255,14 @@ function lr() {
|
|
|
3255
3255
|
}
|
|
3256
3256
|
return e;
|
|
3257
3257
|
}
|
|
3258
|
-
const
|
|
3258
|
+
const Ge = {
|
|
3259
3259
|
name: "UI_CATEGORY",
|
|
3260
|
-
callback:
|
|
3261
|
-
},
|
|
3262
|
-
function
|
|
3260
|
+
callback: ar
|
|
3261
|
+
}, ht = m.xml;
|
|
3262
|
+
function sr(e) {
|
|
3263
3263
|
const o = [];
|
|
3264
3264
|
{
|
|
3265
|
-
const n =
|
|
3265
|
+
const n = ht.createElement("label");
|
|
3266
3266
|
n.setAttribute("text", "%{BKY_LABEL_VARIABLE}"), o.push(n);
|
|
3267
3267
|
}
|
|
3268
3268
|
{
|
|
@@ -3279,35 +3279,35 @@ function ar(e) {
|
|
|
3279
3279
|
const t = e.getVariablesOfType("");
|
|
3280
3280
|
if (t.length <= 0)
|
|
3281
3281
|
return o;
|
|
3282
|
-
t.sort(
|
|
3282
|
+
t.sort(zn.compareByName);
|
|
3283
3283
|
{
|
|
3284
|
-
const n =
|
|
3284
|
+
const n = ht.createElement("label");
|
|
3285
3285
|
n.setAttribute("text", j.LABEL_CREATED), o.push(n);
|
|
3286
3286
|
}
|
|
3287
3287
|
return t.forEach((n) => {
|
|
3288
3288
|
{
|
|
3289
|
-
const i =
|
|
3289
|
+
const i = ht.createElement("block");
|
|
3290
3290
|
i.setAttribute("type", "variable_get_v1"), i.appendChild(bt.generateVariableFieldDom(n)), o.push(i);
|
|
3291
3291
|
}
|
|
3292
3292
|
{
|
|
3293
|
-
const i =
|
|
3293
|
+
const i = ht.createElement("block");
|
|
3294
3294
|
i.setAttribute("type", "variable_set_v1"), i.appendChild(bt.generateVariableFieldDom(n)), o.push(i);
|
|
3295
3295
|
}
|
|
3296
3296
|
}), o;
|
|
3297
3297
|
}
|
|
3298
3298
|
const ce = {
|
|
3299
3299
|
name: "VARIABLE_CATEGORY",
|
|
3300
|
-
callback:
|
|
3300
|
+
callback: sr
|
|
3301
3301
|
};
|
|
3302
3302
|
tn.setConfirm(async (e, o) => {
|
|
3303
|
-
const t = await
|
|
3303
|
+
const t = await ri({
|
|
3304
3304
|
title: "",
|
|
3305
3305
|
text: e
|
|
3306
3306
|
});
|
|
3307
3307
|
o(!!t);
|
|
3308
3308
|
});
|
|
3309
3309
|
tn.setPrompt(async (e, o, t) => {
|
|
3310
|
-
const n = await
|
|
3310
|
+
const n = await li({
|
|
3311
3311
|
title: "",
|
|
3312
3312
|
value: o
|
|
3313
3313
|
});
|
|
@@ -3328,10 +3328,10 @@ const an = (e, o, t) => {
|
|
|
3328
3328
|
};
|
|
3329
3329
|
async function Do(e) {
|
|
3330
3330
|
const o = await an(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./msg-en-kge4l75d.js"), "./msg/zhHans.ts": () => import("./msg-zhHans-hfznrf5k.js") }), `./msg/${e}.ts`, 3);
|
|
3331
|
-
|
|
3331
|
+
qn(o.default);
|
|
3332
3332
|
}
|
|
3333
3333
|
function sn(e) {
|
|
3334
|
-
const o =
|
|
3334
|
+
const o = Pe();
|
|
3335
3335
|
if (!o)
|
|
3336
3336
|
return;
|
|
3337
3337
|
const t = o.getBlockById(e);
|
|
@@ -3345,22 +3345,22 @@ function sn(e) {
|
|
|
3345
3345
|
}
|
|
3346
3346
|
function cn() {
|
|
3347
3347
|
var t;
|
|
3348
|
-
const e =
|
|
3348
|
+
const e = Pe();
|
|
3349
3349
|
if (!e)
|
|
3350
3350
|
return;
|
|
3351
3351
|
const o = (t = e.getTopBlocks(!0)) == null ? void 0 : t[0];
|
|
3352
3352
|
o && sn(o.id);
|
|
3353
3353
|
}
|
|
3354
|
-
class
|
|
3354
|
+
class cr {
|
|
3355
3355
|
init({ contextMenu: o = !0, shortcut: t = !0 } = {
|
|
3356
3356
|
contextMenu: !0,
|
|
3357
3357
|
shortcut: !0
|
|
3358
3358
|
}) {
|
|
3359
|
-
o && (this.blockCopyToStorageContextMenu(), this.blockPasteFromStorageContextMenu()), t && (
|
|
3359
|
+
o && (this.blockCopyToStorageContextMenu(), this.blockPasteFromStorageContextMenu()), t && (z.registry.unregister(
|
|
3360
3360
|
Jt.names.COPY
|
|
3361
|
-
),
|
|
3361
|
+
), z.registry.unregister(
|
|
3362
3362
|
Jt.names.CUT
|
|
3363
|
-
),
|
|
3363
|
+
), z.registry.unregister(
|
|
3364
3364
|
Jt.names.PASTE
|
|
3365
3365
|
), this.blockCopyToStorageShortcut(), this.blockCutToStorageShortcut(), this.blockPasteFromStorageShortcut());
|
|
3366
3366
|
}
|
|
@@ -3370,8 +3370,8 @@ class sr {
|
|
|
3370
3370
|
return j.CROSS_TAB_COPY ? j.CROSS_TAB_COPY : "Copy";
|
|
3371
3371
|
},
|
|
3372
3372
|
preconditionFn: function() {
|
|
3373
|
-
const t =
|
|
3374
|
-
return !t || !
|
|
3373
|
+
const t = Ke();
|
|
3374
|
+
return !t || !_t(t) || !t.isDeletable() || !zt(t) || !t.isMovable() || !Qe(t) ? "disabled" : "enabled";
|
|
3375
3375
|
},
|
|
3376
3376
|
callback: function(t) {
|
|
3377
3377
|
var n;
|
|
@@ -3380,11 +3380,11 @@ class sr {
|
|
|
3380
3380
|
JSON.stringify((n = t.block) == null ? void 0 : n.toCopyData())
|
|
3381
3381
|
);
|
|
3382
3382
|
},
|
|
3383
|
-
scopeType:
|
|
3383
|
+
scopeType: xe.ScopeType.BLOCK,
|
|
3384
3384
|
id: "blockCopyToStorage",
|
|
3385
3385
|
weight: 0
|
|
3386
3386
|
};
|
|
3387
|
-
|
|
3387
|
+
xe.registry.register(o);
|
|
3388
3388
|
}
|
|
3389
3389
|
blockPasteFromStorageContextMenu() {
|
|
3390
3390
|
const o = {
|
|
@@ -3406,20 +3406,20 @@ class sr {
|
|
|
3406
3406
|
const i = JSON.parse(n);
|
|
3407
3407
|
i && t.workspace && ko.paste(i, t.workspace);
|
|
3408
3408
|
},
|
|
3409
|
-
scopeType:
|
|
3409
|
+
scopeType: xe.ScopeType.WORKSPACE,
|
|
3410
3410
|
id: "blockPasteFromStorage",
|
|
3411
3411
|
weight: 0
|
|
3412
3412
|
};
|
|
3413
|
-
|
|
3413
|
+
xe.registry.register(o);
|
|
3414
3414
|
}
|
|
3415
3415
|
blockCopyToStorageShortcut() {
|
|
3416
|
-
const o =
|
|
3416
|
+
const o = z.registry.createSerializedKey(
|
|
3417
3417
|
m.KeyCodes.C,
|
|
3418
3418
|
[m.KeyCodes.CTRL]
|
|
3419
|
-
), t =
|
|
3419
|
+
), t = z.registry.createSerializedKey(
|
|
3420
3420
|
m.KeyCodes.C,
|
|
3421
3421
|
[m.KeyCodes.ALT]
|
|
3422
|
-
), n =
|
|
3422
|
+
), n = z.registry.createSerializedKey(
|
|
3423
3423
|
m.KeyCodes.C,
|
|
3424
3424
|
[m.KeyCodes.META]
|
|
3425
3425
|
), i = {
|
|
@@ -3427,29 +3427,29 @@ class sr {
|
|
|
3427
3427
|
preconditionFn: function(r) {
|
|
3428
3428
|
if (r.options.readOnly || qt.inProgress())
|
|
3429
3429
|
return !1;
|
|
3430
|
-
const l =
|
|
3431
|
-
return !(!l || !
|
|
3430
|
+
const l = Ke();
|
|
3431
|
+
return !(!l || !_t(l) || !l.isDeletable() || !zt(l) || !l.isMovable() || !Qe(l));
|
|
3432
3432
|
},
|
|
3433
3433
|
callback: function(r, l) {
|
|
3434
3434
|
l.preventDefault();
|
|
3435
|
-
const
|
|
3436
|
-
if (!
|
|
3435
|
+
const s = Ke();
|
|
3436
|
+
if (!s || !Qe(s))
|
|
3437
3437
|
return !1;
|
|
3438
|
-
const
|
|
3439
|
-
return
|
|
3438
|
+
const u = s.toCopyData();
|
|
3439
|
+
return u ? (r.hideChaff(), localStorage.setItem("blocklyStash", JSON.stringify(u)), !0) : !1;
|
|
3440
3440
|
},
|
|
3441
3441
|
keyCodes: [o, t, n]
|
|
3442
3442
|
};
|
|
3443
|
-
|
|
3443
|
+
z.registry.register(i);
|
|
3444
3444
|
}
|
|
3445
3445
|
blockCutToStorageShortcut() {
|
|
3446
|
-
const o =
|
|
3446
|
+
const o = z.registry.createSerializedKey(
|
|
3447
3447
|
m.KeyCodes.X,
|
|
3448
3448
|
[m.KeyCodes.CTRL]
|
|
3449
|
-
), t =
|
|
3449
|
+
), t = z.registry.createSerializedKey(
|
|
3450
3450
|
m.KeyCodes.X,
|
|
3451
3451
|
[m.KeyCodes.ALT]
|
|
3452
|
-
), n =
|
|
3452
|
+
), n = z.registry.createSerializedKey(
|
|
3453
3453
|
m.KeyCodes.X,
|
|
3454
3454
|
[m.KeyCodes.META]
|
|
3455
3455
|
), i = {
|
|
@@ -3457,29 +3457,29 @@ class sr {
|
|
|
3457
3457
|
preconditionFn: function(r) {
|
|
3458
3458
|
if (r.options.readOnly || qt.inProgress())
|
|
3459
3459
|
return !1;
|
|
3460
|
-
const l =
|
|
3461
|
-
return !(!l || !
|
|
3460
|
+
const l = Ke();
|
|
3461
|
+
return !(!l || !_t(l) || !l.isDeletable() || !zt(l) || !l.isMovable() || !Qe(l) || l.workspace.isFlyout);
|
|
3462
3462
|
},
|
|
3463
3463
|
callback: function(r, l) {
|
|
3464
3464
|
l.preventDefault();
|
|
3465
|
-
const
|
|
3466
|
-
if (!
|
|
3465
|
+
const s = Ke();
|
|
3466
|
+
if (!s || !_t(s) || !s.isDeletable() || !Qe(s))
|
|
3467
3467
|
return !1;
|
|
3468
|
-
const
|
|
3469
|
-
return
|
|
3468
|
+
const u = s.toCopyData();
|
|
3469
|
+
return u ? (localStorage.setItem("blocklyStash", JSON.stringify(u)), s instanceof Qn ? s.checkAndDelete() : s.dispose(), !0) : !1;
|
|
3470
3470
|
},
|
|
3471
3471
|
keyCodes: [o, t, n]
|
|
3472
3472
|
};
|
|
3473
|
-
|
|
3473
|
+
z.registry.register(i);
|
|
3474
3474
|
}
|
|
3475
3475
|
blockPasteFromStorageShortcut() {
|
|
3476
|
-
const o =
|
|
3476
|
+
const o = z.registry.createSerializedKey(
|
|
3477
3477
|
m.KeyCodes.V,
|
|
3478
3478
|
[m.KeyCodes.CTRL]
|
|
3479
|
-
), t =
|
|
3479
|
+
), t = z.registry.createSerializedKey(
|
|
3480
3480
|
m.KeyCodes.V,
|
|
3481
3481
|
[m.KeyCodes.ALT]
|
|
3482
|
-
), n =
|
|
3482
|
+
), n = z.registry.createSerializedKey(
|
|
3483
3483
|
m.KeyCodes.V,
|
|
3484
3484
|
[m.KeyCodes.META]
|
|
3485
3485
|
), i = {
|
|
@@ -3490,39 +3490,39 @@ class sr {
|
|
|
3490
3490
|
const l = localStorage.getItem("blocklyStash");
|
|
3491
3491
|
if (!l)
|
|
3492
3492
|
return !1;
|
|
3493
|
-
const
|
|
3494
|
-
return !(!
|
|
3493
|
+
const s = JSON.parse(l);
|
|
3494
|
+
return !(!s || !r.isCapacityAvailable(s.typeCounts));
|
|
3495
3495
|
},
|
|
3496
3496
|
callback: function(r, l) {
|
|
3497
3497
|
l.preventDefault();
|
|
3498
|
-
const
|
|
3499
|
-
if (!
|
|
3498
|
+
const s = localStorage.getItem("blocklyStash");
|
|
3499
|
+
if (!s)
|
|
3500
3500
|
return !1;
|
|
3501
|
-
const
|
|
3502
|
-
return
|
|
3501
|
+
const u = JSON.parse(s);
|
|
3502
|
+
return u ? (ko.paste(u, r), !0) : !1;
|
|
3503
3503
|
},
|
|
3504
3504
|
keyCodes: [o, t, n]
|
|
3505
3505
|
};
|
|
3506
|
-
|
|
3506
|
+
z.registry.register(i);
|
|
3507
3507
|
}
|
|
3508
3508
|
}
|
|
3509
|
-
class
|
|
3509
|
+
class ur {
|
|
3510
3510
|
init() {
|
|
3511
|
-
const o =
|
|
3511
|
+
const o = xe.registry.getItem("cleanWorkspace");
|
|
3512
3512
|
o && (o.callback = function(t) {
|
|
3513
3513
|
const n = t.workspace;
|
|
3514
3514
|
if (!n)
|
|
3515
3515
|
return;
|
|
3516
|
-
n.setResizesEnabled(!1),
|
|
3516
|
+
n.setResizesEnabled(!1), F.setGroup(!0);
|
|
3517
3517
|
const i = n.getTopBlocks(!0);
|
|
3518
3518
|
let r = 0;
|
|
3519
|
-
for (let l = 0,
|
|
3520
|
-
if (!
|
|
3519
|
+
for (let l = 0, s; s = i[l]; l++) {
|
|
3520
|
+
if (!s.isMovable())
|
|
3521
3521
|
continue;
|
|
3522
|
-
const
|
|
3523
|
-
|
|
3522
|
+
const u = s.getRelativeToSurfaceXY();
|
|
3523
|
+
s.moveBy(-u.x, r - u.y, ["cleanup"]), s.snapToGrid(), r = s.getRelativeToSurfaceXY().y + s.getHeightWidth().height + 100;
|
|
3524
3524
|
}
|
|
3525
|
-
|
|
3525
|
+
F.setGroup(!1), n.setResizesEnabled(!0);
|
|
3526
3526
|
});
|
|
3527
3527
|
}
|
|
3528
3528
|
}
|
|
@@ -3530,9 +3530,9 @@ function un(e) {
|
|
|
3530
3530
|
const o = e.getParent();
|
|
3531
3531
|
return o && un(o) ? !0 : !o && !!(e.outputConnection || e.previousConnection);
|
|
3532
3532
|
}
|
|
3533
|
-
class
|
|
3533
|
+
class _r {
|
|
3534
3534
|
init() {
|
|
3535
|
-
const o =
|
|
3535
|
+
const o = xe.registry.getItem("blockDisable");
|
|
3536
3536
|
o && (o.preconditionFn = function(t) {
|
|
3537
3537
|
const n = t.block;
|
|
3538
3538
|
return n && !n.isInFlyout && n.workspace.options.disable && n.isEditable() ? n.getInheritedDisabled() || un(n) ? "disabled" : "enabled" : "hidden";
|
|
@@ -4150,13 +4150,13 @@ class _n extends Qt {
|
|
|
4150
4150
|
), this.createBorderRect_(), this.getBorderRect().style.fillOpacity = "1", this.getBorderRect().setAttribute("stroke", "#fff"), this.isFullBlockField() && (this.clickTarget_ = this.sourceBlock_.getSvgRoot());
|
|
4151
4151
|
}
|
|
4152
4152
|
isFullBlockField() {
|
|
4153
|
-
if (!this.getSourceBlock()) throw new
|
|
4153
|
+
if (!this.getSourceBlock()) throw new pt();
|
|
4154
4154
|
const n = this.getConstants();
|
|
4155
4155
|
return this.blockIsSimpleReporter() && !!(n != null && n.FIELD_COLOUR_FULL_BLOCK);
|
|
4156
4156
|
}
|
|
4157
4157
|
blockIsSimpleReporter() {
|
|
4158
4158
|
const t = this.getSourceBlock();
|
|
4159
|
-
if (!t) throw new
|
|
4159
|
+
if (!t) throw new pt();
|
|
4160
4160
|
if (!t.outputConnection) return !1;
|
|
4161
4161
|
for (const n of t.inputList)
|
|
4162
4162
|
if (n.connection || n.fieldRow.length > 1) return !1;
|
|
@@ -4164,7 +4164,7 @@ class _n extends Qt {
|
|
|
4164
4164
|
}
|
|
4165
4165
|
applyColour() {
|
|
4166
4166
|
const t = this.getSourceBlock();
|
|
4167
|
-
if (!t) throw new
|
|
4167
|
+
if (!t) throw new pt();
|
|
4168
4168
|
if (!this.fieldGroup_) return;
|
|
4169
4169
|
const n = this.borderRect_;
|
|
4170
4170
|
if (!n)
|
|
@@ -4178,7 +4178,7 @@ class _n extends Qt {
|
|
|
4178
4178
|
render_() {
|
|
4179
4179
|
super.render_();
|
|
4180
4180
|
const t = this.getSourceBlock();
|
|
4181
|
-
if (!t) throw new
|
|
4181
|
+
if (!t) throw new pt();
|
|
4182
4182
|
t.applyColour();
|
|
4183
4183
|
}
|
|
4184
4184
|
updateSize_(t) {
|
|
@@ -4203,14 +4203,14 @@ class _n extends Qt {
|
|
|
4203
4203
|
showEditor_() {
|
|
4204
4204
|
if (this.dropdownCreate(), !this.picker)
|
|
4205
4205
|
throw Error("Picker not found");
|
|
4206
|
-
|
|
4206
|
+
dt.getContentDiv().appendChild(this.picker), dt.showPositionedByField(
|
|
4207
4207
|
this,
|
|
4208
4208
|
this.dropdownDispose.bind(this)
|
|
4209
4209
|
), this.picker.focus({ preventScroll: !0 });
|
|
4210
4210
|
}
|
|
4211
4211
|
onClick(t) {
|
|
4212
4212
|
const n = t.target, i = n && n.getAttribute("data-colour");
|
|
4213
|
-
i !== null && (this.setValue(i),
|
|
4213
|
+
i !== null && (this.setValue(i), dt.hideIfOwner(this));
|
|
4214
4214
|
}
|
|
4215
4215
|
onKeyDown(t) {
|
|
4216
4216
|
let n = !0, i;
|
|
@@ -4232,7 +4232,7 @@ class _n extends Qt {
|
|
|
4232
4232
|
const r = i.getAttribute("data-colour");
|
|
4233
4233
|
r !== null && this.setValue(r);
|
|
4234
4234
|
}
|
|
4235
|
-
|
|
4235
|
+
dt.hideWithoutAnimation();
|
|
4236
4236
|
break;
|
|
4237
4237
|
default:
|
|
4238
4238
|
n = !1;
|
|
@@ -4243,10 +4243,10 @@ class _n extends Qt {
|
|
|
4243
4243
|
if (!this.highlightedIndex)
|
|
4244
4244
|
return;
|
|
4245
4245
|
const i = this.colours, r = this.columns;
|
|
4246
|
-
let l = this.highlightedIndex % r,
|
|
4247
|
-
l += t,
|
|
4248
|
-
const
|
|
4249
|
-
this.setHighlightedCell(
|
|
4246
|
+
let l = this.highlightedIndex % r, s = Math.floor(this.highlightedIndex / r);
|
|
4247
|
+
l += t, s += n, t < 0 ? l < 0 && s > 0 ? (l = r - 1, s--) : l < 0 && (l = 0) : t > 0 ? l > r - 1 && s < Math.floor(i.length / r) - 1 ? (l = 0, s++) : l > r - 1 && l-- : n < 0 ? s < 0 && (s = 0) : n > 0 && s > Math.floor(i.length / r) - 1 && (s = Math.floor(i.length / r) - 1);
|
|
4248
|
+
const u = this.picker.childNodes[s].childNodes[l], _ = s * r + l;
|
|
4249
|
+
this.setHighlightedCell(u, _);
|
|
4250
4250
|
}
|
|
4251
4251
|
onMouseMove(t) {
|
|
4252
4252
|
const n = t.target, i = n && Number(n.getAttribute("data-index"));
|
|
@@ -4291,21 +4291,21 @@ class _n extends Qt {
|
|
|
4291
4291
|
t
|
|
4292
4292
|
);
|
|
4293
4293
|
let l = null;
|
|
4294
|
-
for (let
|
|
4295
|
-
|
|
4296
|
-
const
|
|
4297
|
-
l.appendChild(
|
|
4298
|
-
|
|
4294
|
+
for (let s = 0; s < n.length; s++) {
|
|
4295
|
+
s % t === 0 && (l = document.createElement("tr"), m.aria.setRole(l, m.aria.Role.ROW), r.appendChild(l));
|
|
4296
|
+
const u = document.createElement("td");
|
|
4297
|
+
l.appendChild(u), u.setAttribute("data-colour", n[s]), u.title = this.titles[s] || n[s], u.id = m.idGenerator.getNextUniqueId(), u.setAttribute("data-index", `${s}`), m.aria.setRole(u, m.aria.Role.GRIDCELL), m.aria.setState(
|
|
4298
|
+
u,
|
|
4299
4299
|
m.aria.State.LABEL,
|
|
4300
|
-
n[
|
|
4300
|
+
n[s]
|
|
4301
4301
|
), m.aria.setState(
|
|
4302
|
-
|
|
4302
|
+
u,
|
|
4303
4303
|
m.aria.State.SELECTED,
|
|
4304
|
-
n[
|
|
4305
|
-
),
|
|
4304
|
+
n[s] === i
|
|
4305
|
+
), u.style.backgroundColor = n[s], n[s] === i && (u.className = "blocklyColourSelected", this.highlightedIndex = s);
|
|
4306
4306
|
}
|
|
4307
4307
|
this.boundEvents.push(
|
|
4308
|
-
|
|
4308
|
+
Ve.conditionalBind(
|
|
4309
4309
|
r,
|
|
4310
4310
|
"pointerdown",
|
|
4311
4311
|
this,
|
|
@@ -4313,7 +4313,7 @@ class _n extends Qt {
|
|
|
4313
4313
|
!0
|
|
4314
4314
|
)
|
|
4315
4315
|
), this.boundEvents.push(
|
|
4316
|
-
|
|
4316
|
+
Ve.conditionalBind(
|
|
4317
4317
|
r,
|
|
4318
4318
|
"pointermove",
|
|
4319
4319
|
this,
|
|
@@ -4321,7 +4321,7 @@ class _n extends Qt {
|
|
|
4321
4321
|
!0
|
|
4322
4322
|
)
|
|
4323
4323
|
), this.boundEvents.push(
|
|
4324
|
-
|
|
4324
|
+
Ve.conditionalBind(
|
|
4325
4325
|
r,
|
|
4326
4326
|
"pointerenter",
|
|
4327
4327
|
this,
|
|
@@ -4329,7 +4329,7 @@ class _n extends Qt {
|
|
|
4329
4329
|
!0
|
|
4330
4330
|
)
|
|
4331
4331
|
), this.boundEvents.push(
|
|
4332
|
-
|
|
4332
|
+
Ve.conditionalBind(
|
|
4333
4333
|
r,
|
|
4334
4334
|
"pointerleave",
|
|
4335
4335
|
this,
|
|
@@ -4337,7 +4337,7 @@ class _n extends Qt {
|
|
|
4337
4337
|
!0
|
|
4338
4338
|
)
|
|
4339
4339
|
), this.boundEvents.push(
|
|
4340
|
-
|
|
4340
|
+
Ve.conditionalBind(
|
|
4341
4341
|
r,
|
|
4342
4342
|
"keydown",
|
|
4343
4343
|
this,
|
|
@@ -4349,7 +4349,7 @@ class _n extends Qt {
|
|
|
4349
4349
|
/** Disposes of events and DOM-references belonging to the colour editor. */
|
|
4350
4350
|
dropdownDispose() {
|
|
4351
4351
|
for (const t of this.boundEvents)
|
|
4352
|
-
|
|
4352
|
+
Ve.unbind(t);
|
|
4353
4353
|
this.boundEvents.length = 0, this.picker = null, this.highlightedIndex = null;
|
|
4354
4354
|
}
|
|
4355
4355
|
static fromJson(t) {
|
|
@@ -4357,7 +4357,7 @@ class _n extends Qt {
|
|
|
4357
4357
|
}
|
|
4358
4358
|
}
|
|
4359
4359
|
_n.prototype.DEFAULT_VALUE = "#ffffff";
|
|
4360
|
-
|
|
4360
|
+
Zn.register(`
|
|
4361
4361
|
.blocklyColourTable {
|
|
4362
4362
|
border-collapse: collapse;
|
|
4363
4363
|
display: block;
|
|
@@ -4384,16 +4384,16 @@ Qn.register(`
|
|
|
4384
4384
|
position: relative;
|
|
4385
4385
|
}
|
|
4386
4386
|
`);
|
|
4387
|
-
function
|
|
4388
|
-
|
|
4387
|
+
function pr() {
|
|
4388
|
+
ei.register("field_colour", _n);
|
|
4389
4389
|
}
|
|
4390
|
-
const pr = new sr();
|
|
4391
|
-
pr.init({ contextMenu: !0, shortcut: !0 });
|
|
4392
4390
|
const dr = new cr();
|
|
4393
|
-
dr.init();
|
|
4391
|
+
dr.init({ contextMenu: !0, shortcut: !0 });
|
|
4394
4392
|
const fr = new ur();
|
|
4395
4393
|
fr.init();
|
|
4396
|
-
_r();
|
|
4394
|
+
const hr = new _r();
|
|
4395
|
+
hr.init();
|
|
4396
|
+
pr();
|
|
4397
4397
|
Vt.Classic.blockStyles = {
|
|
4398
4398
|
color_blocks: {
|
|
4399
4399
|
colourPrimary: "#a5745b",
|
|
@@ -4518,7 +4518,7 @@ Vt.Classic.categoryStyles = {
|
|
|
4518
4518
|
colour: "#a55b80"
|
|
4519
4519
|
}
|
|
4520
4520
|
};
|
|
4521
|
-
const
|
|
4521
|
+
const Tr = on.defineTheme("light", {
|
|
4522
4522
|
name: "light",
|
|
4523
4523
|
base: Vt.Classic,
|
|
4524
4524
|
componentStyles: {
|
|
@@ -4534,7 +4534,7 @@ const hr = on.defineTheme("light", {
|
|
|
4534
4534
|
scrollbarOpacity: 0.4,
|
|
4535
4535
|
cursorColour: ""
|
|
4536
4536
|
}
|
|
4537
|
-
}),
|
|
4537
|
+
}), mr = on.defineTheme("dark", {
|
|
4538
4538
|
name: "dark",
|
|
4539
4539
|
base: Vt.Classic,
|
|
4540
4540
|
componentStyles: {
|
|
@@ -4551,14 +4551,14 @@ const hr = on.defineTheme("light", {
|
|
|
4551
4551
|
cursorColour: ""
|
|
4552
4552
|
}
|
|
4553
4553
|
});
|
|
4554
|
-
function
|
|
4555
|
-
const o =
|
|
4554
|
+
function gr(e) {
|
|
4555
|
+
const o = Pe();
|
|
4556
4556
|
switch (console.log(o), e) {
|
|
4557
4557
|
case "light":
|
|
4558
|
-
o.setTheme(
|
|
4558
|
+
o.setTheme(Tr);
|
|
4559
4559
|
break;
|
|
4560
4560
|
case "dark":
|
|
4561
|
-
o.setTheme(
|
|
4561
|
+
o.setTheme(mr);
|
|
4562
4562
|
break;
|
|
4563
4563
|
}
|
|
4564
4564
|
}
|
|
@@ -5225,14 +5225,14 @@ const Yt = {
|
|
|
5225
5225
|
}
|
|
5226
5226
|
}
|
|
5227
5227
|
]
|
|
5228
|
-
},
|
|
5228
|
+
}, Er = {
|
|
5229
5229
|
kind: "categoryToolbox",
|
|
5230
5230
|
contents: [
|
|
5231
5231
|
{
|
|
5232
5232
|
kind: "category",
|
|
5233
5233
|
name: "%{BKY_CATEGORY_UI}",
|
|
5234
5234
|
categorystyle: "ui_category",
|
|
5235
|
-
custom:
|
|
5235
|
+
custom: Ge.name
|
|
5236
5236
|
},
|
|
5237
5237
|
Ht,
|
|
5238
5238
|
Ft,
|
|
@@ -5261,7 +5261,7 @@ const Yt = {
|
|
|
5261
5261
|
custom: ln.name
|
|
5262
5262
|
}
|
|
5263
5263
|
]
|
|
5264
|
-
},
|
|
5264
|
+
}, vr = {
|
|
5265
5265
|
kind: "categoryToolbox",
|
|
5266
5266
|
contents: [
|
|
5267
5267
|
Ht,
|
|
@@ -5284,7 +5284,7 @@ const Yt = {
|
|
|
5284
5284
|
custom: se.name
|
|
5285
5285
|
}
|
|
5286
5286
|
]
|
|
5287
|
-
},
|
|
5287
|
+
}, yr = {
|
|
5288
5288
|
kind: "categoryToolbox",
|
|
5289
5289
|
contents: [
|
|
5290
5290
|
Ht,
|
|
@@ -5307,14 +5307,14 @@ const Yt = {
|
|
|
5307
5307
|
custom: se.name
|
|
5308
5308
|
}
|
|
5309
5309
|
]
|
|
5310
|
-
},
|
|
5310
|
+
}, br = {
|
|
5311
5311
|
kind: "categoryToolbox",
|
|
5312
5312
|
contents: [
|
|
5313
5313
|
{
|
|
5314
5314
|
kind: "category",
|
|
5315
5315
|
name: "%{BKY_CATEGORY_UI}",
|
|
5316
5316
|
categorystyle: "ui_category",
|
|
5317
|
-
custom:
|
|
5317
|
+
custom: Ge.name
|
|
5318
5318
|
},
|
|
5319
5319
|
Ht,
|
|
5320
5320
|
Ft,
|
|
@@ -5343,39 +5343,39 @@ const Yt = {
|
|
|
5343
5343
|
custom: ln.name
|
|
5344
5344
|
}
|
|
5345
5345
|
]
|
|
5346
|
-
},
|
|
5346
|
+
}, Or = /* @__PURE__ */ we({
|
|
5347
5347
|
__name: "index",
|
|
5348
5348
|
setup(e) {
|
|
5349
5349
|
const { t: o } = Ut(), t = () => {
|
|
5350
|
-
const n =
|
|
5350
|
+
const n = Pe();
|
|
5351
5351
|
if (!n)
|
|
5352
5352
|
return;
|
|
5353
|
-
const i =
|
|
5353
|
+
const i = xe.registry.getItem("cleanWorkspace");
|
|
5354
5354
|
i && i.callback({ workspace: n }, new PointerEvent("dummy"));
|
|
5355
5355
|
};
|
|
5356
|
-
return
|
|
5356
|
+
return ze(() => {
|
|
5357
5357
|
Te.on("cleanWorkspace", t);
|
|
5358
5358
|
}), Nt(() => {
|
|
5359
5359
|
Te.off("cleanWorkspace", t);
|
|
5360
5360
|
}), (n, i) => {
|
|
5361
5361
|
const r = oe("v-btn"), l = oe("v-tooltip");
|
|
5362
|
-
return
|
|
5362
|
+
return J(), Le(l, {
|
|
5363
5363
|
text: N(o)("x-block-lib.tip.hotkeyCtrlQ")
|
|
5364
5364
|
}, {
|
|
5365
|
-
activator:
|
|
5366
|
-
|
|
5365
|
+
activator: je(({ props: s }) => [
|
|
5366
|
+
ne(r, mo(s, {
|
|
5367
5367
|
class: "mr-3",
|
|
5368
5368
|
variant: "outlined",
|
|
5369
5369
|
density: "comfortable",
|
|
5370
|
-
icon: N(
|
|
5371
|
-
onClick: i[0] || (i[0] = (
|
|
5370
|
+
icon: N(ui),
|
|
5371
|
+
onClick: i[0] || (i[0] = (u) => N(Te).emit("cleanWorkspace"))
|
|
5372
5372
|
}), null, 16, ["icon"])
|
|
5373
5373
|
]),
|
|
5374
5374
|
_: 1
|
|
5375
5375
|
}, 8, ["text"]);
|
|
5376
5376
|
};
|
|
5377
5377
|
}
|
|
5378
|
-
}),
|
|
5378
|
+
}), Ir = /* @__PURE__ */ we({
|
|
5379
5379
|
__name: "index",
|
|
5380
5380
|
props: {
|
|
5381
5381
|
modelValue: { type: Boolean, required: !0 },
|
|
@@ -5386,16 +5386,16 @@ const Yt = {
|
|
|
5386
5386
|
const { t: o } = Ut(), t = co(e, "modelValue");
|
|
5387
5387
|
return (n, i) => {
|
|
5388
5388
|
const r = oe("v-btn"), l = oe("v-tooltip");
|
|
5389
|
-
return
|
|
5389
|
+
return J(), Le(l, {
|
|
5390
5390
|
text: N(o)("x-block-lib.tip.hotkeyCtrlW")
|
|
5391
5391
|
}, {
|
|
5392
|
-
activator:
|
|
5393
|
-
|
|
5392
|
+
activator: je(({ props: s }) => [
|
|
5393
|
+
ne(r, mo(s, {
|
|
5394
5394
|
class: "mr-3",
|
|
5395
5395
|
variant: "outlined",
|
|
5396
5396
|
density: "comfortable",
|
|
5397
|
-
icon: t.value ? N(
|
|
5398
|
-
onClick: i[0] || (i[0] = (
|
|
5397
|
+
icon: t.value ? N(fi) : N(hi),
|
|
5398
|
+
onClick: i[0] || (i[0] = (u) => t.value = !t.value)
|
|
5399
5399
|
}), null, 16, ["icon"])
|
|
5400
5400
|
]),
|
|
5401
5401
|
_: 1
|
|
@@ -5403,7 +5403,7 @@ const Yt = {
|
|
|
5403
5403
|
};
|
|
5404
5404
|
}
|
|
5405
5405
|
});
|
|
5406
|
-
var
|
|
5406
|
+
var Cr = Object.defineProperty, St = Object.getOwnPropertySymbols, dn = Object.prototype.hasOwnProperty, fn = Object.prototype.propertyIsEnumerable, xo = (e, o, t) => o in e ? Cr(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t, Xe = (e, o) => {
|
|
5407
5407
|
for (var t in o || (o = {}))
|
|
5408
5408
|
dn.call(o, t) && xo(e, t, o[t]);
|
|
5409
5409
|
if (St)
|
|
@@ -5420,20 +5420,20 @@ var Ir = Object.defineProperty, St = Object.getOwnPropertySymbols, dn = Object.p
|
|
|
5420
5420
|
return t;
|
|
5421
5421
|
};
|
|
5422
5422
|
const Tn = "[vue-draggable-plus]: ";
|
|
5423
|
-
function
|
|
5423
|
+
function Ar(e) {
|
|
5424
5424
|
console.warn(Tn + e);
|
|
5425
5425
|
}
|
|
5426
|
-
function
|
|
5426
|
+
function Lr(e) {
|
|
5427
5427
|
console.error(Tn + e);
|
|
5428
5428
|
}
|
|
5429
5429
|
function Po(e, o, t) {
|
|
5430
5430
|
return t >= 0 && t < e.length && e.splice(t, 0, e.splice(o, 1)[0]), e;
|
|
5431
5431
|
}
|
|
5432
|
-
function
|
|
5432
|
+
function kr(e) {
|
|
5433
5433
|
return e.replace(/-(\w)/g, (o, t) => t ? t.toUpperCase() : "");
|
|
5434
5434
|
}
|
|
5435
|
-
function
|
|
5436
|
-
return Object.keys(e).reduce((o, t) => (typeof e[t] < "u" && (o[
|
|
5435
|
+
function Nr(e) {
|
|
5436
|
+
return Object.keys(e).reduce((o, t) => (typeof e[t] < "u" && (o[kr(t)] = e[t]), o), {});
|
|
5437
5437
|
}
|
|
5438
5438
|
function wo(e, o) {
|
|
5439
5439
|
return Array.isArray(e) && e.splice(o, 1), e;
|
|
@@ -5441,10 +5441,10 @@ function wo(e, o) {
|
|
|
5441
5441
|
function Vo(e, o, t) {
|
|
5442
5442
|
return Array.isArray(e) && e.splice(o, 0, t), e;
|
|
5443
5443
|
}
|
|
5444
|
-
function
|
|
5444
|
+
function Sr(e) {
|
|
5445
5445
|
return typeof e > "u";
|
|
5446
5446
|
}
|
|
5447
|
-
function
|
|
5447
|
+
function Br(e) {
|
|
5448
5448
|
return typeof e == "string";
|
|
5449
5449
|
}
|
|
5450
5450
|
function Uo(e, o, t) {
|
|
@@ -5454,23 +5454,23 @@ function Uo(e, o, t) {
|
|
|
5454
5454
|
function Zt(e) {
|
|
5455
5455
|
e.parentNode && e.parentNode.removeChild(e);
|
|
5456
5456
|
}
|
|
5457
|
-
function
|
|
5457
|
+
function Rr(e, o = document) {
|
|
5458
5458
|
var t;
|
|
5459
5459
|
let n = null;
|
|
5460
|
-
return typeof (o == null ? void 0 : o.querySelector) == "function" ? n = (t = o == null ? void 0 : o.querySelector) == null ? void 0 : t.call(o, e) : n = document.querySelector(e), n ||
|
|
5460
|
+
return typeof (o == null ? void 0 : o.querySelector) == "function" ? n = (t = o == null ? void 0 : o.querySelector) == null ? void 0 : t.call(o, e) : n = document.querySelector(e), n || Ar(`Element not found: ${e}`), n;
|
|
5461
5461
|
}
|
|
5462
|
-
function
|
|
5462
|
+
function Mr(e, o, t = null) {
|
|
5463
5463
|
return function(...n) {
|
|
5464
5464
|
return e.apply(t, n), o.apply(t, n);
|
|
5465
5465
|
};
|
|
5466
5466
|
}
|
|
5467
|
-
function
|
|
5468
|
-
const t =
|
|
5467
|
+
function Dr(e, o) {
|
|
5468
|
+
const t = Xe({}, e);
|
|
5469
5469
|
return Object.keys(o).forEach((n) => {
|
|
5470
|
-
t[n] ? t[n] =
|
|
5470
|
+
t[n] ? t[n] = Mr(e[n], o[n]) : t[n] = o[n];
|
|
5471
5471
|
}), t;
|
|
5472
5472
|
}
|
|
5473
|
-
function
|
|
5473
|
+
function xr(e) {
|
|
5474
5474
|
return e instanceof HTMLElement;
|
|
5475
5475
|
}
|
|
5476
5476
|
function Yo(e, o) {
|
|
@@ -5478,11 +5478,11 @@ function Yo(e, o) {
|
|
|
5478
5478
|
o(t, e[t]);
|
|
5479
5479
|
});
|
|
5480
5480
|
}
|
|
5481
|
-
function
|
|
5481
|
+
function Pr(e) {
|
|
5482
5482
|
return e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && // uppercase letter
|
|
5483
5483
|
(e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97);
|
|
5484
5484
|
}
|
|
5485
|
-
const
|
|
5485
|
+
const wr = Object.assign;
|
|
5486
5486
|
/**!
|
|
5487
5487
|
* Sortable 1.15.2
|
|
5488
5488
|
* @author RubaXa <trash@rubaxa.org>
|
|
@@ -5503,7 +5503,7 @@ function ge(e) {
|
|
|
5503
5503
|
for (var o = 1; o < arguments.length; o++) {
|
|
5504
5504
|
var t = arguments[o] != null ? arguments[o] : {};
|
|
5505
5505
|
o % 2 ? Ko(Object(t), !0).forEach(function(n) {
|
|
5506
|
-
|
|
5506
|
+
Vr(e, n, t[n]);
|
|
5507
5507
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : Ko(Object(t)).forEach(function(n) {
|
|
5508
5508
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n));
|
|
5509
5509
|
});
|
|
@@ -5518,7 +5518,7 @@ function It(e) {
|
|
|
5518
5518
|
return o && typeof Symbol == "function" && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
5519
5519
|
}, It(e);
|
|
5520
5520
|
}
|
|
5521
|
-
function
|
|
5521
|
+
function Vr(e, o, t) {
|
|
5522
5522
|
return o in e ? Object.defineProperty(e, o, {
|
|
5523
5523
|
value: t,
|
|
5524
5524
|
enumerable: !0,
|
|
@@ -5536,7 +5536,7 @@ function be() {
|
|
|
5536
5536
|
return e;
|
|
5537
5537
|
}, be.apply(this, arguments);
|
|
5538
5538
|
}
|
|
5539
|
-
function
|
|
5539
|
+
function Ur(e, o) {
|
|
5540
5540
|
if (e == null)
|
|
5541
5541
|
return {};
|
|
5542
5542
|
var t = {}, n = Object.keys(e), i, r;
|
|
@@ -5544,10 +5544,10 @@ function Vr(e, o) {
|
|
|
5544
5544
|
i = n[r], !(o.indexOf(i) >= 0) && (t[i] = e[i]);
|
|
5545
5545
|
return t;
|
|
5546
5546
|
}
|
|
5547
|
-
function
|
|
5547
|
+
function Yr(e, o) {
|
|
5548
5548
|
if (e == null)
|
|
5549
5549
|
return {};
|
|
5550
|
-
var t =
|
|
5550
|
+
var t = Ur(e, o), n, i;
|
|
5551
5551
|
if (Object.getOwnPropertySymbols) {
|
|
5552
5552
|
var r = Object.getOwnPropertySymbols(e);
|
|
5553
5553
|
for (i = 0; i < r.length; i++)
|
|
@@ -5555,12 +5555,12 @@ function Ur(e, o) {
|
|
|
5555
5555
|
}
|
|
5556
5556
|
return t;
|
|
5557
5557
|
}
|
|
5558
|
-
var
|
|
5558
|
+
var Kr = "1.15.2";
|
|
5559
5559
|
function ye(e) {
|
|
5560
5560
|
if (typeof window < "u" && window.navigator)
|
|
5561
5561
|
return !!/* @__PURE__ */ navigator.userAgent.match(e);
|
|
5562
5562
|
}
|
|
5563
|
-
var Oe = ye(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),
|
|
5563
|
+
var Oe = ye(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), ct = ye(/Edge/i), Fo = ye(/firefox/i), it = ye(/safari/i) && !ye(/chrome/i) && !ye(/android/i), mn = ye(/iP(ad|od|hone)/i), gn = ye(/chrome/i) && ye(/android/i), En = {
|
|
5564
5564
|
capture: !1,
|
|
5565
5565
|
passive: !1
|
|
5566
5566
|
};
|
|
@@ -5586,7 +5586,7 @@ function Bt(e, o) {
|
|
|
5586
5586
|
return !1;
|
|
5587
5587
|
}
|
|
5588
5588
|
}
|
|
5589
|
-
function
|
|
5589
|
+
function Fr(e) {
|
|
5590
5590
|
return e.host && e !== document && e.host.nodeType ? e.host : e.parentNode;
|
|
5591
5591
|
}
|
|
5592
5592
|
function de(e, o, t, n) {
|
|
@@ -5597,7 +5597,7 @@ function de(e, o, t, n) {
|
|
|
5597
5597
|
return e;
|
|
5598
5598
|
if (e === t)
|
|
5599
5599
|
break;
|
|
5600
|
-
} while (e =
|
|
5600
|
+
} while (e = Fr(e));
|
|
5601
5601
|
}
|
|
5602
5602
|
return null;
|
|
5603
5603
|
}
|
|
@@ -5619,7 +5619,7 @@ function v(e, o, t) {
|
|
|
5619
5619
|
!(o in n) && o.indexOf("webkit") === -1 && (o = "-webkit-" + o), n[o] = t + (typeof t == "string" ? "" : "px");
|
|
5620
5620
|
}
|
|
5621
5621
|
}
|
|
5622
|
-
function
|
|
5622
|
+
function We(e, o) {
|
|
5623
5623
|
var t = "";
|
|
5624
5624
|
if (typeof e == "string")
|
|
5625
5625
|
t = e;
|
|
@@ -5645,34 +5645,34 @@ function me() {
|
|
|
5645
5645
|
var e = document.scrollingElement;
|
|
5646
5646
|
return e || document.documentElement;
|
|
5647
5647
|
}
|
|
5648
|
-
function
|
|
5648
|
+
function K(e, o, t, n, i) {
|
|
5649
5649
|
if (!(!e.getBoundingClientRect && e !== window)) {
|
|
5650
|
-
var r, l,
|
|
5651
|
-
if (e !== window && e.parentNode && e !== me() ? (r = e.getBoundingClientRect(), l = r.top,
|
|
5650
|
+
var r, l, s, u, _, d, p;
|
|
5651
|
+
if (e !== window && e.parentNode && e !== me() ? (r = e.getBoundingClientRect(), l = r.top, s = r.left, u = r.bottom, _ = r.right, d = r.height, p = r.width) : (l = 0, s = 0, u = window.innerHeight, _ = window.innerWidth, d = window.innerHeight, p = window.innerWidth), (o || t) && e !== window && (i = i || e.parentNode, !Oe))
|
|
5652
5652
|
do
|
|
5653
5653
|
if (i && i.getBoundingClientRect && (v(i, "transform") !== "none" || t && v(i, "position") !== "static")) {
|
|
5654
5654
|
var T = i.getBoundingClientRect();
|
|
5655
|
-
l -= T.top + parseInt(v(i, "border-top-width")),
|
|
5655
|
+
l -= T.top + parseInt(v(i, "border-top-width")), s -= T.left + parseInt(v(i, "border-left-width")), u = l + r.height, _ = s + r.width;
|
|
5656
5656
|
break;
|
|
5657
5657
|
}
|
|
5658
5658
|
while (i = i.parentNode);
|
|
5659
5659
|
if (n && e !== window) {
|
|
5660
|
-
var h =
|
|
5661
|
-
h && (l /= b,
|
|
5660
|
+
var h = We(i || e), A = h && h.a, b = h && h.d;
|
|
5661
|
+
h && (l /= b, s /= A, p /= A, d /= b, u = l + d, _ = s + p);
|
|
5662
5662
|
}
|
|
5663
5663
|
return {
|
|
5664
5664
|
top: l,
|
|
5665
|
-
left:
|
|
5666
|
-
bottom:
|
|
5667
|
-
right:
|
|
5668
|
-
width:
|
|
5669
|
-
height:
|
|
5665
|
+
left: s,
|
|
5666
|
+
bottom: u,
|
|
5667
|
+
right: _,
|
|
5668
|
+
width: p,
|
|
5669
|
+
height: d
|
|
5670
5670
|
};
|
|
5671
5671
|
}
|
|
5672
5672
|
}
|
|
5673
5673
|
function Go(e, o, t) {
|
|
5674
|
-
for (var n = Ae(e, !0), i =
|
|
5675
|
-
var r =
|
|
5674
|
+
for (var n = Ae(e, !0), i = K(e)[o]; n; ) {
|
|
5675
|
+
var r = K(n)[t], l = void 0;
|
|
5676
5676
|
if (l = i >= r, !l)
|
|
5677
5677
|
return n;
|
|
5678
5678
|
if (n === me())
|
|
@@ -5709,12 +5709,12 @@ function Xo(e) {
|
|
|
5709
5709
|
var o = 0, t = 0, n = me();
|
|
5710
5710
|
if (e)
|
|
5711
5711
|
do {
|
|
5712
|
-
var i =
|
|
5712
|
+
var i = We(e), r = i.a, l = i.d;
|
|
5713
5713
|
o += e.scrollLeft * r, t += e.scrollTop * l;
|
|
5714
5714
|
} while (e !== n && (e = e.parentNode));
|
|
5715
5715
|
return [o, t];
|
|
5716
5716
|
}
|
|
5717
|
-
function
|
|
5717
|
+
function Hr(e, o) {
|
|
5718
5718
|
for (var t in e)
|
|
5719
5719
|
if (e.hasOwnProperty(t)) {
|
|
5720
5720
|
for (var n in o)
|
|
@@ -5741,7 +5741,7 @@ function Ae(e, o) {
|
|
|
5741
5741
|
while (t = t.parentNode);
|
|
5742
5742
|
return me();
|
|
5743
5743
|
}
|
|
5744
|
-
function
|
|
5744
|
+
function Gr(e, o) {
|
|
5745
5745
|
if (e && o)
|
|
5746
5746
|
for (var t in o)
|
|
5747
5747
|
o.hasOwnProperty(t) && (e[t] = o[t]);
|
|
@@ -5750,19 +5750,19 @@ function Hr(e, o) {
|
|
|
5750
5750
|
function eo(e, o) {
|
|
5751
5751
|
return Math.round(e.top) === Math.round(o.top) && Math.round(e.left) === Math.round(o.left) && Math.round(e.height) === Math.round(o.height) && Math.round(e.width) === Math.round(o.width);
|
|
5752
5752
|
}
|
|
5753
|
-
var
|
|
5753
|
+
var rt;
|
|
5754
5754
|
function yn(e, o) {
|
|
5755
5755
|
return function() {
|
|
5756
|
-
if (!
|
|
5756
|
+
if (!rt) {
|
|
5757
5757
|
var t = arguments, n = this;
|
|
5758
|
-
t.length === 1 ? e.call(n, t[0]) : e.apply(n, t),
|
|
5759
|
-
|
|
5758
|
+
t.length === 1 ? e.call(n, t[0]) : e.apply(n, t), rt = setTimeout(function() {
|
|
5759
|
+
rt = void 0;
|
|
5760
5760
|
}, o);
|
|
5761
5761
|
}
|
|
5762
5762
|
};
|
|
5763
5763
|
}
|
|
5764
|
-
function
|
|
5765
|
-
clearTimeout(
|
|
5764
|
+
function Xr() {
|
|
5765
|
+
clearTimeout(rt), rt = void 0;
|
|
5766
5766
|
}
|
|
5767
5767
|
function bn(e, o, t) {
|
|
5768
5768
|
e.scrollLeft += o, e.scrollTop += t;
|
|
@@ -5774,15 +5774,15 @@ function On(e) {
|
|
|
5774
5774
|
function In(e, o, t) {
|
|
5775
5775
|
var n = {};
|
|
5776
5776
|
return Array.from(e.children).forEach(function(i) {
|
|
5777
|
-
var r, l,
|
|
5777
|
+
var r, l, s, u;
|
|
5778
5778
|
if (!(!de(i, o.draggable, e, !1) || i.animated || i === t)) {
|
|
5779
|
-
var
|
|
5780
|
-
n.left = Math.min((r = n.left) !== null && r !== void 0 ? r : 1 / 0,
|
|
5779
|
+
var _ = K(i);
|
|
5780
|
+
n.left = Math.min((r = n.left) !== null && r !== void 0 ? r : 1 / 0, _.left), n.top = Math.min((l = n.top) !== null && l !== void 0 ? l : 1 / 0, _.top), n.right = Math.max((s = n.right) !== null && s !== void 0 ? s : -1 / 0, _.right), n.bottom = Math.max((u = n.bottom) !== null && u !== void 0 ? u : -1 / 0, _.bottom);
|
|
5781
5781
|
}
|
|
5782
5782
|
}), n.width = n.right - n.left, n.height = n.bottom - n.top, n.x = n.left, n.y = n.top, n;
|
|
5783
5783
|
}
|
|
5784
|
-
var
|
|
5785
|
-
function
|
|
5784
|
+
var ie = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
|
|
5785
|
+
function $r() {
|
|
5786
5786
|
var e = [], o;
|
|
5787
5787
|
return {
|
|
5788
5788
|
captureAnimationState: function() {
|
|
@@ -5792,11 +5792,11 @@ function Xr() {
|
|
|
5792
5792
|
if (!(v(n, "display") === "none" || n === y.ghost)) {
|
|
5793
5793
|
e.push({
|
|
5794
5794
|
target: n,
|
|
5795
|
-
rect:
|
|
5795
|
+
rect: K(n)
|
|
5796
5796
|
});
|
|
5797
5797
|
var i = ge({}, e[e.length - 1].rect);
|
|
5798
5798
|
if (n.thisAnimationDuration) {
|
|
5799
|
-
var r =
|
|
5799
|
+
var r = We(n, !0);
|
|
5800
5800
|
r && (i.top -= r.f, i.left -= r.e);
|
|
5801
5801
|
}
|
|
5802
5802
|
n.fromRect = i;
|
|
@@ -5808,7 +5808,7 @@ function Xr() {
|
|
|
5808
5808
|
e.push(t);
|
|
5809
5809
|
},
|
|
5810
5810
|
removeAnimationState: function(t) {
|
|
5811
|
-
e.splice(
|
|
5811
|
+
e.splice(Hr(e, {
|
|
5812
5812
|
target: t
|
|
5813
5813
|
}), 1);
|
|
5814
5814
|
},
|
|
@@ -5820,11 +5820,11 @@ function Xr() {
|
|
|
5820
5820
|
}
|
|
5821
5821
|
var i = !1, r = 0;
|
|
5822
5822
|
e.forEach(function(l) {
|
|
5823
|
-
var
|
|
5824
|
-
A && (
|
|
5825
|
-
(h.top -
|
|
5826
|
-
|
|
5827
|
-
},
|
|
5823
|
+
var s = 0, u = l.target, _ = u.fromRect, d = K(u), p = u.prevFromRect, T = u.prevToRect, h = l.rect, A = We(u, !0);
|
|
5824
|
+
A && (d.top -= A.f, d.left -= A.e), u.toRect = d, u.thisAnimationDuration && eo(p, d) && !eo(_, d) && // Make sure animatingRect is on line between toRect & fromRect
|
|
5825
|
+
(h.top - d.top) / (h.left - d.left) === (_.top - d.top) / (_.left - d.left) && (s = Wr(h, p, T, n.options)), eo(d, _) || (u.prevFromRect = _, u.prevToRect = d, s || (s = n.options.animation), n.animate(u, h, d, s)), s && (i = !0, r = Math.max(r, s), clearTimeout(u.animationResetTimer), u.animationResetTimer = setTimeout(function() {
|
|
5826
|
+
u.animationTime = 0, u.prevFromRect = null, u.fromRect = null, u.prevToRect = null, u.thisAnimationDuration = null;
|
|
5827
|
+
}, s), u.thisAnimationDuration = s);
|
|
5828
5828
|
}), clearTimeout(o), i ? o = setTimeout(function() {
|
|
5829
5829
|
typeof t == "function" && t();
|
|
5830
5830
|
}, r) : typeof t == "function" && t(), e = [];
|
|
@@ -5832,30 +5832,30 @@ function Xr() {
|
|
|
5832
5832
|
animate: function(t, n, i, r) {
|
|
5833
5833
|
if (r) {
|
|
5834
5834
|
v(t, "transition", ""), v(t, "transform", "");
|
|
5835
|
-
var l =
|
|
5836
|
-
t.animatingX = !!
|
|
5835
|
+
var l = We(this.el), s = l && l.a, u = l && l.d, _ = (n.left - i.left) / (s || 1), d = (n.top - i.top) / (u || 1);
|
|
5836
|
+
t.animatingX = !!_, t.animatingY = !!d, v(t, "transform", "translate3d(" + _ + "px," + d + "px,0)"), this.forRepaintDummy = jr(t), v(t, "transition", "transform " + r + "ms" + (this.options.easing ? " " + this.options.easing : "")), v(t, "transform", "translate3d(0,0,0)"), typeof t.animated == "number" && clearTimeout(t.animated), t.animated = setTimeout(function() {
|
|
5837
5837
|
v(t, "transition", ""), v(t, "transform", ""), t.animated = !1, t.animatingX = !1, t.animatingY = !1;
|
|
5838
5838
|
}, r);
|
|
5839
5839
|
}
|
|
5840
5840
|
}
|
|
5841
5841
|
};
|
|
5842
5842
|
}
|
|
5843
|
-
function
|
|
5843
|
+
function jr(e) {
|
|
5844
5844
|
return e.offsetWidth;
|
|
5845
5845
|
}
|
|
5846
|
-
function
|
|
5846
|
+
function Wr(e, o, t, n) {
|
|
5847
5847
|
return Math.sqrt(Math.pow(o.top - e.top, 2) + Math.pow(o.left - e.left, 2)) / Math.sqrt(Math.pow(o.top - t.top, 2) + Math.pow(o.left - t.left, 2)) * n.animation;
|
|
5848
5848
|
}
|
|
5849
|
-
var
|
|
5849
|
+
var Ue = [], to = {
|
|
5850
5850
|
initializeByDefault: !0
|
|
5851
|
-
},
|
|
5851
|
+
}, ut = {
|
|
5852
5852
|
mount: function(e) {
|
|
5853
5853
|
for (var o in to)
|
|
5854
5854
|
to.hasOwnProperty(o) && !(o in e) && (e[o] = to[o]);
|
|
5855
|
-
|
|
5855
|
+
Ue.forEach(function(t) {
|
|
5856
5856
|
if (t.pluginName === e.pluginName)
|
|
5857
5857
|
throw "Sortable: Cannot mount plugin ".concat(e.pluginName, " more than once");
|
|
5858
|
-
}),
|
|
5858
|
+
}), Ue.push(e);
|
|
5859
5859
|
},
|
|
5860
5860
|
pluginEvent: function(e, o, t) {
|
|
5861
5861
|
var n = this;
|
|
@@ -5863,7 +5863,7 @@ var Ve = [], to = {
|
|
|
5863
5863
|
n.eventCanceled = !0;
|
|
5864
5864
|
};
|
|
5865
5865
|
var i = e + "Global";
|
|
5866
|
-
|
|
5866
|
+
Ue.forEach(function(r) {
|
|
5867
5867
|
o[r.pluginName] && (o[r.pluginName][i] && o[r.pluginName][i](ge({
|
|
5868
5868
|
sortable: o
|
|
5869
5869
|
}, t)), o.options[r.pluginName] && o[r.pluginName][e] && o[r.pluginName][e](ge({
|
|
@@ -5872,11 +5872,11 @@ var Ve = [], to = {
|
|
|
5872
5872
|
});
|
|
5873
5873
|
},
|
|
5874
5874
|
initializePlugins: function(e, o, t, n) {
|
|
5875
|
-
|
|
5876
|
-
var
|
|
5877
|
-
if (!(!e.options[
|
|
5878
|
-
var
|
|
5879
|
-
|
|
5875
|
+
Ue.forEach(function(l) {
|
|
5876
|
+
var s = l.pluginName;
|
|
5877
|
+
if (!(!e.options[s] && !l.initializeByDefault)) {
|
|
5878
|
+
var u = new l(e, o, e.options);
|
|
5879
|
+
u.sortable = e, u.options = e.options, e[s] = u, be(t, u.defaults);
|
|
5880
5880
|
}
|
|
5881
5881
|
});
|
|
5882
5882
|
for (var i in e.options)
|
|
@@ -5887,39 +5887,39 @@ var Ve = [], to = {
|
|
|
5887
5887
|
},
|
|
5888
5888
|
getEventProperties: function(e, o) {
|
|
5889
5889
|
var t = {};
|
|
5890
|
-
return
|
|
5890
|
+
return Ue.forEach(function(n) {
|
|
5891
5891
|
typeof n.eventProperties == "function" && be(t, n.eventProperties.call(o[n.pluginName], e));
|
|
5892
5892
|
}), t;
|
|
5893
5893
|
},
|
|
5894
5894
|
modifyOption: function(e, o, t) {
|
|
5895
5895
|
var n;
|
|
5896
|
-
return
|
|
5896
|
+
return Ue.forEach(function(i) {
|
|
5897
5897
|
e[i.pluginName] && i.optionListeners && typeof i.optionListeners[o] == "function" && (n = i.optionListeners[o].call(e[i.pluginName], t));
|
|
5898
5898
|
}), n;
|
|
5899
5899
|
}
|
|
5900
5900
|
};
|
|
5901
|
-
function
|
|
5902
|
-
var o = e.sortable, t = e.rootEl, n = e.name, i = e.targetEl, r = e.cloneEl, l = e.toEl,
|
|
5903
|
-
if (o = o || t && t[
|
|
5904
|
-
var b,
|
|
5905
|
-
window.CustomEvent && !Oe && !
|
|
5901
|
+
function Jr(e) {
|
|
5902
|
+
var o = e.sortable, t = e.rootEl, n = e.name, i = e.targetEl, r = e.cloneEl, l = e.toEl, s = e.fromEl, u = e.oldIndex, _ = e.newIndex, d = e.oldDraggableIndex, p = e.newDraggableIndex, T = e.originalEvent, h = e.putSortable, A = e.extraEventProperties;
|
|
5903
|
+
if (o = o || t && t[ie], !!o) {
|
|
5904
|
+
var b, H = o.options, S = "on" + n.charAt(0).toUpperCase() + n.substr(1);
|
|
5905
|
+
window.CustomEvent && !Oe && !ct ? b = new CustomEvent(n, {
|
|
5906
5906
|
bubbles: !0,
|
|
5907
5907
|
cancelable: !0
|
|
5908
|
-
}) : (b = document.createEvent("Event"), b.initEvent(n, !0, !0)), b.to = l || t, b.from =
|
|
5909
|
-
var
|
|
5910
|
-
for (var w in
|
|
5911
|
-
b[w] =
|
|
5912
|
-
t && t.dispatchEvent(b),
|
|
5908
|
+
}) : (b = document.createEvent("Event"), b.initEvent(n, !0, !0)), b.to = l || t, b.from = s || t, b.item = i || t, b.clone = r, b.oldIndex = u, b.newIndex = _, b.oldDraggableIndex = d, b.newDraggableIndex = p, b.originalEvent = T, b.pullMode = h ? h.lastPutMode : void 0;
|
|
5909
|
+
var Q = ge(ge({}, A), ut.getEventProperties(n, o));
|
|
5910
|
+
for (var w in Q)
|
|
5911
|
+
b[w] = Q[w];
|
|
5912
|
+
t && t.dispatchEvent(b), H[S] && H[S].call(o, b);
|
|
5913
5913
|
}
|
|
5914
5914
|
}
|
|
5915
|
-
var
|
|
5916
|
-
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n = t.evt, i =
|
|
5917
|
-
|
|
5915
|
+
var zr = ["evt"], Z = function(e, o) {
|
|
5916
|
+
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n = t.evt, i = Yr(t, zr);
|
|
5917
|
+
ut.pluginEvent.bind(y)(e, o, ge({
|
|
5918
5918
|
dragEl: f,
|
|
5919
5919
|
parentEl: P,
|
|
5920
5920
|
ghostEl: I,
|
|
5921
5921
|
rootEl: M,
|
|
5922
|
-
nextEl:
|
|
5922
|
+
nextEl: Me,
|
|
5923
5923
|
lastDownEl: Ct,
|
|
5924
5924
|
cloneEl: D,
|
|
5925
5925
|
cloneHidden: Ce,
|
|
@@ -5927,8 +5927,8 @@ var Jr = ["evt"], q = function(e, o) {
|
|
|
5927
5927
|
putSortable: $,
|
|
5928
5928
|
activeSortable: y.active,
|
|
5929
5929
|
originalEvent: n,
|
|
5930
|
-
oldIndex:
|
|
5931
|
-
oldDraggableIndex:
|
|
5930
|
+
oldIndex: $e,
|
|
5931
|
+
oldDraggableIndex: lt,
|
|
5932
5932
|
newIndex: te,
|
|
5933
5933
|
newDraggableIndex: Ie,
|
|
5934
5934
|
hideGhostForTarget: kn,
|
|
@@ -5940,7 +5940,7 @@ var Jr = ["evt"], q = function(e, o) {
|
|
|
5940
5940
|
Ce = !1;
|
|
5941
5941
|
},
|
|
5942
5942
|
dispatchSortableEvent: function(r) {
|
|
5943
|
-
|
|
5943
|
+
q({
|
|
5944
5944
|
sortable: o,
|
|
5945
5945
|
name: r,
|
|
5946
5946
|
originalEvent: n
|
|
@@ -5948,19 +5948,19 @@ var Jr = ["evt"], q = function(e, o) {
|
|
|
5948
5948
|
}
|
|
5949
5949
|
}, i));
|
|
5950
5950
|
};
|
|
5951
|
-
function
|
|
5952
|
-
|
|
5951
|
+
function q(e) {
|
|
5952
|
+
Jr(ge({
|
|
5953
5953
|
putSortable: $,
|
|
5954
5954
|
cloneEl: D,
|
|
5955
5955
|
targetEl: f,
|
|
5956
5956
|
rootEl: M,
|
|
5957
|
-
oldIndex:
|
|
5958
|
-
oldDraggableIndex:
|
|
5957
|
+
oldIndex: $e,
|
|
5958
|
+
oldDraggableIndex: lt,
|
|
5959
5959
|
newIndex: te,
|
|
5960
5960
|
newDraggableIndex: Ie
|
|
5961
5961
|
}, e));
|
|
5962
5962
|
}
|
|
5963
|
-
var f, P, I, M,
|
|
5963
|
+
var f, P, I, M, Me, Ct, D, Ce, $e, te, lt, Ie, Tt, $, Fe = !1, Rt = !1, Mt = [], Be, pe, oo, no, $o, jo, et, Ye, at, st = !1, mt = !1, At, W, io = [], _o = !1, Dt = [], jt = typeof document < "u", gt = mn, Wo = ct || Oe ? "cssFloat" : "float", qr = jt && !gn && !mn && "draggable" in document.createElement("div"), Cn = function() {
|
|
5964
5964
|
if (jt) {
|
|
5965
5965
|
if (Oe)
|
|
5966
5966
|
return !1;
|
|
@@ -5968,43 +5968,43 @@ var f, P, I, M, Be, Ct, D, Ce, Xe, te, rt, Ie, ht, $, Ke = !1, Rt = !1, Mt = [],
|
|
|
5968
5968
|
return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
|
|
5969
5969
|
}
|
|
5970
5970
|
}(), An = function(e, o) {
|
|
5971
|
-
var t = v(e), n = parseInt(t.width) - parseInt(t.paddingLeft) - parseInt(t.paddingRight) - parseInt(t.borderLeftWidth) - parseInt(t.borderRightWidth), i = qe(e, 0, o), r = qe(e, 1, o), l = i && v(i),
|
|
5971
|
+
var t = v(e), n = parseInt(t.width) - parseInt(t.paddingLeft) - parseInt(t.paddingRight) - parseInt(t.borderLeftWidth) - parseInt(t.borderRightWidth), i = qe(e, 0, o), r = qe(e, 1, o), l = i && v(i), s = r && v(r), u = l && parseInt(l.marginLeft) + parseInt(l.marginRight) + K(i).width, _ = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + K(r).width;
|
|
5972
5972
|
if (t.display === "flex")
|
|
5973
5973
|
return t.flexDirection === "column" || t.flexDirection === "column-reverse" ? "vertical" : "horizontal";
|
|
5974
5974
|
if (t.display === "grid")
|
|
5975
5975
|
return t.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
|
|
5976
5976
|
if (i && l.float && l.float !== "none") {
|
|
5977
|
-
var
|
|
5978
|
-
return r && (
|
|
5979
|
-
}
|
|
5980
|
-
return i && (l.display === "block" || l.display === "flex" || l.display === "table" || l.display === "grid" ||
|
|
5981
|
-
},
|
|
5982
|
-
var n = t ? e.left : e.top, i = t ? e.right : e.bottom, r = t ? e.width : e.height, l = t ? o.left : o.top,
|
|
5983
|
-
return n === l || i ===
|
|
5984
|
-
},
|
|
5977
|
+
var d = l.float === "left" ? "left" : "right";
|
|
5978
|
+
return r && (s.clear === "both" || s.clear === d) ? "vertical" : "horizontal";
|
|
5979
|
+
}
|
|
5980
|
+
return i && (l.display === "block" || l.display === "flex" || l.display === "table" || l.display === "grid" || u >= n && t[Wo] === "none" || r && t[Wo] === "none" && u + _ > n) ? "vertical" : "horizontal";
|
|
5981
|
+
}, Qr = function(e, o, t) {
|
|
5982
|
+
var n = t ? e.left : e.top, i = t ? e.right : e.bottom, r = t ? e.width : e.height, l = t ? o.left : o.top, s = t ? o.right : o.bottom, u = t ? o.width : o.height;
|
|
5983
|
+
return n === l || i === s || n + r / 2 === l + u / 2;
|
|
5984
|
+
}, Zr = function(e, o) {
|
|
5985
5985
|
var t;
|
|
5986
5986
|
return Mt.some(function(n) {
|
|
5987
|
-
var i = n[
|
|
5987
|
+
var i = n[ie].options.emptyInsertThreshold;
|
|
5988
5988
|
if (!(!i || Oo(n))) {
|
|
5989
|
-
var r =
|
|
5990
|
-
if (l &&
|
|
5989
|
+
var r = K(n), l = e >= r.left - i && e <= r.right + i, s = o >= r.top - i && o <= r.bottom + i;
|
|
5990
|
+
if (l && s)
|
|
5991
5991
|
return t = n;
|
|
5992
5992
|
}
|
|
5993
5993
|
}), t;
|
|
5994
5994
|
}, Ln = function(e) {
|
|
5995
5995
|
function o(i, r) {
|
|
5996
|
-
return function(l,
|
|
5997
|
-
var
|
|
5998
|
-
if (i == null && (r ||
|
|
5996
|
+
return function(l, s, u, _) {
|
|
5997
|
+
var d = l.options.group.name && s.options.group.name && l.options.group.name === s.options.group.name;
|
|
5998
|
+
if (i == null && (r || d))
|
|
5999
5999
|
return !0;
|
|
6000
6000
|
if (i == null || i === !1)
|
|
6001
6001
|
return !1;
|
|
6002
6002
|
if (r && i === "clone")
|
|
6003
6003
|
return i;
|
|
6004
6004
|
if (typeof i == "function")
|
|
6005
|
-
return o(i(l,
|
|
6006
|
-
var
|
|
6007
|
-
return i === !0 || typeof i == "string" && i ===
|
|
6005
|
+
return o(i(l, s, u, _), r)(l, s, u, _);
|
|
6006
|
+
var p = (r ? l : s).options.group.name;
|
|
6007
|
+
return i === !0 || typeof i == "string" && i === p || i.join && i.indexOf(p) > -1;
|
|
6008
6008
|
};
|
|
6009
6009
|
}
|
|
6010
6010
|
var t = {}, n = e.group;
|
|
@@ -6020,24 +6020,24 @@ jt && !gn && document.addEventListener("click", function(e) {
|
|
|
6020
6020
|
if (Rt)
|
|
6021
6021
|
return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), Rt = !1, !1;
|
|
6022
6022
|
}, !0);
|
|
6023
|
-
var
|
|
6023
|
+
var Re = function(e) {
|
|
6024
6024
|
if (f) {
|
|
6025
6025
|
e = e.touches ? e.touches[0] : e;
|
|
6026
|
-
var o =
|
|
6026
|
+
var o = Zr(e.clientX, e.clientY);
|
|
6027
6027
|
if (o) {
|
|
6028
6028
|
var t = {};
|
|
6029
6029
|
for (var n in e)
|
|
6030
6030
|
e.hasOwnProperty(n) && (t[n] = e[n]);
|
|
6031
|
-
t.target = t.rootEl = o, t.preventDefault = void 0, t.stopPropagation = void 0, o[
|
|
6031
|
+
t.target = t.rootEl = o, t.preventDefault = void 0, t.stopPropagation = void 0, o[ie]._onDragOver(t);
|
|
6032
6032
|
}
|
|
6033
6033
|
}
|
|
6034
|
-
},
|
|
6035
|
-
f && f.parentNode[
|
|
6034
|
+
}, el = function(e) {
|
|
6035
|
+
f && f.parentNode[ie]._isOutsideThisEl(e.target);
|
|
6036
6036
|
};
|
|
6037
6037
|
function y(e, o) {
|
|
6038
6038
|
if (!(e && e.nodeType && e.nodeType === 1))
|
|
6039
6039
|
throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));
|
|
6040
|
-
this.el = e, this.options = o = be({}, o), e[
|
|
6040
|
+
this.el = e, this.options = o = be({}, o), e[ie] = this;
|
|
6041
6041
|
var t = {
|
|
6042
6042
|
group: null,
|
|
6043
6043
|
sort: !0,
|
|
@@ -6080,96 +6080,96 @@ function y(e, o) {
|
|
|
6080
6080
|
x: 0,
|
|
6081
6081
|
y: 0
|
|
6082
6082
|
},
|
|
6083
|
-
supportPointer: y.supportPointer !== !1 && "PointerEvent" in window && !
|
|
6083
|
+
supportPointer: y.supportPointer !== !1 && "PointerEvent" in window && !it,
|
|
6084
6084
|
emptyInsertThreshold: 5
|
|
6085
6085
|
};
|
|
6086
|
-
|
|
6086
|
+
ut.initializePlugins(this, e, t);
|
|
6087
6087
|
for (var n in t)
|
|
6088
6088
|
!(n in o) && (o[n] = t[n]);
|
|
6089
6089
|
Ln(o);
|
|
6090
6090
|
for (var i in this)
|
|
6091
6091
|
i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
|
|
6092
|
-
this.nativeDraggable = o.forceFallback ? !1 :
|
|
6092
|
+
this.nativeDraggable = o.forceFallback ? !1 : qr, this.nativeDraggable && (this.options.touchStartThreshold = 1), o.supportPointer ? k(e, "pointerdown", this._onTapStart) : (k(e, "mousedown", this._onTapStart), k(e, "touchstart", this._onTapStart)), this.nativeDraggable && (k(e, "dragover", this), k(e, "dragenter", this)), Mt.push(this.el), o.store && o.store.get && this.sort(o.store.get(this) || []), be(this, $r());
|
|
6093
6093
|
}
|
|
6094
6094
|
y.prototype = /** @lends Sortable.prototype */
|
|
6095
6095
|
{
|
|
6096
6096
|
constructor: y,
|
|
6097
6097
|
_isOutsideThisEl: function(e) {
|
|
6098
|
-
!this.el.contains(e) && e !== this.el && (
|
|
6098
|
+
!this.el.contains(e) && e !== this.el && (Ye = null);
|
|
6099
6099
|
},
|
|
6100
6100
|
_getDirection: function(e, o) {
|
|
6101
6101
|
return typeof this.options.direction == "function" ? this.options.direction.call(this, e, o, f) : this.options.direction;
|
|
6102
6102
|
},
|
|
6103
6103
|
_onTapStart: function(e) {
|
|
6104
6104
|
if (e.cancelable) {
|
|
6105
|
-
var o = this, t = this.el, n = this.options, i = n.preventOnFilter, r = e.type, l = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e,
|
|
6106
|
-
if (
|
|
6107
|
-
if (
|
|
6108
|
-
if (
|
|
6109
|
-
|
|
6105
|
+
var o = this, t = this.el, n = this.options, i = n.preventOnFilter, r = e.type, l = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, s = (l || e).target, u = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || s, _ = n.filter;
|
|
6106
|
+
if (sl(t), !f && !(/mousedown|pointerdown/.test(r) && e.button !== 0 || n.disabled) && !u.isContentEditable && !(!this.nativeDraggable && it && s && s.tagName.toUpperCase() === "SELECT") && (s = de(s, n.draggable, t, !1), !(s && s.animated) && Ct !== s)) {
|
|
6107
|
+
if ($e = ae(s), lt = ae(s, n.draggable), typeof _ == "function") {
|
|
6108
|
+
if (_.call(this, e, s, this)) {
|
|
6109
|
+
q({
|
|
6110
6110
|
sortable: o,
|
|
6111
|
-
rootEl:
|
|
6111
|
+
rootEl: u,
|
|
6112
6112
|
name: "filter",
|
|
6113
|
-
targetEl:
|
|
6113
|
+
targetEl: s,
|
|
6114
6114
|
toEl: t,
|
|
6115
6115
|
fromEl: t
|
|
6116
|
-
}),
|
|
6116
|
+
}), Z("filter", o, {
|
|
6117
6117
|
evt: e
|
|
6118
6118
|
}), i && e.cancelable && e.preventDefault();
|
|
6119
6119
|
return;
|
|
6120
6120
|
}
|
|
6121
|
-
} else if (
|
|
6122
|
-
if (
|
|
6123
|
-
return
|
|
6121
|
+
} else if (_ && (_ = _.split(",").some(function(d) {
|
|
6122
|
+
if (d = de(u, d.trim(), t, !1), d)
|
|
6123
|
+
return q({
|
|
6124
6124
|
sortable: o,
|
|
6125
|
-
rootEl:
|
|
6125
|
+
rootEl: d,
|
|
6126
6126
|
name: "filter",
|
|
6127
|
-
targetEl:
|
|
6127
|
+
targetEl: s,
|
|
6128
6128
|
fromEl: t,
|
|
6129
6129
|
toEl: t
|
|
6130
|
-
}),
|
|
6130
|
+
}), Z("filter", o, {
|
|
6131
6131
|
evt: e
|
|
6132
6132
|
}), !0;
|
|
6133
|
-
}),
|
|
6133
|
+
}), _)) {
|
|
6134
6134
|
i && e.cancelable && e.preventDefault();
|
|
6135
6135
|
return;
|
|
6136
6136
|
}
|
|
6137
|
-
n.handle && !de(
|
|
6137
|
+
n.handle && !de(u, n.handle, t, !1) || this._prepareDragStart(e, l, s);
|
|
6138
6138
|
}
|
|
6139
6139
|
}
|
|
6140
6140
|
},
|
|
6141
6141
|
_prepareDragStart: function(e, o, t) {
|
|
6142
|
-
var n = this, i = n.el, r = n.options, l = i.ownerDocument,
|
|
6142
|
+
var n = this, i = n.el, r = n.options, l = i.ownerDocument, s;
|
|
6143
6143
|
if (t && !f && t.parentNode === i) {
|
|
6144
|
-
var
|
|
6145
|
-
if (M = i, f = t, P = f.parentNode,
|
|
6144
|
+
var u = K(t);
|
|
6145
|
+
if (M = i, f = t, P = f.parentNode, Me = f.nextSibling, Ct = t, Tt = r.group, y.dragged = f, Be = {
|
|
6146
6146
|
target: f,
|
|
6147
6147
|
clientX: (o || e).clientX,
|
|
6148
6148
|
clientY: (o || e).clientY
|
|
6149
|
-
}, $o =
|
|
6150
|
-
if (
|
|
6149
|
+
}, $o = Be.clientX - u.left, jo = Be.clientY - u.top, this._lastX = (o || e).clientX, this._lastY = (o || e).clientY, f.style["will-change"] = "all", s = function() {
|
|
6150
|
+
if (Z("delayEnded", n, {
|
|
6151
6151
|
evt: e
|
|
6152
6152
|
}), y.eventCanceled) {
|
|
6153
6153
|
n._onDrop();
|
|
6154
6154
|
return;
|
|
6155
6155
|
}
|
|
6156
|
-
n._disableDelayedDragEvents(), !Fo && n.nativeDraggable && (f.draggable = !0), n._triggerDragStart(e, o),
|
|
6156
|
+
n._disableDelayedDragEvents(), !Fo && n.nativeDraggable && (f.draggable = !0), n._triggerDragStart(e, o), q({
|
|
6157
6157
|
sortable: n,
|
|
6158
6158
|
name: "choose",
|
|
6159
6159
|
originalEvent: e
|
|
6160
6160
|
}), ee(f, r.chosenClass, !0);
|
|
6161
|
-
}, r.ignore.split(",").forEach(function(
|
|
6162
|
-
vn(f,
|
|
6163
|
-
}), k(l, "dragover",
|
|
6161
|
+
}, r.ignore.split(",").forEach(function(_) {
|
|
6162
|
+
vn(f, _.trim(), ro);
|
|
6163
|
+
}), k(l, "dragover", Re), k(l, "mousemove", Re), k(l, "touchmove", Re), k(l, "mouseup", n._onDrop), k(l, "touchend", n._onDrop), k(l, "touchcancel", n._onDrop), Fo && this.nativeDraggable && (this.options.touchStartThreshold = 4, f.draggable = !0), Z("delayStart", this, {
|
|
6164
6164
|
evt: e
|
|
6165
|
-
}), r.delay && (!r.delayOnTouchOnly || o) && (!this.nativeDraggable || !(
|
|
6165
|
+
}), r.delay && (!r.delayOnTouchOnly || o) && (!this.nativeDraggable || !(ct || Oe))) {
|
|
6166
6166
|
if (y.eventCanceled) {
|
|
6167
6167
|
this._onDrop();
|
|
6168
6168
|
return;
|
|
6169
6169
|
}
|
|
6170
|
-
k(l, "mouseup", n._disableDelayedDrag), k(l, "touchend", n._disableDelayedDrag), k(l, "touchcancel", n._disableDelayedDrag), k(l, "mousemove", n._delayedDragTouchMoveHandler), k(l, "touchmove", n._delayedDragTouchMoveHandler), r.supportPointer && k(l, "pointermove", n._delayedDragTouchMoveHandler), n._dragStartTimer = setTimeout(
|
|
6170
|
+
k(l, "mouseup", n._disableDelayedDrag), k(l, "touchend", n._disableDelayedDrag), k(l, "touchcancel", n._disableDelayedDrag), k(l, "mousemove", n._delayedDragTouchMoveHandler), k(l, "touchmove", n._delayedDragTouchMoveHandler), r.supportPointer && k(l, "pointermove", n._delayedDragTouchMoveHandler), n._dragStartTimer = setTimeout(s, r.delay);
|
|
6171
6171
|
} else
|
|
6172
|
-
|
|
6172
|
+
s();
|
|
6173
6173
|
}
|
|
6174
6174
|
},
|
|
6175
6175
|
_delayedDragTouchMoveHandler: function(e) {
|
|
@@ -6193,12 +6193,12 @@ y.prototype = /** @lends Sortable.prototype */
|
|
|
6193
6193
|
}
|
|
6194
6194
|
},
|
|
6195
6195
|
_dragStarted: function(e, o) {
|
|
6196
|
-
if (
|
|
6197
|
-
|
|
6196
|
+
if (Fe = !1, M && f) {
|
|
6197
|
+
Z("dragStarted", this, {
|
|
6198
6198
|
evt: o
|
|
6199
|
-
}), this.nativeDraggable && k(document, "dragover",
|
|
6199
|
+
}), this.nativeDraggable && k(document, "dragover", el);
|
|
6200
6200
|
var t = this.options;
|
|
6201
|
-
!e && ee(f, t.dragClass, !1), ee(f, t.ghostClass, !0), y.active = this, e && this._appendGhost(),
|
|
6201
|
+
!e && ee(f, t.dragClass, !1), ee(f, t.ghostClass, !0), y.active = this, e && this._appendGhost(), q({
|
|
6202
6202
|
sortable: this,
|
|
6203
6203
|
name: "start",
|
|
6204
6204
|
originalEvent: o
|
|
@@ -6211,11 +6211,11 @@ y.prototype = /** @lends Sortable.prototype */
|
|
|
6211
6211
|
this._lastX = pe.clientX, this._lastY = pe.clientY, kn();
|
|
6212
6212
|
for (var e = document.elementFromPoint(pe.clientX, pe.clientY), o = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(pe.clientX, pe.clientY), e !== o); )
|
|
6213
6213
|
o = e;
|
|
6214
|
-
if (f.parentNode[
|
|
6214
|
+
if (f.parentNode[ie]._isOutsideThisEl(e), o)
|
|
6215
6215
|
do {
|
|
6216
|
-
if (o[
|
|
6216
|
+
if (o[ie]) {
|
|
6217
6217
|
var t = void 0;
|
|
6218
|
-
if (t = o[
|
|
6218
|
+
if (t = o[ie]._onDragOver({
|
|
6219
6219
|
clientX: pe.clientX,
|
|
6220
6220
|
clientY: pe.clientY,
|
|
6221
6221
|
target: e,
|
|
@@ -6229,89 +6229,89 @@ y.prototype = /** @lends Sortable.prototype */
|
|
|
6229
6229
|
}
|
|
6230
6230
|
},
|
|
6231
6231
|
_onTouchMove: function(e) {
|
|
6232
|
-
if (
|
|
6233
|
-
var o = this.options, t = o.fallbackTolerance, n = o.fallbackOffset, i = e.touches ? e.touches[0] : e, r = I &&
|
|
6234
|
-
if (!y.active && !
|
|
6232
|
+
if (Be) {
|
|
6233
|
+
var o = this.options, t = o.fallbackTolerance, n = o.fallbackOffset, i = e.touches ? e.touches[0] : e, r = I && We(I, !0), l = I && r && r.a, s = I && r && r.d, u = gt && W && Xo(W), _ = (i.clientX - Be.clientX + n.x) / (l || 1) + (u ? u[0] - io[0] : 0) / (l || 1), d = (i.clientY - Be.clientY + n.y) / (s || 1) + (u ? u[1] - io[1] : 0) / (s || 1);
|
|
6234
|
+
if (!y.active && !Fe) {
|
|
6235
6235
|
if (t && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < t)
|
|
6236
6236
|
return;
|
|
6237
6237
|
this._onDragStart(e, !0);
|
|
6238
6238
|
}
|
|
6239
6239
|
if (I) {
|
|
6240
|
-
r ? (r.e +=
|
|
6240
|
+
r ? (r.e += _ - (oo || 0), r.f += d - (no || 0)) : r = {
|
|
6241
6241
|
a: 1,
|
|
6242
6242
|
b: 0,
|
|
6243
6243
|
c: 0,
|
|
6244
6244
|
d: 1,
|
|
6245
|
-
e:
|
|
6246
|
-
f:
|
|
6245
|
+
e: _,
|
|
6246
|
+
f: d
|
|
6247
6247
|
};
|
|
6248
|
-
var
|
|
6249
|
-
v(I, "webkitTransform",
|
|
6248
|
+
var p = "matrix(".concat(r.a, ",").concat(r.b, ",").concat(r.c, ",").concat(r.d, ",").concat(r.e, ",").concat(r.f, ")");
|
|
6249
|
+
v(I, "webkitTransform", p), v(I, "mozTransform", p), v(I, "msTransform", p), v(I, "transform", p), oo = _, no = d, pe = i;
|
|
6250
6250
|
}
|
|
6251
6251
|
e.cancelable && e.preventDefault();
|
|
6252
6252
|
}
|
|
6253
6253
|
},
|
|
6254
6254
|
_appendGhost: function() {
|
|
6255
6255
|
if (!I) {
|
|
6256
|
-
var e = this.options.fallbackOnBody ? document.body : M, o =
|
|
6257
|
-
if (
|
|
6256
|
+
var e = this.options.fallbackOnBody ? document.body : M, o = K(f, !0, gt, !0, e), t = this.options;
|
|
6257
|
+
if (gt) {
|
|
6258
6258
|
for (W = e; v(W, "position") === "static" && v(W, "transform") === "none" && W !== document; )
|
|
6259
6259
|
W = W.parentNode;
|
|
6260
6260
|
W !== document.body && W !== document.documentElement ? (W === document && (W = me()), o.top += W.scrollTop, o.left += W.scrollLeft) : W = me(), io = Xo(W);
|
|
6261
6261
|
}
|
|
6262
|
-
I = f.cloneNode(!0), ee(I, t.ghostClass, !1), ee(I, t.fallbackClass, !0), ee(I, t.dragClass, !0), v(I, "transition", ""), v(I, "transform", ""), v(I, "box-sizing", "border-box"), v(I, "margin", 0), v(I, "top", o.top), v(I, "left", o.left), v(I, "width", o.width), v(I, "height", o.height), v(I, "opacity", "0.8"), v(I, "position",
|
|
6262
|
+
I = f.cloneNode(!0), ee(I, t.ghostClass, !1), ee(I, t.fallbackClass, !0), ee(I, t.dragClass, !0), v(I, "transition", ""), v(I, "transform", ""), v(I, "box-sizing", "border-box"), v(I, "margin", 0), v(I, "top", o.top), v(I, "left", o.left), v(I, "width", o.width), v(I, "height", o.height), v(I, "opacity", "0.8"), v(I, "position", gt ? "absolute" : "fixed"), v(I, "zIndex", "100000"), v(I, "pointerEvents", "none"), y.ghost = I, e.appendChild(I), v(I, "transform-origin", $o / parseInt(I.style.width) * 100 + "% " + jo / parseInt(I.style.height) * 100 + "%");
|
|
6263
6263
|
}
|
|
6264
6264
|
},
|
|
6265
6265
|
_onDragStart: function(e, o) {
|
|
6266
6266
|
var t = this, n = e.dataTransfer, i = t.options;
|
|
6267
|
-
if (
|
|
6267
|
+
if (Z("dragStart", this, {
|
|
6268
6268
|
evt: e
|
|
6269
6269
|
}), y.eventCanceled) {
|
|
6270
6270
|
this._onDrop();
|
|
6271
6271
|
return;
|
|
6272
6272
|
}
|
|
6273
|
-
|
|
6274
|
-
|
|
6273
|
+
Z("setupClone", this), y.eventCanceled || (D = On(f), D.removeAttribute("id"), D.draggable = !1, D.style["will-change"] = "", this._hideClone(), ee(D, this.options.chosenClass, !1), y.clone = D), t.cloneId = Lt(function() {
|
|
6274
|
+
Z("clone", t), !y.eventCanceled && (t.options.removeCloneOnHide || M.insertBefore(D, f), t._hideClone(), q({
|
|
6275
6275
|
sortable: t,
|
|
6276
6276
|
name: "clone"
|
|
6277
6277
|
}));
|
|
6278
|
-
}), !o && ee(f, i.dragClass, !0), o ? (Rt = !0, t._loopId = setInterval(t._emulateDragOver, 50)) : (L(document, "mouseup", t._onDrop), L(document, "touchend", t._onDrop), L(document, "touchcancel", t._onDrop), n && (n.effectAllowed = "move", i.setData && i.setData.call(t, n, f)), k(document, "drop", t), v(f, "transform", "translateZ(0)")),
|
|
6278
|
+
}), !o && ee(f, i.dragClass, !0), o ? (Rt = !0, t._loopId = setInterval(t._emulateDragOver, 50)) : (L(document, "mouseup", t._onDrop), L(document, "touchend", t._onDrop), L(document, "touchcancel", t._onDrop), n && (n.effectAllowed = "move", i.setData && i.setData.call(t, n, f)), k(document, "drop", t), v(f, "transform", "translateZ(0)")), Fe = !0, t._dragStartId = Lt(t._dragStarted.bind(t, o, e)), k(document, "selectstart", t), et = !0, it && v(document.body, "user-select", "none");
|
|
6279
6279
|
},
|
|
6280
6280
|
// Returns true - if no further action is needed (either inserted or another condition)
|
|
6281
6281
|
_onDragOver: function(e) {
|
|
6282
|
-
var o = this.el, t = e.target, n, i, r, l = this.options,
|
|
6282
|
+
var o = this.el, t = e.target, n, i, r, l = this.options, s = l.group, u = y.active, _ = Tt === s, d = l.sort, p = $ || u, T, h = this, A = !1;
|
|
6283
6283
|
if (_o)
|
|
6284
6284
|
return;
|
|
6285
|
-
function b(
|
|
6286
|
-
|
|
6285
|
+
function b(Se, Wt) {
|
|
6286
|
+
Z(Se, h, ge({
|
|
6287
6287
|
evt: e,
|
|
6288
|
-
isOwner:
|
|
6288
|
+
isOwner: _,
|
|
6289
6289
|
axis: T ? "vertical" : "horizontal",
|
|
6290
6290
|
revert: r,
|
|
6291
6291
|
dragRect: n,
|
|
6292
6292
|
targetRect: i,
|
|
6293
|
-
canSort:
|
|
6294
|
-
fromSortable:
|
|
6293
|
+
canSort: d,
|
|
6294
|
+
fromSortable: p,
|
|
6295
6295
|
target: t,
|
|
6296
|
-
completed:
|
|
6297
|
-
onMove: function(Ao,
|
|
6298
|
-
return
|
|
6296
|
+
completed: S,
|
|
6297
|
+
onMove: function(Ao, Dn) {
|
|
6298
|
+
return Et(M, o, f, n, Ao, K(Ao), e, Dn);
|
|
6299
6299
|
},
|
|
6300
|
-
changed:
|
|
6300
|
+
changed: Q
|
|
6301
6301
|
}, Wt));
|
|
6302
6302
|
}
|
|
6303
|
-
function
|
|
6304
|
-
b("dragOverAnimationCapture"), h.captureAnimationState(), h !==
|
|
6303
|
+
function H() {
|
|
6304
|
+
b("dragOverAnimationCapture"), h.captureAnimationState(), h !== p && p.captureAnimationState();
|
|
6305
6305
|
}
|
|
6306
|
-
function
|
|
6306
|
+
function S(Se) {
|
|
6307
6307
|
return b("dragOverCompleted", {
|
|
6308
|
-
insertion:
|
|
6309
|
-
}),
|
|
6308
|
+
insertion: Se
|
|
6309
|
+
}), Se && (_ ? u._hideClone() : u._showClone(h), h !== p && (ee(f, $ ? $.options.ghostClass : u.options.ghostClass, !1), ee(f, l.ghostClass, !0)), $ !== h && h !== y.active ? $ = h : h === y.active && $ && ($ = null), p === h && (h._ignoreWhileAnimating = t), h.animateAll(function() {
|
|
6310
6310
|
b("dragOverAnimationComplete"), h._ignoreWhileAnimating = null;
|
|
6311
|
-
}), h !==
|
|
6311
|
+
}), h !== p && (p.animateAll(), p._ignoreWhileAnimating = null)), (t === f && !f.animated || t === o && !t.animated) && (Ye = null), !l.dragoverBubble && !e.rootEl && t !== document && (f.parentNode[ie]._isOutsideThisEl(e.target), !Se && Re(e)), !l.dragoverBubble && e.stopPropagation && e.stopPropagation(), A = !0;
|
|
6312
6312
|
}
|
|
6313
|
-
function
|
|
6314
|
-
te = ae(f), Ie = ae(f, l.draggable),
|
|
6313
|
+
function Q() {
|
|
6314
|
+
te = ae(f), Ie = ae(f, l.draggable), q({
|
|
6315
6315
|
sortable: h,
|
|
6316
6316
|
name: "change",
|
|
6317
6317
|
toEl: o,
|
|
@@ -6323,52 +6323,52 @@ y.prototype = /** @lends Sortable.prototype */
|
|
|
6323
6323
|
if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), t = de(t, l.draggable, o, !0), b("dragOver"), y.eventCanceled)
|
|
6324
6324
|
return A;
|
|
6325
6325
|
if (f.contains(e.target) || t.animated && t.animatingX && t.animatingY || h._ignoreWhileAnimating === t)
|
|
6326
|
-
return
|
|
6327
|
-
if (Rt = !1,
|
|
6328
|
-
if (T = this._getDirection(e, t) === "vertical", n =
|
|
6326
|
+
return S(!1);
|
|
6327
|
+
if (Rt = !1, u && !l.disabled && (_ ? d || (r = P !== M) : $ === this || (this.lastPutMode = Tt.checkPull(this, u, f, e)) && s.checkPut(this, u, f, e))) {
|
|
6328
|
+
if (T = this._getDirection(e, t) === "vertical", n = K(f), b("dragOverValid"), y.eventCanceled)
|
|
6329
6329
|
return A;
|
|
6330
6330
|
if (r)
|
|
6331
|
-
return P = M,
|
|
6331
|
+
return P = M, H(), this._hideClone(), b("revert"), y.eventCanceled || (Me ? M.insertBefore(f, Me) : M.appendChild(f)), S(!0);
|
|
6332
6332
|
var w = Oo(o, l.draggable);
|
|
6333
|
-
if (!w ||
|
|
6333
|
+
if (!w || il(e, T, this) && !w.animated) {
|
|
6334
6334
|
if (w === f)
|
|
6335
|
-
return
|
|
6336
|
-
if (w && o === e.target && (t = w), t && (i =
|
|
6337
|
-
return
|
|
6338
|
-
} else if (w &&
|
|
6335
|
+
return S(!1);
|
|
6336
|
+
if (w && o === e.target && (t = w), t && (i = K(t)), Et(M, o, f, n, t, i, e, !!t) !== !1)
|
|
6337
|
+
return H(), w && w.nextSibling ? o.insertBefore(f, w.nextSibling) : o.appendChild(f), P = o, Q(), S(!0);
|
|
6338
|
+
} else if (w && nl(e, T, this)) {
|
|
6339
6339
|
var re = qe(o, 0, l, !0);
|
|
6340
6340
|
if (re === f)
|
|
6341
|
-
return
|
|
6342
|
-
if (t = re, i =
|
|
6343
|
-
return
|
|
6341
|
+
return S(!1);
|
|
6342
|
+
if (t = re, i = K(t), Et(M, o, f, n, t, i, e, !1) !== !1)
|
|
6343
|
+
return H(), o.insertBefore(f, re), P = o, Q(), S(!0);
|
|
6344
6344
|
} else if (t.parentNode === o) {
|
|
6345
|
-
i =
|
|
6346
|
-
var
|
|
6347
|
-
|
|
6348
|
-
var
|
|
6349
|
-
if (
|
|
6345
|
+
i = K(t);
|
|
6346
|
+
var U = 0, le, Ee = f.parentNode !== o, O = !Qr(f.animated && f.toRect || n, t.animated && t.toRect || i, T), C = T ? "top" : "left", E = Go(t, "top", "top") || Go(f, "top", "top"), B = E ? E.scrollTop : void 0;
|
|
6347
|
+
Ye !== t && (le = i[C], st = !1, mt = !O && l.invertSwap || Ee), U = rl(e, t, i, T, O ? 1 : l.swapThreshold, l.invertedSwapThreshold == null ? l.swapThreshold : l.invertedSwapThreshold, mt, Ye === t);
|
|
6348
|
+
var R;
|
|
6349
|
+
if (U !== 0) {
|
|
6350
6350
|
var x = ae(f);
|
|
6351
6351
|
do
|
|
6352
|
-
x -=
|
|
6353
|
-
while (
|
|
6352
|
+
x -= U, R = P.children[x];
|
|
6353
|
+
while (R && (v(R, "display") === "none" || R === I));
|
|
6354
6354
|
}
|
|
6355
|
-
if (
|
|
6356
|
-
return
|
|
6357
|
-
|
|
6355
|
+
if (U === 0 || R === t)
|
|
6356
|
+
return S(!1);
|
|
6357
|
+
Ye = t, at = U;
|
|
6358
6358
|
var G = t.nextElementSibling, X = !1;
|
|
6359
|
-
X =
|
|
6360
|
-
var fe =
|
|
6359
|
+
X = U === 1;
|
|
6360
|
+
var fe = Et(M, o, f, n, t, i, e, X);
|
|
6361
6361
|
if (fe !== !1)
|
|
6362
|
-
return (fe === 1 || fe === -1) && (X = fe === 1), _o = !0, setTimeout(
|
|
6362
|
+
return (fe === 1 || fe === -1) && (X = fe === 1), _o = !0, setTimeout(ol, 30), H(), X && !G ? o.appendChild(f) : t.parentNode.insertBefore(f, X ? G : t), E && bn(E, 0, B - E.scrollTop), P = f.parentNode, le !== void 0 && !mt && (At = Math.abs(le - K(t)[C])), Q(), S(!0);
|
|
6363
6363
|
}
|
|
6364
6364
|
if (o.contains(f))
|
|
6365
|
-
return
|
|
6365
|
+
return S(!1);
|
|
6366
6366
|
}
|
|
6367
6367
|
return !1;
|
|
6368
6368
|
},
|
|
6369
6369
|
_ignoreWhileAnimating: null,
|
|
6370
6370
|
_offMoveEvents: function() {
|
|
6371
|
-
L(document, "mousemove", this._onTouchMove), L(document, "touchmove", this._onTouchMove), L(document, "pointermove", this._onTouchMove), L(document, "dragover",
|
|
6371
|
+
L(document, "mousemove", this._onTouchMove), L(document, "touchmove", this._onTouchMove), L(document, "pointermove", this._onTouchMove), L(document, "dragover", Re), L(document, "mousemove", Re), L(document, "touchmove", Re);
|
|
6372
6372
|
},
|
|
6373
6373
|
_offUpEvents: function() {
|
|
6374
6374
|
var e = this.el.ownerDocument;
|
|
@@ -6376,52 +6376,52 @@ y.prototype = /** @lends Sortable.prototype */
|
|
|
6376
6376
|
},
|
|
6377
6377
|
_onDrop: function(e) {
|
|
6378
6378
|
var o = this.el, t = this.options;
|
|
6379
|
-
if (te = ae(f), Ie = ae(f, t.draggable),
|
|
6379
|
+
if (te = ae(f), Ie = ae(f, t.draggable), Z("drop", this, {
|
|
6380
6380
|
evt: e
|
|
6381
6381
|
}), P = f && f.parentNode, te = ae(f), Ie = ae(f, t.draggable), y.eventCanceled) {
|
|
6382
6382
|
this._nulling();
|
|
6383
6383
|
return;
|
|
6384
6384
|
}
|
|
6385
|
-
|
|
6385
|
+
Fe = !1, mt = !1, st = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), po(this.cloneId), po(this._dragStartId), this.nativeDraggable && (L(document, "drop", this), L(o, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), it && v(document.body, "user-select", ""), v(f, "transform", ""), e && (et && (e.cancelable && e.preventDefault(), !t.dropBubble && e.stopPropagation()), I && I.parentNode && I.parentNode.removeChild(I), (M === P || $ && $.lastPutMode !== "clone") && D && D.parentNode && D.parentNode.removeChild(D), f && (this.nativeDraggable && L(f, "dragend", this), ro(f), f.style["will-change"] = "", et && !Fe && ee(f, $ ? $.options.ghostClass : this.options.ghostClass, !1), ee(f, this.options.chosenClass, !1), q({
|
|
6386
6386
|
sortable: this,
|
|
6387
6387
|
name: "unchoose",
|
|
6388
6388
|
toEl: P,
|
|
6389
6389
|
newIndex: null,
|
|
6390
6390
|
newDraggableIndex: null,
|
|
6391
6391
|
originalEvent: e
|
|
6392
|
-
}), M !== P ? (te >= 0 && (
|
|
6392
|
+
}), M !== P ? (te >= 0 && (q({
|
|
6393
6393
|
rootEl: P,
|
|
6394
6394
|
name: "add",
|
|
6395
6395
|
toEl: P,
|
|
6396
6396
|
fromEl: M,
|
|
6397
6397
|
originalEvent: e
|
|
6398
|
-
}),
|
|
6398
|
+
}), q({
|
|
6399
6399
|
sortable: this,
|
|
6400
6400
|
name: "remove",
|
|
6401
6401
|
toEl: P,
|
|
6402
6402
|
originalEvent: e
|
|
6403
|
-
}),
|
|
6403
|
+
}), q({
|
|
6404
6404
|
rootEl: P,
|
|
6405
6405
|
name: "sort",
|
|
6406
6406
|
toEl: P,
|
|
6407
6407
|
fromEl: M,
|
|
6408
6408
|
originalEvent: e
|
|
6409
|
-
}),
|
|
6409
|
+
}), q({
|
|
6410
6410
|
sortable: this,
|
|
6411
6411
|
name: "sort",
|
|
6412
6412
|
toEl: P,
|
|
6413
6413
|
originalEvent: e
|
|
6414
|
-
})), $ && $.save()) : te !==
|
|
6414
|
+
})), $ && $.save()) : te !== $e && te >= 0 && (q({
|
|
6415
6415
|
sortable: this,
|
|
6416
6416
|
name: "update",
|
|
6417
6417
|
toEl: P,
|
|
6418
6418
|
originalEvent: e
|
|
6419
|
-
}),
|
|
6419
|
+
}), q({
|
|
6420
6420
|
sortable: this,
|
|
6421
6421
|
name: "sort",
|
|
6422
6422
|
toEl: P,
|
|
6423
6423
|
originalEvent: e
|
|
6424
|
-
})), y.active && ((te == null || te === -1) && (te =
|
|
6424
|
+
})), y.active && ((te == null || te === -1) && (te = $e, Ie = lt), q({
|
|
6425
6425
|
sortable: this,
|
|
6426
6426
|
name: "end",
|
|
6427
6427
|
toEl: P,
|
|
@@ -6429,7 +6429,7 @@ y.prototype = /** @lends Sortable.prototype */
|
|
|
6429
6429
|
}), this.save()))), this._nulling();
|
|
6430
6430
|
},
|
|
6431
6431
|
_nulling: function() {
|
|
6432
|
-
|
|
6432
|
+
Z("nulling", this), M = f = P = I = Me = D = Ct = Ce = Be = pe = et = te = Ie = $e = lt = Ye = at = $ = Tt = y.dragged = y.ghost = y.clone = y.active = null, Dt.forEach(function(e) {
|
|
6433
6433
|
e.checked = !0;
|
|
6434
6434
|
}), Dt.length = oo = no = 0;
|
|
6435
6435
|
},
|
|
@@ -6441,7 +6441,7 @@ y.prototype = /** @lends Sortable.prototype */
|
|
|
6441
6441
|
break;
|
|
6442
6442
|
case "dragenter":
|
|
6443
6443
|
case "dragover":
|
|
6444
|
-
f && (this._onDragOver(e),
|
|
6444
|
+
f && (this._onDragOver(e), tl(e));
|
|
6445
6445
|
break;
|
|
6446
6446
|
case "selectstart":
|
|
6447
6447
|
e.preventDefault();
|
|
@@ -6454,7 +6454,7 @@ y.prototype = /** @lends Sortable.prototype */
|
|
|
6454
6454
|
*/
|
|
6455
6455
|
toArray: function() {
|
|
6456
6456
|
for (var e = [], o, t = this.el.children, n = 0, i = t.length, r = this.options; n < i; n++)
|
|
6457
|
-
o = t[n], de(o, r.draggable, this.el, !1) && e.push(o.getAttribute(r.dataIdAttr) ||
|
|
6457
|
+
o = t[n], de(o, r.draggable, this.el, !1) && e.push(o.getAttribute(r.dataIdAttr) || al(o));
|
|
6458
6458
|
return e;
|
|
6459
6459
|
},
|
|
6460
6460
|
/**
|
|
@@ -6496,22 +6496,22 @@ y.prototype = /** @lends Sortable.prototype */
|
|
|
6496
6496
|
var t = this.options;
|
|
6497
6497
|
if (o === void 0)
|
|
6498
6498
|
return t[e];
|
|
6499
|
-
var n =
|
|
6499
|
+
var n = ut.modifyOption(this, e, o);
|
|
6500
6500
|
typeof n < "u" ? t[e] = n : t[e] = o, e === "group" && Ln(t);
|
|
6501
6501
|
},
|
|
6502
6502
|
/**
|
|
6503
6503
|
* Destroy
|
|
6504
6504
|
*/
|
|
6505
6505
|
destroy: function() {
|
|
6506
|
-
|
|
6506
|
+
Z("destroy", this);
|
|
6507
6507
|
var e = this.el;
|
|
6508
|
-
e[
|
|
6508
|
+
e[ie] = null, L(e, "mousedown", this._onTapStart), L(e, "touchstart", this._onTapStart), L(e, "pointerdown", this._onTapStart), this.nativeDraggable && (L(e, "dragover", this), L(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(o) {
|
|
6509
6509
|
o.removeAttribute("draggable");
|
|
6510
6510
|
}), this._onDrop(), this._disableDelayedDragEvents(), Mt.splice(Mt.indexOf(this.el), 1), this.el = e = null;
|
|
6511
6511
|
},
|
|
6512
6512
|
_hideClone: function() {
|
|
6513
6513
|
if (!Ce) {
|
|
6514
|
-
if (
|
|
6514
|
+
if (Z("hideClone", this), y.eventCanceled)
|
|
6515
6515
|
return;
|
|
6516
6516
|
v(D, "display", "none"), this.options.removeCloneOnHide && D.parentNode && D.parentNode.removeChild(D), Ce = !0;
|
|
6517
6517
|
}
|
|
@@ -6522,58 +6522,58 @@ y.prototype = /** @lends Sortable.prototype */
|
|
|
6522
6522
|
return;
|
|
6523
6523
|
}
|
|
6524
6524
|
if (Ce) {
|
|
6525
|
-
if (
|
|
6525
|
+
if (Z("showClone", this), y.eventCanceled)
|
|
6526
6526
|
return;
|
|
6527
|
-
f.parentNode == M && !this.options.group.revertClone ? M.insertBefore(D, f) :
|
|
6527
|
+
f.parentNode == M && !this.options.group.revertClone ? M.insertBefore(D, f) : Me ? M.insertBefore(D, Me) : M.appendChild(D), this.options.group.revertClone && this.animate(f, D), v(D, "display", ""), Ce = !1;
|
|
6528
6528
|
}
|
|
6529
6529
|
}
|
|
6530
6530
|
};
|
|
6531
|
-
function
|
|
6531
|
+
function tl(e) {
|
|
6532
6532
|
e.dataTransfer && (e.dataTransfer.dropEffect = "move"), e.cancelable && e.preventDefault();
|
|
6533
6533
|
}
|
|
6534
|
-
function
|
|
6535
|
-
var
|
|
6536
|
-
return window.CustomEvent && !Oe && !
|
|
6534
|
+
function Et(e, o, t, n, i, r, l, s) {
|
|
6535
|
+
var u, _ = e[ie], d = _.options.onMove, p;
|
|
6536
|
+
return window.CustomEvent && !Oe && !ct ? u = new CustomEvent("move", {
|
|
6537
6537
|
bubbles: !0,
|
|
6538
6538
|
cancelable: !0
|
|
6539
|
-
}) : (
|
|
6539
|
+
}) : (u = document.createEvent("Event"), u.initEvent("move", !0, !0)), u.to = o, u.from = e, u.dragged = t, u.draggedRect = n, u.related = i || o, u.relatedRect = r || K(o), u.willInsertAfter = s, u.originalEvent = l, e.dispatchEvent(u), d && (p = d.call(_, u, l)), p;
|
|
6540
6540
|
}
|
|
6541
6541
|
function ro(e) {
|
|
6542
6542
|
e.draggable = !1;
|
|
6543
6543
|
}
|
|
6544
|
-
function
|
|
6544
|
+
function ol() {
|
|
6545
6545
|
_o = !1;
|
|
6546
6546
|
}
|
|
6547
|
-
function
|
|
6548
|
-
var n =
|
|
6547
|
+
function nl(e, o, t) {
|
|
6548
|
+
var n = K(qe(t.el, 0, t.options, !0)), i = In(t.el, t.options, I), r = 10;
|
|
6549
6549
|
return o ? e.clientX < i.left - r || e.clientY < n.top && e.clientX < n.right : e.clientY < i.top - r || e.clientY < n.bottom && e.clientX < n.left;
|
|
6550
6550
|
}
|
|
6551
|
-
function
|
|
6552
|
-
var n =
|
|
6551
|
+
function il(e, o, t) {
|
|
6552
|
+
var n = K(Oo(t.el, t.options.draggable)), i = In(t.el, t.options, I), r = 10;
|
|
6553
6553
|
return o ? e.clientX > i.right + r || e.clientY > n.bottom && e.clientX > n.left : e.clientY > i.bottom + r || e.clientX > n.right && e.clientY > n.top;
|
|
6554
6554
|
}
|
|
6555
|
-
function
|
|
6556
|
-
var
|
|
6555
|
+
function rl(e, o, t, n, i, r, l, s) {
|
|
6556
|
+
var u = n ? e.clientY : e.clientX, _ = n ? t.height : t.width, d = n ? t.top : t.left, p = n ? t.bottom : t.right, T = !1;
|
|
6557
6557
|
if (!l) {
|
|
6558
|
-
if (
|
|
6559
|
-
if (!
|
|
6558
|
+
if (s && At < _ * i) {
|
|
6559
|
+
if (!st && (at === 1 ? u > d + _ * r / 2 : u < p - _ * r / 2) && (st = !0), st)
|
|
6560
6560
|
T = !0;
|
|
6561
|
-
else if (
|
|
6562
|
-
return -
|
|
6563
|
-
} else if (
|
|
6564
|
-
return
|
|
6561
|
+
else if (at === 1 ? u < d + At : u > p - At)
|
|
6562
|
+
return -at;
|
|
6563
|
+
} else if (u > d + _ * (1 - i) / 2 && u < p - _ * (1 - i) / 2)
|
|
6564
|
+
return ll(o);
|
|
6565
6565
|
}
|
|
6566
|
-
return T = T || l, T && (
|
|
6566
|
+
return T = T || l, T && (u < d + _ * r / 2 || u > p - _ * r / 2) ? u > d + _ / 2 ? 1 : -1 : 0;
|
|
6567
6567
|
}
|
|
6568
|
-
function
|
|
6568
|
+
function ll(e) {
|
|
6569
6569
|
return ae(f) < ae(e) ? 1 : -1;
|
|
6570
6570
|
}
|
|
6571
|
-
function
|
|
6571
|
+
function al(e) {
|
|
6572
6572
|
for (var o = e.tagName + e.className + e.src + e.href + e.textContent, t = o.length, n = 0; t--; )
|
|
6573
6573
|
n += o.charCodeAt(t);
|
|
6574
6574
|
return n.toString(36);
|
|
6575
6575
|
}
|
|
6576
|
-
function
|
|
6576
|
+
function sl(e) {
|
|
6577
6577
|
Dt.length = 0;
|
|
6578
6578
|
for (var o = e.getElementsByTagName("input"), t = o.length; t--; ) {
|
|
6579
6579
|
var n = o[t];
|
|
@@ -6587,7 +6587,7 @@ function po(e) {
|
|
|
6587
6587
|
return clearTimeout(e);
|
|
6588
6588
|
}
|
|
6589
6589
|
jt && k(document, "touchmove", function(e) {
|
|
6590
|
-
(y.active ||
|
|
6590
|
+
(y.active || Fe) && e.cancelable && e.preventDefault();
|
|
6591
6591
|
});
|
|
6592
6592
|
y.utils = {
|
|
6593
6593
|
on: k,
|
|
@@ -6597,7 +6597,7 @@ y.utils = {
|
|
|
6597
6597
|
is: function(e, o) {
|
|
6598
6598
|
return !!de(e, o, e, !1);
|
|
6599
6599
|
},
|
|
6600
|
-
extend:
|
|
6600
|
+
extend: Gr,
|
|
6601
6601
|
throttle: yn,
|
|
6602
6602
|
closest: de,
|
|
6603
6603
|
toggleClass: ee,
|
|
@@ -6609,7 +6609,7 @@ y.utils = {
|
|
|
6609
6609
|
getChild: qe
|
|
6610
6610
|
};
|
|
6611
6611
|
y.get = function(e) {
|
|
6612
|
-
return e[
|
|
6612
|
+
return e[ie];
|
|
6613
6613
|
};
|
|
6614
6614
|
y.mount = function() {
|
|
6615
6615
|
for (var e = arguments.length, o = new Array(e), t = 0; t < e; t++)
|
|
@@ -6617,15 +6617,15 @@ y.mount = function() {
|
|
|
6617
6617
|
o[0].constructor === Array && (o = o[0]), o.forEach(function(n) {
|
|
6618
6618
|
if (!n.prototype || !n.prototype.constructor)
|
|
6619
6619
|
throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(n));
|
|
6620
|
-
n.utils && (y.utils = ge(ge({}, y.utils), n.utils)),
|
|
6620
|
+
n.utils && (y.utils = ge(ge({}, y.utils), n.utils)), ut.mount(n);
|
|
6621
6621
|
});
|
|
6622
6622
|
};
|
|
6623
6623
|
y.create = function(e, o) {
|
|
6624
6624
|
return new y(e, o);
|
|
6625
6625
|
};
|
|
6626
|
-
y.version =
|
|
6627
|
-
var
|
|
6628
|
-
function
|
|
6626
|
+
y.version = Kr;
|
|
6627
|
+
var Y = [], tt, fo, ho = !1, lo, ao, xt, ot;
|
|
6628
|
+
function cl() {
|
|
6629
6629
|
function e() {
|
|
6630
6630
|
this.defaults = {
|
|
6631
6631
|
scroll: !0,
|
|
@@ -6647,22 +6647,22 @@ function sl() {
|
|
|
6647
6647
|
!this.options.dragOverBubble && !t.rootEl && this._handleAutoScroll(t);
|
|
6648
6648
|
},
|
|
6649
6649
|
drop: function() {
|
|
6650
|
-
this.sortable.nativeDraggable ? L(document, "dragover", this._handleAutoScroll) : (L(document, "pointermove", this._handleFallbackAutoScroll), L(document, "touchmove", this._handleFallbackAutoScroll), L(document, "mousemove", this._handleFallbackAutoScroll)), Jo(), kt(),
|
|
6650
|
+
this.sortable.nativeDraggable ? L(document, "dragover", this._handleAutoScroll) : (L(document, "pointermove", this._handleFallbackAutoScroll), L(document, "touchmove", this._handleFallbackAutoScroll), L(document, "mousemove", this._handleFallbackAutoScroll)), Jo(), kt(), Xr();
|
|
6651
6651
|
},
|
|
6652
6652
|
nulling: function() {
|
|
6653
|
-
xt = fo = tt = ho = ot = lo = ao = null,
|
|
6653
|
+
xt = fo = tt = ho = ot = lo = ao = null, Y.length = 0;
|
|
6654
6654
|
},
|
|
6655
6655
|
_handleFallbackAutoScroll: function(o) {
|
|
6656
6656
|
this._handleAutoScroll(o, !0);
|
|
6657
6657
|
},
|
|
6658
6658
|
_handleAutoScroll: function(o, t) {
|
|
6659
6659
|
var n = this, i = (o.touches ? o.touches[0] : o).clientX, r = (o.touches ? o.touches[0] : o).clientY, l = document.elementFromPoint(i, r);
|
|
6660
|
-
if (xt = o, t || this.options.forceAutoScrollFallback ||
|
|
6660
|
+
if (xt = o, t || this.options.forceAutoScrollFallback || ct || Oe || it) {
|
|
6661
6661
|
so(o, this.options, l, t);
|
|
6662
|
-
var
|
|
6662
|
+
var s = Ae(l, !0);
|
|
6663
6663
|
ho && (!ot || i !== lo || r !== ao) && (ot && Jo(), ot = setInterval(function() {
|
|
6664
|
-
var
|
|
6665
|
-
|
|
6664
|
+
var u = Ae(document.elementFromPoint(i, r), !0);
|
|
6665
|
+
u !== s && (s = u, kt()), so(o, n.options, u, t);
|
|
6666
6666
|
}, 10), lo = i, ao = r);
|
|
6667
6667
|
} else {
|
|
6668
6668
|
if (!this.options.bubbleScroll || Ae(l, !0) === me()) {
|
|
@@ -6678,42 +6678,42 @@ function sl() {
|
|
|
6678
6678
|
});
|
|
6679
6679
|
}
|
|
6680
6680
|
function kt() {
|
|
6681
|
-
|
|
6681
|
+
Y.forEach(function(e) {
|
|
6682
6682
|
clearInterval(e.pid);
|
|
6683
|
-
}),
|
|
6683
|
+
}), Y = [];
|
|
6684
6684
|
}
|
|
6685
6685
|
function Jo() {
|
|
6686
6686
|
clearInterval(ot);
|
|
6687
6687
|
}
|
|
6688
6688
|
var so = yn(function(e, o, t, n) {
|
|
6689
6689
|
if (o.scroll) {
|
|
6690
|
-
var i = (e.touches ? e.touches[0] : e).clientX, r = (e.touches ? e.touches[0] : e).clientY, l = o.scrollSensitivity,
|
|
6691
|
-
fo !== t && (fo = t, kt(), tt = o.scroll,
|
|
6692
|
-
var
|
|
6690
|
+
var i = (e.touches ? e.touches[0] : e).clientX, r = (e.touches ? e.touches[0] : e).clientY, l = o.scrollSensitivity, s = o.scrollSpeed, u = me(), _ = !1, d;
|
|
6691
|
+
fo !== t && (fo = t, kt(), tt = o.scroll, d = o.scrollFn, tt === !0 && (tt = Ae(t, !0)));
|
|
6692
|
+
var p = 0, T = tt;
|
|
6693
6693
|
do {
|
|
6694
|
-
var h = T, A =
|
|
6695
|
-
h ===
|
|
6696
|
-
var
|
|
6697
|
-
if (!
|
|
6698
|
-
for (var G = 0; G <=
|
|
6699
|
-
|
|
6700
|
-
(
|
|
6694
|
+
var h = T, A = K(h), b = A.top, H = A.bottom, S = A.left, Q = A.right, w = A.width, re = A.height, U = void 0, le = void 0, Ee = h.scrollWidth, O = h.scrollHeight, C = v(h), E = h.scrollLeft, B = h.scrollTop;
|
|
6695
|
+
h === u ? (U = w < Ee && (C.overflowX === "auto" || C.overflowX === "scroll" || C.overflowX === "visible"), le = re < O && (C.overflowY === "auto" || C.overflowY === "scroll" || C.overflowY === "visible")) : (U = w < Ee && (C.overflowX === "auto" || C.overflowX === "scroll"), le = re < O && (C.overflowY === "auto" || C.overflowY === "scroll"));
|
|
6696
|
+
var R = U && (Math.abs(Q - i) <= l && E + w < Ee) - (Math.abs(S - i) <= l && !!E), x = le && (Math.abs(H - r) <= l && B + re < O) - (Math.abs(b - r) <= l && !!B);
|
|
6697
|
+
if (!Y[p])
|
|
6698
|
+
for (var G = 0; G <= p; G++)
|
|
6699
|
+
Y[G] || (Y[G] = {});
|
|
6700
|
+
(Y[p].vx != R || Y[p].vy != x || Y[p].el !== h) && (Y[p].el = h, Y[p].vx = R, Y[p].vy = x, clearInterval(Y[p].pid), (R != 0 || x != 0) && (_ = !0, Y[p].pid = setInterval((function() {
|
|
6701
6701
|
n && this.layer === 0 && y.active._onTouchMove(xt);
|
|
6702
|
-
var X =
|
|
6703
|
-
typeof
|
|
6702
|
+
var X = Y[this.layer].vy ? Y[this.layer].vy * s : 0, fe = Y[this.layer].vx ? Y[this.layer].vx * s : 0;
|
|
6703
|
+
typeof d == "function" && d.call(y.dragged.parentNode[ie], fe, X, e, xt, Y[this.layer].el) !== "continue" || bn(Y[this.layer].el, fe, X);
|
|
6704
6704
|
}).bind({
|
|
6705
|
-
layer:
|
|
6706
|
-
}), 24))),
|
|
6707
|
-
} while (o.bubbleScroll && T !==
|
|
6708
|
-
ho =
|
|
6705
|
+
layer: p
|
|
6706
|
+
}), 24))), p++;
|
|
6707
|
+
} while (o.bubbleScroll && T !== u && (T = Ae(T, !1)));
|
|
6708
|
+
ho = _;
|
|
6709
6709
|
}
|
|
6710
6710
|
}, 30), Sn = function(e) {
|
|
6711
|
-
var o = e.originalEvent, t = e.putSortable, n = e.dragEl, i = e.activeSortable, r = e.dispatchSortableEvent, l = e.hideGhostForTarget,
|
|
6711
|
+
var o = e.originalEvent, t = e.putSortable, n = e.dragEl, i = e.activeSortable, r = e.dispatchSortableEvent, l = e.hideGhostForTarget, s = e.unhideGhostForTarget;
|
|
6712
6712
|
if (o) {
|
|
6713
|
-
var
|
|
6713
|
+
var u = t || i;
|
|
6714
6714
|
l();
|
|
6715
|
-
var
|
|
6716
|
-
|
|
6715
|
+
var _ = o.changedTouches && o.changedTouches.length ? o.changedTouches[0] : o, d = document.elementFromPoint(_.clientX, _.clientY);
|
|
6716
|
+
s(), u && !u.el.contains(d) && (r("spill"), this.onSpill({
|
|
6717
6717
|
dragEl: n,
|
|
6718
6718
|
putSortable: t
|
|
6719
6719
|
}));
|
|
@@ -6750,52 +6750,52 @@ Co.prototype = {
|
|
|
6750
6750
|
be(Co, {
|
|
6751
6751
|
pluginName: "removeOnSpill"
|
|
6752
6752
|
});
|
|
6753
|
-
y.mount(new
|
|
6753
|
+
y.mount(new cl());
|
|
6754
6754
|
y.mount(Co, Io);
|
|
6755
|
-
function cl(e) {
|
|
6756
|
-
return e == null ? e : JSON.parse(JSON.stringify(e));
|
|
6757
|
-
}
|
|
6758
6755
|
function ul(e) {
|
|
6759
|
-
|
|
6756
|
+
return e == null ? e : JSON.parse(JSON.stringify(e));
|
|
6760
6757
|
}
|
|
6761
6758
|
function _l(e) {
|
|
6762
|
-
Pt()
|
|
6759
|
+
Pt() && Fn(e);
|
|
6760
|
+
}
|
|
6761
|
+
function pl(e) {
|
|
6762
|
+
Pt() ? ze(e) : go(e);
|
|
6763
6763
|
}
|
|
6764
6764
|
let Bn = null, Rn = null;
|
|
6765
6765
|
function zo(e = null, o = null) {
|
|
6766
6766
|
Bn = e, Rn = o;
|
|
6767
6767
|
}
|
|
6768
|
-
function
|
|
6768
|
+
function dl() {
|
|
6769
6769
|
return {
|
|
6770
6770
|
data: Bn,
|
|
6771
6771
|
clonedData: Rn
|
|
6772
6772
|
};
|
|
6773
6773
|
}
|
|
6774
6774
|
const qo = Symbol("cloneElement");
|
|
6775
|
-
function
|
|
6775
|
+
function fl(...e) {
|
|
6776
6776
|
var o, t;
|
|
6777
6777
|
const n = (o = Pt()) == null ? void 0 : o.proxy;
|
|
6778
6778
|
let i = null;
|
|
6779
6779
|
const r = e[0];
|
|
6780
|
-
let [, l,
|
|
6781
|
-
Array.isArray(N(l)) || (
|
|
6782
|
-
let
|
|
6780
|
+
let [, l, s] = e;
|
|
6781
|
+
Array.isArray(N(l)) || (s = l, l = null);
|
|
6782
|
+
let u = null;
|
|
6783
6783
|
const {
|
|
6784
|
-
immediate:
|
|
6785
|
-
clone:
|
|
6786
|
-
customUpdate:
|
|
6787
|
-
} = (t = N(
|
|
6784
|
+
immediate: _ = !0,
|
|
6785
|
+
clone: d = ul,
|
|
6786
|
+
customUpdate: p
|
|
6787
|
+
} = (t = N(s)) != null ? t : {};
|
|
6788
6788
|
function T(O) {
|
|
6789
6789
|
var C;
|
|
6790
|
-
const { from: E, oldIndex:
|
|
6790
|
+
const { from: E, oldIndex: B, item: R } = O;
|
|
6791
6791
|
i = Array.from(E.childNodes);
|
|
6792
|
-
const x = N((C = N(l)) == null ? void 0 : C[
|
|
6793
|
-
zo(x, G),
|
|
6792
|
+
const x = N((C = N(l)) == null ? void 0 : C[B]), G = d(x);
|
|
6793
|
+
zo(x, G), R[qo] = G;
|
|
6794
6794
|
}
|
|
6795
6795
|
function h(O) {
|
|
6796
6796
|
const C = O.item[qo];
|
|
6797
|
-
if (!
|
|
6798
|
-
if (Zt(O.item),
|
|
6797
|
+
if (!Sr(C)) {
|
|
6798
|
+
if (Zt(O.item), vt(l)) {
|
|
6799
6799
|
const E = [...N(l)];
|
|
6800
6800
|
l.value = Vo(E, O.newDraggableIndex, C);
|
|
6801
6801
|
return;
|
|
@@ -6804,43 +6804,43 @@ function dl(...e) {
|
|
|
6804
6804
|
}
|
|
6805
6805
|
}
|
|
6806
6806
|
function A(O) {
|
|
6807
|
-
const { from: C, item: E, oldIndex:
|
|
6808
|
-
if (Uo(C, E,
|
|
6807
|
+
const { from: C, item: E, oldIndex: B, oldDraggableIndex: R, pullMode: x, clone: G } = O;
|
|
6808
|
+
if (Uo(C, E, B), x === "clone") {
|
|
6809
6809
|
Zt(G);
|
|
6810
6810
|
return;
|
|
6811
6811
|
}
|
|
6812
|
-
if (
|
|
6812
|
+
if (vt(l)) {
|
|
6813
6813
|
const X = [...N(l)];
|
|
6814
|
-
l.value = wo(X,
|
|
6814
|
+
l.value = wo(X, R);
|
|
6815
6815
|
return;
|
|
6816
6816
|
}
|
|
6817
|
-
wo(N(l),
|
|
6817
|
+
wo(N(l), R);
|
|
6818
6818
|
}
|
|
6819
6819
|
function b(O) {
|
|
6820
|
-
if (
|
|
6821
|
-
|
|
6820
|
+
if (p) {
|
|
6821
|
+
p(O);
|
|
6822
6822
|
return;
|
|
6823
6823
|
}
|
|
6824
|
-
const { from: C, item: E, oldIndex:
|
|
6825
|
-
if (Zt(E), Uo(C, E,
|
|
6824
|
+
const { from: C, item: E, oldIndex: B, newIndex: R } = O;
|
|
6825
|
+
if (Zt(E), Uo(C, E, B), vt(l)) {
|
|
6826
6826
|
const x = [...N(l)];
|
|
6827
|
-
l.value = Po(x,
|
|
6827
|
+
l.value = Po(x, B, R);
|
|
6828
6828
|
return;
|
|
6829
6829
|
}
|
|
6830
|
-
Po(N(l),
|
|
6830
|
+
Po(N(l), B, R);
|
|
6831
6831
|
}
|
|
6832
|
-
function
|
|
6833
|
-
const { newIndex: C, oldIndex: E, from:
|
|
6832
|
+
function H(O) {
|
|
6833
|
+
const { newIndex: C, oldIndex: E, from: B, to: R } = O;
|
|
6834
6834
|
let x = null;
|
|
6835
|
-
const G = C === E &&
|
|
6835
|
+
const G = C === E && B === R;
|
|
6836
6836
|
try {
|
|
6837
6837
|
if (G) {
|
|
6838
6838
|
let X = null;
|
|
6839
|
-
i == null || i.some((fe,
|
|
6840
|
-
if (X && (i == null ? void 0 : i.length) !==
|
|
6841
|
-
return
|
|
6842
|
-
const Wt =
|
|
6843
|
-
X =
|
|
6839
|
+
i == null || i.some((fe, Se) => {
|
|
6840
|
+
if (X && (i == null ? void 0 : i.length) !== R.childNodes.length)
|
|
6841
|
+
return B.insertBefore(X, fe.nextSibling), !0;
|
|
6842
|
+
const Wt = R.childNodes[Se];
|
|
6843
|
+
X = R == null ? void 0 : R.replaceChild(fe, Wt);
|
|
6844
6844
|
});
|
|
6845
6845
|
}
|
|
6846
6846
|
} catch (X) {
|
|
@@ -6853,54 +6853,54 @@ function dl(...e) {
|
|
|
6853
6853
|
throw x;
|
|
6854
6854
|
});
|
|
6855
6855
|
}
|
|
6856
|
-
const
|
|
6856
|
+
const S = {
|
|
6857
6857
|
onUpdate: b,
|
|
6858
6858
|
onStart: T,
|
|
6859
6859
|
onAdd: h,
|
|
6860
6860
|
onRemove: A,
|
|
6861
|
-
onEnd:
|
|
6861
|
+
onEnd: H
|
|
6862
6862
|
};
|
|
6863
|
-
function
|
|
6863
|
+
function Q(O) {
|
|
6864
6864
|
const C = N(r);
|
|
6865
|
-
return O || (O =
|
|
6865
|
+
return O || (O = Br(C) ? Rr(C, n == null ? void 0 : n.$el) : C), O && !xr(O) && (O = O.$el), O || Lr("Root element not found"), O;
|
|
6866
6866
|
}
|
|
6867
6867
|
function w() {
|
|
6868
6868
|
var O;
|
|
6869
|
-
const C = (O = N(
|
|
6870
|
-
return Yo(E, (
|
|
6871
|
-
|
|
6872
|
-
const X =
|
|
6873
|
-
return
|
|
6869
|
+
const C = (O = N(s)) != null ? O : {}, E = hn(C, ["immediate", "clone"]);
|
|
6870
|
+
return Yo(E, (B, R) => {
|
|
6871
|
+
Pr(B) && (E[B] = (x, ...G) => {
|
|
6872
|
+
const X = dl();
|
|
6873
|
+
return wr(x, X), R(x, ...G);
|
|
6874
6874
|
});
|
|
6875
|
-
}),
|
|
6876
|
-
l === null ? {} :
|
|
6875
|
+
}), Dr(
|
|
6876
|
+
l === null ? {} : S,
|
|
6877
6877
|
E
|
|
6878
6878
|
);
|
|
6879
6879
|
}
|
|
6880
6880
|
const re = (O) => {
|
|
6881
|
-
O =
|
|
6881
|
+
O = Q(O), u && U.destroy(), u = new y(O, w());
|
|
6882
6882
|
};
|
|
6883
|
-
|
|
6884
|
-
() =>
|
|
6883
|
+
He(
|
|
6884
|
+
() => s,
|
|
6885
6885
|
() => {
|
|
6886
|
-
|
|
6887
|
-
|
|
6886
|
+
u && Yo(w(), (O, C) => {
|
|
6887
|
+
u == null || u.option(O, C);
|
|
6888
6888
|
});
|
|
6889
6889
|
},
|
|
6890
6890
|
{ deep: !0 }
|
|
6891
6891
|
);
|
|
6892
|
-
const
|
|
6893
|
-
option: (O, C) =>
|
|
6892
|
+
const U = {
|
|
6893
|
+
option: (O, C) => u == null ? void 0 : u.option(O, C),
|
|
6894
6894
|
destroy: () => {
|
|
6895
|
-
|
|
6895
|
+
u == null || u.destroy(), u = null;
|
|
6896
6896
|
},
|
|
6897
|
-
save: () =>
|
|
6898
|
-
toArray: () =>
|
|
6899
|
-
closest: (...O) =>
|
|
6900
|
-
}, le = () =>
|
|
6901
|
-
return
|
|
6902
|
-
|
|
6903
|
-
}),
|
|
6897
|
+
save: () => u == null ? void 0 : u.save(),
|
|
6898
|
+
toArray: () => u == null ? void 0 : u.toArray(),
|
|
6899
|
+
closest: (...O) => u == null ? void 0 : u.closest(...O)
|
|
6900
|
+
}, le = () => U == null ? void 0 : U.option("disabled", !0), Ee = () => U == null ? void 0 : U.option("disabled", !1);
|
|
6901
|
+
return pl(() => {
|
|
6902
|
+
_ && re();
|
|
6903
|
+
}), _l(U.destroy), Xe({ start: re, pause: le, resume: Ee }, U);
|
|
6904
6904
|
}
|
|
6905
6905
|
const To = [
|
|
6906
6906
|
"update",
|
|
@@ -6915,7 +6915,7 @@ const To = [
|
|
|
6915
6915
|
"clone",
|
|
6916
6916
|
"move",
|
|
6917
6917
|
"change"
|
|
6918
|
-
],
|
|
6918
|
+
], hl = [
|
|
6919
6919
|
"clone",
|
|
6920
6920
|
"animation",
|
|
6921
6921
|
"ghostClass",
|
|
@@ -6960,112 +6960,108 @@ const To = [
|
|
|
6960
6960
|
"target",
|
|
6961
6961
|
"customUpdate",
|
|
6962
6962
|
...To.map((e) => `on${e.replace(/^\S/, (o) => o.toUpperCase())}`)
|
|
6963
|
-
],
|
|
6963
|
+
], Tl = we({
|
|
6964
6964
|
name: "VueDraggable",
|
|
6965
6965
|
model: {
|
|
6966
6966
|
prop: "modelValue",
|
|
6967
6967
|
event: "update:modelValue"
|
|
6968
6968
|
},
|
|
6969
|
-
props:
|
|
6969
|
+
props: hl,
|
|
6970
6970
|
emits: ["update:modelValue", ...To],
|
|
6971
6971
|
setup(e, { slots: o, emit: t, expose: n, attrs: i }) {
|
|
6972
|
-
const r = To.reduce((
|
|
6973
|
-
const T = `on${
|
|
6974
|
-
return
|
|
6972
|
+
const r = To.reduce((d, p) => {
|
|
6973
|
+
const T = `on${p.replace(/^\S/, (h) => h.toUpperCase())}`;
|
|
6974
|
+
return d[T] = (...h) => t(p, ...h), d;
|
|
6975
6975
|
}, {}), l = ue(() => {
|
|
6976
|
-
const
|
|
6977
|
-
const
|
|
6978
|
-
return
|
|
6976
|
+
const d = Un(e), p = hn(d, ["modelValue"]), T = Object.entries(p).reduce((h, [A, b]) => {
|
|
6977
|
+
const H = N(b);
|
|
6978
|
+
return H !== void 0 && (h[A] = H), h;
|
|
6979
6979
|
}, {});
|
|
6980
|
-
return
|
|
6981
|
-
}),
|
|
6980
|
+
return Xe(Xe({}, r), Nr(Xe(Xe({}, i), T)));
|
|
6981
|
+
}), s = ue({
|
|
6982
6982
|
get: () => e.modelValue,
|
|
6983
|
-
set: (
|
|
6984
|
-
}),
|
|
6985
|
-
|
|
6983
|
+
set: (d) => t("update:modelValue", d)
|
|
6984
|
+
}), u = Je(), _ = Yn(
|
|
6985
|
+
fl(e.target || u, s, l)
|
|
6986
6986
|
);
|
|
6987
|
-
return n(
|
|
6988
|
-
var
|
|
6989
|
-
return
|
|
6987
|
+
return n(_), () => {
|
|
6988
|
+
var d;
|
|
6989
|
+
return Kn(e.tag || "div", { ref: u }, (d = o == null ? void 0 : o.default) == null ? void 0 : d.call(o, _));
|
|
6990
6990
|
};
|
|
6991
6991
|
}
|
|
6992
|
-
}),
|
|
6992
|
+
}), ml = { class: "text-subtitle-1 ml-6" }, gl = /* @__PURE__ */ we({
|
|
6993
6993
|
__name: "item",
|
|
6994
6994
|
props: {
|
|
6995
6995
|
id: {},
|
|
6996
6996
|
title: {},
|
|
6997
|
-
select: { type: Boolean }
|
|
6998
|
-
index: {}
|
|
6997
|
+
select: { type: Boolean }
|
|
6999
6998
|
},
|
|
7000
6999
|
emits: ["x-click"],
|
|
7001
7000
|
setup(e, { emit: o }) {
|
|
7002
|
-
const { primaryColor: t, backgroundColor2: n, highlightColor: i } = nn(), r = e, l = o,
|
|
7001
|
+
const { primaryColor: t, backgroundColor2: n, highlightColor: i } = nn(), r = e, l = o, s = Je(!1), u = ue(() => ({
|
|
7003
7002
|
position: "relative",
|
|
7004
|
-
background:
|
|
7003
|
+
background: s.value ? i.value : n.value,
|
|
7005
7004
|
height: "48px",
|
|
7006
7005
|
marginBottom: "1px",
|
|
7007
7006
|
userSelect: "none"
|
|
7008
|
-
})),
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
return (_, d) => {
|
|
7022
|
-
const T = oe("v-spacer"), h = oe("v-icon"), A = Fn("ripple");
|
|
7023
|
-
return Hn((ie(), De("div", {
|
|
7007
|
+
})), _ = ue(() => ({
|
|
7008
|
+
display: r.select ? "block" : "none",
|
|
7009
|
+
position: "absolute",
|
|
7010
|
+
top: "0px",
|
|
7011
|
+
left: "0px",
|
|
7012
|
+
width: "100%",
|
|
7013
|
+
height: "100%",
|
|
7014
|
+
border: "1px solid " + t.value,
|
|
7015
|
+
pointerEvents: "none"
|
|
7016
|
+
}));
|
|
7017
|
+
return (d, p) => {
|
|
7018
|
+
const T = oe("v-spacer"), h = oe("v-icon"), A = Hn("ripple");
|
|
7019
|
+
return Gn((J(), ke("div", {
|
|
7024
7020
|
class: "d-flex align-center cursor-pointer",
|
|
7025
|
-
style:
|
|
7026
|
-
onClick:
|
|
7027
|
-
onMouseover:
|
|
7028
|
-
onMouseout:
|
|
7021
|
+
style: Ne(u.value),
|
|
7022
|
+
onClick: p[1] || (p[1] = (b) => l("x-click", r.id)),
|
|
7023
|
+
onMouseover: p[2] || (p[2] = (b) => s.value = !0),
|
|
7024
|
+
onMouseout: p[3] || (p[3] = (b) => s.value = !1)
|
|
7029
7025
|
}, [
|
|
7030
|
-
ve("span",
|
|
7031
|
-
|
|
7032
|
-
|
|
7026
|
+
ve("span", ml, Eo(r.title), 1),
|
|
7027
|
+
ne(T),
|
|
7028
|
+
ne(h, {
|
|
7033
7029
|
class: "x-handle cursor-move mr-3",
|
|
7034
|
-
icon: N(
|
|
7035
|
-
onMousedown:
|
|
7030
|
+
icon: N(di),
|
|
7031
|
+
onMousedown: p[0] || (p[0] = yt(() => {
|
|
7036
7032
|
}, ["stop"]))
|
|
7037
7033
|
}, null, 8, ["icon"]),
|
|
7038
7034
|
ve("div", {
|
|
7039
|
-
style:
|
|
7035
|
+
style: Ne(_.value)
|
|
7040
7036
|
}, null, 4)
|
|
7041
7037
|
], 36)), [
|
|
7042
7038
|
[A]
|
|
7043
7039
|
]);
|
|
7044
7040
|
};
|
|
7045
7041
|
}
|
|
7046
|
-
}),
|
|
7042
|
+
}), El = {
|
|
7047
7043
|
key: 1,
|
|
7048
7044
|
class: "text-caption text-grey"
|
|
7049
|
-
},
|
|
7045
|
+
}, vl = /* @__PURE__ */ we({
|
|
7050
7046
|
__name: "index",
|
|
7051
7047
|
setup(e) {
|
|
7052
|
-
const { t: o } = Ut(), t =
|
|
7053
|
-
const
|
|
7054
|
-
if (!
|
|
7048
|
+
const { t: o } = Ut(), t = Je([]), n = () => {
|
|
7049
|
+
const _ = Pe();
|
|
7050
|
+
if (!_) {
|
|
7055
7051
|
console.assert(!1);
|
|
7056
7052
|
return;
|
|
7057
7053
|
}
|
|
7058
|
-
const
|
|
7059
|
-
|
|
7054
|
+
const d = [];
|
|
7055
|
+
_.getTopBlocks(!0).forEach((T) => {
|
|
7060
7056
|
var A;
|
|
7061
|
-
const h = T.id === ((A =
|
|
7057
|
+
const h = T.id === ((A = Ke()) == null ? void 0 : A.id);
|
|
7062
7058
|
if (T.type.startsWith("on_node_event_v"))
|
|
7063
7059
|
console.log("1");
|
|
7064
7060
|
else if (T.type.startsWith("procedure_def_v"))
|
|
7065
7061
|
console.log("2");
|
|
7066
7062
|
else {
|
|
7067
7063
|
const b = T.getRelativeToSurfaceXY();
|
|
7068
|
-
|
|
7064
|
+
d.push({
|
|
7069
7065
|
id: T.id,
|
|
7070
7066
|
name: o("x-block-lib.temporaryBlock"),
|
|
7071
7067
|
x: b.x,
|
|
@@ -7073,148 +7069,154 @@ const To = [
|
|
|
7073
7069
|
select: h
|
|
7074
7070
|
});
|
|
7075
7071
|
}
|
|
7076
|
-
}), t.value =
|
|
7072
|
+
}), t.value = d;
|
|
7077
7073
|
};
|
|
7078
|
-
|
|
7074
|
+
ze(() => {
|
|
7079
7075
|
Te.on("codeUpdate", n);
|
|
7080
7076
|
}), Nt(() => {
|
|
7081
7077
|
Te.off("codeUpdate", n);
|
|
7082
7078
|
});
|
|
7083
7079
|
let i = [];
|
|
7084
7080
|
const r = () => {
|
|
7085
|
-
const
|
|
7086
|
-
t.value.forEach(({ id:
|
|
7087
|
-
|
|
7088
|
-
}), i =
|
|
7089
|
-
}, l = (
|
|
7090
|
-
const
|
|
7091
|
-
if (!
|
|
7081
|
+
const _ = [];
|
|
7082
|
+
t.value.forEach(({ id: d }) => {
|
|
7083
|
+
_.push(d);
|
|
7084
|
+
}), i = _;
|
|
7085
|
+
}, l = (_) => {
|
|
7086
|
+
const d = Pe();
|
|
7087
|
+
if (!d) {
|
|
7092
7088
|
console.assert(!1);
|
|
7093
7089
|
return;
|
|
7094
7090
|
}
|
|
7095
|
-
if (
|
|
7091
|
+
if (_.oldIndex === void 0 || _.newIndex === void 0) {
|
|
7096
7092
|
console.assert(!1);
|
|
7097
7093
|
return;
|
|
7098
7094
|
}
|
|
7099
|
-
if (
|
|
7095
|
+
if (_.oldIndex === _.newIndex)
|
|
7100
7096
|
return;
|
|
7101
|
-
const
|
|
7097
|
+
const p = i[_.oldIndex], T = d.getBlockById(p);
|
|
7102
7098
|
if (!T) {
|
|
7103
7099
|
console.assert(!1);
|
|
7104
7100
|
return;
|
|
7105
7101
|
}
|
|
7106
7102
|
let h = "";
|
|
7107
|
-
|
|
7103
|
+
_.newIndex > _.oldIndex ? h = i[_.newIndex] : _.newIndex > 0 && (h = i[_.newIndex - 1]);
|
|
7108
7104
|
let A = -10;
|
|
7109
|
-
h !== "" && (A =
|
|
7105
|
+
h !== "" && (A = d.getBlockById(h).getRelativeToSurfaceXY().y + 10);
|
|
7110
7106
|
const b = T.getRelativeToSurfaceXY();
|
|
7111
7107
|
T.moveTo(new m.Coordinate(b.x, A)), Te.emit("cleanWorkspace"), cn();
|
|
7112
|
-
}, { open:
|
|
7113
|
-
const
|
|
7114
|
-
if (!
|
|
7108
|
+
}, { open: s } = bo("blocklyNavigatorDlg"), u = async (_) => {
|
|
7109
|
+
const d = Pe();
|
|
7110
|
+
if (!d) {
|
|
7115
7111
|
console.assert(!1);
|
|
7116
7112
|
return;
|
|
7117
7113
|
}
|
|
7118
|
-
const
|
|
7119
|
-
|
|
7114
|
+
const p = d.getBlockById(_);
|
|
7115
|
+
ti.setSelected(p), sn(_), s.value = !1;
|
|
7120
7116
|
};
|
|
7121
|
-
return (
|
|
7117
|
+
return (_, d) => t.value.length > 0 ? (J(), Le(N(Tl), {
|
|
7122
7118
|
key: 0,
|
|
7123
7119
|
modelValue: t.value,
|
|
7124
|
-
"onUpdate:modelValue":
|
|
7120
|
+
"onUpdate:modelValue": d[0] || (d[0] = (p) => t.value = p),
|
|
7125
7121
|
animation: 150,
|
|
7126
7122
|
"ghost-class": "ghost",
|
|
7127
7123
|
handle: ".x-handle",
|
|
7128
7124
|
onStart: r,
|
|
7129
7125
|
onEnd: l
|
|
7130
7126
|
}, {
|
|
7131
|
-
default:
|
|
7132
|
-
(
|
|
7133
|
-
id:
|
|
7134
|
-
key:
|
|
7135
|
-
title:
|
|
7136
|
-
select:
|
|
7137
|
-
|
|
7138
|
-
|
|
7139
|
-
}, null, 8, ["id", "title", "select", "index"]))), 128))
|
|
7127
|
+
default: je(() => [
|
|
7128
|
+
(J(!0), ke(Zo, null, Xn(t.value, (p) => (J(), Le(gl, {
|
|
7129
|
+
id: p.id,
|
|
7130
|
+
key: p.id,
|
|
7131
|
+
title: p.name,
|
|
7132
|
+
select: p.select,
|
|
7133
|
+
onXClick: u
|
|
7134
|
+
}, null, 8, ["id", "title", "select"]))), 128))
|
|
7140
7135
|
]),
|
|
7141
7136
|
_: 1
|
|
7142
|
-
}, 8, ["modelValue"])) : (
|
|
7137
|
+
}, 8, ["modelValue"])) : (J(), ke("span", El, Eo(N(o)("x-block-lib.noOption")), 1));
|
|
7143
7138
|
}
|
|
7144
|
-
}),
|
|
7139
|
+
}), Mn = (e, o) => {
|
|
7145
7140
|
const t = e.__vccOpts || e;
|
|
7146
7141
|
for (const [n, i] of o)
|
|
7147
7142
|
t[n] = i;
|
|
7148
7143
|
return t;
|
|
7149
|
-
}, yl = /* @__PURE__ */ vl
|
|
7144
|
+
}, yl = /* @__PURE__ */ Mn(vl, [["__scopeId", "data-v-91f61557"]]), bl = {};
|
|
7145
|
+
function Ol(e, o) {
|
|
7146
|
+
return J(), ke("div", null, "blockTree");
|
|
7147
|
+
}
|
|
7148
|
+
const Il = /* @__PURE__ */ Mn(bl, [["render", Ol]]), Cl = { class: "text-subtitle-1 ml-3" }, Al = /* @__PURE__ */ we({
|
|
7150
7149
|
__name: "index",
|
|
7150
|
+
props: {
|
|
7151
|
+
type: {}
|
|
7152
|
+
},
|
|
7151
7153
|
setup(e) {
|
|
7152
|
-
const { t: o } = Ut(), t =
|
|
7153
|
-
let
|
|
7154
|
-
return t.mdAndUp.value && (
|
|
7154
|
+
const { t: o } = Ut(), t = ci(), { sysBarAvail: n } = ai(), { backgroundColor1: i } = nn(), r = e, l = ue(() => {
|
|
7155
|
+
let d = "100%";
|
|
7156
|
+
return t.mdAndUp.value && (d = "400px"), {
|
|
7155
7157
|
background: i.value,
|
|
7156
|
-
width:
|
|
7158
|
+
width: d,
|
|
7157
7159
|
height: "100%"
|
|
7158
7160
|
};
|
|
7159
|
-
}),
|
|
7160
|
-
let
|
|
7161
|
-
return n.value && (
|
|
7161
|
+
}), s = ue(() => {
|
|
7162
|
+
let d = 48;
|
|
7163
|
+
return n.value && (d += 24), {
|
|
7162
7164
|
position: "relative",
|
|
7163
7165
|
width: "100%",
|
|
7164
|
-
height: `calc(100% - ${
|
|
7166
|
+
height: `calc(100% - ${d}px)`
|
|
7165
7167
|
};
|
|
7166
|
-
}),
|
|
7168
|
+
}), u = ue(() => ({
|
|
7167
7169
|
height: "60px"
|
|
7168
|
-
})), { open:
|
|
7169
|
-
return (
|
|
7170
|
-
const
|
|
7171
|
-
return
|
|
7172
|
-
|
|
7173
|
-
modelValue: N(
|
|
7174
|
-
"onUpdate:modelValue":
|
|
7170
|
+
})), { open: _ } = bo("blocklyNavigatorDlg");
|
|
7171
|
+
return (d, p) => {
|
|
7172
|
+
const T = oe("v-sheet"), h = oe("v-icon"), A = oe("v-dialog"), b = oe("v-btn"), H = oe("v-tooltip");
|
|
7173
|
+
return J(), ke(Zo, null, [
|
|
7174
|
+
ne(A, {
|
|
7175
|
+
modelValue: N(_),
|
|
7176
|
+
"onUpdate:modelValue": p[3] || (p[3] = (S) => vt(_) ? _.value = S : null),
|
|
7175
7177
|
transition: "scroll-x-reverse-transition",
|
|
7176
7178
|
persistent: "",
|
|
7177
7179
|
"no-click-animation": "",
|
|
7178
7180
|
fullscreen: "",
|
|
7179
7181
|
eager: "",
|
|
7180
|
-
onKeydown:
|
|
7182
|
+
onKeydown: p[4] || (p[4] = $n(yt((S) => _.value = !1, ["stop", "prevent"]), ["esc"]))
|
|
7181
7183
|
}, {
|
|
7182
|
-
default:
|
|
7184
|
+
default: je(() => [
|
|
7183
7185
|
ve("div", {
|
|
7184
7186
|
class: "w-100 h-100 d-flex flex-row-reverse",
|
|
7185
|
-
onClick:
|
|
7186
|
-
onContextmenu:
|
|
7187
|
+
onClick: p[1] || (p[1] = yt((S) => _.value = !1, ["self"])),
|
|
7188
|
+
onContextmenu: p[2] || (p[2] = yt((S) => _.value = !1, ["self", "prevent"]))
|
|
7187
7189
|
}, [
|
|
7188
7190
|
ve("div", {
|
|
7189
7191
|
class: "elevation-2",
|
|
7190
|
-
style:
|
|
7192
|
+
style: Ne(l.value)
|
|
7191
7193
|
}, [
|
|
7192
|
-
N(n) ? (
|
|
7194
|
+
N(n) ? (J(), Le(T, {
|
|
7193
7195
|
key: 0,
|
|
7194
7196
|
color: "transparent",
|
|
7195
7197
|
height: 24
|
|
7196
|
-
})) :
|
|
7197
|
-
|
|
7198
|
+
})) : nt("", !0),
|
|
7199
|
+
ne(T, {
|
|
7198
7200
|
class: "d-flex align-center px-3",
|
|
7199
7201
|
color: "transparent",
|
|
7200
7202
|
height: 48
|
|
7201
7203
|
}, {
|
|
7202
|
-
default:
|
|
7203
|
-
|
|
7204
|
-
icon: N(
|
|
7205
|
-
onClick:
|
|
7204
|
+
default: je(() => [
|
|
7205
|
+
ne(h, {
|
|
7206
|
+
icon: N(_i),
|
|
7207
|
+
onClick: p[0] || (p[0] = (S) => _.value = !1)
|
|
7206
7208
|
}, null, 8, ["icon"]),
|
|
7207
|
-
ve("span",
|
|
7209
|
+
ve("span", Cl, Eo(N(o)("x-block-lib.navigator")), 1)
|
|
7208
7210
|
]),
|
|
7209
7211
|
_: 1
|
|
7210
7212
|
}),
|
|
7211
7213
|
ve("div", {
|
|
7212
7214
|
class: "overflow-y-auto",
|
|
7213
|
-
style:
|
|
7215
|
+
style: Ne(s.value)
|
|
7214
7216
|
}, [
|
|
7215
|
-
|
|
7217
|
+
r.type === "list" ? (J(), Le(yl, { key: 0 })) : r.type === "tree" ? (J(), Le(Il, { key: 1 })) : nt("", !0),
|
|
7216
7218
|
ve("div", {
|
|
7217
|
-
style:
|
|
7219
|
+
style: Ne(u.value)
|
|
7218
7220
|
}, null, 4)
|
|
7219
7221
|
], 4)
|
|
7220
7222
|
], 4)
|
|
@@ -7222,15 +7224,15 @@ const To = [
|
|
|
7222
7224
|
]),
|
|
7223
7225
|
_: 1
|
|
7224
7226
|
}, 8, ["modelValue"]),
|
|
7225
|
-
|
|
7227
|
+
ne(H, {
|
|
7226
7228
|
text: N(o)("x-block-lib.tip.hotkeyCtrlE")
|
|
7227
7229
|
}, {
|
|
7228
|
-
activator:
|
|
7229
|
-
|
|
7230
|
+
activator: je(({ props: S }) => [
|
|
7231
|
+
ne(b, mo(S, {
|
|
7230
7232
|
variant: "outlined",
|
|
7231
7233
|
density: "comfortable",
|
|
7232
|
-
icon: N(
|
|
7233
|
-
onClick:
|
|
7234
|
+
icon: N(Ti),
|
|
7235
|
+
onClick: p[5] || (p[5] = (Q) => _.value = !0)
|
|
7234
7236
|
}), null, 16, ["icon"])
|
|
7235
7237
|
]),
|
|
7236
7238
|
_: 1
|
|
@@ -7261,13 +7263,13 @@ const To = [
|
|
|
7261
7263
|
wheel: !0
|
|
7262
7264
|
}
|
|
7263
7265
|
};
|
|
7264
|
-
function
|
|
7266
|
+
function Ll(e, o, t) {
|
|
7265
7267
|
let n;
|
|
7266
|
-
o === "page" ? t === "v1" && (n =
|
|
7267
|
-
const i =
|
|
7268
|
+
o === "page" ? t === "v1" && (n = br) : o === "comp" ? t === "v1" && (n = Er) : o === "func" ? t === "v1" && (n = yr) : o === "flow" && t === "v1" && (n = vr), console.assert(!!n), Qo.toolbox = n;
|
|
7269
|
+
const i = oi(e, Qo);
|
|
7268
7270
|
return o === "page" || o === "comp" ? t === "v1" && (i.registerToolboxCategoryCallback(
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
+
Ge.name,
|
|
7272
|
+
Ge.callback
|
|
7271
7273
|
), i.registerToolboxCategoryCallback(
|
|
7272
7274
|
se.name,
|
|
7273
7275
|
se.callback
|
|
@@ -7288,7 +7290,7 @@ function Il(e, o, t) {
|
|
|
7288
7290
|
ce.callback
|
|
7289
7291
|
)), i;
|
|
7290
7292
|
}
|
|
7291
|
-
const
|
|
7293
|
+
const kl = { class: "position-relative w-100 h-100" }, Nl = /* @__PURE__ */ we({
|
|
7292
7294
|
__name: "index",
|
|
7293
7295
|
props: /* @__PURE__ */ Lo({
|
|
7294
7296
|
type: {},
|
|
@@ -7301,9 +7303,9 @@ const Cl = { class: "position-relative w-100 h-100" }, Al = /* @__PURE__ */ Pe({
|
|
|
7301
7303
|
}),
|
|
7302
7304
|
emits: /* @__PURE__ */ Lo(["ready"], ["update:lock", "update:scale"]),
|
|
7303
7305
|
setup(e, { expose: o, emit: t }) {
|
|
7304
|
-
const n =
|
|
7306
|
+
const n = si(), { locale: i, dark: r } = ii(n), { open: l } = bo("blocklyEditorFlyout"), s = co(e, "lock"), u = co(e, "scale"), _ = e, d = t, p = jn("blocklyDiv");
|
|
7305
7307
|
let T;
|
|
7306
|
-
const h =
|
|
7308
|
+
const h = Je(!1), A = Je(!1), b = ue(() => ({
|
|
7307
7309
|
position: "absolute",
|
|
7308
7310
|
background: r.value ? "#0000007f" : "#ffffff7f",
|
|
7309
7311
|
top: "1px",
|
|
@@ -7312,7 +7314,7 @@ const Cl = { class: "position-relative w-100 h-100" }, Al = /* @__PURE__ */ Pe({
|
|
|
7312
7314
|
height: "calc(100% - 1px)",
|
|
7313
7315
|
pointerEvents: "none",
|
|
7314
7316
|
zIndex: 999
|
|
7315
|
-
})),
|
|
7317
|
+
})), H = ue(() => ({
|
|
7316
7318
|
position: "absolute",
|
|
7317
7319
|
background: r.value ? "#0000007f" : "#ffffff7f",
|
|
7318
7320
|
top: "0px",
|
|
@@ -7320,27 +7322,27 @@ const Cl = { class: "position-relative w-100 h-100" }, Al = /* @__PURE__ */ Pe({
|
|
|
7320
7322
|
width: "100%",
|
|
7321
7323
|
height: "100%",
|
|
7322
7324
|
pointerEvents: "none"
|
|
7323
|
-
})),
|
|
7325
|
+
})), S = ue(() => ({
|
|
7324
7326
|
position: "absolute",
|
|
7325
7327
|
top: "0px",
|
|
7326
7328
|
right: "0px",
|
|
7327
7329
|
zIndex: 20
|
|
7328
|
-
})),
|
|
7330
|
+
})), Q = (E) => {
|
|
7329
7331
|
h.value = !0, No.workspaces.load(E, T);
|
|
7330
7332
|
}, w = () => No.workspaces.save(T), re = () => a.workspaceToCode(T);
|
|
7331
|
-
|
|
7332
|
-
await Do(i.value), T =
|
|
7333
|
+
ze(async () => {
|
|
7334
|
+
await Do(i.value), T = Ll(p.value, _.type, _.version), T.addChangeListener(F.disableOrphans), T.addChangeListener(U), T.setScale(u.value), await go(), d("ready");
|
|
7333
7335
|
}), Nt(() => {
|
|
7334
7336
|
l.value = !1;
|
|
7335
|
-
}),
|
|
7336
|
-
T &&
|
|
7337
|
+
}), Oi(p, () => {
|
|
7338
|
+
T && ni(T);
|
|
7337
7339
|
});
|
|
7338
|
-
async function
|
|
7339
|
-
if (E.type ===
|
|
7340
|
+
async function U(E) {
|
|
7341
|
+
if (E.type === F.FINISHED_LOADING) {
|
|
7340
7342
|
cn(), Te.emit("codeUpdate"), h.value = !1;
|
|
7341
7343
|
return;
|
|
7342
7344
|
}
|
|
7343
|
-
h.value || (E.type ===
|
|
7345
|
+
h.value || (E.type === F.VIEWPORT_CHANGE && (u.value = T.getScale()), E.type === F.BLOCK_DRAG && (E.isStart ? A.value = !0 : A.value = !1), Te.emit("codeUpdate"));
|
|
7344
7346
|
}
|
|
7345
7347
|
const le = (E) => {
|
|
7346
7348
|
if (E.key === "q" && E.ctrlKey) {
|
|
@@ -7358,74 +7360,76 @@ const Cl = { class: "position-relative w-100 h-100" }, Al = /* @__PURE__ */ Pe({
|
|
|
7358
7360
|
}, Ee = () => {
|
|
7359
7361
|
Te.emit("cleanWorkspace");
|
|
7360
7362
|
}, O = () => {
|
|
7361
|
-
|
|
7363
|
+
s.value = !s.value;
|
|
7362
7364
|
}, C = () => {
|
|
7363
7365
|
Te.emit("blocklyNavigatorDlg");
|
|
7364
7366
|
};
|
|
7365
|
-
return
|
|
7367
|
+
return ze(() => {
|
|
7366
7368
|
window.addEventListener("keydown", le, !1);
|
|
7367
7369
|
}), Nt(() => {
|
|
7368
7370
|
window.addEventListener("keydown", le, !1);
|
|
7369
|
-
}),
|
|
7371
|
+
}), He(i, (E) => {
|
|
7370
7372
|
Do(E);
|
|
7371
|
-
}),
|
|
7372
|
-
|
|
7373
|
-
}),
|
|
7374
|
-
var
|
|
7375
|
-
E || (
|
|
7376
|
-
}),
|
|
7373
|
+
}), He(r, (E) => {
|
|
7374
|
+
gr(E ? "dark" : "light");
|
|
7375
|
+
}), He(l, (E) => {
|
|
7376
|
+
var B;
|
|
7377
|
+
E || (B = T.getToolbox()) == null || B.clearSelection();
|
|
7378
|
+
}), He(u, (E) => {
|
|
7377
7379
|
T.setScale(E);
|
|
7378
|
-
}), o({ loading: h, load:
|
|
7379
|
-
const
|
|
7380
|
-
return
|
|
7380
|
+
}), o({ loading: h, load: Q, save: w, generateCode: re }), (E, B) => {
|
|
7381
|
+
const R = oe("v-icon"), x = oe("x-loading");
|
|
7382
|
+
return J(), ke("div", kl, [
|
|
7381
7383
|
ve("div", {
|
|
7382
7384
|
id: "blocklyEditor",
|
|
7383
7385
|
ref_key: "blocklyDiv",
|
|
7384
|
-
ref:
|
|
7386
|
+
ref: p,
|
|
7385
7387
|
class: "w-100 h-100"
|
|
7386
7388
|
}, null, 512),
|
|
7387
|
-
A.value ? (
|
|
7389
|
+
A.value ? (J(), ke("div", {
|
|
7388
7390
|
key: 0,
|
|
7389
7391
|
class: "d-flex flex-column align-center justify-center",
|
|
7390
|
-
style:
|
|
7392
|
+
style: Ne(b.value)
|
|
7391
7393
|
}, [
|
|
7392
|
-
|
|
7393
|
-
icon: N(
|
|
7394
|
+
ne(R, {
|
|
7395
|
+
icon: N(pi),
|
|
7394
7396
|
size: "x-large"
|
|
7395
7397
|
}, null, 8, ["icon"])
|
|
7396
|
-
], 4)) :
|
|
7397
|
-
|
|
7398
|
+
], 4)) : nt("", !0),
|
|
7399
|
+
s.value ? (J(), ke("div", {
|
|
7398
7400
|
key: 1,
|
|
7399
|
-
style:
|
|
7400
|
-
}, null, 4)) :
|
|
7401
|
+
style: Ne(H.value)
|
|
7402
|
+
}, null, 4)) : nt("", !0),
|
|
7401
7403
|
ve("div", {
|
|
7402
7404
|
class: "d-flex align-end pt-3 pr-3",
|
|
7403
|
-
style:
|
|
7405
|
+
style: Ne(S.value)
|
|
7404
7406
|
}, [
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
modelValue:
|
|
7408
|
-
"onUpdate:modelValue":
|
|
7407
|
+
ne(Or),
|
|
7408
|
+
ne(Ir, {
|
|
7409
|
+
modelValue: s.value,
|
|
7410
|
+
"onUpdate:modelValue": B[0] || (B[0] = (G) => s.value = G)
|
|
7409
7411
|
}, null, 8, ["modelValue"]),
|
|
7410
|
-
|
|
7412
|
+
ne(Al, {
|
|
7413
|
+
type: E.type === "json" ? "tree" : "list"
|
|
7414
|
+
}, null, 8, ["type"])
|
|
7411
7415
|
], 4),
|
|
7412
|
-
h.value ? (
|
|
7416
|
+
h.value ? (J(), Le(x, {
|
|
7413
7417
|
key: 2,
|
|
7414
7418
|
"z-index": 99
|
|
7415
|
-
})) :
|
|
7419
|
+
})) : nt("", !0)
|
|
7416
7420
|
]);
|
|
7417
7421
|
};
|
|
7418
7422
|
}
|
|
7419
|
-
}),
|
|
7420
|
-
e.component("XBlockly",
|
|
7423
|
+
}), Sl = (e) => {
|
|
7424
|
+
e.component("XBlockly", Nl);
|
|
7421
7425
|
};
|
|
7422
|
-
async function
|
|
7426
|
+
async function Vl(e) {
|
|
7423
7427
|
return (await an(/* @__PURE__ */ Object.assign({ "./locales/en/index.ts": () => import("./i18n-en-58ejxm4b.js"), "./locales/zhHans/index.ts": () => import("./i18n-zhHans-cb9uza7v.js") }), `./locales/${e}/index.ts`, 4)).default;
|
|
7424
7428
|
}
|
|
7425
|
-
const
|
|
7429
|
+
const Ul = { install: Sl };
|
|
7426
7430
|
export {
|
|
7427
|
-
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
+
Nl as XBlockly,
|
|
7432
|
+
Ul as default,
|
|
7433
|
+
Sl as install,
|
|
7434
|
+
Vl as loadLocaleMessageBlock
|
|
7431
7435
|
};
|