x-block-lib 0.11.5 → 0.11.7
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/{en.mwyn804k.js → en.ek9yugi6.js} +5 -2
- package/dist/{i18n-en.d45d4c13.js → i18n-en.c3uxu3r5.js} +1 -1
- package/dist/{i18n-zhHans.vr7fw0y7.js → i18n-zhHans.hyv14btt.js} +2 -2
- package/dist/index.d.ts +8 -9
- package/dist/index.js +243 -189
- package/dist/{rolldown-runtime.wcysgu6r.js → rolldown-runtime.d6iwd7kf.js} +1 -1
- package/dist/vendor.k3ftbehq.js +36962 -0
- package/dist/{zhHans.oa40n62t.js → zhHans.e42r5aas.js} +8 -5
- package/package.json +24 -27
- package/dist/vendor.b0mctov2.js +0 -34461
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(){try{document.getElementById(`x-block-lib`)?.remove();const e = document.createElement(`style`);e.setAttribute(`id`, `x-block-lib`);const t = document.createTextNode(`.ghost[data-v-x-block-lib-ca7316a0]{opacity:.4;pointer-events:none}.blocklyToolbox{width:56px;overflow-x:hidden}.blocklyMainBackground{stroke-width:0}.blocklyToolboxCategory{margin-bottom:12px!important}.blocklyToolboxCategoryIcon{display:none!important}.blocklyTreeRowContentContainer{place-items:center;height:28px;display:flex;overflow:hidden}.blocklyFlyout{z-index:21}pre code.hljs{padding:1em;display:block;overflow-x:auto}code.hljs{padding:3px 5px}.hljs{color:#444;background:#f3f3f3}.hljs-comment{color:#697070}.hljs-punctuation,.hljs-tag{color:#444a}.hljs-tag .hljs-attr,.hljs-tag .hljs-name{color:#444}.hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-tag{font-weight:700}.hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type{color:#800}.hljs-section,.hljs-title{color:#800;font-weight:700}.hljs-link,.hljs-operator,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable{color:#ab5656}.hljs-literal{color:#695}.hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta .hljs-string{color:#38a}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}`);e.appendChild(t);document.head.appendChild(e);}catch(e){console.error('rolldown-plugin-inject-css', e);}})()
|
|
2
|
-
import { A as Names, B as defineBlocksWithJsonArray, C as FieldCheckbox, D as FieldNumber, E as FieldLabel, F as Themes, G as inject$1, H as getMainWorkspace, I as Variables, J as serialization, K as inputs, L as WorkspaceSvg, M as ShortcutItems, N as ShortcutRegistry, O as FieldTextInput, P as Theme, Q as utils, R as Xml, S as Extensions, T as FieldImage, U as getSelected, V as dialog, W as icons, X as setParentContainer, Y as setLocale$1, Z as svgResize, _ as javascriptGenerator, a as lo, b as ContextMenuRegistry, c as encodeString, d as snakeCase, f as parseInt$1, g as Order, h as cloneDeep, i as require_dist$2, j as Procedures, k as Msg, l as require_dist, m as debounce, n as o, o as useResizeObserver, p as isEqual, q as registry, r as core_default, s as require_dist$1, t as javascript, u as upperCase, v as Blocks, w as FieldDropdown, x as Events, y as ContextMenu, z as common } from "./vendor.
|
|
2
|
+
import { A as Names, B as defineBlocksWithJsonArray, C as FieldCheckbox, D as FieldNumber, E as FieldLabel, F as Themes, G as inject$1, H as getMainWorkspace, I as Variables, J as serialization, K as inputs, L as WorkspaceSvg, M as ShortcutItems, N as ShortcutRegistry, O as FieldTextInput, P as Theme, Q as utils, R as Xml, S as Extensions, T as FieldImage, U as getSelected, V as dialog, W as icons, X as setParentContainer, Y as setLocale$1, Z as svgResize, _ as javascriptGenerator, a as lo, b as ContextMenuRegistry, c as encodeString, d as snakeCase, f as parseInt$1, g as Order, h as cloneDeep, i as require_dist$2, j as Procedures, k as Msg, l as require_dist, m as debounce, n as o, o as useResizeObserver, p as isEqual, q as registry, r as core_default, s as require_dist$1, t as javascript, u as upperCase, v as Blocks, w as FieldDropdown, x as Events, y as ContextMenu, z as common } from "./vendor.k3ftbehq.js";
|
|
3
3
|
import { eventBus, globalObjects, messageWarning, openConfirmDlg, openPromptDlg, useColor, useSystem, useViewStack } from "x-essential-lib";
|
|
4
4
|
import { globalState } from "x-state-lib";
|
|
5
5
|
import { addIndent, finalProperties, getElement, getImplementMethodName, getItems, getTag, getTypes, makeEventId, makeEventKeyOfCustomSlot, makeEventKeyOfElementSlot, makeMethodId, makeMethodKeyOfCustomSlot, makeMethodKeyOfElementSlot, makePropertyId, makePropertyKeyOfCustomSlot, makePropertyKeyOfElementSlot, makeTriggerId, parseNumberUnit, pkgs, themeColors, toEventName, toMethodName, toPropertyName, unwrapEventId, unwrapEventKeyOfCustomSlot, unwrapEventKeyOfElementSlot, unwrapMethodId, unwrapMethodKeyOfCustomSlot, unwrapMethodKeyOfElementSlot, unwrapPropertyId, unwrapPropertyKeyOfCustomSlot, unwrapPropertyKeyOfElementSlot, unwrapSlotId } from "x-runtime-lib";
|
|
@@ -9,8 +9,8 @@ import { useDisplay } from "vuetify";
|
|
|
9
9
|
|
|
10
10
|
//#region src/core/locale/index.ts
|
|
11
11
|
async function setLocale(locale) {
|
|
12
|
-
if (locale === "en") setLocale$1((await import("./en.
|
|
13
|
-
else if (locale === "zhHans") setLocale$1((await import("./zhHans.
|
|
12
|
+
if (locale === "en") setLocale$1((await import("./en.ek9yugi6.js")).default);
|
|
13
|
+
else if (locale === "zhHans") setLocale$1((await import("./zhHans.e42r5aas.js")).default);
|
|
14
14
|
else throw new Error(`invalid locale=${locale}`);
|
|
15
15
|
}
|
|
16
16
|
function localeMsg(key) {
|
|
@@ -1123,10 +1123,11 @@ function getAllBindKinds() {
|
|
|
1123
1123
|
}
|
|
1124
1124
|
function genBindKindOpts() {
|
|
1125
1125
|
const { i18n } = globalObjects;
|
|
1126
|
-
|
|
1126
|
+
const options = getAllBindKinds().map((v) => {
|
|
1127
1127
|
if (v === "notSet") return [i18n.global.t(`x-runtime-lib.${v}`), v];
|
|
1128
1128
|
else return [localeMsg(`APP_${upperCase(v)}`), v];
|
|
1129
|
-
})
|
|
1129
|
+
});
|
|
1130
|
+
return ensureOpts(options);
|
|
1130
1131
|
}
|
|
1131
1132
|
|
|
1132
1133
|
//#endregion
|
|
@@ -2895,8 +2896,10 @@ const APP_BIND_V1 = {
|
|
|
2895
2896
|
let currCheck;
|
|
2896
2897
|
if (block.kind === "property") {
|
|
2897
2898
|
const propertyInfo = getPropertyInfo(block.property.id);
|
|
2898
|
-
if (propertyInfo)
|
|
2899
|
-
|
|
2899
|
+
if (propertyInfo) {
|
|
2900
|
+
if (propertyInfo.meta.element) currCheck = getPropCheck(propertyInfo.meta.raw);
|
|
2901
|
+
else currCheck = getTypeCheck(propertyInfo.meta.raw.type);
|
|
2902
|
+
}
|
|
2900
2903
|
} else if (block.kind === "state") {
|
|
2901
2904
|
const stateInfo = getStateInfo(block.state.id);
|
|
2902
2905
|
if (stateInfo) currCheck = getTypeCheck(stateInfo.type);
|
|
@@ -3747,7 +3750,6 @@ const CALL_APP_METHOD_V1 = {
|
|
|
3747
3750
|
};
|
|
3748
3751
|
Blocks.call_app_method_v1 = CALL_APP_METHOD_V1;
|
|
3749
3752
|
javascriptGenerator.forBlock["call_app_method_v1"] = function(blockBase) {
|
|
3750
|
-
const it = javascriptGenerator.INDENT;
|
|
3751
3753
|
const block = blockBase;
|
|
3752
3754
|
let instance = "''";
|
|
3753
3755
|
switch (block.method.kind) {
|
|
@@ -3781,7 +3783,7 @@ javascriptGenerator.forBlock["call_app_method_v1"] = function(blockBase) {
|
|
|
3781
3783
|
}
|
|
3782
3784
|
inputs += `}`;
|
|
3783
3785
|
let outputs = "";
|
|
3784
|
-
if (block.method.outputs) for (const { key } of block.method.outputs) outputs +=
|
|
3786
|
+
if (block.method.outputs) for (const { key } of block.method.outputs) outputs += ` const __output$${key}__ = __outputs__[${javascriptGenerator.quote_(key)}];\n`;
|
|
3785
3787
|
if (block.method.kind === "customMethod") {
|
|
3786
3788
|
const { kind, nodeId, methodKey } = unwrapMethodId(block.method.id);
|
|
3787
3789
|
const funcName = getImplementMethodName(kind, nodeId, methodKey);
|
|
@@ -3990,15 +3992,14 @@ const IMPLEMENT_APP_METHOD_V1 = {
|
|
|
3990
3992
|
};
|
|
3991
3993
|
Blocks.implement_app_method_v1 = IMPLEMENT_APP_METHOD_V1;
|
|
3992
3994
|
javascriptGenerator.forBlock["implement_app_method_v1"] = function(blockBase) {
|
|
3993
|
-
const it = javascriptGenerator.INDENT;
|
|
3994
3995
|
const block = blockBase;
|
|
3995
3996
|
const { kind, nodeId, methodKey } = unwrapMethodId(block.method.id);
|
|
3996
3997
|
let inputs = "";
|
|
3997
|
-
if (block.method.inputs) for (const { key } of block.method.inputs) inputs +=
|
|
3998
|
+
if (block.method.inputs) for (const { key } of block.method.inputs) inputs += ` const __input$${key}__ = __inputs__[${javascriptGenerator.quote_(key)}];\n`;
|
|
3998
3999
|
const handle = javascriptGenerator.statementToCode(block, "HANDLE");
|
|
3999
4000
|
return `async function ${getImplementMethodName(kind, nodeId, methodKey)}(__instance__, __inputs__) {
|
|
4000
|
-
${inputs}
|
|
4001
|
-
${handle}
|
|
4001
|
+
${inputs} const __outputs__ = {};
|
|
4002
|
+
${handle} return __outputs__;
|
|
4002
4003
|
}
|
|
4003
4004
|
`;
|
|
4004
4005
|
};
|
|
@@ -5180,9 +5181,31 @@ function ${javascriptGenerator.FUNCTION_NAME_PLACEHOLDER_}(r, g, b) {
|
|
|
5180
5181
|
`)}(${red}, ${green}, ${blue})`, Order.FUNCTION_CALL];
|
|
5181
5182
|
};
|
|
5182
5183
|
|
|
5184
|
+
//#endregion
|
|
5185
|
+
//#region src/core/blocks/compute/flow/customFlowTrigger/v1/index.ts
|
|
5186
|
+
const CUSTOM_FLOW_TRIGGER_V1 = { init: function() {} };
|
|
5187
|
+
Blocks.custom_flow_trigger_v1 = CUSTOM_FLOW_TRIGGER_V1;
|
|
5188
|
+
javascriptGenerator.forBlock["custom_flow_trigger_v1"] = function() {
|
|
5189
|
+
return ``;
|
|
5190
|
+
};
|
|
5191
|
+
|
|
5192
|
+
//#endregion
|
|
5193
|
+
//#region src/core/blocks/compute/flow/invokeFlowTrigger/v1/index.ts
|
|
5194
|
+
const INVOKE_FLOW_TRIGGER_V1 = { init: function() {} };
|
|
5195
|
+
Blocks.invoke_flow_trigger_v1 = INVOKE_FLOW_TRIGGER_V1;
|
|
5196
|
+
javascriptGenerator.forBlock["invoke_flow_trigger_v1"] = function() {
|
|
5197
|
+
return ``;
|
|
5198
|
+
};
|
|
5199
|
+
|
|
5183
5200
|
//#endregion
|
|
5184
5201
|
//#region src/core/blocks/compute/flow/onFlowStateEvent/v1/index.ts
|
|
5185
|
-
const ON_FLOW_STATE_EVENT_V1 = { init: function() {
|
|
5202
|
+
const ON_FLOW_STATE_EVENT_V1 = { init: function() {
|
|
5203
|
+
this.appendDummyInput().appendField("%{BKY_COMPUTE_V1_ON_FLOW_STATE_EVENT_TITLE}");
|
|
5204
|
+
this.appendStatementInput("HANDLE").appendField("%{BKY_APP_DO}");
|
|
5205
|
+
this.setStyle("event_blocks");
|
|
5206
|
+
this.setTooltip("%{BKY_COMPUTE_V1_ON_FLOW_STATE_EVENT_TOOLTIP}");
|
|
5207
|
+
this.setHelpUrl("%{BKY_COMPUTE_V1_ON_FLOW_STATE_EVENT_HELPURL}");
|
|
5208
|
+
} };
|
|
5186
5209
|
Blocks.on_flow_state_event_v1 = ON_FLOW_STATE_EVENT_V1;
|
|
5187
5210
|
javascriptGenerator.forBlock["on_flow_state_event_v1"] = function() {
|
|
5188
5211
|
return `__onFlowStateEventV1__();\n`;
|
|
@@ -5191,12 +5214,14 @@ javascriptGenerator.forBlock["on_flow_state_event_v1"] = function() {
|
|
|
5191
5214
|
//#endregion
|
|
5192
5215
|
//#region src/core/utils/compute/func.ts
|
|
5193
5216
|
function getAllFuncInfos(spaceId) {
|
|
5194
|
-
const
|
|
5217
|
+
const { spaces } = globalState.compute;
|
|
5218
|
+
const space = spaces.find((entry) => entry.id === spaceId);
|
|
5195
5219
|
if (!space) return [];
|
|
5196
5220
|
return space.funcs;
|
|
5197
5221
|
}
|
|
5198
5222
|
function getFuncInfo(spaceId, funcId) {
|
|
5199
|
-
const
|
|
5223
|
+
const { spaces } = globalState.compute;
|
|
5224
|
+
const space = spaces.find((entry) => entry.id === spaceId);
|
|
5200
5225
|
if (!space) return;
|
|
5201
5226
|
return space.funcs.find((entry) => entry.id === funcId);
|
|
5202
5227
|
}
|
|
@@ -5208,7 +5233,8 @@ function genFuncOpts(spaceId) {
|
|
|
5208
5233
|
return ensureOpts(options);
|
|
5209
5234
|
}
|
|
5210
5235
|
function getActiveFunc() {
|
|
5211
|
-
|
|
5236
|
+
const { activeFunc } = globalState.compute;
|
|
5237
|
+
return activeFunc;
|
|
5212
5238
|
}
|
|
5213
5239
|
function getActiveFuncOutputInfo(id) {
|
|
5214
5240
|
const { activeFunc } = globalState.compute;
|
|
@@ -5445,26 +5471,25 @@ const CALL_FUNC_V1 = {
|
|
|
5445
5471
|
};
|
|
5446
5472
|
Blocks.call_func_v1 = CALL_FUNC_V1;
|
|
5447
5473
|
javascriptGenerator.forBlock["call_func_v1"] = function(base) {
|
|
5448
|
-
const it = javascriptGenerator.INDENT;
|
|
5449
5474
|
const block = base;
|
|
5450
5475
|
const spaceId = javascriptGenerator.quote_(block.space.id);
|
|
5451
5476
|
const funcId = javascriptGenerator.quote_(block.func.id);
|
|
5452
5477
|
let inputs = "";
|
|
5453
|
-
inputs +=
|
|
5478
|
+
inputs += ` var __inputs__ = {\n`;
|
|
5454
5479
|
block.func.inputs.forEach(({ id }, index) => {
|
|
5455
5480
|
const value = javascriptGenerator.valueToCode(block, "INPUT" + index, Order.ATOMIC);
|
|
5456
|
-
inputs +=
|
|
5481
|
+
inputs += ` ${javascriptGenerator.quote_(id)}: ${value},\n`;
|
|
5457
5482
|
});
|
|
5458
|
-
inputs +=
|
|
5483
|
+
inputs += ` };`;
|
|
5459
5484
|
const name = javascriptGenerator.quote_(block.space.name + "/" + block.func.name);
|
|
5460
5485
|
let outputs = "";
|
|
5461
5486
|
block.func.outputs.forEach(({ id }) => {
|
|
5462
|
-
outputs +=
|
|
5487
|
+
outputs += ` var __output${id}__ = __result__[${javascriptGenerator.quote_(id)}];\n`;
|
|
5463
5488
|
});
|
|
5464
5489
|
const callback = javascriptGenerator.statementToCode(block, "CALLBACK");
|
|
5465
5490
|
return `{
|
|
5466
5491
|
${inputs}
|
|
5467
|
-
|
|
5492
|
+
var __result__ = __callFuncV1__(${spaceId},${funcId},__inputs__,__getEnvV1__(),${name});
|
|
5468
5493
|
${outputs}${callback}}
|
|
5469
5494
|
`;
|
|
5470
5495
|
};
|
|
@@ -5670,28 +5695,27 @@ const CALL_FUNC_INTERNAL_V1 = {
|
|
|
5670
5695
|
};
|
|
5671
5696
|
Blocks.call_func_internal_v1 = CALL_FUNC_INTERNAL_V1;
|
|
5672
5697
|
javascriptGenerator.forBlock["call_func_internal_v1"] = function(base) {
|
|
5673
|
-
const it = javascriptGenerator.INDENT;
|
|
5674
5698
|
const block = base;
|
|
5675
5699
|
const spaceId = javascriptGenerator.quote_(block.space.id);
|
|
5676
5700
|
const funcId = javascriptGenerator.quote_(block.func.id);
|
|
5677
|
-
let inputs =
|
|
5701
|
+
let inputs = ` var __inputs__ = {\n`;
|
|
5678
5702
|
block.func.inputs.forEach(({ id }, index) => {
|
|
5679
5703
|
const value = javascriptGenerator.valueToCode(block, "INPUT" + index, Order.ATOMIC);
|
|
5680
|
-
inputs +=
|
|
5704
|
+
inputs += ` ${javascriptGenerator.quote_(id)}: ${value},\n`;
|
|
5681
5705
|
});
|
|
5682
|
-
inputs +=
|
|
5706
|
+
inputs += ` };`;
|
|
5683
5707
|
const name = block.space.name + "/" + block.func.name;
|
|
5684
5708
|
let outputs = "";
|
|
5685
5709
|
block.func.outputs.forEach(({ id }) => {
|
|
5686
|
-
outputs +=
|
|
5710
|
+
outputs += ` var __output$${id}__ = __result__.outputs[${javascriptGenerator.quote_(id)}];\n`;
|
|
5687
5711
|
});
|
|
5688
5712
|
const callback = javascriptGenerator.statementToCode(block, "CALLBACK");
|
|
5689
5713
|
return `{
|
|
5690
5714
|
${inputs}
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5715
|
+
var __result__ = __callFuncInternalV1__(${spaceId}, ${funcId}, __inputs__);
|
|
5716
|
+
if (!__result__.success) {
|
|
5717
|
+
throw 'call func<${name}> failed, reason: ' + __result__.message;
|
|
5718
|
+
}
|
|
5695
5719
|
${outputs}${callback}}
|
|
5696
5720
|
`;
|
|
5697
5721
|
};
|
|
@@ -6074,12 +6098,13 @@ const ADD_DATA_V1 = {
|
|
|
6074
6098
|
this.setHelpUrl("%{BKY_DATA_V1_ADD_DATA_HELPURL}");
|
|
6075
6099
|
},
|
|
6076
6100
|
saveExtraState: function() {
|
|
6077
|
-
return {};
|
|
6101
|
+
return { create: !this.isInFlyout };
|
|
6078
6102
|
},
|
|
6079
|
-
loadExtraState: function() {
|
|
6103
|
+
loadExtraState: function(state) {
|
|
6080
6104
|
this.updateShape_();
|
|
6105
|
+
if (!state.create) this.ensureBlocks_();
|
|
6081
6106
|
setTimeout(() => {
|
|
6082
|
-
this.
|
|
6107
|
+
this.ensureBlocks2_();
|
|
6083
6108
|
}, 0);
|
|
6084
6109
|
},
|
|
6085
6110
|
updateShape_: function() {
|
|
@@ -6104,6 +6129,10 @@ const ADD_DATA_V1 = {
|
|
|
6104
6129
|
ensureBlocks_: function() {
|
|
6105
6130
|
if (this.isInsertionMarker()) return;
|
|
6106
6131
|
ensureTableBlock$3(this);
|
|
6132
|
+
ensureHandleBlock$3(this);
|
|
6133
|
+
},
|
|
6134
|
+
ensureBlocks2_: function() {
|
|
6135
|
+
if (this.isInsertionMarker()) return;
|
|
6107
6136
|
ensureParameterBlockV1s(this, [
|
|
6108
6137
|
[
|
|
6109
6138
|
"SUCCESS",
|
|
@@ -6124,22 +6153,21 @@ const ADD_DATA_V1 = {
|
|
|
6124
6153
|
true
|
|
6125
6154
|
]
|
|
6126
6155
|
]);
|
|
6127
|
-
ensureHandleBlock$3(this);
|
|
6128
6156
|
}
|
|
6129
6157
|
};
|
|
6130
6158
|
Blocks.add_data_v1 = ADD_DATA_V1;
|
|
6131
6159
|
javascriptGenerator.forBlock["add_data_v1"] = function(block) {
|
|
6132
|
-
const it = javascriptGenerator.INDENT;
|
|
6133
6160
|
return `{
|
|
6134
|
-
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6161
|
+
var __tx__ = typeof __tx__ !== 'undefined' ? __tx__ : null;
|
|
6162
|
+
const __table__ = ${javascriptGenerator.valueToCode(block, "TABLE", Order.ATOMIC) || "null"};
|
|
6163
|
+
const {
|
|
6164
|
+
success: __success__,
|
|
6165
|
+
message: __message__,
|
|
6166
|
+
data: __data__
|
|
6167
|
+
} = __addDataV1__(__tx__, __table__);
|
|
6168
|
+
if (__tx__ && !__success__) {
|
|
6169
|
+
throw __message__;
|
|
6170
|
+
}
|
|
6143
6171
|
${javascriptGenerator.statementToCode(block, "HANDLE")}}
|
|
6144
6172
|
`;
|
|
6145
6173
|
};
|
|
@@ -6546,12 +6574,13 @@ const DATA_DELETE_V1 = {
|
|
|
6546
6574
|
this.setHelpUrl("%{BKY_DATA_V1_DELETE_DATA_HELPURL}");
|
|
6547
6575
|
},
|
|
6548
6576
|
saveExtraState: function() {
|
|
6549
|
-
return {};
|
|
6577
|
+
return { create: !this.isInFlyout };
|
|
6550
6578
|
},
|
|
6551
|
-
loadExtraState: function() {
|
|
6579
|
+
loadExtraState: function(state) {
|
|
6552
6580
|
this.updateShape_();
|
|
6581
|
+
if (!state.create) this.ensureBlocks_();
|
|
6553
6582
|
setTimeout(() => {
|
|
6554
|
-
this.
|
|
6583
|
+
this.ensureBlocks2_();
|
|
6555
6584
|
}, 0);
|
|
6556
6585
|
},
|
|
6557
6586
|
updateShape_: function() {
|
|
@@ -6577,6 +6606,10 @@ const DATA_DELETE_V1 = {
|
|
|
6577
6606
|
if (this.isInsertionMarker()) return;
|
|
6578
6607
|
ensureTableBlock$2(this);
|
|
6579
6608
|
ensureConditionBlock$2(this);
|
|
6609
|
+
ensureHandleBlock$2(this);
|
|
6610
|
+
},
|
|
6611
|
+
ensureBlocks2_: function() {
|
|
6612
|
+
if (this.isInsertionMarker()) return;
|
|
6580
6613
|
ensureParameterBlockV1s(this, [[
|
|
6581
6614
|
"SUCCESS",
|
|
6582
6615
|
"__success__",
|
|
@@ -6588,22 +6621,21 @@ const DATA_DELETE_V1 = {
|
|
|
6588
6621
|
"x-runtime-lib.message",
|
|
6589
6622
|
true
|
|
6590
6623
|
]]);
|
|
6591
|
-
ensureHandleBlock$2(this);
|
|
6592
6624
|
}
|
|
6593
6625
|
};
|
|
6594
6626
|
Blocks.delete_data_v1 = DATA_DELETE_V1;
|
|
6595
6627
|
javascriptGenerator.forBlock["delete_data_v1"] = function(block) {
|
|
6596
|
-
const it = javascriptGenerator.INDENT;
|
|
6597
6628
|
return `{
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6629
|
+
var __tx__ = typeof __tx__ !== 'undefined' ? __tx__ : null;
|
|
6630
|
+
const __table__ = ${javascriptGenerator.valueToCode(block, "TABLE", Order.ATOMIC) || "null"};
|
|
6631
|
+
const __condition__ = ${javascriptGenerator.valueToCode(block, "CONDITION", Order.ATOMIC) || "null"};
|
|
6632
|
+
const {
|
|
6633
|
+
success: __success__,
|
|
6634
|
+
message: __message__
|
|
6635
|
+
} = __deleteDataV1__(__tx__, __table__, __condition__);
|
|
6636
|
+
if (__tx__ && !__success__) {
|
|
6637
|
+
throw __message__;
|
|
6638
|
+
}
|
|
6607
6639
|
${javascriptGenerator.statementToCode(block, "HANDLE")}}
|
|
6608
6640
|
`;
|
|
6609
6641
|
};
|
|
@@ -6737,12 +6769,16 @@ const QUERY_DATA_V1 = {
|
|
|
6737
6769
|
this.setHelpUrl("%{BKY_DATA_V1_QUERY_DATA_HELPURL}");
|
|
6738
6770
|
},
|
|
6739
6771
|
saveExtraState: function() {
|
|
6740
|
-
return {};
|
|
6772
|
+
return { create: !this.isInFlyout };
|
|
6741
6773
|
},
|
|
6742
|
-
loadExtraState: function() {
|
|
6774
|
+
loadExtraState: function(state) {
|
|
6743
6775
|
this.updateShape_();
|
|
6744
6776
|
setTimeout(() => {
|
|
6745
|
-
this.
|
|
6777
|
+
this.updateShadow_();
|
|
6778
|
+
}, 0);
|
|
6779
|
+
if (!state.create) this.ensureBlocks_();
|
|
6780
|
+
setTimeout(() => {
|
|
6781
|
+
this.ensureBlocks2_();
|
|
6746
6782
|
}, 0);
|
|
6747
6783
|
},
|
|
6748
6784
|
updateShape_: function() {
|
|
@@ -6776,11 +6812,19 @@ const QUERY_DATA_V1 = {
|
|
|
6776
6812
|
this.moveInputBefore("TABLE", "CONDITION");
|
|
6777
6813
|
}
|
|
6778
6814
|
},
|
|
6815
|
+
updateShadow_: function() {
|
|
6816
|
+
if (this.isInsertionMarker()) return;
|
|
6817
|
+
this.getInput("EXTRA").setShadowDom(shadowOfListCreateV1());
|
|
6818
|
+
},
|
|
6779
6819
|
ensureBlocks_: function() {
|
|
6780
6820
|
if (this.isInsertionMarker()) return;
|
|
6781
6821
|
ensureTableBlock$1(this);
|
|
6782
6822
|
ensureConditionBlock$1(this);
|
|
6783
6823
|
ensureExtraBlock(this);
|
|
6824
|
+
ensureHandleBlock$1(this);
|
|
6825
|
+
},
|
|
6826
|
+
ensureBlocks2_: function() {
|
|
6827
|
+
if (this.isInsertionMarker()) return;
|
|
6784
6828
|
ensureParameterBlockV1s(this, [
|
|
6785
6829
|
[
|
|
6786
6830
|
"SUCCESS",
|
|
@@ -6807,25 +6851,24 @@ const QUERY_DATA_V1 = {
|
|
|
6807
6851
|
true
|
|
6808
6852
|
]
|
|
6809
6853
|
]);
|
|
6810
|
-
ensureHandleBlock$1(this);
|
|
6811
6854
|
}
|
|
6812
6855
|
};
|
|
6813
6856
|
Blocks.query_data_v1 = QUERY_DATA_V1;
|
|
6814
6857
|
javascriptGenerator.forBlock["query_data_v1"] = function(block) {
|
|
6815
|
-
const it = javascriptGenerator.INDENT;
|
|
6816
6858
|
return `{
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6859
|
+
var __tx__ = typeof __tx__ !== 'undefined' ? __tx__ : null;
|
|
6860
|
+
const __table__ = ${javascriptGenerator.valueToCode(block, "TABLE", Order.ATOMIC) || "null"};
|
|
6861
|
+
const __condition__ = ${javascriptGenerator.valueToCode(block, "CONDITION", Order.ATOMIC) || "null"};
|
|
6862
|
+
const __extra__ = ${javascriptGenerator.valueToCode(block, "EXTRA", Order.ATOMIC) || "null"};
|
|
6863
|
+
const {
|
|
6864
|
+
success: __success__,
|
|
6865
|
+
message: __message__,
|
|
6866
|
+
mainData: __mainData__,
|
|
6867
|
+
extraData: __extraData__
|
|
6868
|
+
} = __queryDataV1__(__tx__, __table__, __condition__, __extra__);
|
|
6869
|
+
if (__tx__ && !__success__) {
|
|
6870
|
+
throw __message__;
|
|
6871
|
+
}
|
|
6829
6872
|
${javascriptGenerator.statementToCode(block, "HANDLE")}}
|
|
6830
6873
|
`;
|
|
6831
6874
|
};
|
|
@@ -7319,49 +7362,48 @@ const TRANSACTION_V1 = {
|
|
|
7319
7362
|
};
|
|
7320
7363
|
Blocks.transaction_v1 = TRANSACTION_V1;
|
|
7321
7364
|
javascriptGenerator.forBlock["transaction_v1"] = function(blockBase) {
|
|
7322
|
-
const it = javascriptGenerator.INDENT;
|
|
7323
7365
|
const block = blockBase;
|
|
7324
7366
|
const depth = getBlockDepth(block);
|
|
7325
7367
|
const handle = javascriptGenerator.statementToCode(block, "HANDLE");
|
|
7326
7368
|
const finally_ = javascriptGenerator.statementToCode(block, "FINALLY");
|
|
7327
7369
|
return `{
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
${javascriptGenerator.prefixLines(handle,
|
|
7342
|
-
|
|
7343
|
-
|
|
7344
|
-
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
|
|
7360
|
-
|
|
7361
|
-
${javascriptGenerator.prefixLines(finally_,
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7370
|
+
var __error${depth}__ = '';
|
|
7371
|
+
var __txExist${depth}__ = typeof(__tx__) !== 'undefined';
|
|
7372
|
+
var __tx__ = __txExist${depth}__ ? __tx__ : __txBeginV1__();
|
|
7373
|
+
var __spName${depth}__ = 'savePoint${depth}';
|
|
7374
|
+
try {
|
|
7375
|
+
if (!__tx__) {
|
|
7376
|
+
throw 'begin transaction failed';
|
|
7377
|
+
}
|
|
7378
|
+
if (__txExist${depth}__) {
|
|
7379
|
+
if (__txSavePointV1__(__tx__, __spName${depth}__)) {
|
|
7380
|
+
throw 'save point of transaction failed';
|
|
7381
|
+
}
|
|
7382
|
+
}
|
|
7383
|
+
${javascriptGenerator.prefixLines(handle, javascriptGenerator.INDENT)} } catch (__e__) {
|
|
7384
|
+
__error${depth}__ = __e__ ? __e__ : 'transaction interrupted';
|
|
7385
|
+
} finally {
|
|
7386
|
+
if (__txExist${depth}__) {
|
|
7387
|
+
if (__error${depth}__) {
|
|
7388
|
+
__txRollbackToV1__(__tx__, __spName${depth}__);
|
|
7389
|
+
}
|
|
7390
|
+
} else {
|
|
7391
|
+
if(__tx__) {
|
|
7392
|
+
if (__error${depth}__) {
|
|
7393
|
+
__txRollbackV1__(__tx__);
|
|
7394
|
+
} else {
|
|
7395
|
+
if (__txCommitV1__(__tx__)) {
|
|
7396
|
+
__error${depth}__ = 'commit transaction failed';
|
|
7397
|
+
}
|
|
7398
|
+
}
|
|
7399
|
+
}
|
|
7400
|
+
}
|
|
7401
|
+
var __success__ = !__error${depth}__;
|
|
7402
|
+
var __message__ = __error${depth}__ ? __error${depth}__ : 'success';
|
|
7403
|
+
${javascriptGenerator.prefixLines(finally_, javascriptGenerator.INDENT)} if (__txExist${depth}__ && __error${depth}__) {
|
|
7404
|
+
throw __error${depth}__;
|
|
7405
|
+
}
|
|
7406
|
+
}
|
|
7365
7407
|
}
|
|
7366
7408
|
`;
|
|
7367
7409
|
};
|
|
@@ -7756,12 +7798,13 @@ const UPDATE_DATA_V1 = {
|
|
|
7756
7798
|
this.setHelpUrl("%{BKY_DATA_V1_UPDATE_DATA_HELPURL}");
|
|
7757
7799
|
},
|
|
7758
7800
|
saveExtraState: function() {
|
|
7759
|
-
return {};
|
|
7801
|
+
return { create: !this.isInFlyout };
|
|
7760
7802
|
},
|
|
7761
|
-
loadExtraState: function() {
|
|
7803
|
+
loadExtraState: function(state) {
|
|
7762
7804
|
this.updateShape_();
|
|
7805
|
+
if (!state.create) this.ensureBlocks_();
|
|
7763
7806
|
setTimeout(() => {
|
|
7764
|
-
this.
|
|
7807
|
+
this.ensureBlocks2_();
|
|
7765
7808
|
}, 0);
|
|
7766
7809
|
},
|
|
7767
7810
|
updateShape_: function() {
|
|
@@ -7787,10 +7830,14 @@ const UPDATE_DATA_V1 = {
|
|
|
7787
7830
|
this.moveInputBefore("TABLE", "CONDITION");
|
|
7788
7831
|
}
|
|
7789
7832
|
},
|
|
7790
|
-
|
|
7833
|
+
ensureBlocks_: function() {
|
|
7791
7834
|
if (this.isInsertionMarker()) return;
|
|
7792
7835
|
ensureTableBlock(this);
|
|
7793
7836
|
ensureConditionBlock(this);
|
|
7837
|
+
ensureHandleBlock(this);
|
|
7838
|
+
},
|
|
7839
|
+
ensureBlocks2_: function() {
|
|
7840
|
+
if (this.isInsertionMarker()) return;
|
|
7794
7841
|
ensureParameterBlockV1s(this, [
|
|
7795
7842
|
[
|
|
7796
7843
|
"SUCCESS",
|
|
@@ -7811,23 +7858,22 @@ const UPDATE_DATA_V1 = {
|
|
|
7811
7858
|
true
|
|
7812
7859
|
]
|
|
7813
7860
|
]);
|
|
7814
|
-
ensureHandleBlock(this);
|
|
7815
7861
|
}
|
|
7816
7862
|
};
|
|
7817
7863
|
Blocks.update_data_v1 = UPDATE_DATA_V1;
|
|
7818
7864
|
javascriptGenerator.forBlock["update_data_v1"] = function(block) {
|
|
7819
|
-
const it = javascriptGenerator.INDENT;
|
|
7820
7865
|
return `{
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7824
|
-
|
|
7825
|
-
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
-
|
|
7829
|
-
|
|
7830
|
-
|
|
7866
|
+
var __tx__ = typeof __tx__ !== 'undefined' ? __tx__ : null;
|
|
7867
|
+
const __table__ = ${javascriptGenerator.valueToCode(block, "TABLE", Order.ATOMIC) || "null"};
|
|
7868
|
+
const __condition__ = ${javascriptGenerator.valueToCode(block, "CONDITION", Order.ATOMIC) || "null"};
|
|
7869
|
+
const {
|
|
7870
|
+
success: __success__,
|
|
7871
|
+
message: __message__,
|
|
7872
|
+
data: __data__
|
|
7873
|
+
} = __updateDataV1__(__tx__, __table__, __condition__);
|
|
7874
|
+
if (__tx__ && !__success__) {
|
|
7875
|
+
throw __message__;
|
|
7876
|
+
}
|
|
7831
7877
|
${javascriptGenerator.statementToCode(block, "HANDLE")}}
|
|
7832
7878
|
`;
|
|
7833
7879
|
};
|
|
@@ -8801,7 +8847,7 @@ Extensions.register("flow_control_tooltip_v1", Extensions.buildTooltipForDropdow
|
|
|
8801
8847
|
BREAK: "%{BKY_LOOP_V1_FLOW_CONTROL_TOOLTIP_BREAK}",
|
|
8802
8848
|
CONTINUE: "%{BKY_LOOP_V1_FLOW_CONTROL_TOOLTIP_CONTINUE}"
|
|
8803
8849
|
}));
|
|
8804
|
-
const loopTypes = new Set([
|
|
8850
|
+
const loopTypes = /* @__PURE__ */ new Set([
|
|
8805
8851
|
"repeat_v1",
|
|
8806
8852
|
"for_each_v1",
|
|
8807
8853
|
"for_v1",
|
|
@@ -8905,7 +8951,6 @@ defineBlocksWithJsonArray([{
|
|
|
8905
8951
|
extensions: ["contextMenu_newGetVariableBlock_v1", "for_tooltip_v1"]
|
|
8906
8952
|
}]);
|
|
8907
8953
|
javascriptGenerator.forBlock["for_v1"] = function(block) {
|
|
8908
|
-
const it = javascriptGenerator.INDENT;
|
|
8909
8954
|
const variable = javascriptGenerator.getVariableName(block.getFieldValue("VAR"));
|
|
8910
8955
|
const from = javascriptGenerator.valueToCode(block, "FROM", Order.ASSIGNMENT) || "0";
|
|
8911
8956
|
const to = javascriptGenerator.valueToCode(block, "TO", Order.ASSIGNMENT) || "0";
|
|
@@ -8931,7 +8976,7 @@ javascriptGenerator.forBlock["for_v1"] = function(block) {
|
|
|
8931
8976
|
code += `var ${byVar} = `;
|
|
8932
8977
|
if (utils.string.isNumber(by)) code += `${Math.abs(Number(by))};\n`;
|
|
8933
8978
|
else code += `Math.abs(${by});\n`;
|
|
8934
|
-
code += `if (${fromVar} > ${toVar}) {\n${
|
|
8979
|
+
code += `if (${fromVar} > ${toVar}) {\n ${byVar} = -${byVar};\n}\n`;
|
|
8935
8980
|
code += `for (${variable} = ${fromVar}; ${byVar} >= 0 ? ${variable} <= ${toVar} : ${variable} >= ${toVar}; ${variable} += ${byVar}) {\n${handle}}\n`;
|
|
8936
8981
|
return code;
|
|
8937
8982
|
}
|
|
@@ -8964,7 +9009,6 @@ defineBlocksWithJsonArray([{
|
|
|
8964
9009
|
extensions: ["contextMenu_newGetVariableBlock_v1", "for_each_tooltip_v1"]
|
|
8965
9010
|
}]);
|
|
8966
9011
|
javascriptGenerator.forBlock["for_each_v1"] = function(block) {
|
|
8967
|
-
const it = javascriptGenerator.INDENT;
|
|
8968
9012
|
const variable = javascriptGenerator.getVariableName(block.getFieldValue("VAR"));
|
|
8969
9013
|
const list = javascriptGenerator.valueToCode(block, "LIST", Order.ASSIGNMENT) || "[]";
|
|
8970
9014
|
const handle = javascriptGenerator.addLoopTrap(javascriptGenerator.statementToCode(block, "DO"), block);
|
|
@@ -8976,7 +9020,7 @@ javascriptGenerator.forBlock["for_each_v1"] = function(block) {
|
|
|
8976
9020
|
}
|
|
8977
9021
|
const indexVar = javascriptGenerator.nameDB_.getDistinctName(`${variable}_index`, Names.NameType.VARIABLE);
|
|
8978
9022
|
code += `for (var ${indexVar} in ${listVar}) {
|
|
8979
|
-
${
|
|
9023
|
+
${variable} = ${listVar}[${indexVar}];
|
|
8980
9024
|
${handle}}\n`;
|
|
8981
9025
|
return code;
|
|
8982
9026
|
};
|
|
@@ -9568,9 +9612,7 @@ javascriptGenerator.forBlock["math_round_v1"] = function(block) {
|
|
|
9568
9612
|
case "ROUNDUP":
|
|
9569
9613
|
code = `Math.ceil(${arg})`;
|
|
9570
9614
|
break;
|
|
9571
|
-
case "ROUNDDOWN":
|
|
9572
|
-
code = `Math.floor(${arg})`;
|
|
9573
|
-
break;
|
|
9615
|
+
case "ROUNDDOWN": code = `Math.floor(${arg})`;
|
|
9574
9616
|
}
|
|
9575
9617
|
return [code, Order.FUNCTION_CALL];
|
|
9576
9618
|
};
|
|
@@ -9625,9 +9667,7 @@ javascriptGenerator.forBlock["math_single_v1"] = function(block) {
|
|
|
9625
9667
|
case "EXP":
|
|
9626
9668
|
code = `Math.exp(${arg})`;
|
|
9627
9669
|
break;
|
|
9628
|
-
case "POW10":
|
|
9629
|
-
code = `Math.pow(10, ${arg})`;
|
|
9630
|
-
break;
|
|
9670
|
+
case "POW10": code = `Math.pow(10, ${arg})`;
|
|
9631
9671
|
}
|
|
9632
9672
|
if (code) return [code, Order.FUNCTION_CALL];
|
|
9633
9673
|
switch (operator) {
|
|
@@ -9678,9 +9718,7 @@ javascriptGenerator.forBlock["math_trig_v1"] = function(block) {
|
|
|
9678
9718
|
case "COS":
|
|
9679
9719
|
code = `Math.cos(${arg} / 180 * Math.PI)`;
|
|
9680
9720
|
break;
|
|
9681
|
-
case "TAN":
|
|
9682
|
-
code = `Math.tan(${arg} / 180 * Math.PI)`;
|
|
9683
|
-
break;
|
|
9721
|
+
case "TAN": code = `Math.tan(${arg} / 180 * Math.PI)`;
|
|
9684
9722
|
}
|
|
9685
9723
|
if (code) return [code, Order.FUNCTION_CALL];
|
|
9686
9724
|
switch (operator) {
|
|
@@ -10631,7 +10669,9 @@ defineBlocksWithJsonArray([{
|
|
|
10631
10669
|
extensions: ["text_append_tooltip_v1"]
|
|
10632
10670
|
}]);
|
|
10633
10671
|
javascriptGenerator.forBlock["text_append_v1"] = function(block) {
|
|
10634
|
-
|
|
10672
|
+
const varName = javascriptGenerator.nameDB_?.getName(block.getFieldValue("VAR"), Names.NameType.VARIABLE);
|
|
10673
|
+
const value = javascriptGenerator.valueToCode(block, "TEXT", Order.NONE) || "''";
|
|
10674
|
+
return `${varName} += ${forceString(value)[0]};\n`;
|
|
10635
10675
|
};
|
|
10636
10676
|
|
|
10637
10677
|
//#endregion
|
|
@@ -10899,7 +10939,10 @@ javascriptGenerator.forBlock["text_join_v1"] = function(blockBase) {
|
|
|
10899
10939
|
const block = blockBase;
|
|
10900
10940
|
switch (block.itemCount_) {
|
|
10901
10941
|
case 0: return ["''", Order.ATOMIC];
|
|
10902
|
-
case 1:
|
|
10942
|
+
case 1: {
|
|
10943
|
+
const element = javascriptGenerator.valueToCode(block, "ADD0", Order.NONE) || "''";
|
|
10944
|
+
return forceString(element);
|
|
10945
|
+
}
|
|
10903
10946
|
case 2: {
|
|
10904
10947
|
const element0 = javascriptGenerator.valueToCode(block, "ADD0", Order.NONE) || "''";
|
|
10905
10948
|
const element1 = javascriptGenerator.valueToCode(block, "ADD1", Order.NONE) || "''";
|
|
@@ -11380,7 +11423,7 @@ new import_dist$1.CrossTabCopyPaste().init({
|
|
|
11380
11423
|
new DisableTopBlocks().init();
|
|
11381
11424
|
|
|
11382
11425
|
//#endregion
|
|
11383
|
-
//#region \0@oxc-project+runtime@0.
|
|
11426
|
+
//#region \0@oxc-project+runtime@0.149.0/helpers/esm/typeof.js
|
|
11384
11427
|
function _typeof(o) {
|
|
11385
11428
|
"@babel/helpers - typeof";
|
|
11386
11429
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -11391,7 +11434,7 @@ function _typeof(o) {
|
|
|
11391
11434
|
}
|
|
11392
11435
|
|
|
11393
11436
|
//#endregion
|
|
11394
|
-
//#region \0@oxc-project+runtime@0.
|
|
11437
|
+
//#region \0@oxc-project+runtime@0.149.0/helpers/esm/toPrimitive.js
|
|
11395
11438
|
function toPrimitive(t, r) {
|
|
11396
11439
|
if ("object" != _typeof(t) || !t) return t;
|
|
11397
11440
|
var e = t[Symbol.toPrimitive];
|
|
@@ -11404,14 +11447,14 @@ function toPrimitive(t, r) {
|
|
|
11404
11447
|
}
|
|
11405
11448
|
|
|
11406
11449
|
//#endregion
|
|
11407
|
-
//#region \0@oxc-project+runtime@0.
|
|
11450
|
+
//#region \0@oxc-project+runtime@0.149.0/helpers/esm/toPropertyKey.js
|
|
11408
11451
|
function toPropertyKey(t) {
|
|
11409
11452
|
var i = toPrimitive(t, "string");
|
|
11410
11453
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
11411
11454
|
}
|
|
11412
11455
|
|
|
11413
11456
|
//#endregion
|
|
11414
|
-
//#region \0@oxc-project+runtime@0.
|
|
11457
|
+
//#region \0@oxc-project+runtime@0.149.0/helpers/esm/defineProperty.js
|
|
11415
11458
|
function _defineProperty(e, r, t) {
|
|
11416
11459
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
11417
11460
|
value: t,
|
|
@@ -11606,9 +11649,7 @@ function setTheme(theme) {
|
|
|
11606
11649
|
case "light":
|
|
11607
11650
|
workspace.setTheme(light);
|
|
11608
11651
|
break;
|
|
11609
|
-
case "dark":
|
|
11610
|
-
workspace.setTheme(dark);
|
|
11611
|
-
break;
|
|
11652
|
+
case "dark": workspace.setTheme(dark);
|
|
11612
11653
|
}
|
|
11613
11654
|
}
|
|
11614
11655
|
|
|
@@ -11883,23 +11924,21 @@ var item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
11883
11924
|
const emit = __emit;
|
|
11884
11925
|
const mouseOver = ref(false);
|
|
11885
11926
|
const style = computed(() => {
|
|
11886
|
-
|
|
11927
|
+
return {
|
|
11887
11928
|
position: "relative",
|
|
11888
11929
|
background: mouseOver.value ? highlightColor.value : backgroundColor2.value,
|
|
11889
|
-
boxSizing: "border-box",
|
|
11890
11930
|
width: "100%",
|
|
11891
11931
|
height: "48px",
|
|
11892
|
-
marginTop: "1px",
|
|
11893
11932
|
userSelect: "none"
|
|
11894
11933
|
};
|
|
11895
|
-
|
|
11896
|
-
|
|
11897
|
-
|
|
11898
|
-
|
|
11899
|
-
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
11934
|
+
});
|
|
11935
|
+
const flagStyle = computed(() => {
|
|
11936
|
+
return {
|
|
11937
|
+
position: "absolute",
|
|
11938
|
+
background: primaryColor.value,
|
|
11939
|
+
width: "4px",
|
|
11940
|
+
height: "100%"
|
|
11941
|
+
};
|
|
11903
11942
|
});
|
|
11904
11943
|
return (_ctx, _cache) => {
|
|
11905
11944
|
const _component_v_spacer = resolveComponent("v-spacer");
|
|
@@ -11912,6 +11951,10 @@ var item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
11912
11951
|
onMouseout: _cache[2] || (_cache[2] = ($event) => mouseOver.value = false),
|
|
11913
11952
|
onMouseover: _cache[3] || (_cache[3] = ($event) => mouseOver.value = true)
|
|
11914
11953
|
}, [
|
|
11954
|
+
__props.select ? (openBlock(), createElementBlock("div", {
|
|
11955
|
+
key: 0,
|
|
11956
|
+
style: normalizeStyle(flagStyle.value)
|
|
11957
|
+
}, null, 4)) : createCommentVNode("v-if", true),
|
|
11915
11958
|
createElementVNode("div", _hoisted_1$4, [createElementVNode("span", _hoisted_2$1, toDisplayString(__props.title), 1), __props.desc ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(__props.desc), 1)) : createCommentVNode("v-if", true)]),
|
|
11916
11959
|
createVNode(_component_v_spacer),
|
|
11917
11960
|
createVNode(_component_v_icon, {
|
|
@@ -11951,8 +11994,15 @@ var index_vue_vue_type_script_setup_true_lang_default$5 = /*@__PURE__*/ defineCo
|
|
|
11951
11994
|
const { t } = useI18n();
|
|
11952
11995
|
const open = useModel(__props, "modelValue");
|
|
11953
11996
|
const context = injectContext();
|
|
11997
|
+
const style = computed(() => {
|
|
11998
|
+
return {
|
|
11999
|
+
display: "flex",
|
|
12000
|
+
flexDirection: "column",
|
|
12001
|
+
gap: "1px"
|
|
12002
|
+
};
|
|
12003
|
+
});
|
|
11954
12004
|
const blockList = ref([]);
|
|
11955
|
-
|
|
12005
|
+
function update() {
|
|
11956
12006
|
if (!context.workspace) {
|
|
11957
12007
|
console.assert(false);
|
|
11958
12008
|
return;
|
|
@@ -11987,10 +12037,10 @@ var index_vue_vue_type_script_setup_true_lang_default$5 = /*@__PURE__*/ defineCo
|
|
|
11987
12037
|
});
|
|
11988
12038
|
});
|
|
11989
12039
|
blockList.value = tmpBlockList;
|
|
11990
|
-
}
|
|
12040
|
+
}
|
|
11991
12041
|
__expose({ update });
|
|
11992
12042
|
let backupBlockIdList = [];
|
|
11993
|
-
|
|
12043
|
+
function onStart() {
|
|
11994
12044
|
if (__props.lock) {
|
|
11995
12045
|
messageWarning(t("x-block-lib.msg.cannotOperateInLockedState"));
|
|
11996
12046
|
return;
|
|
@@ -12000,11 +12050,11 @@ var index_vue_vue_type_script_setup_true_lang_default$5 = /*@__PURE__*/ defineCo
|
|
|
12000
12050
|
tmpBlockList.push(id);
|
|
12001
12051
|
});
|
|
12002
12052
|
backupBlockIdList = tmpBlockList;
|
|
12003
|
-
}
|
|
12004
|
-
|
|
12053
|
+
}
|
|
12054
|
+
function onMove() {
|
|
12005
12055
|
return !__props.lock;
|
|
12006
|
-
}
|
|
12007
|
-
|
|
12056
|
+
}
|
|
12057
|
+
function onEnd(e) {
|
|
12008
12058
|
if (!context.workspace) {
|
|
12009
12059
|
console.assert(false);
|
|
12010
12060
|
return;
|
|
@@ -12029,8 +12079,8 @@ var index_vue_vue_type_script_setup_true_lang_default$5 = /*@__PURE__*/ defineCo
|
|
|
12029
12079
|
draggedBlock.moveTo(new utils.Coordinate(pos.x, y));
|
|
12030
12080
|
context.workspace.cleanUp();
|
|
12031
12081
|
jumpFirstTopBlock();
|
|
12032
|
-
}
|
|
12033
|
-
|
|
12082
|
+
}
|
|
12083
|
+
async function onItemClick(id) {
|
|
12034
12084
|
if (!context.workspace) {
|
|
12035
12085
|
console.assert(false);
|
|
12036
12086
|
return;
|
|
@@ -12039,7 +12089,7 @@ var index_vue_vue_type_script_setup_true_lang_default$5 = /*@__PURE__*/ defineCo
|
|
|
12039
12089
|
common.setSelected(block);
|
|
12040
12090
|
jumpTopBlock(id);
|
|
12041
12091
|
open.value = false;
|
|
12042
|
-
}
|
|
12092
|
+
}
|
|
12043
12093
|
return (_ctx, _cache) => {
|
|
12044
12094
|
return blockList.value.length > 0 ? (openBlock(), createBlock(unref(lo), {
|
|
12045
12095
|
key: 0,
|
|
@@ -12048,6 +12098,7 @@ var index_vue_vue_type_script_setup_true_lang_default$5 = /*@__PURE__*/ defineCo
|
|
|
12048
12098
|
animation: 150,
|
|
12049
12099
|
"ghost-class": "ghost",
|
|
12050
12100
|
handle: ".x-handle",
|
|
12101
|
+
style: normalizeStyle(style.value),
|
|
12051
12102
|
onEnd,
|
|
12052
12103
|
onMove,
|
|
12053
12104
|
onStart
|
|
@@ -12068,7 +12119,7 @@ var index_vue_vue_type_script_setup_true_lang_default$5 = /*@__PURE__*/ defineCo
|
|
|
12068
12119
|
]);
|
|
12069
12120
|
}), 128))]),
|
|
12070
12121
|
_: 1
|
|
12071
|
-
}, 8, ["modelValue"])) : (openBlock(), createElementBlock("span", _hoisted_1$3, toDisplayString(unref(t)("x-block-lib.noOption")), 1));
|
|
12122
|
+
}, 8, ["modelValue", "style"])) : (openBlock(), createElementBlock("span", _hoisted_1$3, toDisplayString(unref(t)("x-block-lib.noOption")), 1));
|
|
12072
12123
|
};
|
|
12073
12124
|
}
|
|
12074
12125
|
});
|
|
@@ -12597,8 +12648,9 @@ function callFlowAvail() {
|
|
|
12597
12648
|
return getAllSpaceInfos$2("flow").length > 0;
|
|
12598
12649
|
}
|
|
12599
12650
|
function callback$2() {
|
|
12651
|
+
const { activeObject } = globalState.compute;
|
|
12600
12652
|
const root = [];
|
|
12601
|
-
if (
|
|
12653
|
+
if (activeObject.type === "flow") root.push(createBlock$1("on_flow_state_event_v1"));
|
|
12602
12654
|
if (callFlowAvail()) console.assert(true);
|
|
12603
12655
|
return root;
|
|
12604
12656
|
}
|
|
@@ -13237,18 +13289,18 @@ const compToolboxV1 = {
|
|
|
13237
13289
|
const flowToolboxV1 = {
|
|
13238
13290
|
kind: "categoryToolbox",
|
|
13239
13291
|
contents: [
|
|
13240
|
-
{
|
|
13241
|
-
kind: "category",
|
|
13242
|
-
name: "%{BKY_CATEGORY_FUNC}",
|
|
13243
|
-
categorystyle: "func_category",
|
|
13244
|
-
custom: computeFuncCategoryV1.name
|
|
13245
|
-
},
|
|
13246
13292
|
{
|
|
13247
13293
|
kind: "category",
|
|
13248
13294
|
name: "%{BKY_CATEGORY_FLOW}",
|
|
13249
13295
|
categorystyle: "flow_category",
|
|
13250
13296
|
custom: computeFlowCategoryV1.name
|
|
13251
13297
|
},
|
|
13298
|
+
{
|
|
13299
|
+
kind: "category",
|
|
13300
|
+
name: "%{BKY_CATEGORY_FUNC}",
|
|
13301
|
+
categorystyle: "func_category",
|
|
13302
|
+
custom: computeFuncCategoryV1.name
|
|
13303
|
+
},
|
|
13252
13304
|
{
|
|
13253
13305
|
kind: "category",
|
|
13254
13306
|
name: "%{BKY_CATEGORY_DATA}",
|
|
@@ -13534,13 +13586,13 @@ function regCustomCategory(workspace, type, version) {
|
|
|
13534
13586
|
function regButtonCallback(workspace) {
|
|
13535
13587
|
const { router } = globalObjects;
|
|
13536
13588
|
workspace.registerButtonCallback("NO_COMPUTE", () => {
|
|
13537
|
-
const target = router.resolve({ path:
|
|
13589
|
+
const target = router.resolve({ path: `/compute/${Date.now()}` });
|
|
13538
13590
|
setTimeout(() => {
|
|
13539
13591
|
window.open(target.href, "_blank");
|
|
13540
13592
|
}, 100);
|
|
13541
13593
|
});
|
|
13542
13594
|
workspace.registerButtonCallback("NO_TABLE", () => {
|
|
13543
|
-
const target = router.resolve({ path:
|
|
13595
|
+
const target = router.resolve({ path: `/data/${Date.now()}` });
|
|
13544
13596
|
setTimeout(() => {
|
|
13545
13597
|
window.open(target.href, "_blank");
|
|
13546
13598
|
}, 100);
|
|
@@ -13706,8 +13758,10 @@ var index_vue_vue_type_script_setup_true_lang_default$2 = /*@__PURE__*/ defineCo
|
|
|
13706
13758
|
scale.value = context.workspace.getScale();
|
|
13707
13759
|
return;
|
|
13708
13760
|
}
|
|
13709
|
-
if (event.type === Events.BLOCK_DRAG)
|
|
13710
|
-
|
|
13761
|
+
if (event.type === Events.BLOCK_DRAG) {
|
|
13762
|
+
if (event.isStart) dragging.value = true;
|
|
13763
|
+
else dragging.value = false;
|
|
13764
|
+
}
|
|
13711
13765
|
setTimeout(() => {
|
|
13712
13766
|
navigator.value?.update();
|
|
13713
13767
|
}, 0);
|
|
@@ -13973,8 +14027,8 @@ const install = (app) => {
|
|
|
13973
14027
|
//#endregion
|
|
13974
14028
|
//#region src/i18n/index.ts
|
|
13975
14029
|
async function loadLocaleMessageBlock(locale) {
|
|
13976
|
-
if (locale === "en") return (await import("./i18n-en.
|
|
13977
|
-
else if (locale === "zhHans") return (await import("./i18n-zhHans.
|
|
14030
|
+
if (locale === "en") return (await import("./i18n-en.c3uxu3r5.js").then((n) => n.t)).default;
|
|
14031
|
+
else if (locale === "zhHans") return (await import("./i18n-zhHans.hyv14btt.js").then((n) => n.t)).default;
|
|
13978
14032
|
else throw new Error(`invalid locale=${locale}`);
|
|
13979
14033
|
}
|
|
13980
14034
|
|