x-block-lib 0.3.5 → 0.3.22
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/components/blockly/cleanup.vue.d.ts +2 -0
- package/dist/components/blockly/index.vue.d.ts +10 -3
- package/dist/components/blockly/lock.vue.d.ts +18 -0
- package/dist/components/blockly/navigator.vue.d.ts +2 -0
- package/dist/core/locale/msg/en/index.d.ts +5 -5
- package/dist/core/locale/msg/en/logic.d.ts +13 -0
- package/dist/core/locale/msg/en/loop.d.ts +11 -0
- package/dist/core/locale/msg/zhHans/index.d.ts +5 -5
- package/dist/core/locale/msg/zhHans/logic.d.ts +13 -0
- package/dist/core/locale/msg/zhHans/loop.d.ts +11 -0
- package/dist/{zhHans-dmzotd2n.js → en-jrrs2wmb.js} +15 -7
- package/dist/index.js +273 -149
- package/dist/zhHans-jrrs2wmb.js +35 -0
- package/package.json +6 -2
- package/dist/en-c75t6n0y.js +0 -27
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
interface Props {
|
|
2
2
|
type: 'app';
|
|
3
3
|
version: 'v1';
|
|
4
|
+
active: boolean;
|
|
4
5
|
}
|
|
5
|
-
declare
|
|
6
|
+
declare let __VLS_typeProps: Props;
|
|
7
|
+
type __VLS_PublicProps = {
|
|
8
|
+
'lock': boolean;
|
|
9
|
+
} & typeof __VLS_typeProps;
|
|
10
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_PublicProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
"update:lock": (lock: boolean) => void;
|
|
6
12
|
ready: (...args: any[]) => void;
|
|
7
13
|
change: (...args: any[]) => void;
|
|
8
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<
|
|
9
|
-
onReady?: ((...args: any[]) => any) | undefined;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_PublicProps>>> & {
|
|
10
15
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
16
|
+
onReady?: ((...args: any[]) => any) | undefined;
|
|
17
|
+
"onUpdate:lock"?: ((lock: boolean) => any) | undefined;
|
|
11
18
|
}, {}, {}>;
|
|
12
19
|
export default _default;
|
|
13
20
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_PublicProps = {
|
|
2
|
+
modelValue: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_PublicProps>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
"update:modelValue": (modelValue: boolean) => void;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_PublicProps>>> & {
|
|
7
|
+
"onUpdate:modelValue"?: ((modelValue: boolean) => any) | undefined;
|
|
8
|
+
}, {}, {}>;
|
|
9
|
+
export default _default;
|
|
10
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
11
|
+
type __VLS_TypePropsToOption<T> = {
|
|
12
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
13
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
14
|
+
} : {
|
|
15
|
+
type: import('vue').PropType<T[K]>;
|
|
16
|
+
required: true;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
LOOP_DO: string;
|
|
3
2
|
LOOP_V1_FOR_TITLE: string;
|
|
4
3
|
LOOP_V1_FOR_EACH_TITLE: string;
|
|
5
4
|
LOOP_V1_WHILE_UNTIL_OPERATOR_WHILE: string;
|
|
@@ -7,15 +6,16 @@ declare const _default: {
|
|
|
7
6
|
LOOP_V1_WHILE_UNTIL_TOOLTIP_WHILE: string;
|
|
8
7
|
LOOP_V1_WHILE_UNTIL_TOOLTIP_UNTIL: string;
|
|
9
8
|
LOOP_V1_WHILE_UNTIL_HELPURL: string;
|
|
9
|
+
LOOP_DO: string;
|
|
10
|
+
LOGIC_V1_BOOLEAN_TOOPTIP: string;
|
|
11
|
+
LOGIC_V1_BOOLEAN_HELPURL: string;
|
|
12
|
+
LOGIC_V1_IF_TOOLTIP: string;
|
|
13
|
+
LOGIC_V1_IF_HELPURL: string;
|
|
10
14
|
LOGIC_BOOLEAN_FALSE: string;
|
|
11
15
|
LOGIC_BOOLEAN_TRUE: string;
|
|
12
16
|
LOGIC_DO: string;
|
|
13
17
|
LOGIC_ELSE: string;
|
|
14
18
|
LOGIC_ELSE_IF: string;
|
|
15
19
|
LOGIC_IF: string;
|
|
16
|
-
LOGIC_V1_BOOLEAN_TOOPTIP: string;
|
|
17
|
-
LOGIC_V1_BOOLEAN_HELPURL: string;
|
|
18
|
-
LOGIC_V1_IF_TOOLTIP: string;
|
|
19
|
-
LOGIC_V1_IF_HELPURL: string;
|
|
20
20
|
};
|
|
21
21
|
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
LOGIC_V1_BOOLEAN_TOOPTIP: string;
|
|
3
|
+
LOGIC_V1_BOOLEAN_HELPURL: string;
|
|
4
|
+
LOGIC_V1_IF_TOOLTIP: string;
|
|
5
|
+
LOGIC_V1_IF_HELPURL: string;
|
|
6
|
+
LOGIC_BOOLEAN_FALSE: string;
|
|
7
|
+
LOGIC_BOOLEAN_TRUE: string;
|
|
8
|
+
LOGIC_DO: string;
|
|
9
|
+
LOGIC_ELSE: string;
|
|
10
|
+
LOGIC_ELSE_IF: string;
|
|
11
|
+
LOGIC_IF: string;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
LOOP_V1_FOR_TITLE: string;
|
|
3
|
+
LOOP_V1_FOR_EACH_TITLE: string;
|
|
4
|
+
LOOP_V1_WHILE_UNTIL_OPERATOR_WHILE: string;
|
|
5
|
+
LOOP_V1_WHILE_UNTIL_OPERATOR_UNTIL: string;
|
|
6
|
+
LOOP_V1_WHILE_UNTIL_TOOLTIP_WHILE: string;
|
|
7
|
+
LOOP_V1_WHILE_UNTIL_TOOLTIP_UNTIL: string;
|
|
8
|
+
LOOP_V1_WHILE_UNTIL_HELPURL: string;
|
|
9
|
+
LOOP_DO: string;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
LOOP_DO: string;
|
|
3
2
|
LOOP_V1_FOR_TITLE: string;
|
|
4
3
|
LOOP_V1_FOR_EACH_TITLE: string;
|
|
5
4
|
LOOP_V1_WHILE_UNTIL_OPERATOR_WHILE: string;
|
|
@@ -7,15 +6,16 @@ declare const _default: {
|
|
|
7
6
|
LOOP_V1_WHILE_UNTIL_TOOLTIP_WHILE: string;
|
|
8
7
|
LOOP_V1_WHILE_UNTIL_TOOLTIP_UNTIL: string;
|
|
9
8
|
LOOP_V1_WHILE_UNTIL_HELPURL: string;
|
|
9
|
+
LOOP_DO: string;
|
|
10
|
+
LOGIC_V1_BOOLEAN_TOOPTIP: string;
|
|
11
|
+
LOGIC_V1_BOOLEAN_HELPURL: string;
|
|
12
|
+
LOGIC_V1_IF_TOOLTIP: string;
|
|
13
|
+
LOGIC_V1_IF_HELPURL: string;
|
|
10
14
|
LOGIC_BOOLEAN_FALSE: string;
|
|
11
15
|
LOGIC_BOOLEAN_TRUE: string;
|
|
12
16
|
LOGIC_DO: string;
|
|
13
17
|
LOGIC_ELSE: string;
|
|
14
18
|
LOGIC_ELSE_IF: string;
|
|
15
19
|
LOGIC_IF: string;
|
|
16
|
-
LOGIC_V1_BOOLEAN_TOOPTIP: string;
|
|
17
|
-
LOGIC_V1_BOOLEAN_HELPURL: string;
|
|
18
|
-
LOGIC_V1_IF_TOOLTIP: string;
|
|
19
|
-
LOGIC_V1_IF_HELPURL: string;
|
|
20
20
|
};
|
|
21
21
|
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
LOGIC_V1_BOOLEAN_TOOPTIP: string;
|
|
3
|
+
LOGIC_V1_BOOLEAN_HELPURL: string;
|
|
4
|
+
LOGIC_V1_IF_TOOLTIP: string;
|
|
5
|
+
LOGIC_V1_IF_HELPURL: string;
|
|
6
|
+
LOGIC_BOOLEAN_FALSE: string;
|
|
7
|
+
LOGIC_BOOLEAN_TRUE: string;
|
|
8
|
+
LOGIC_DO: string;
|
|
9
|
+
LOGIC_ELSE: string;
|
|
10
|
+
LOGIC_ELSE_IF: string;
|
|
11
|
+
LOGIC_IF: string;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
LOOP_V1_FOR_TITLE: string;
|
|
3
|
+
LOOP_V1_FOR_EACH_TITLE: string;
|
|
4
|
+
LOOP_V1_WHILE_UNTIL_OPERATOR_WHILE: string;
|
|
5
|
+
LOOP_V1_WHILE_UNTIL_OPERATOR_UNTIL: string;
|
|
6
|
+
LOOP_V1_WHILE_UNTIL_TOOLTIP_WHILE: string;
|
|
7
|
+
LOOP_V1_WHILE_UNTIL_TOOLTIP_UNTIL: string;
|
|
8
|
+
LOOP_V1_WHILE_UNTIL_HELPURL: string;
|
|
9
|
+
LOOP_DO: string;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -4,13 +4,18 @@ const _ = {
|
|
|
4
4
|
LOGIC_DO: "执行",
|
|
5
5
|
LOGIC_ELSE: "否则",
|
|
6
6
|
LOGIC_ELSE_IF: "否则如果",
|
|
7
|
-
LOGIC_IF: "如果"
|
|
7
|
+
LOGIC_IF: "如果"
|
|
8
|
+
}, L = {
|
|
8
9
|
LOGIC_V1_BOOLEAN_TOOPTIP: "LOGIC_V1_BOOLEAN_TOOPTIP",
|
|
9
10
|
LOGIC_V1_BOOLEAN_HELPURL: "LOGIC_V1_BOOLEAN_HELPURL",
|
|
10
11
|
LOGIC_V1_IF_TOOLTIP: "LOGIC_V1_IF_TOOLTIP",
|
|
11
12
|
LOGIC_V1_IF_HELPURL: "LOGIC_V1_IF_HELPURL"
|
|
12
|
-
},
|
|
13
|
-
|
|
13
|
+
}, O = {
|
|
14
|
+
..._,
|
|
15
|
+
...L
|
|
16
|
+
}, I = {
|
|
17
|
+
LOOP_DO: "执行"
|
|
18
|
+
}, E = {
|
|
14
19
|
LOOP_V1_FOR_TITLE: "变量%1从%2数到%3每次增加%4",
|
|
15
20
|
LOOP_V1_FOR_EACH_TITLE: "遍历列表%2中的每一项%1",
|
|
16
21
|
LOOP_V1_WHILE_UNTIL_OPERATOR_WHILE: "当条件满足时重复",
|
|
@@ -18,10 +23,13 @@ const _ = {
|
|
|
18
23
|
LOOP_V1_WHILE_UNTIL_TOOLTIP_WHILE: "LOOP_V1_WHILE_UNTIL_TOOLTIP_WHILE",
|
|
19
24
|
LOOP_V1_WHILE_UNTIL_TOOLTIP_UNTIL: "LOOP_V1_WHILE_UNTIL_TOOLTIP_UNTIL",
|
|
20
25
|
LOOP_V1_WHILE_UNTIL_HELPURL: "LOOP_V1_WHILE_UNTIL_HELPURL"
|
|
21
|
-
},
|
|
22
|
-
...
|
|
23
|
-
...
|
|
26
|
+
}, T = {
|
|
27
|
+
...I,
|
|
28
|
+
...E
|
|
29
|
+
}, P = {
|
|
30
|
+
...O,
|
|
31
|
+
...T
|
|
24
32
|
};
|
|
25
33
|
export {
|
|
26
|
-
|
|
34
|
+
P as default
|
|
27
35
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
2
|
-
import { defineComponent as F,
|
|
3
|
-
import {
|
|
4
|
-
import { openConfirmDlg as
|
|
5
|
-
import { d as
|
|
6
|
-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.id="x-block-lib",o.appendChild(document.createTextNode(".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
|
+
import { defineComponent as B, resolveComponent as b, openBlock as O, createBlock as F, unref as S, useModel as X, computed as I, withCtx as U, createVNode as h, mergeProps as se, createElementVNode as V, normalizeStyle as E, mergeModels as H, ref as Y, onMounted as le, onBeforeUnmount as ae, watch as L, resolveDirective as ie, createElementBlock as R, withDirectives as ce, createCommentVNode as G } from "vue";
|
|
3
|
+
import { storeToRefs as ue } from "pinia";
|
|
4
|
+
import { openConfirmDlg as _e, openPromptDlg as pe, useGlobalStore as fe, useViewStack as de } from "x-essential-lib";
|
|
5
|
+
import { d as C, j as ye, O as ge, E as p, u as i, M as f, C as me, a as y, b as j, s as he, S as u, c as w, g as k, i as T, e as K, f as v, h as m, k as W, G as M, B as be, T as x, l as J, m as $, n as Oe, o as Ce } from "./blockly-kru4jhu1.js";
|
|
6
|
+
var ke = "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", ve = "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z", Se = "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", Le = "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", Te = "M21 3L3 10.53V11.5L9.84 14.16L12.5 21H13.46L21 3Z";
|
|
7
|
+
C([
|
|
7
8
|
{
|
|
8
9
|
type: "boolean_v1",
|
|
9
10
|
message0: "%1",
|
|
@@ -23,16 +24,16 @@ g([
|
|
|
23
24
|
helpUrl: "%{BKY_LOGIC_V1_BOOLEAN_HELPURL}"
|
|
24
25
|
}
|
|
25
26
|
]);
|
|
26
|
-
|
|
27
|
-
return [t.getFieldValue("BOOL") === "TRUE" ? "true" : "false",
|
|
27
|
+
ye.forBlock.boolean_v1 = function(t) {
|
|
28
|
+
return [t.getFieldValue("BOOL") === "TRUE" ? "true" : "false", ge.ATOMIC];
|
|
28
29
|
};
|
|
29
|
-
const
|
|
30
|
+
const Ie = {
|
|
30
31
|
elseIfCount_: 0,
|
|
31
32
|
hasElse_: !1,
|
|
32
33
|
mutationToDom: function() {
|
|
33
34
|
if (this.elseIfCount_ <= 0 && !this.hasElse_)
|
|
34
35
|
return null;
|
|
35
|
-
const t =
|
|
36
|
+
const t = i.xml.createElement("mutation");
|
|
36
37
|
return this.elseIfCount_ > 0 && t.setAttribute("elseIf", String(this.elseIfCount_)), this.hasElse_ && t.setAttribute("else", "TRUE"), t;
|
|
37
38
|
},
|
|
38
39
|
domToMutation: function(t) {
|
|
@@ -150,11 +151,11 @@ const re = {
|
|
|
150
151
|
};
|
|
151
152
|
p.registerMutator(
|
|
152
153
|
"if_v1_mutator",
|
|
153
|
-
|
|
154
|
+
Ie,
|
|
154
155
|
void 0,
|
|
155
156
|
["if_else_if_v1", "if_else_v1"]
|
|
156
157
|
);
|
|
157
|
-
|
|
158
|
+
C([
|
|
158
159
|
{
|
|
159
160
|
type: "if_v1",
|
|
160
161
|
message0: "%{BKY_LOGIC_IF} %1",
|
|
@@ -202,7 +203,7 @@ g([
|
|
|
202
203
|
style: "logic_blocks"
|
|
203
204
|
}
|
|
204
205
|
]);
|
|
205
|
-
const
|
|
206
|
+
const Ee = {
|
|
206
207
|
customContextMenu: function(t) {
|
|
207
208
|
if (this.isInFlyout)
|
|
208
209
|
return;
|
|
@@ -217,14 +218,14 @@ const se = {
|
|
|
217
218
|
t.push({
|
|
218
219
|
enabled: !0,
|
|
219
220
|
text: f.VARIABLES_SET_CREATE_GET.replace("%1", o),
|
|
220
|
-
callback:
|
|
221
|
+
callback: me.callbackFactory(this, r)
|
|
221
222
|
});
|
|
222
223
|
}
|
|
223
224
|
}
|
|
224
225
|
};
|
|
225
226
|
p.registerMixin(
|
|
226
227
|
"contextMenu_newGetVariableBlock_v1",
|
|
227
|
-
|
|
228
|
+
Ee
|
|
228
229
|
);
|
|
229
230
|
p.register(
|
|
230
231
|
"flow_control_tooltip_v1",
|
|
@@ -233,16 +234,16 @@ p.register(
|
|
|
233
234
|
CONTINUE: "%{BKY_LOOP_V1_FLOW_CONTROL_TOOLTIP_CONTINUE}"
|
|
234
235
|
})
|
|
235
236
|
);
|
|
236
|
-
const
|
|
237
|
+
const Be = /* @__PURE__ */ new Set([
|
|
237
238
|
"repeat_v1",
|
|
238
239
|
"for_each_v1",
|
|
239
240
|
"for_v1",
|
|
240
241
|
"while_until_v1"
|
|
241
|
-
]),
|
|
242
|
+
]), xe = {
|
|
242
243
|
getSurroundLoop: function() {
|
|
243
244
|
let t = this;
|
|
244
245
|
do {
|
|
245
|
-
if (
|
|
246
|
+
if (Be.has(t.type))
|
|
246
247
|
return !0;
|
|
247
248
|
t = t == null ? void 0 : t.getSurroundParent();
|
|
248
249
|
} while (t);
|
|
@@ -265,9 +266,9 @@ const ae = /* @__PURE__ */ new Set([
|
|
|
265
266
|
};
|
|
266
267
|
p.registerMixin(
|
|
267
268
|
"flow_control_in_loop_check_v1",
|
|
268
|
-
|
|
269
|
+
xe
|
|
269
270
|
);
|
|
270
|
-
|
|
271
|
+
C([
|
|
271
272
|
{
|
|
272
273
|
type: "flow_control_v1",
|
|
273
274
|
message0: "%1",
|
|
@@ -295,7 +296,7 @@ p.register(
|
|
|
295
296
|
"VAR"
|
|
296
297
|
)
|
|
297
298
|
);
|
|
298
|
-
|
|
299
|
+
C([
|
|
299
300
|
{
|
|
300
301
|
type: "for_v1",
|
|
301
302
|
message0: "%{BKY_LOOP_V1_FOR_TITLE}",
|
|
@@ -346,7 +347,7 @@ p.register(
|
|
|
346
347
|
"VAR"
|
|
347
348
|
)
|
|
348
349
|
);
|
|
349
|
-
|
|
350
|
+
C([
|
|
350
351
|
{
|
|
351
352
|
type: "for_each_v1",
|
|
352
353
|
message0: "%{BKY_LOOP_V1_FOR_EACH_TITLE}",
|
|
@@ -383,7 +384,7 @@ p.register(
|
|
|
383
384
|
UNTIL: "%{BKY_LOOP_V1_WHILE_UNTIL_TOOLTIP_UNTIL}"
|
|
384
385
|
})
|
|
385
386
|
);
|
|
386
|
-
|
|
387
|
+
C([
|
|
387
388
|
{
|
|
388
389
|
type: "while_until_v1",
|
|
389
390
|
message0: "%1 %2",
|
|
@@ -416,21 +417,21 @@ g([
|
|
|
416
417
|
extensions: ["while_until_tooltip_v1"]
|
|
417
418
|
}
|
|
418
419
|
]);
|
|
419
|
-
|
|
420
|
-
const n = await
|
|
420
|
+
j.setConfirm(async (t, e) => {
|
|
421
|
+
const n = await _e({
|
|
421
422
|
title: "",
|
|
422
423
|
text: t
|
|
423
424
|
});
|
|
424
425
|
e(!!n);
|
|
425
426
|
});
|
|
426
|
-
|
|
427
|
-
const o = await
|
|
427
|
+
j.setPrompt(async (t, e, n) => {
|
|
428
|
+
const o = await pe({
|
|
428
429
|
title: "",
|
|
429
430
|
value: e
|
|
430
431
|
});
|
|
431
432
|
n(o);
|
|
432
433
|
});
|
|
433
|
-
const
|
|
434
|
+
const Ae = (t, e, n) => {
|
|
434
435
|
const o = t[e];
|
|
435
436
|
return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((r, s) => {
|
|
436
437
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
@@ -443,21 +444,21 @@ const ie = (t, e, n) => {
|
|
|
443
444
|
);
|
|
444
445
|
});
|
|
445
446
|
};
|
|
446
|
-
async function
|
|
447
|
-
const e = await
|
|
448
|
-
|
|
447
|
+
async function z(t) {
|
|
448
|
+
const e = await Ae(/* @__PURE__ */ Object.assign({ "./msg/en/index.ts": () => import("./en-jrrs2wmb.js"), "./msg/zhHans/index.ts": () => import("./zhHans-jrrs2wmb.js") }), `./msg/${t}/index.ts`, 4);
|
|
449
|
+
he(e.default);
|
|
449
450
|
}
|
|
450
|
-
class
|
|
451
|
+
class Pe {
|
|
451
452
|
init({ contextMenu: e = !0, shortcut: n = !0 } = {
|
|
452
453
|
contextMenu: !0,
|
|
453
454
|
shortcut: !0
|
|
454
455
|
}) {
|
|
455
456
|
e && (this.blockCopyToStorageContextMenu(), this.blockPasteFromStorageContextMenu()), n && (u.registry.unregister(
|
|
456
|
-
|
|
457
|
+
w.names.COPY
|
|
457
458
|
), u.registry.unregister(
|
|
458
|
-
|
|
459
|
+
w.names.CUT
|
|
459
460
|
), u.registry.unregister(
|
|
460
|
-
|
|
461
|
+
w.names.PASTE
|
|
461
462
|
), this.blockCopyToStorageShortcut(), this.blockCutToStorageShortcut(), this.blockPasteFromStorageShortcut());
|
|
462
463
|
}
|
|
463
464
|
blockCopyToStorageContextMenu() {
|
|
@@ -466,8 +467,8 @@ class ce {
|
|
|
466
467
|
return f.CROSS_TAB_COPY ? f.CROSS_TAB_COPY : "Copy";
|
|
467
468
|
},
|
|
468
469
|
preconditionFn: function() {
|
|
469
|
-
const n =
|
|
470
|
-
return !n || !
|
|
470
|
+
const n = k();
|
|
471
|
+
return !n || !T(n) || !n.isDeletable() || !K(n) || !n.isMovable() || !v(n) ? "disabled" : "enabled";
|
|
471
472
|
},
|
|
472
473
|
callback: function(n) {
|
|
473
474
|
var o;
|
|
@@ -476,11 +477,11 @@ class ce {
|
|
|
476
477
|
JSON.stringify((o = n.block) == null ? void 0 : o.toCopyData())
|
|
477
478
|
);
|
|
478
479
|
},
|
|
479
|
-
scopeType:
|
|
480
|
+
scopeType: m.ScopeType.BLOCK,
|
|
480
481
|
id: "blockCopyToStorage",
|
|
481
482
|
weight: 0
|
|
482
483
|
};
|
|
483
|
-
|
|
484
|
+
m.registry.register(e);
|
|
484
485
|
}
|
|
485
486
|
blockPasteFromStorageContextMenu() {
|
|
486
487
|
const e = {
|
|
@@ -500,39 +501,39 @@ class ce {
|
|
|
500
501
|
if (!o)
|
|
501
502
|
return;
|
|
502
503
|
const r = JSON.parse(o);
|
|
503
|
-
r && n.workspace &&
|
|
504
|
+
r && n.workspace && W.paste(r, n.workspace);
|
|
504
505
|
},
|
|
505
|
-
scopeType:
|
|
506
|
+
scopeType: m.ScopeType.WORKSPACE,
|
|
506
507
|
id: "blockPasteFromStorage",
|
|
507
508
|
weight: 0
|
|
508
509
|
};
|
|
509
|
-
|
|
510
|
+
m.registry.register(e);
|
|
510
511
|
}
|
|
511
512
|
blockCopyToStorageShortcut() {
|
|
512
513
|
const e = u.registry.createSerializedKey(
|
|
513
|
-
|
|
514
|
-
[
|
|
514
|
+
i.KeyCodes.C,
|
|
515
|
+
[i.KeyCodes.CTRL]
|
|
515
516
|
), n = u.registry.createSerializedKey(
|
|
516
|
-
|
|
517
|
-
[
|
|
517
|
+
i.KeyCodes.C,
|
|
518
|
+
[i.KeyCodes.ALT]
|
|
518
519
|
), o = u.registry.createSerializedKey(
|
|
519
|
-
|
|
520
|
-
[
|
|
520
|
+
i.KeyCodes.C,
|
|
521
|
+
[i.KeyCodes.META]
|
|
521
522
|
), r = {
|
|
522
523
|
name: "copy",
|
|
523
524
|
preconditionFn: function(s) {
|
|
524
|
-
if (s.options.readOnly ||
|
|
525
|
+
if (s.options.readOnly || M.inProgress())
|
|
525
526
|
return !1;
|
|
526
|
-
const l =
|
|
527
|
-
return !(!l || !
|
|
527
|
+
const l = k();
|
|
528
|
+
return !(!l || !T(l) || !l.isDeletable() || !K(l) || !l.isMovable() || !v(l));
|
|
528
529
|
},
|
|
529
530
|
callback: function(s, l) {
|
|
530
531
|
l.preventDefault();
|
|
531
|
-
const a =
|
|
532
|
-
if (!a || !
|
|
532
|
+
const a = k();
|
|
533
|
+
if (!a || !v(a))
|
|
533
534
|
return !1;
|
|
534
|
-
const
|
|
535
|
-
return
|
|
535
|
+
const _ = a.toCopyData();
|
|
536
|
+
return _ ? (s.hideChaff(), localStorage.setItem("blocklyStash", JSON.stringify(_)), !0) : !1;
|
|
536
537
|
},
|
|
537
538
|
keyCodes: [e, n, o]
|
|
538
539
|
};
|
|
@@ -540,29 +541,29 @@ class ce {
|
|
|
540
541
|
}
|
|
541
542
|
blockCutToStorageShortcut() {
|
|
542
543
|
const e = u.registry.createSerializedKey(
|
|
543
|
-
|
|
544
|
-
[
|
|
544
|
+
i.KeyCodes.X,
|
|
545
|
+
[i.KeyCodes.CTRL]
|
|
545
546
|
), n = u.registry.createSerializedKey(
|
|
546
|
-
|
|
547
|
-
[
|
|
547
|
+
i.KeyCodes.X,
|
|
548
|
+
[i.KeyCodes.ALT]
|
|
548
549
|
), o = u.registry.createSerializedKey(
|
|
549
|
-
|
|
550
|
-
[
|
|
550
|
+
i.KeyCodes.X,
|
|
551
|
+
[i.KeyCodes.META]
|
|
551
552
|
), r = {
|
|
552
553
|
name: "cut",
|
|
553
554
|
preconditionFn: function(s) {
|
|
554
|
-
if (s.options.readOnly ||
|
|
555
|
+
if (s.options.readOnly || M.inProgress())
|
|
555
556
|
return !1;
|
|
556
|
-
const l =
|
|
557
|
-
return !(!l || !
|
|
557
|
+
const l = k();
|
|
558
|
+
return !(!l || !T(l) || !l.isDeletable() || !K(l) || !l.isMovable() || !v(l) || l.workspace.isFlyout);
|
|
558
559
|
},
|
|
559
560
|
callback: function(s, l) {
|
|
560
561
|
l.preventDefault();
|
|
561
|
-
const a =
|
|
562
|
-
if (!a || !
|
|
562
|
+
const a = k();
|
|
563
|
+
if (!a || !T(a) || !a.isDeletable() || !v(a))
|
|
563
564
|
return !1;
|
|
564
|
-
const
|
|
565
|
-
return
|
|
565
|
+
const _ = a.toCopyData();
|
|
566
|
+
return _ ? (localStorage.setItem("blocklyStash", JSON.stringify(_)), a instanceof be ? a.checkAndDelete() : a.dispose(), !0) : !1;
|
|
566
567
|
},
|
|
567
568
|
keyCodes: [e, n, o]
|
|
568
569
|
};
|
|
@@ -570,18 +571,18 @@ class ce {
|
|
|
570
571
|
}
|
|
571
572
|
blockPasteFromStorageShortcut() {
|
|
572
573
|
const e = u.registry.createSerializedKey(
|
|
573
|
-
|
|
574
|
-
[
|
|
574
|
+
i.KeyCodes.V,
|
|
575
|
+
[i.KeyCodes.CTRL]
|
|
575
576
|
), n = u.registry.createSerializedKey(
|
|
576
|
-
|
|
577
|
-
[
|
|
577
|
+
i.KeyCodes.V,
|
|
578
|
+
[i.KeyCodes.ALT]
|
|
578
579
|
), o = u.registry.createSerializedKey(
|
|
579
|
-
|
|
580
|
-
[
|
|
580
|
+
i.KeyCodes.V,
|
|
581
|
+
[i.KeyCodes.META]
|
|
581
582
|
), r = {
|
|
582
583
|
name: "paste",
|
|
583
584
|
preconditionFn: function(s) {
|
|
584
|
-
if (s.options.readOnly ||
|
|
585
|
+
if (s.options.readOnly || M.inProgress())
|
|
585
586
|
return !1;
|
|
586
587
|
const l = localStorage.getItem("blocklyStash");
|
|
587
588
|
if (!l)
|
|
@@ -594,17 +595,17 @@ class ce {
|
|
|
594
595
|
const a = localStorage.getItem("blocklyStash");
|
|
595
596
|
if (!a)
|
|
596
597
|
return !1;
|
|
597
|
-
const
|
|
598
|
-
return
|
|
598
|
+
const _ = JSON.parse(a);
|
|
599
|
+
return _ ? (W.paste(_, s), !0) : !1;
|
|
599
600
|
},
|
|
600
601
|
keyCodes: [e, n, o]
|
|
601
602
|
};
|
|
602
603
|
u.registry.register(r);
|
|
603
604
|
}
|
|
604
605
|
}
|
|
605
|
-
class
|
|
606
|
+
class Re {
|
|
606
607
|
init() {
|
|
607
|
-
const e =
|
|
608
|
+
const e = m.registry.getItem("cleanWorkspace");
|
|
608
609
|
e && (e.callback = function(n) {
|
|
609
610
|
const o = n.workspace;
|
|
610
611
|
if (!o)
|
|
@@ -615,33 +616,33 @@ class ue {
|
|
|
615
616
|
for (let l = 0, a; a = r[l]; l++) {
|
|
616
617
|
if (!a.isMovable())
|
|
617
618
|
continue;
|
|
618
|
-
const
|
|
619
|
-
a.moveBy(-
|
|
619
|
+
const _ = a.getRelativeToSurfaceXY();
|
|
620
|
+
a.moveBy(-_.x, s - _.y, ["cleanup"]), a.snapToGrid(), s = a.getRelativeToSurfaceXY().y + a.getHeightWidth().height + 100;
|
|
620
621
|
}
|
|
621
622
|
y.setGroup(!1), o.setResizesEnabled(!0);
|
|
622
623
|
});
|
|
623
624
|
}
|
|
624
625
|
}
|
|
625
|
-
function
|
|
626
|
+
function Z(t) {
|
|
626
627
|
const e = t.getParent();
|
|
627
|
-
return e &&
|
|
628
|
+
return e && Z(e) ? !0 : !e && !!(t.outputConnection || t.previousConnection);
|
|
628
629
|
}
|
|
629
|
-
class
|
|
630
|
+
class we {
|
|
630
631
|
init() {
|
|
631
|
-
const e =
|
|
632
|
+
const e = m.registry.getItem("blockDisable");
|
|
632
633
|
e && (e.preconditionFn = function(n) {
|
|
633
634
|
const o = n.block;
|
|
634
|
-
return o && !o.isInFlyout && o.workspace.options.disable && o.isEditable() ? o.getInheritedDisabled() ||
|
|
635
|
+
return o && !o.isInFlyout && o.workspace.options.disable && o.isEditable() ? o.getInheritedDisabled() || Z(o) ? "disabled" : "enabled" : "hidden";
|
|
635
636
|
});
|
|
636
637
|
}
|
|
637
638
|
}
|
|
638
|
-
const
|
|
639
|
-
|
|
640
|
-
const
|
|
641
|
-
|
|
642
|
-
const
|
|
643
|
-
|
|
644
|
-
|
|
639
|
+
const Ke = new Pe();
|
|
640
|
+
Ke.init({ contextMenu: !0, shortcut: !0 });
|
|
641
|
+
const Me = new Re();
|
|
642
|
+
Me.init();
|
|
643
|
+
const Ve = new we();
|
|
644
|
+
Ve.init();
|
|
645
|
+
x.Classic.blockStyles = {
|
|
645
646
|
color_blocks: {
|
|
646
647
|
colourPrimary: "#a5745b",
|
|
647
648
|
colourSecondary: "#ede3de",
|
|
@@ -715,7 +716,7 @@ C.Classic.blockStyles = {
|
|
|
715
716
|
hat: ""
|
|
716
717
|
}
|
|
717
718
|
};
|
|
718
|
-
|
|
719
|
+
x.Classic.categoryStyles = {
|
|
719
720
|
calc_category: {
|
|
720
721
|
colour: "#757575"
|
|
721
722
|
},
|
|
@@ -765,9 +766,9 @@ C.Classic.categoryStyles = {
|
|
|
765
766
|
colour: "#a55b80"
|
|
766
767
|
}
|
|
767
768
|
};
|
|
768
|
-
const
|
|
769
|
+
const Fe = J.defineTheme("light", {
|
|
769
770
|
name: "light",
|
|
770
|
-
base:
|
|
771
|
+
base: x.Classic,
|
|
771
772
|
componentStyles: {
|
|
772
773
|
workspaceBackgroundColour: "#ffffff",
|
|
773
774
|
toolboxBackgroundColour: "#eeeeee",
|
|
@@ -781,9 +782,9 @@ const de = P.defineTheme("light", {
|
|
|
781
782
|
scrollbarOpacity: 0.4,
|
|
782
783
|
cursorColour: ""
|
|
783
784
|
}
|
|
784
|
-
}),
|
|
785
|
+
}), Ne = J.defineTheme("dark", {
|
|
785
786
|
name: "dark",
|
|
786
|
-
base:
|
|
787
|
+
base: x.Classic,
|
|
787
788
|
componentStyles: {
|
|
788
789
|
workspaceBackgroundColour: "#1e1e1e",
|
|
789
790
|
toolboxBackgroundColour: "#272727",
|
|
@@ -798,18 +799,18 @@ const de = P.defineTheme("light", {
|
|
|
798
799
|
cursorColour: ""
|
|
799
800
|
}
|
|
800
801
|
});
|
|
801
|
-
function
|
|
802
|
-
const e =
|
|
802
|
+
function De(t) {
|
|
803
|
+
const e = $();
|
|
803
804
|
switch (console.log(e), t) {
|
|
804
805
|
case "light":
|
|
805
|
-
e.setTheme(
|
|
806
|
+
e.setTheme(Fe);
|
|
806
807
|
break;
|
|
807
808
|
case "dark":
|
|
808
|
-
e.setTheme(
|
|
809
|
+
e.setTheme(Ne);
|
|
809
810
|
break;
|
|
810
811
|
}
|
|
811
812
|
}
|
|
812
|
-
const
|
|
813
|
+
const Ue = {
|
|
813
814
|
kind: "category",
|
|
814
815
|
name: "%{BKY_CATEGORY_LOGIC}",
|
|
815
816
|
categorystyle: "logic_category",
|
|
@@ -827,7 +828,7 @@ const Oe = {
|
|
|
827
828
|
type: "if_v1"
|
|
828
829
|
}
|
|
829
830
|
]
|
|
830
|
-
},
|
|
831
|
+
}, He = {
|
|
831
832
|
kind: "category",
|
|
832
833
|
name: "%{BKY_CATEGORY_LOOP}",
|
|
833
834
|
categorystyle: "loop_category",
|
|
@@ -849,20 +850,95 @@ const Oe = {
|
|
|
849
850
|
type: "for_each_v1"
|
|
850
851
|
}
|
|
851
852
|
]
|
|
852
|
-
},
|
|
853
|
+
}, Ye = {
|
|
853
854
|
kind: "categoryToolbox",
|
|
854
|
-
contents: [
|
|
855
|
-
},
|
|
856
|
-
__name: "
|
|
855
|
+
contents: [Ue, He]
|
|
856
|
+
}, Ge = /* @__PURE__ */ B({
|
|
857
|
+
__name: "cleanup",
|
|
858
|
+
setup(t) {
|
|
859
|
+
const e = () => {
|
|
860
|
+
const n = $();
|
|
861
|
+
if (!n)
|
|
862
|
+
return;
|
|
863
|
+
const o = m.registry.getItem("cleanWorkspace");
|
|
864
|
+
o && o.callback({ workspace: n }, new PointerEvent("dummy"));
|
|
865
|
+
};
|
|
866
|
+
return (n, o) => {
|
|
867
|
+
const r = b("v-btn");
|
|
868
|
+
return O(), F(r, {
|
|
869
|
+
onClick: e,
|
|
870
|
+
class: "mr-3",
|
|
871
|
+
variant: "outlined",
|
|
872
|
+
density: "comfortable",
|
|
873
|
+
icon: S(ke)
|
|
874
|
+
}, null, 8, ["icon"]);
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
}), We = /* @__PURE__ */ B({
|
|
878
|
+
__name: "lock",
|
|
857
879
|
props: {
|
|
858
|
-
type:
|
|
859
|
-
|
|
880
|
+
modelValue: { type: Boolean, required: !0 },
|
|
881
|
+
modelModifiers: {}
|
|
860
882
|
},
|
|
861
|
-
emits: ["
|
|
883
|
+
emits: ["update:modelValue"],
|
|
884
|
+
setup(t) {
|
|
885
|
+
const e = X(t, "modelValue");
|
|
886
|
+
return (n, o) => {
|
|
887
|
+
const r = b("v-btn");
|
|
888
|
+
return O(), F(r, {
|
|
889
|
+
onClick: o[0] || (o[0] = (s) => e.value = !e.value),
|
|
890
|
+
class: "mr-3",
|
|
891
|
+
variant: "outlined",
|
|
892
|
+
density: "comfortable",
|
|
893
|
+
icon: e.value ? S(Se) : S(Le)
|
|
894
|
+
}, null, 8, ["icon"]);
|
|
895
|
+
};
|
|
896
|
+
}
|
|
897
|
+
}), ze = /* @__PURE__ */ B({
|
|
898
|
+
__name: "navigator",
|
|
899
|
+
setup(t) {
|
|
900
|
+
const e = I(() => ({
|
|
901
|
+
maxHeight: "calc(100vh - 200px)"
|
|
902
|
+
}));
|
|
903
|
+
return (n, o) => {
|
|
904
|
+
const r = b("v-btn"), s = b("v-list"), l = b("v-menu");
|
|
905
|
+
return O(), F(l, {
|
|
906
|
+
"close-on-content-click": !1,
|
|
907
|
+
transition: "slide-y-transition",
|
|
908
|
+
"offset-y": ""
|
|
909
|
+
}, {
|
|
910
|
+
activator: U(({ props: a }) => [
|
|
911
|
+
h(r, se(a, {
|
|
912
|
+
variant: "outlined",
|
|
913
|
+
density: "comfortable",
|
|
914
|
+
icon: S(Te)
|
|
915
|
+
}), null, 16, ["icon"])
|
|
916
|
+
]),
|
|
917
|
+
default: U(() => [
|
|
918
|
+
V("div", {
|
|
919
|
+
class: "overflow-auto",
|
|
920
|
+
style: E(e.value)
|
|
921
|
+
}, [
|
|
922
|
+
h(s)
|
|
923
|
+
], 4)
|
|
924
|
+
]),
|
|
925
|
+
_: 1
|
|
926
|
+
});
|
|
927
|
+
};
|
|
928
|
+
}
|
|
929
|
+
}), Xe = { class: "position-relative w-100 h-100" }, je = /* @__PURE__ */ B({
|
|
930
|
+
__name: "index",
|
|
931
|
+
props: /* @__PURE__ */ H({
|
|
932
|
+
type: {},
|
|
933
|
+
version: {},
|
|
934
|
+
active: { type: Boolean }
|
|
935
|
+
}, {
|
|
936
|
+
lock: { type: Boolean, required: !0 },
|
|
937
|
+
lockModifiers: {}
|
|
938
|
+
}),
|
|
939
|
+
emits: /* @__PURE__ */ H(["ready", "change"], ["update:lock"]),
|
|
862
940
|
setup(t, { emit: e }) {
|
|
863
|
-
const n =
|
|
864
|
-
let i;
|
|
865
|
-
const I = {
|
|
941
|
+
const n = fe(), { locale: o, dark: r } = ue(n), { open: s } = de("blocklyEditorFlyout"), l = t, a = X(t, "lock"), _ = e, A = Y(), N = {
|
|
866
942
|
grid: {
|
|
867
943
|
length: 2,
|
|
868
944
|
snap: !0,
|
|
@@ -875,7 +951,7 @@ const Oe = {
|
|
|
875
951
|
wheel: !0
|
|
876
952
|
},
|
|
877
953
|
readOnly: !1,
|
|
878
|
-
theme:
|
|
954
|
+
theme: r.value ? "dark" : "light",
|
|
879
955
|
trashcan: !1,
|
|
880
956
|
zoom: {
|
|
881
957
|
maxScale: 1,
|
|
@@ -885,51 +961,99 @@ const Oe = {
|
|
|
885
961
|
wheel: !0
|
|
886
962
|
}
|
|
887
963
|
};
|
|
888
|
-
|
|
889
|
-
|
|
964
|
+
let g;
|
|
965
|
+
const P = Y(!1), q = I(() => ({
|
|
966
|
+
position: "absolute",
|
|
967
|
+
background: r.value ? "#0000007f" : "#ffffff7f",
|
|
968
|
+
top: "1px",
|
|
969
|
+
left: "0px",
|
|
970
|
+
width: "56px",
|
|
971
|
+
height: "100%",
|
|
972
|
+
pointerEvents: "none",
|
|
973
|
+
zIndex: 999
|
|
974
|
+
})), Q = I(() => ({
|
|
975
|
+
position: "absolute",
|
|
976
|
+
background: r.value ? "#0000007f" : "#ffffff7f",
|
|
977
|
+
top: "0px",
|
|
978
|
+
left: "0px",
|
|
979
|
+
width: "100%",
|
|
980
|
+
height: "100%",
|
|
981
|
+
pointerEvents: "none"
|
|
982
|
+
})), ee = I(() => ({
|
|
983
|
+
position: "absolute",
|
|
984
|
+
top: "0px",
|
|
985
|
+
right: "0px",
|
|
986
|
+
zIndex: 20
|
|
987
|
+
}));
|
|
988
|
+
le(async () => {
|
|
989
|
+
if (!A.value)
|
|
890
990
|
return;
|
|
891
|
-
await
|
|
892
|
-
let
|
|
893
|
-
|
|
991
|
+
await z(o.value);
|
|
992
|
+
let c;
|
|
993
|
+
l.type === "app" && l.version === "v1" && (c = Ye), N.toolbox = c, g = Oe(A.value, N), g.addChangeListener(y.disableOrphans), g.addChangeListener(te), _("ready", g);
|
|
994
|
+
}), ae(() => {
|
|
995
|
+
s.value = !1;
|
|
894
996
|
});
|
|
895
|
-
function
|
|
896
|
-
|
|
997
|
+
function D() {
|
|
998
|
+
g && Ce(g);
|
|
897
999
|
}
|
|
898
|
-
function
|
|
899
|
-
|
|
1000
|
+
function te(c) {
|
|
1001
|
+
c.type === y.BLOCK_DRAG && (c.isStart ? P.value = !0 : P.value = !1), _("change", c);
|
|
900
1002
|
}
|
|
901
|
-
return
|
|
902
|
-
|
|
903
|
-
}),
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
()
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
() => o.current.value.dark,
|
|
913
|
-
(_) => {
|
|
914
|
-
he(_ ? "dark" : "light");
|
|
1003
|
+
return L(o, (c) => {
|
|
1004
|
+
z(c);
|
|
1005
|
+
}), L(r, (c) => {
|
|
1006
|
+
De(c ? "dark" : "light");
|
|
1007
|
+
}), L(s, (c) => {
|
|
1008
|
+
var d;
|
|
1009
|
+
c || (d = g.getToolbox()) == null || d.clearSelection();
|
|
1010
|
+
}), L(
|
|
1011
|
+
() => l.active,
|
|
1012
|
+
(c) => {
|
|
1013
|
+
c && setTimeout(() => D(), 0);
|
|
915
1014
|
}
|
|
916
|
-
), (
|
|
917
|
-
const
|
|
918
|
-
return
|
|
919
|
-
|
|
1015
|
+
), (c, d) => {
|
|
1016
|
+
const oe = b("v-icon"), ne = ie("resize");
|
|
1017
|
+
return O(), R("div", Xe, [
|
|
1018
|
+
ce(V("div", {
|
|
920
1019
|
class: "w-100 h-100",
|
|
921
1020
|
ref_key: "blocklyDiv",
|
|
922
|
-
ref:
|
|
1021
|
+
ref: A,
|
|
923
1022
|
id: "blocklyEditor"
|
|
924
1023
|
}, null, 512), [
|
|
925
|
-
[
|
|
926
|
-
])
|
|
1024
|
+
[ne, D]
|
|
1025
|
+
]),
|
|
1026
|
+
P.value ? (O(), R("div", {
|
|
1027
|
+
key: 0,
|
|
1028
|
+
class: "d-flex flex-column align-center justify-center",
|
|
1029
|
+
style: E(q.value)
|
|
1030
|
+
}, [
|
|
1031
|
+
h(oe, {
|
|
1032
|
+
icon: S(ve),
|
|
1033
|
+
size: "x-large"
|
|
1034
|
+
}, null, 8, ["icon"])
|
|
1035
|
+
], 4)) : G("", !0),
|
|
1036
|
+
a.value ? (O(), R("div", {
|
|
1037
|
+
key: 1,
|
|
1038
|
+
style: E(Q.value)
|
|
1039
|
+
}, null, 4)) : G("", !0),
|
|
1040
|
+
V("div", {
|
|
1041
|
+
class: "d-flex align-end pt-3 pr-3",
|
|
1042
|
+
style: E(ee.value)
|
|
1043
|
+
}, [
|
|
1044
|
+
h(Ge),
|
|
1045
|
+
h(We, {
|
|
1046
|
+
modelValue: a.value,
|
|
1047
|
+
"onUpdate:modelValue": d[0] || (d[0] = (re) => a.value = re)
|
|
1048
|
+
}, null, 8, ["modelValue"]),
|
|
1049
|
+
h(ze)
|
|
1050
|
+
], 4)
|
|
927
1051
|
]);
|
|
928
1052
|
};
|
|
929
1053
|
}
|
|
930
|
-
}),
|
|
931
|
-
t.component("x-blockly",
|
|
932
|
-
},
|
|
1054
|
+
}), Je = (t) => {
|
|
1055
|
+
t.component("x-blockly", je);
|
|
1056
|
+
}, et = { install: Je };
|
|
933
1057
|
export {
|
|
934
|
-
|
|
1058
|
+
et as default
|
|
935
1059
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const _ = {
|
|
2
|
+
LOGIC_BOOLEAN_FALSE: "假",
|
|
3
|
+
LOGIC_BOOLEAN_TRUE: "真",
|
|
4
|
+
LOGIC_DO: "执行",
|
|
5
|
+
LOGIC_ELSE: "否则",
|
|
6
|
+
LOGIC_ELSE_IF: "否则如果",
|
|
7
|
+
LOGIC_IF: "如果"
|
|
8
|
+
}, L = {
|
|
9
|
+
LOGIC_V1_BOOLEAN_TOOPTIP: "LOGIC_V1_BOOLEAN_TOOPTIP",
|
|
10
|
+
LOGIC_V1_BOOLEAN_HELPURL: "LOGIC_V1_BOOLEAN_HELPURL",
|
|
11
|
+
LOGIC_V1_IF_TOOLTIP: "LOGIC_V1_IF_TOOLTIP",
|
|
12
|
+
LOGIC_V1_IF_HELPURL: "LOGIC_V1_IF_HELPURL"
|
|
13
|
+
}, O = {
|
|
14
|
+
..._,
|
|
15
|
+
...L
|
|
16
|
+
}, I = {
|
|
17
|
+
LOOP_DO: "执行"
|
|
18
|
+
}, E = {
|
|
19
|
+
LOOP_V1_FOR_TITLE: "变量%1从%2数到%3每次增加%4",
|
|
20
|
+
LOOP_V1_FOR_EACH_TITLE: "遍历列表%2中的每一项%1",
|
|
21
|
+
LOOP_V1_WHILE_UNTIL_OPERATOR_WHILE: "当条件满足时重复",
|
|
22
|
+
LOOP_V1_WHILE_UNTIL_OPERATOR_UNTIL: "重复直到条件满足",
|
|
23
|
+
LOOP_V1_WHILE_UNTIL_TOOLTIP_WHILE: "LOOP_V1_WHILE_UNTIL_TOOLTIP_WHILE",
|
|
24
|
+
LOOP_V1_WHILE_UNTIL_TOOLTIP_UNTIL: "LOOP_V1_WHILE_UNTIL_TOOLTIP_UNTIL",
|
|
25
|
+
LOOP_V1_WHILE_UNTIL_HELPURL: "LOOP_V1_WHILE_UNTIL_HELPURL"
|
|
26
|
+
}, T = {
|
|
27
|
+
...I,
|
|
28
|
+
...E
|
|
29
|
+
}, P = {
|
|
30
|
+
...O,
|
|
31
|
+
...T
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
P as default
|
|
35
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-block-lib",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.22",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -22,10 +22,11 @@
|
|
|
22
22
|
"*": "prettier --write ."
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
+
"axios": "^1.7.2",
|
|
25
26
|
"blockly": "^11.1.1",
|
|
26
27
|
"vue": "^3.4.31",
|
|
27
28
|
"vuetify": "^3.6.12",
|
|
28
|
-
"x-essential-lib": "^0.6.
|
|
29
|
+
"x-essential-lib": "^0.6.2"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@rushstack/eslint-patch": "^1.10.3",
|
|
@@ -48,5 +49,8 @@
|
|
|
48
49
|
"vue-i18n": "^9.13.1",
|
|
49
50
|
"vue-router": "4.4.0",
|
|
50
51
|
"vue-tsc": "^2.0.26"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@mdi/js": "^7.4.47"
|
|
51
55
|
}
|
|
52
56
|
}
|
package/dist/en-c75t6n0y.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const _ = {
|
|
2
|
-
LOGIC_BOOLEAN_FALSE: "false",
|
|
3
|
-
LOGIC_BOOLEAN_TRUE: "true",
|
|
4
|
-
LOGIC_DO: "do",
|
|
5
|
-
LOGIC_ELSE: "else",
|
|
6
|
-
LOGIC_ELSE_IF: "else if",
|
|
7
|
-
LOGIC_IF: "if",
|
|
8
|
-
LOGIC_V1_BOOLEAN_TOOPTIP: "LOGIC_V1_BOOLEAN_TOOPTIP",
|
|
9
|
-
LOGIC_V1_BOOLEAN_HELPURL: "LOGIC_V1_BOOLEAN_HELPURL",
|
|
10
|
-
LOGIC_V1_IF_TOOLTIP: "LOGIC_V1_IF_TOOLTIP",
|
|
11
|
-
LOGIC_V1_IF_HELPURL: "LOGIC_V1_IF_HELPURL"
|
|
12
|
-
}, L = {
|
|
13
|
-
LOOP_DO: "do",
|
|
14
|
-
LOOP_V1_FOR_TITLE: "count with %1 from %2 to %3 by %4",
|
|
15
|
-
LOOP_V1_FOR_EACH_TITLE: "for each item %1 in list %2",
|
|
16
|
-
LOOP_V1_WHILE_UNTIL_OPERATOR_WHILE: "repeat while",
|
|
17
|
-
LOOP_V1_WHILE_UNTIL_OPERATOR_UNTIL: "repeat until",
|
|
18
|
-
LOOP_V1_WHILE_UNTIL_TOOLTIP_WHILE: "LOOP_V1_WHILE_UNTIL_TOOLTIP_WHILE",
|
|
19
|
-
LOOP_V1_WHILE_UNTIL_TOOLTIP_UNTIL: "LOOP_V1_WHILE_UNTIL_TOOLTIP_UNTIL",
|
|
20
|
-
LOOP_V1_WHILE_UNTIL_HELPURL: "LOOP_V1_WHILE_UNTIL_HELPURL"
|
|
21
|
-
}, O = {
|
|
22
|
-
..._,
|
|
23
|
-
...L
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
O as default
|
|
27
|
-
};
|