x-block-lib 0.1.5 → 0.2.0
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/index.vue.d.ts +15 -2
- package/dist/{blockly → core}/index.d.ts +2 -1
- package/dist/core/locale/index.d.ts +1 -0
- package/dist/core/plugins/crossTabCopyPaste/index.d.ts +11 -0
- package/dist/core/plugins/index.d.ts +1 -0
- package/dist/core/toolbox/app/v1/index.d.ts +3 -0
- package/dist/core/toolbox/index.d.ts +2 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +309 -383
- package/package.json +2 -4
- package/dist/blockly/locale/index.d.ts +0 -1
- package/dist/blockly-ByC0ID0H.js +0 -15828
- /package/dist/{blockly → core}/blocks/downloadAsset/v1/index.d.ts +0 -0
- /package/dist/{blockly → core}/dialog/index.d.ts +0 -0
- /package/dist/{blockly → core}/locale/msg/en.d.ts +0 -0
- /package/dist/{blockly → core}/locale/msg/zhHans.d.ts +0 -0
- /package/dist/{blockly → core}/theme/index.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1,173 +1,250 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { openConfirmDlg as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
DragTarget: Se,
|
|
28
|
-
DropDownDiv: ve,
|
|
29
|
-
Events: L,
|
|
30
|
-
Extensions: Me,
|
|
31
|
-
Field: Oe,
|
|
32
|
-
FieldCheckbox: Ae,
|
|
33
|
-
FieldDropdown: Pe,
|
|
34
|
-
FieldImage: we,
|
|
35
|
-
FieldLabel: Be,
|
|
36
|
-
FieldLabelSerializable: Re,
|
|
37
|
-
FieldNumber: Le,
|
|
38
|
-
FieldTextInput: Ie,
|
|
39
|
-
FieldVariable: xe,
|
|
40
|
-
Flyout: De,
|
|
41
|
-
FlyoutButton: Fe,
|
|
42
|
-
FlyoutMetricsManager: Ve,
|
|
43
|
-
Generator: ze,
|
|
44
|
-
Gesture: Ne,
|
|
45
|
-
Grid: Ue,
|
|
46
|
-
HorizontalFlyout: je,
|
|
47
|
-
INPUT_VALUE: $e,
|
|
48
|
-
Input: Ge,
|
|
49
|
-
InsertionMarkerManager: We,
|
|
50
|
-
InsertionMarkerPreviewer: Xe,
|
|
51
|
-
Marker: He,
|
|
52
|
-
MarkerManager: Ye,
|
|
53
|
-
Menu: qe,
|
|
54
|
-
MenuItem: Je,
|
|
55
|
-
MetricsManager: Ze,
|
|
56
|
-
Msg: Ke,
|
|
57
|
-
NEXT_STATEMENT: Qe,
|
|
58
|
-
Names: eo,
|
|
59
|
-
OPPOSITE_TYPE: oo,
|
|
60
|
-
OUTPUT_VALUE: ro,
|
|
61
|
-
Options: to,
|
|
62
|
-
PREVIOUS_STATEMENT: ao,
|
|
63
|
-
PROCEDURE_CATEGORY_NAME: co,
|
|
64
|
-
Procedures: no,
|
|
65
|
-
RENAME_VARIABLE_ID: lo,
|
|
66
|
-
RenderedConnection: io,
|
|
67
|
-
Scrollbar: so,
|
|
68
|
-
ScrollbarPair: uo,
|
|
69
|
-
ShortcutItems: yo,
|
|
70
|
-
ShortcutRegistry: mo,
|
|
71
|
-
TOOLBOX_AT_BOTTOM: bo,
|
|
72
|
-
TOOLBOX_AT_LEFT: go,
|
|
73
|
-
TOOLBOX_AT_RIGHT: _o,
|
|
74
|
-
TOOLBOX_AT_TOP: fo,
|
|
75
|
-
TabNavigateCursor: po,
|
|
76
|
-
Theme: b,
|
|
77
|
-
ThemeManager: ho,
|
|
78
|
-
Themes: i,
|
|
79
|
-
Toolbox: ko,
|
|
80
|
-
ToolboxCategory: To,
|
|
81
|
-
ToolboxItem: Co,
|
|
82
|
-
ToolboxSeparator: Eo,
|
|
83
|
-
Tooltip: So,
|
|
84
|
-
Touch: vo,
|
|
85
|
-
Trashcan: Mo,
|
|
86
|
-
UnattachedFieldError: Oo,
|
|
87
|
-
VARIABLE_CATEGORY_NAME: Ao,
|
|
88
|
-
VARIABLE_DYNAMIC_CATEGORY_NAME: Po,
|
|
89
|
-
VERSION: wo,
|
|
90
|
-
VariableMap: Bo,
|
|
91
|
-
VariableModel: Ro,
|
|
92
|
-
Variables: Lo,
|
|
93
|
-
VariablesDynamic: Io,
|
|
94
|
-
VerticalFlyout: xo,
|
|
95
|
-
WidgetDiv: Do,
|
|
96
|
-
Workspace: Fo,
|
|
97
|
-
WorkspaceAudio: Vo,
|
|
98
|
-
WorkspaceDragger: zo,
|
|
99
|
-
WorkspaceSvg: No,
|
|
100
|
-
Xml: Uo,
|
|
101
|
-
ZoomControls: jo,
|
|
102
|
-
blockAnimations: $o,
|
|
103
|
-
blockRendering: Go,
|
|
104
|
-
browserEvents: Wo,
|
|
105
|
-
bubbles: Xo,
|
|
106
|
-
bumpObjects: Ho,
|
|
107
|
-
clipboard: Yo,
|
|
108
|
-
comments: qo,
|
|
109
|
-
common: Jo,
|
|
110
|
-
config: Zo,
|
|
111
|
-
constants: Ko,
|
|
112
|
-
defineBlocksWithJsonArray: Qo,
|
|
113
|
-
dialog: g,
|
|
114
|
-
dragging: er,
|
|
115
|
-
fieldRegistry: or,
|
|
116
|
-
geras: rr,
|
|
117
|
-
getMainWorkspace: I,
|
|
118
|
-
getSelected: tr,
|
|
119
|
-
hasBubble: ar,
|
|
120
|
-
hideChaff: cr,
|
|
121
|
-
icons: nr,
|
|
122
|
-
inject: x,
|
|
123
|
-
inputs: lr,
|
|
124
|
-
isCopyable: ir,
|
|
125
|
-
isDeletable: sr,
|
|
126
|
-
isDraggable: ur,
|
|
127
|
-
isIcon: dr,
|
|
128
|
-
isObservable: yr,
|
|
129
|
-
isPaster: mr,
|
|
130
|
-
isRenderedElement: br,
|
|
131
|
-
isSelectable: gr,
|
|
132
|
-
isSerializable: _r,
|
|
133
|
-
isVariableBackedParameterModel: fr,
|
|
134
|
-
procedures: pr,
|
|
135
|
-
registry: hr,
|
|
136
|
-
renderManagement: kr,
|
|
137
|
-
serialization: Tr,
|
|
138
|
-
setLocale: D,
|
|
139
|
-
setParentContainer: Cr,
|
|
140
|
-
svgResize: F,
|
|
141
|
-
thrasos: Er,
|
|
142
|
-
uiPosition: Sr,
|
|
143
|
-
utils: vr,
|
|
144
|
-
zelos: Mr
|
|
145
|
-
} = h;
|
|
146
|
-
g.setConfirm(async (e, o) => {
|
|
147
|
-
const r = await k({
|
|
1
|
+
import { getCurrentInstance as b, inject as m, defineComponent as h, ref as C, onMounted as k, nextTick as T, onBeforeUnmount as _, watch as d, openBlock as v, createElementBlock as R, withDirectives as K, createElementVNode as M } from "vue";
|
|
2
|
+
import { openConfirmDlg as P, openPromptDlg as w, useViewStack as x } from "x-essential-lib";
|
|
3
|
+
import * as e from "blockly/core";
|
|
4
|
+
function B(r, t) {
|
|
5
|
+
const o = b();
|
|
6
|
+
if (!o)
|
|
7
|
+
throw new Error(`[Vuetify] ${r} must be called from inside a setup function`);
|
|
8
|
+
return o;
|
|
9
|
+
}
|
|
10
|
+
const O = Symbol.for("vuetify:locale");
|
|
11
|
+
function z() {
|
|
12
|
+
const r = m(O);
|
|
13
|
+
if (!r)
|
|
14
|
+
throw new Error("[Vuetify] Could not find injected locale instance");
|
|
15
|
+
return r;
|
|
16
|
+
}
|
|
17
|
+
const E = Symbol.for("vuetify:theme");
|
|
18
|
+
function I() {
|
|
19
|
+
B("useTheme");
|
|
20
|
+
const r = m(E, null);
|
|
21
|
+
if (!r)
|
|
22
|
+
throw new Error("Could not find Vuetify theme injection");
|
|
23
|
+
return r;
|
|
24
|
+
}
|
|
25
|
+
e.dialog.setConfirm(async (r, t) => {
|
|
26
|
+
const o = await P({
|
|
148
27
|
title: "",
|
|
149
|
-
text:
|
|
28
|
+
text: r
|
|
150
29
|
});
|
|
151
|
-
|
|
30
|
+
t(!!o);
|
|
152
31
|
});
|
|
153
|
-
|
|
154
|
-
const
|
|
32
|
+
e.dialog.setPrompt(async (r, t, o) => {
|
|
33
|
+
const a = await w({
|
|
155
34
|
title: "",
|
|
156
|
-
value:
|
|
35
|
+
value: t
|
|
157
36
|
});
|
|
158
|
-
|
|
37
|
+
o(a);
|
|
159
38
|
});
|
|
160
|
-
const
|
|
161
|
-
const
|
|
162
|
-
return
|
|
163
|
-
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
|
|
39
|
+
const D = (r, t) => {
|
|
40
|
+
const o = r[t];
|
|
41
|
+
return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((a, c) => {
|
|
42
|
+
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(c.bind(null, new Error("Unknown variable dynamic import: " + t)));
|
|
164
43
|
});
|
|
165
44
|
};
|
|
166
|
-
async function
|
|
167
|
-
const
|
|
168
|
-
|
|
45
|
+
async function f(r) {
|
|
46
|
+
const t = await D(/* @__PURE__ */ Object.assign({ "./msg/en.ts": () => import("./en-DYxpcVy9.js"), "./msg/zhHans.ts": () => import("./zhHans-DjWw6Iqb.js") }), `./msg/${r}.ts`);
|
|
47
|
+
e.setLocale(t);
|
|
48
|
+
}
|
|
49
|
+
class F {
|
|
50
|
+
init({ contextMenu: t = !0, shortcut: o = !0 } = {
|
|
51
|
+
contextMenu: !0,
|
|
52
|
+
shortcut: !0
|
|
53
|
+
}) {
|
|
54
|
+
t && (this.blockCopyToStorageContextMenu(), this.blockPasteFromStorageContextMenu()), o && (e.ShortcutRegistry.registry.unregister(
|
|
55
|
+
e.ShortcutItems.names.COPY
|
|
56
|
+
), e.ShortcutRegistry.registry.unregister(
|
|
57
|
+
e.ShortcutItems.names.CUT
|
|
58
|
+
), e.ShortcutRegistry.registry.unregister(
|
|
59
|
+
e.ShortcutItems.names.PASTE
|
|
60
|
+
), this.blockCopyToStorageShortcut(), this.blockCutToStorageShortcut(), this.blockPasteFromStorageShortcut());
|
|
61
|
+
}
|
|
62
|
+
blockCopyToStorageContextMenu() {
|
|
63
|
+
const t = {
|
|
64
|
+
displayText: function() {
|
|
65
|
+
return e.Msg.CROSS_TAB_COPY ? e.Msg.CROSS_TAB_COPY : "Copy";
|
|
66
|
+
},
|
|
67
|
+
preconditionFn: function(o) {
|
|
68
|
+
var s;
|
|
69
|
+
const a = e.getSelected();
|
|
70
|
+
if (!a)
|
|
71
|
+
return "disabled";
|
|
72
|
+
const c = (s = o.workspace) == null ? void 0 : s.getBlockById(
|
|
73
|
+
a.id
|
|
74
|
+
);
|
|
75
|
+
return !c || !c.isDeletable() || !c.isMovable() ? "disabled" : "enabled";
|
|
76
|
+
},
|
|
77
|
+
callback: function(o) {
|
|
78
|
+
var a;
|
|
79
|
+
localStorage.setItem(
|
|
80
|
+
"blocklyStash",
|
|
81
|
+
JSON.stringify((a = o.block) == null ? void 0 : a.toCopyData())
|
|
82
|
+
);
|
|
83
|
+
},
|
|
84
|
+
scopeType: e.ContextMenuRegistry.ScopeType.BLOCK,
|
|
85
|
+
id: "blockCopyToStorage",
|
|
86
|
+
weight: 0
|
|
87
|
+
};
|
|
88
|
+
e.ContextMenuRegistry.registry.register(t);
|
|
89
|
+
}
|
|
90
|
+
blockPasteFromStorageContextMenu() {
|
|
91
|
+
const t = {
|
|
92
|
+
displayText: function() {
|
|
93
|
+
return e.Msg.CROSS_TAB_PASTE ? e.Msg.CROSS_TAB_PASTE : "Paste";
|
|
94
|
+
},
|
|
95
|
+
preconditionFn: function(o) {
|
|
96
|
+
var s;
|
|
97
|
+
const a = localStorage.getItem("blocklyStash");
|
|
98
|
+
if (!a)
|
|
99
|
+
return "disabled";
|
|
100
|
+
const c = JSON.parse(a);
|
|
101
|
+
return !c || !((s = o.workspace) != null && s.isCapacityAvailable(c.typeCounts)) ? "disabled" : "enabled";
|
|
102
|
+
},
|
|
103
|
+
callback: function(o) {
|
|
104
|
+
const a = localStorage.getItem("blocklyStash");
|
|
105
|
+
if (!a)
|
|
106
|
+
return;
|
|
107
|
+
const c = JSON.parse(a);
|
|
108
|
+
c && o.workspace && e.clipboard.paste(c, o.workspace);
|
|
109
|
+
},
|
|
110
|
+
scopeType: e.ContextMenuRegistry.ScopeType.WORKSPACE,
|
|
111
|
+
id: "blockPasteFromStorage",
|
|
112
|
+
weight: 0
|
|
113
|
+
};
|
|
114
|
+
e.ContextMenuRegistry.registry.register(t);
|
|
115
|
+
}
|
|
116
|
+
blockCopyToStorageShortcut() {
|
|
117
|
+
const t = {
|
|
118
|
+
name: "copy",
|
|
119
|
+
preconditionFn: function(s) {
|
|
120
|
+
if (s.options.readOnly || e.Gesture.inProgress())
|
|
121
|
+
return !1;
|
|
122
|
+
const n = e.getSelected();
|
|
123
|
+
if (!n)
|
|
124
|
+
return !1;
|
|
125
|
+
const i = s.getBlockById(
|
|
126
|
+
n.id
|
|
127
|
+
);
|
|
128
|
+
return !(!i || !i.isDeletable() || !i.isMovable() || i.isInMutator);
|
|
129
|
+
},
|
|
130
|
+
callback: function(s, n) {
|
|
131
|
+
n.preventDefault();
|
|
132
|
+
const i = e.getSelected();
|
|
133
|
+
if (!i)
|
|
134
|
+
return !1;
|
|
135
|
+
const l = s.getBlockById(
|
|
136
|
+
i.id
|
|
137
|
+
);
|
|
138
|
+
return l ? (s.hideChaff(), localStorage.setItem(
|
|
139
|
+
"blocklyStash",
|
|
140
|
+
JSON.stringify(l.toCopyData())
|
|
141
|
+
), !0) : !1;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
e.ShortcutRegistry.registry.register(t);
|
|
145
|
+
const o = e.ShortcutRegistry.registry.createSerializedKey(
|
|
146
|
+
e.utils.KeyCodes.C,
|
|
147
|
+
[e.utils.KeyCodes.CTRL]
|
|
148
|
+
);
|
|
149
|
+
e.ShortcutRegistry.registry.addKeyMapping(o, t.name);
|
|
150
|
+
const a = e.ShortcutRegistry.registry.createSerializedKey(
|
|
151
|
+
e.utils.KeyCodes.C,
|
|
152
|
+
[e.utils.KeyCodes.ALT]
|
|
153
|
+
);
|
|
154
|
+
e.ShortcutRegistry.registry.addKeyMapping(a, t.name);
|
|
155
|
+
const c = e.ShortcutRegistry.registry.createSerializedKey(
|
|
156
|
+
e.utils.KeyCodes.C,
|
|
157
|
+
[e.utils.KeyCodes.META]
|
|
158
|
+
);
|
|
159
|
+
e.ShortcutRegistry.registry.addKeyMapping(c, t.name);
|
|
160
|
+
}
|
|
161
|
+
blockCutToStorageShortcut() {
|
|
162
|
+
const t = {
|
|
163
|
+
name: "cut",
|
|
164
|
+
preconditionFn: function(s) {
|
|
165
|
+
if (s.options.readOnly || e.Gesture.inProgress())
|
|
166
|
+
return !1;
|
|
167
|
+
const n = e.getSelected();
|
|
168
|
+
if (!n)
|
|
169
|
+
return !1;
|
|
170
|
+
const i = s.getBlockById(
|
|
171
|
+
n.id
|
|
172
|
+
);
|
|
173
|
+
return !(!i || !i.isDeletable() || !i.isMovable() || s.isFlyout);
|
|
174
|
+
},
|
|
175
|
+
callback: function(s, n) {
|
|
176
|
+
n.preventDefault();
|
|
177
|
+
const i = e.getSelected();
|
|
178
|
+
if (!i)
|
|
179
|
+
return !1;
|
|
180
|
+
const l = s.getBlockById(
|
|
181
|
+
i.id
|
|
182
|
+
);
|
|
183
|
+
return l ? (localStorage.setItem(
|
|
184
|
+
"blocklyStash",
|
|
185
|
+
JSON.stringify(l.toCopyData())
|
|
186
|
+
), e.Events.setGroup(!0), l.dispose(!0), e.Events.setGroup(!1), !0) : !1;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
e.ShortcutRegistry.registry.register(t);
|
|
190
|
+
const o = e.ShortcutRegistry.registry.createSerializedKey(
|
|
191
|
+
e.utils.KeyCodes.X,
|
|
192
|
+
[e.utils.KeyCodes.CTRL]
|
|
193
|
+
);
|
|
194
|
+
e.ShortcutRegistry.registry.addKeyMapping(o, t.name);
|
|
195
|
+
const a = e.ShortcutRegistry.registry.createSerializedKey(
|
|
196
|
+
e.utils.KeyCodes.X,
|
|
197
|
+
[e.utils.KeyCodes.ALT]
|
|
198
|
+
);
|
|
199
|
+
e.ShortcutRegistry.registry.addKeyMapping(a, t.name);
|
|
200
|
+
const c = e.ShortcutRegistry.registry.createSerializedKey(
|
|
201
|
+
e.utils.KeyCodes.X,
|
|
202
|
+
[e.utils.KeyCodes.META]
|
|
203
|
+
);
|
|
204
|
+
e.ShortcutRegistry.registry.addKeyMapping(c, t.name);
|
|
205
|
+
}
|
|
206
|
+
blockPasteFromStorageShortcut() {
|
|
207
|
+
const t = {
|
|
208
|
+
name: "paste",
|
|
209
|
+
preconditionFn: function(s) {
|
|
210
|
+
if (s.options.readOnly || e.Gesture.inProgress())
|
|
211
|
+
return !1;
|
|
212
|
+
const n = localStorage.getItem("blocklyStash");
|
|
213
|
+
if (!n)
|
|
214
|
+
return !1;
|
|
215
|
+
const i = JSON.parse(n);
|
|
216
|
+
return !(!i || !s.isCapacityAvailable(i.typeCounts));
|
|
217
|
+
},
|
|
218
|
+
callback: function(s, n) {
|
|
219
|
+
n.preventDefault();
|
|
220
|
+
const i = localStorage.getItem("blocklyStash");
|
|
221
|
+
if (!i)
|
|
222
|
+
return !1;
|
|
223
|
+
const l = JSON.parse(i);
|
|
224
|
+
return l ? (e.clipboard.paste(l, s), !0) : !1;
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
e.ShortcutRegistry.registry.register(t);
|
|
228
|
+
const o = e.ShortcutRegistry.registry.createSerializedKey(
|
|
229
|
+
e.utils.KeyCodes.V,
|
|
230
|
+
[e.utils.KeyCodes.CTRL]
|
|
231
|
+
);
|
|
232
|
+
e.ShortcutRegistry.registry.addKeyMapping(o, t.name);
|
|
233
|
+
const a = e.ShortcutRegistry.registry.createSerializedKey(
|
|
234
|
+
e.utils.KeyCodes.V,
|
|
235
|
+
[e.utils.KeyCodes.ALT]
|
|
236
|
+
);
|
|
237
|
+
e.ShortcutRegistry.registry.addKeyMapping(a, t.name);
|
|
238
|
+
const c = e.ShortcutRegistry.registry.createSerializedKey(
|
|
239
|
+
e.utils.KeyCodes.V,
|
|
240
|
+
[e.utils.KeyCodes.META]
|
|
241
|
+
);
|
|
242
|
+
e.ShortcutRegistry.registry.addKeyMapping(c, t.name);
|
|
243
|
+
}
|
|
169
244
|
}
|
|
170
|
-
|
|
245
|
+
const A = new F();
|
|
246
|
+
A.init({ contextMenu: !0, shortcut: !0 });
|
|
247
|
+
e.Themes.Classic.blockStyles = {
|
|
171
248
|
color_blocks: {
|
|
172
249
|
colourPrimary: "#a5745b",
|
|
173
250
|
colourSecondary: "#ede3de",
|
|
@@ -241,7 +318,7 @@ i.Classic.blockStyles = {
|
|
|
241
318
|
hat: ""
|
|
242
319
|
}
|
|
243
320
|
};
|
|
244
|
-
|
|
321
|
+
e.Themes.Classic.categoryStyles = {
|
|
245
322
|
calc_category: {
|
|
246
323
|
colour: "#757575"
|
|
247
324
|
},
|
|
@@ -291,9 +368,9 @@ i.Classic.categoryStyles = {
|
|
|
291
368
|
colour: "#a55b80"
|
|
292
369
|
}
|
|
293
370
|
};
|
|
294
|
-
const
|
|
371
|
+
const L = e.Theme.defineTheme("light", {
|
|
295
372
|
name: "light",
|
|
296
|
-
base:
|
|
373
|
+
base: e.Themes.Classic,
|
|
297
374
|
componentStyles: {
|
|
298
375
|
workspaceBackgroundColour: "#ffffff",
|
|
299
376
|
toolboxBackgroundColour: "#eeeeee",
|
|
@@ -307,9 +384,9 @@ const z = b.defineTheme("light", {
|
|
|
307
384
|
scrollbarOpacity: 0.4,
|
|
308
385
|
cursorColour: ""
|
|
309
386
|
}
|
|
310
|
-
}),
|
|
387
|
+
}), V = e.Theme.defineTheme("dark", {
|
|
311
388
|
name: "dark",
|
|
312
|
-
base:
|
|
389
|
+
base: e.Themes.Classic,
|
|
313
390
|
componentStyles: {
|
|
314
391
|
workspaceBackgroundColour: "#1e1e1e",
|
|
315
392
|
toolboxBackgroundColour: "#272727",
|
|
@@ -324,68 +401,55 @@ const z = b.defineTheme("light", {
|
|
|
324
401
|
cursorColour: ""
|
|
325
402
|
}
|
|
326
403
|
});
|
|
327
|
-
function
|
|
328
|
-
const
|
|
329
|
-
switch (console.log(
|
|
404
|
+
function $(r) {
|
|
405
|
+
const t = e.getMainWorkspace();
|
|
406
|
+
switch (console.log(t), r) {
|
|
330
407
|
case "light":
|
|
331
|
-
|
|
408
|
+
t.setTheme(L);
|
|
332
409
|
break;
|
|
333
410
|
case "dark":
|
|
334
|
-
|
|
411
|
+
t.setTheme(V);
|
|
335
412
|
break;
|
|
336
413
|
}
|
|
337
414
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
const
|
|
345
|
-
|
|
346
|
-
const e = m($);
|
|
347
|
-
if (!e)
|
|
348
|
-
throw new Error("[Vuetify] Could not find injected locale instance");
|
|
349
|
-
return e;
|
|
350
|
-
}
|
|
351
|
-
const W = Symbol.for("vuetify:theme");
|
|
352
|
-
function X() {
|
|
353
|
-
j("useTheme");
|
|
354
|
-
const e = m(W, null);
|
|
355
|
-
if (!e)
|
|
356
|
-
throw new Error("Could not find Vuetify theme injection");
|
|
357
|
-
return e;
|
|
358
|
-
}
|
|
359
|
-
function H(e, o) {
|
|
360
|
-
var a, l;
|
|
361
|
-
const r = o.value, t = {
|
|
362
|
-
passive: !((a = o.modifiers) != null && a.active)
|
|
415
|
+
const j = {
|
|
416
|
+
kind: "categoryToolbox",
|
|
417
|
+
contents: []
|
|
418
|
+
};
|
|
419
|
+
function N(r, t) {
|
|
420
|
+
var c, s;
|
|
421
|
+
const o = t.value, a = {
|
|
422
|
+
passive: !((c = t.modifiers) != null && c.active)
|
|
363
423
|
};
|
|
364
|
-
window.addEventListener("resize",
|
|
365
|
-
handler:
|
|
366
|
-
options:
|
|
367
|
-
}, (
|
|
424
|
+
window.addEventListener("resize", o, a), r._onResize = Object(r._onResize), r._onResize[t.instance.$.uid] = {
|
|
425
|
+
handler: o,
|
|
426
|
+
options: a
|
|
427
|
+
}, (s = t.modifiers) != null && s.quiet || o();
|
|
368
428
|
}
|
|
369
|
-
function
|
|
370
|
-
var
|
|
371
|
-
if (!((
|
|
429
|
+
function J(r, t) {
|
|
430
|
+
var c;
|
|
431
|
+
if (!((c = r._onResize) != null && c[t.instance.$.uid]))
|
|
372
432
|
return;
|
|
373
433
|
const {
|
|
374
|
-
handler:
|
|
375
|
-
options:
|
|
376
|
-
} =
|
|
377
|
-
window.removeEventListener("resize",
|
|
434
|
+
handler: o,
|
|
435
|
+
options: a
|
|
436
|
+
} = r._onResize[t.instance.$.uid];
|
|
437
|
+
window.removeEventListener("resize", o, a), delete r._onResize[t.instance.$.uid];
|
|
378
438
|
}
|
|
379
|
-
const
|
|
380
|
-
mounted:
|
|
381
|
-
unmounted:
|
|
382
|
-
},
|
|
439
|
+
const X = {
|
|
440
|
+
mounted: N,
|
|
441
|
+
unmounted: J
|
|
442
|
+
}, G = { class: "position-relative w-100 h-100" }, q = /* @__PURE__ */ h({
|
|
383
443
|
__name: "index",
|
|
444
|
+
props: {
|
|
445
|
+
type: {},
|
|
446
|
+
version: {}
|
|
447
|
+
},
|
|
384
448
|
emits: ["ready", "change"],
|
|
385
|
-
setup(
|
|
386
|
-
const
|
|
387
|
-
let
|
|
388
|
-
const
|
|
449
|
+
setup(r, { emit: t }) {
|
|
450
|
+
const o = z(), a = I(), { open: c } = x("blocklyEditorFlyout"), s = r, n = t, i = C(null);
|
|
451
|
+
let l;
|
|
452
|
+
const g = {
|
|
389
453
|
grid: {
|
|
390
454
|
length: 2,
|
|
391
455
|
snap: !0,
|
|
@@ -397,7 +461,7 @@ const q = {
|
|
|
397
461
|
scrollbars: !0,
|
|
398
462
|
wheel: !0
|
|
399
463
|
},
|
|
400
|
-
theme:
|
|
464
|
+
theme: a.current.value.dark ? "dark" : "light",
|
|
401
465
|
trashcan: !1,
|
|
402
466
|
zoom: {
|
|
403
467
|
maxScale: 1,
|
|
@@ -407,186 +471,48 @@ const q = {
|
|
|
407
471
|
wheel: !0
|
|
408
472
|
}
|
|
409
473
|
};
|
|
410
|
-
|
|
411
|
-
|
|
474
|
+
k(async () => {
|
|
475
|
+
if (!i.value)
|
|
476
|
+
return;
|
|
477
|
+
await f(o.current.value);
|
|
478
|
+
let u;
|
|
479
|
+
s.type === "app" && s.version === "v1" && (u = j), g.toolbox = u, l = e.inject(i.value, g), l.addChangeListener(e.Events.disableOrphans), l.addChangeListener(S), await T(), n("ready", l);
|
|
412
480
|
});
|
|
413
|
-
function
|
|
414
|
-
|
|
481
|
+
function p() {
|
|
482
|
+
l && e.svgResize(l);
|
|
415
483
|
}
|
|
416
|
-
function
|
|
417
|
-
|
|
484
|
+
function S(u) {
|
|
485
|
+
n("change", u);
|
|
418
486
|
}
|
|
419
|
-
return
|
|
420
|
-
|
|
421
|
-
}), d(
|
|
422
|
-
var
|
|
423
|
-
|
|
487
|
+
return _(() => {
|
|
488
|
+
c.value = !1;
|
|
489
|
+
}), d(c, (u) => {
|
|
490
|
+
var y;
|
|
491
|
+
u || (y = l.getToolbox()) == null || y.clearSelection();
|
|
424
492
|
}), d(
|
|
425
|
-
() =>
|
|
426
|
-
(
|
|
427
|
-
|
|
493
|
+
() => o.current.value,
|
|
494
|
+
(u) => {
|
|
495
|
+
f(u);
|
|
428
496
|
}
|
|
429
497
|
), d(
|
|
430
|
-
() =>
|
|
431
|
-
(
|
|
432
|
-
|
|
498
|
+
() => a.current.value.dark,
|
|
499
|
+
(u) => {
|
|
500
|
+
$(u ? "dark" : "light");
|
|
433
501
|
}
|
|
434
|
-
), (
|
|
435
|
-
|
|
502
|
+
), (u, y) => (v(), R("div", G, [
|
|
503
|
+
K(M("div", {
|
|
436
504
|
class: "w-100 h-100",
|
|
437
505
|
ref_key: "blocklyDiv",
|
|
438
|
-
ref:
|
|
506
|
+
ref: i,
|
|
439
507
|
id: "blocklyEditor"
|
|
440
508
|
}, null, 512), [
|
|
441
|
-
[
|
|
509
|
+
[X, p]
|
|
442
510
|
])
|
|
443
511
|
]));
|
|
444
512
|
}
|
|
445
|
-
}),
|
|
446
|
-
|
|
447
|
-
},
|
|
513
|
+
}), U = (r) => {
|
|
514
|
+
r.component("x-blockly", q);
|
|
515
|
+
}, W = { install: U };
|
|
448
516
|
export {
|
|
449
|
-
|
|
450
|
-
te as BasicCursor,
|
|
451
|
-
ae as Block,
|
|
452
|
-
ce as BlockSvg,
|
|
453
|
-
ne as Blocks,
|
|
454
|
-
le as COLLAPSED_FIELD_NAME,
|
|
455
|
-
ie as COLLAPSED_INPUT_NAME,
|
|
456
|
-
se as COLLAPSE_CHARS,
|
|
457
|
-
ue as CodeGenerator,
|
|
458
|
-
de as CollapsibleToolboxCategory,
|
|
459
|
-
ye as ComponentManager,
|
|
460
|
-
me as Connection,
|
|
461
|
-
be as ConnectionChecker,
|
|
462
|
-
ge as ConnectionDB,
|
|
463
|
-
_e as ConnectionType,
|
|
464
|
-
fe as ContextMenu,
|
|
465
|
-
pe as ContextMenuItems,
|
|
466
|
-
he as ContextMenuRegistry,
|
|
467
|
-
ke as Css,
|
|
468
|
-
Te as Cursor,
|
|
469
|
-
Ce as DELETE_VARIABLE_ID,
|
|
470
|
-
Ee as DeleteArea,
|
|
471
|
-
Se as DragTarget,
|
|
472
|
-
ve as DropDownDiv,
|
|
473
|
-
L as Events,
|
|
474
|
-
Me as Extensions,
|
|
475
|
-
Oe as Field,
|
|
476
|
-
Ae as FieldCheckbox,
|
|
477
|
-
Pe as FieldDropdown,
|
|
478
|
-
we as FieldImage,
|
|
479
|
-
Be as FieldLabel,
|
|
480
|
-
Re as FieldLabelSerializable,
|
|
481
|
-
Le as FieldNumber,
|
|
482
|
-
Ie as FieldTextInput,
|
|
483
|
-
xe as FieldVariable,
|
|
484
|
-
De as Flyout,
|
|
485
|
-
Fe as FlyoutButton,
|
|
486
|
-
Ve as FlyoutMetricsManager,
|
|
487
|
-
ze as Generator,
|
|
488
|
-
Ne as Gesture,
|
|
489
|
-
Ue as Grid,
|
|
490
|
-
je as HorizontalFlyout,
|
|
491
|
-
$e as INPUT_VALUE,
|
|
492
|
-
Ge as Input,
|
|
493
|
-
We as InsertionMarkerManager,
|
|
494
|
-
Xe as InsertionMarkerPreviewer,
|
|
495
|
-
He as Marker,
|
|
496
|
-
Ye as MarkerManager,
|
|
497
|
-
qe as Menu,
|
|
498
|
-
Je as MenuItem,
|
|
499
|
-
Ze as MetricsManager,
|
|
500
|
-
Ke as Msg,
|
|
501
|
-
Qe as NEXT_STATEMENT,
|
|
502
|
-
eo as Names,
|
|
503
|
-
oo as OPPOSITE_TYPE,
|
|
504
|
-
ro as OUTPUT_VALUE,
|
|
505
|
-
to as Options,
|
|
506
|
-
ao as PREVIOUS_STATEMENT,
|
|
507
|
-
co as PROCEDURE_CATEGORY_NAME,
|
|
508
|
-
no as Procedures,
|
|
509
|
-
lo as RENAME_VARIABLE_ID,
|
|
510
|
-
io as RenderedConnection,
|
|
511
|
-
so as Scrollbar,
|
|
512
|
-
uo as ScrollbarPair,
|
|
513
|
-
yo as ShortcutItems,
|
|
514
|
-
mo as ShortcutRegistry,
|
|
515
|
-
bo as TOOLBOX_AT_BOTTOM,
|
|
516
|
-
go as TOOLBOX_AT_LEFT,
|
|
517
|
-
_o as TOOLBOX_AT_RIGHT,
|
|
518
|
-
fo as TOOLBOX_AT_TOP,
|
|
519
|
-
po as TabNavigateCursor,
|
|
520
|
-
b as Theme,
|
|
521
|
-
ho as ThemeManager,
|
|
522
|
-
i as Themes,
|
|
523
|
-
ko as Toolbox,
|
|
524
|
-
To as ToolboxCategory,
|
|
525
|
-
Co as ToolboxItem,
|
|
526
|
-
Eo as ToolboxSeparator,
|
|
527
|
-
So as Tooltip,
|
|
528
|
-
vo as Touch,
|
|
529
|
-
Mo as Trashcan,
|
|
530
|
-
Oo as UnattachedFieldError,
|
|
531
|
-
Ao as VARIABLE_CATEGORY_NAME,
|
|
532
|
-
Po as VARIABLE_DYNAMIC_CATEGORY_NAME,
|
|
533
|
-
wo as VERSION,
|
|
534
|
-
Bo as VariableMap,
|
|
535
|
-
Ro as VariableModel,
|
|
536
|
-
Lo as Variables,
|
|
537
|
-
Io as VariablesDynamic,
|
|
538
|
-
xo as VerticalFlyout,
|
|
539
|
-
Do as WidgetDiv,
|
|
540
|
-
Fo as Workspace,
|
|
541
|
-
Vo as WorkspaceAudio,
|
|
542
|
-
zo as WorkspaceDragger,
|
|
543
|
-
No as WorkspaceSvg,
|
|
544
|
-
Uo as Xml,
|
|
545
|
-
jo as ZoomControls,
|
|
546
|
-
$o as blockAnimations,
|
|
547
|
-
Go as blockRendering,
|
|
548
|
-
Wo as browserEvents,
|
|
549
|
-
Xo as bubbles,
|
|
550
|
-
Ho as bumpObjects,
|
|
551
|
-
Yo as clipboard,
|
|
552
|
-
qo as comments,
|
|
553
|
-
Jo as common,
|
|
554
|
-
Zo as config,
|
|
555
|
-
Ko as constants,
|
|
556
|
-
Or as default,
|
|
557
|
-
Qo as defineBlocksWithJsonArray,
|
|
558
|
-
g as dialog,
|
|
559
|
-
er as dragging,
|
|
560
|
-
or as fieldRegistry,
|
|
561
|
-
rr as geras,
|
|
562
|
-
I as getMainWorkspace,
|
|
563
|
-
tr as getSelected,
|
|
564
|
-
ar as hasBubble,
|
|
565
|
-
cr as hideChaff,
|
|
566
|
-
nr as icons,
|
|
567
|
-
x as inject,
|
|
568
|
-
lr as inputs,
|
|
569
|
-
ir as isCopyable,
|
|
570
|
-
sr as isDeletable,
|
|
571
|
-
ur as isDraggable,
|
|
572
|
-
dr as isIcon,
|
|
573
|
-
yr as isObservable,
|
|
574
|
-
mr as isPaster,
|
|
575
|
-
br as isRenderedElement,
|
|
576
|
-
gr as isSelectable,
|
|
577
|
-
_r as isSerializable,
|
|
578
|
-
fr as isVariableBackedParameterModel,
|
|
579
|
-
pr as procedures,
|
|
580
|
-
hr as registry,
|
|
581
|
-
kr as renderManagement,
|
|
582
|
-
Tr as serialization,
|
|
583
|
-
D as setLocale,
|
|
584
|
-
y as setLocaleAsync,
|
|
585
|
-
Cr as setParentContainer,
|
|
586
|
-
U as setTheme,
|
|
587
|
-
F as svgResize,
|
|
588
|
-
Er as thrasos,
|
|
589
|
-
Sr as uiPosition,
|
|
590
|
-
vr as utils,
|
|
591
|
-
Mr as zelos
|
|
517
|
+
W as default
|
|
592
518
|
};
|