x-block-lib 0.11.10 → 0.11.12
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.
|
@@ -301,11 +301,11 @@ var en_default = {
|
|
|
301
301
|
CATEGORY_LOOP: "loop",
|
|
302
302
|
CATEGORY_MATH: "math",
|
|
303
303
|
CATEGORY_MESSAGE: "msg",
|
|
304
|
-
CATEGORY_MISC: "misc",
|
|
305
304
|
CATEGORY_OBJECT: "object",
|
|
306
305
|
CATEGORY_PAGE: "page",
|
|
307
306
|
CATEGORY_PROCEDURE: "proc",
|
|
308
307
|
CATEGORY_RESOURCE: "resource",
|
|
308
|
+
CATEGORY_SYSTEM: "system",
|
|
309
309
|
CATEGORY_TEXT: "text",
|
|
310
310
|
CATEGORY_TIME: "time",
|
|
311
311
|
CATEGORY_TYPE: "type",
|
package/dist/index.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ type __VLS_Props = {
|
|
|
71
71
|
declare function load(state: any): void;
|
|
72
72
|
declare function save(): any;
|
|
73
73
|
declare function appendBlock(state: any): void;
|
|
74
|
-
declare function generateCode(): string
|
|
74
|
+
declare function generateCode(): string;
|
|
75
75
|
declare function generateReactivity(): import("x-runtime-lib").Reactivity;
|
|
76
76
|
declare function fireStateChange(): void;
|
|
77
77
|
type __VLS_ModelProps = {
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
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
|
|
2
|
+
import { A as Names, B as constants, C as FieldCheckbox, D as FieldNumber, E as FieldLabel, F as Themes, G as icons, H as dialog, I as Variables, J as registry, K as inject$1, 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 getMainWorkspace, V as defineBlocksWithJsonArray, W as getSelected, X as setLocale$1, Y as serialization, 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 inputs, 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.lqnzhjrj.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";
|
|
6
|
+
import { Permission } from "x-permission-lib";
|
|
6
7
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, inject, isRef, mergeModels, mergeProps, nextTick, normalizeStyle, onBeforeUnmount, onMounted, onUnmounted, openBlock, provide, ref, renderList, renderSlot, resolveComponent, resolveDirective, toDisplayString, unref, useId, useModel, useTemplateRef, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
|
|
7
8
|
import { useI18n } from "vue-i18n";
|
|
8
9
|
import { useDisplay } from "vuetify";
|
|
9
10
|
|
|
10
11
|
//#region src/core/locale/index.ts
|
|
11
12
|
async function setLocale(locale) {
|
|
12
|
-
if (locale === "en") setLocale$1((await import("./en.
|
|
13
|
-
else if (locale === "zhHans") setLocale$1((await import("./zhHans.
|
|
13
|
+
if (locale === "en") setLocale$1((await import("./en.gpg8dd47.js")).default);
|
|
14
|
+
else if (locale === "zhHans") setLocale$1((await import("./zhHans.b6qujoys.js")).default);
|
|
14
15
|
else throw new Error(`invalid locale=${locale}`);
|
|
15
16
|
}
|
|
16
17
|
function localeMsg(key) {
|
|
@@ -595,8 +596,15 @@ function ensureParameterBlockV1s(scope, params) {
|
|
|
595
596
|
}
|
|
596
597
|
}
|
|
597
598
|
|
|
599
|
+
//#endregion
|
|
600
|
+
//#region src/core/utils/common/permisison.ts
|
|
601
|
+
const filtedPermissions = [Permission.unknown_permission, Permission.UNRECOGNIZED];
|
|
602
|
+
|
|
598
603
|
//#endregion
|
|
599
604
|
//#region src/core/utils/common/shadow.ts
|
|
605
|
+
function shadowOfJsonNullV1() {
|
|
606
|
+
return utils.xml.textToDom(`<shadow type="json_null_v1"></shadow>`);
|
|
607
|
+
}
|
|
600
608
|
function shadowOfTextV1(value) {
|
|
601
609
|
const text = `<shadow type="text_v1"><field name="TEXT">${value}</field></shadow>`;
|
|
602
610
|
return utils.xml.textToDom(text);
|
|
@@ -4225,145 +4233,6 @@ javascriptGenerator.forBlock["set_app_method_output_v1"] = function(blockBase) {
|
|
|
4225
4233
|
return `__outputs__[${javascriptGenerator.quote_(block.output.key)}] = ${value};\n`;
|
|
4226
4234
|
};
|
|
4227
4235
|
|
|
4228
|
-
//#endregion
|
|
4229
|
-
//#region src/core/blocks/app/misc/appEnvIs/v1/index.ts
|
|
4230
|
-
defineBlocksWithJsonArray([{
|
|
4231
|
-
type: "app_env_is_v1",
|
|
4232
|
-
message0: "%{BKY_APP_V1_APP_ENV_IS_TITLE}",
|
|
4233
|
-
args0: [{
|
|
4234
|
-
type: "field_dropdown",
|
|
4235
|
-
name: "ENV",
|
|
4236
|
-
options: [["%{BKY_APP_ENV_DEV}", "dev"], ["%{BKY_APP_ENV_PROD}", "prod"]]
|
|
4237
|
-
}],
|
|
4238
|
-
output: "Boolean",
|
|
4239
|
-
style: "logic_blocks",
|
|
4240
|
-
tooltip: "%{BKY_APP_V1_APP_ENV_IS_TOOLTIP}",
|
|
4241
|
-
helpUrl: "%{BKY_APP_V1_APP_ENV_IS_HELPURL}"
|
|
4242
|
-
}]);
|
|
4243
|
-
javascriptGenerator.forBlock["app_env_is_v1"] = function(block) {
|
|
4244
|
-
return [`__getEnvV1__() === ${javascriptGenerator.quote_(block.getFieldValue("ENV"))}`, Order.ATOMIC];
|
|
4245
|
-
};
|
|
4246
|
-
|
|
4247
|
-
//#endregion
|
|
4248
|
-
//#region src/core/blocks/app/misc/navigateTo/v1/index.ts
|
|
4249
|
-
const NAVIGATE_TO_V1 = {
|
|
4250
|
-
init: function() {
|
|
4251
|
-
this.app = {
|
|
4252
|
-
id: "",
|
|
4253
|
-
name: ""
|
|
4254
|
-
};
|
|
4255
|
-
this.page = {
|
|
4256
|
-
id: "",
|
|
4257
|
-
name: ""
|
|
4258
|
-
};
|
|
4259
|
-
this.appendDummyInput().appendField("%{BKY_APP_V1_NAVIGATE_TO_TITLE}").appendField(new FieldDropdown(() => this.genAppOpts_()), "APP").appendField(new FieldDropdown(() => this.genPageOpts_()), "PAGE");
|
|
4260
|
-
this.setPreviousStatement(true, null);
|
|
4261
|
-
this.setNextStatement(true, null);
|
|
4262
|
-
this.setStyle("procedure_blocks");
|
|
4263
|
-
this.setTooltip("%{BKY_APP_V1_NAVIGATE_TOOLTIP}");
|
|
4264
|
-
this.setHelpUrl("%{BKY_APP_V1_NAVIGATE_HELPURL}");
|
|
4265
|
-
this.initData_();
|
|
4266
|
-
},
|
|
4267
|
-
initData_: function() {
|
|
4268
|
-
if (this.app.id) return;
|
|
4269
|
-
const appInfo = getAllAppInfos()?.[0];
|
|
4270
|
-
if (!appInfo) return;
|
|
4271
|
-
this.app.id = appInfo.id;
|
|
4272
|
-
this.app.name = appInfo.name;
|
|
4273
|
-
const appDropdown = this.getField("APP");
|
|
4274
|
-
appDropdown.getOptions(false);
|
|
4275
|
-
appDropdown.setValue(this.app.id);
|
|
4276
|
-
const pageInfo = getAllPageInfos(this.app.id)?.[0];
|
|
4277
|
-
if (!pageInfo) return;
|
|
4278
|
-
this.page.id = pageInfo.id;
|
|
4279
|
-
this.page.name = pageInfo.name;
|
|
4280
|
-
const pageDropdown = this.getField("PAGE");
|
|
4281
|
-
pageDropdown.getOptions(false);
|
|
4282
|
-
pageDropdown.setValue(this.page.id);
|
|
4283
|
-
},
|
|
4284
|
-
saveExtraState: function() {
|
|
4285
|
-
return {
|
|
4286
|
-
app: this.app,
|
|
4287
|
-
page: this.page
|
|
4288
|
-
};
|
|
4289
|
-
},
|
|
4290
|
-
loadExtraState: function(state) {
|
|
4291
|
-
this.app.id = state.app?.id ?? "";
|
|
4292
|
-
this.app.name = state.app?.name ?? "";
|
|
4293
|
-
this.page.id = state.page?.id ?? "";
|
|
4294
|
-
this.page.name = state.page?.name ?? "";
|
|
4295
|
-
setTimeout(() => {
|
|
4296
|
-
this.checkWarning_();
|
|
4297
|
-
}, 0);
|
|
4298
|
-
},
|
|
4299
|
-
genAppOpts_: function() {
|
|
4300
|
-
return genAppOpts();
|
|
4301
|
-
},
|
|
4302
|
-
genPageOpts_: function() {
|
|
4303
|
-
return genPageOpts(this.app.id);
|
|
4304
|
-
},
|
|
4305
|
-
onchange: function(event) {
|
|
4306
|
-
if (event.type === Events.BLOCK_CHANGE) {
|
|
4307
|
-
const changeEvent = event;
|
|
4308
|
-
if (changeEvent.blockId === this.id) {
|
|
4309
|
-
if (changeEvent.element === "field") {
|
|
4310
|
-
if (changeEvent.name === "APP") this.onAppChange_(changeEvent.newValue);
|
|
4311
|
-
else if (changeEvent.name === "PAGE") this.onPageChange_(changeEvent.newValue);
|
|
4312
|
-
}
|
|
4313
|
-
setTimeout(() => {
|
|
4314
|
-
this.checkWarning_();
|
|
4315
|
-
}, 0);
|
|
4316
|
-
}
|
|
4317
|
-
}
|
|
4318
|
-
},
|
|
4319
|
-
onAppChange_: function(value) {
|
|
4320
|
-
const appInfo = getAppInfo(value);
|
|
4321
|
-
if (!appInfo) {
|
|
4322
|
-
console.assert(false);
|
|
4323
|
-
return;
|
|
4324
|
-
}
|
|
4325
|
-
const change = this.app.id !== appInfo.id;
|
|
4326
|
-
this.app.id = appInfo.id;
|
|
4327
|
-
this.app.name = appInfo.name;
|
|
4328
|
-
const pageDropdown = this.getField("PAGE");
|
|
4329
|
-
pageDropdown.getOptions(false);
|
|
4330
|
-
if (change) {
|
|
4331
|
-
const pageInfo = getAllPageInfos(this.app.id)?.[0];
|
|
4332
|
-
pageDropdown.setValue(pageInfo?.id ?? "");
|
|
4333
|
-
}
|
|
4334
|
-
this.onPageChange_(pageDropdown.getValue());
|
|
4335
|
-
},
|
|
4336
|
-
onPageChange_: function(value) {
|
|
4337
|
-
const pageInfo = getPageInfo(this.app.id, value);
|
|
4338
|
-
if (!pageInfo) {
|
|
4339
|
-
console.assert(false);
|
|
4340
|
-
return;
|
|
4341
|
-
}
|
|
4342
|
-
this.page.id = pageInfo.id;
|
|
4343
|
-
this.page.name = pageInfo.name;
|
|
4344
|
-
},
|
|
4345
|
-
checkWarning_: function() {
|
|
4346
|
-
const appInfo = getAppInfo(this.app.id);
|
|
4347
|
-
if (!appInfo) {
|
|
4348
|
-
this.setWarningText(localeMsg("WARN_APP_NOT_FOUND"));
|
|
4349
|
-
return;
|
|
4350
|
-
}
|
|
4351
|
-
if (appInfo.name !== this.app.name) this.app.name = appInfo.name;
|
|
4352
|
-
const pageInfo = getPageInfo(this.app.id, this.page.id);
|
|
4353
|
-
if (!pageInfo) {
|
|
4354
|
-
this.setWarningText(localeMsg("WARN_PAGE_NOT_FOUND"));
|
|
4355
|
-
return;
|
|
4356
|
-
}
|
|
4357
|
-
if (pageInfo.name !== this.page.name) this.page.name = pageInfo.name;
|
|
4358
|
-
this.setWarningText(null);
|
|
4359
|
-
}
|
|
4360
|
-
};
|
|
4361
|
-
Blocks.navigate_to_v1 = NAVIGATE_TO_V1;
|
|
4362
|
-
javascriptGenerator.forBlock["navigate_to_v1"] = function(blockBase) {
|
|
4363
|
-
const block = blockBase;
|
|
4364
|
-
return `__navigateToV1__(${javascriptGenerator.quote_(block.app.id)}, ${javascriptGenerator.quote_(block.page.id)});\n`;
|
|
4365
|
-
};
|
|
4366
|
-
|
|
4367
4236
|
//#endregion
|
|
4368
4237
|
//#region src/core/blocks/app/misc/selectComp/v1/index.ts
|
|
4369
4238
|
const SELECT_COMP_V1 = {
|
|
@@ -5040,6 +4909,145 @@ javascriptGenerator.forBlock["set_app_state_v1"] = function(blockBase) {
|
|
|
5040
4909
|
return `await __setStateV1__(${javascriptGenerator.quote_(block.state.id)}, ${value});\n`;
|
|
5041
4910
|
};
|
|
5042
4911
|
|
|
4912
|
+
//#endregion
|
|
4913
|
+
//#region src/core/blocks/app/system/appEnvIs/v1/index.ts
|
|
4914
|
+
defineBlocksWithJsonArray([{
|
|
4915
|
+
type: "app_env_is_v1",
|
|
4916
|
+
message0: "%{BKY_APP_V1_APP_ENV_IS_TITLE}",
|
|
4917
|
+
args0: [{
|
|
4918
|
+
type: "field_dropdown",
|
|
4919
|
+
name: "ENV",
|
|
4920
|
+
options: [["%{BKY_APP_ENV_DEV}", "dev"], ["%{BKY_APP_ENV_PROD}", "prod"]]
|
|
4921
|
+
}],
|
|
4922
|
+
output: "Boolean",
|
|
4923
|
+
style: "logic_blocks",
|
|
4924
|
+
tooltip: "%{BKY_APP_V1_APP_ENV_IS_TOOLTIP}",
|
|
4925
|
+
helpUrl: "%{BKY_APP_V1_APP_ENV_IS_HELPURL}"
|
|
4926
|
+
}]);
|
|
4927
|
+
javascriptGenerator.forBlock["app_env_is_v1"] = function(block) {
|
|
4928
|
+
return [`__getEnvV1__() === ${javascriptGenerator.quote_(block.getFieldValue("ENV"))}`, Order.ATOMIC];
|
|
4929
|
+
};
|
|
4930
|
+
|
|
4931
|
+
//#endregion
|
|
4932
|
+
//#region src/core/blocks/app/system/navigateTo/v1/index.ts
|
|
4933
|
+
const NAVIGATE_TO_V1 = {
|
|
4934
|
+
init: function() {
|
|
4935
|
+
this.app = {
|
|
4936
|
+
id: "",
|
|
4937
|
+
name: ""
|
|
4938
|
+
};
|
|
4939
|
+
this.page = {
|
|
4940
|
+
id: "",
|
|
4941
|
+
name: ""
|
|
4942
|
+
};
|
|
4943
|
+
this.appendDummyInput().appendField("%{BKY_APP_V1_NAVIGATE_TO_TITLE}").appendField(new FieldDropdown(() => this.genAppOpts_()), "APP").appendField(new FieldDropdown(() => this.genPageOpts_()), "PAGE");
|
|
4944
|
+
this.setPreviousStatement(true, null);
|
|
4945
|
+
this.setNextStatement(true, null);
|
|
4946
|
+
this.setStyle("procedure_blocks");
|
|
4947
|
+
this.setTooltip("%{BKY_APP_V1_NAVIGATE_TO_TOOLTIP}");
|
|
4948
|
+
this.setHelpUrl("%{BKY_APP_V1_NAVIGATE_TO_HELPURL}");
|
|
4949
|
+
this.initData_();
|
|
4950
|
+
},
|
|
4951
|
+
initData_: function() {
|
|
4952
|
+
if (this.app.id) return;
|
|
4953
|
+
const appInfo = getAllAppInfos()?.[0];
|
|
4954
|
+
if (!appInfo) return;
|
|
4955
|
+
this.app.id = appInfo.id;
|
|
4956
|
+
this.app.name = appInfo.name;
|
|
4957
|
+
const appDropdown = this.getField("APP");
|
|
4958
|
+
appDropdown.getOptions(false);
|
|
4959
|
+
appDropdown.setValue(this.app.id);
|
|
4960
|
+
const pageInfo = getAllPageInfos(this.app.id)?.[0];
|
|
4961
|
+
if (!pageInfo) return;
|
|
4962
|
+
this.page.id = pageInfo.id;
|
|
4963
|
+
this.page.name = pageInfo.name;
|
|
4964
|
+
const pageDropdown = this.getField("PAGE");
|
|
4965
|
+
pageDropdown.getOptions(false);
|
|
4966
|
+
pageDropdown.setValue(this.page.id);
|
|
4967
|
+
},
|
|
4968
|
+
saveExtraState: function() {
|
|
4969
|
+
return {
|
|
4970
|
+
app: this.app,
|
|
4971
|
+
page: this.page
|
|
4972
|
+
};
|
|
4973
|
+
},
|
|
4974
|
+
loadExtraState: function(state) {
|
|
4975
|
+
this.app.id = state.app?.id ?? "";
|
|
4976
|
+
this.app.name = state.app?.name ?? "";
|
|
4977
|
+
this.page.id = state.page?.id ?? "";
|
|
4978
|
+
this.page.name = state.page?.name ?? "";
|
|
4979
|
+
setTimeout(() => {
|
|
4980
|
+
this.checkWarning_();
|
|
4981
|
+
}, 0);
|
|
4982
|
+
},
|
|
4983
|
+
genAppOpts_: function() {
|
|
4984
|
+
return genAppOpts();
|
|
4985
|
+
},
|
|
4986
|
+
genPageOpts_: function() {
|
|
4987
|
+
return genPageOpts(this.app.id);
|
|
4988
|
+
},
|
|
4989
|
+
onchange: function(event) {
|
|
4990
|
+
if (event.type === Events.BLOCK_CHANGE) {
|
|
4991
|
+
const changeEvent = event;
|
|
4992
|
+
if (changeEvent.blockId === this.id) {
|
|
4993
|
+
if (changeEvent.element === "field") {
|
|
4994
|
+
if (changeEvent.name === "APP") this.onAppChange_(changeEvent.newValue);
|
|
4995
|
+
else if (changeEvent.name === "PAGE") this.onPageChange_(changeEvent.newValue);
|
|
4996
|
+
}
|
|
4997
|
+
setTimeout(() => {
|
|
4998
|
+
this.checkWarning_();
|
|
4999
|
+
}, 0);
|
|
5000
|
+
}
|
|
5001
|
+
}
|
|
5002
|
+
},
|
|
5003
|
+
onAppChange_: function(value) {
|
|
5004
|
+
const appInfo = getAppInfo(value);
|
|
5005
|
+
if (!appInfo) {
|
|
5006
|
+
console.assert(false);
|
|
5007
|
+
return;
|
|
5008
|
+
}
|
|
5009
|
+
const change = this.app.id !== appInfo.id;
|
|
5010
|
+
this.app.id = appInfo.id;
|
|
5011
|
+
this.app.name = appInfo.name;
|
|
5012
|
+
const pageDropdown = this.getField("PAGE");
|
|
5013
|
+
pageDropdown.getOptions(false);
|
|
5014
|
+
if (change) {
|
|
5015
|
+
const pageInfo = getAllPageInfos(this.app.id)?.[0];
|
|
5016
|
+
pageDropdown.setValue(pageInfo?.id ?? "");
|
|
5017
|
+
}
|
|
5018
|
+
this.onPageChange_(pageDropdown.getValue());
|
|
5019
|
+
},
|
|
5020
|
+
onPageChange_: function(value) {
|
|
5021
|
+
const pageInfo = getPageInfo(this.app.id, value);
|
|
5022
|
+
if (!pageInfo) {
|
|
5023
|
+
console.assert(false);
|
|
5024
|
+
return;
|
|
5025
|
+
}
|
|
5026
|
+
this.page.id = pageInfo.id;
|
|
5027
|
+
this.page.name = pageInfo.name;
|
|
5028
|
+
},
|
|
5029
|
+
checkWarning_: function() {
|
|
5030
|
+
const appInfo = getAppInfo(this.app.id);
|
|
5031
|
+
if (!appInfo) {
|
|
5032
|
+
this.setWarningText(localeMsg("WARN_APP_NOT_FOUND"));
|
|
5033
|
+
return;
|
|
5034
|
+
}
|
|
5035
|
+
if (appInfo.name !== this.app.name) this.app.name = appInfo.name;
|
|
5036
|
+
const pageInfo = getPageInfo(this.app.id, this.page.id);
|
|
5037
|
+
if (!pageInfo) {
|
|
5038
|
+
this.setWarningText(localeMsg("WARN_PAGE_NOT_FOUND"));
|
|
5039
|
+
return;
|
|
5040
|
+
}
|
|
5041
|
+
if (pageInfo.name !== this.page.name) this.page.name = pageInfo.name;
|
|
5042
|
+
this.setWarningText(null);
|
|
5043
|
+
}
|
|
5044
|
+
};
|
|
5045
|
+
Blocks.navigate_to_v1 = NAVIGATE_TO_V1;
|
|
5046
|
+
javascriptGenerator.forBlock["navigate_to_v1"] = function(blockBase) {
|
|
5047
|
+
const block = blockBase;
|
|
5048
|
+
return `__navigateToV1__(${javascriptGenerator.quote_(block.app.id)}, ${javascriptGenerator.quote_(block.page.id)});\n`;
|
|
5049
|
+
};
|
|
5050
|
+
|
|
5043
5051
|
//#endregion
|
|
5044
5052
|
//#region src/core/blocks/color/colorBlend/v1/index.ts
|
|
5045
5053
|
defineBlocksWithJsonArray([{
|
|
@@ -5189,6 +5197,14 @@ javascriptGenerator.forBlock["custom_flow_trigger_v1"] = function() {
|
|
|
5189
5197
|
return ``;
|
|
5190
5198
|
};
|
|
5191
5199
|
|
|
5200
|
+
//#endregion
|
|
5201
|
+
//#region src/core/blocks/compute/flow/hasRoleFlow/v1/index.ts
|
|
5202
|
+
const HAS_ROLE_FLOW_V1 = { init: function() {} };
|
|
5203
|
+
Blocks.has_role_flow_v1 = HAS_ROLE_FLOW_V1;
|
|
5204
|
+
javascriptGenerator.forBlock["has_role_flow_v1"] = function() {
|
|
5205
|
+
return ``;
|
|
5206
|
+
};
|
|
5207
|
+
|
|
5192
5208
|
//#endregion
|
|
5193
5209
|
//#region src/core/blocks/compute/flow/invokeFlowTrigger/v1/index.ts
|
|
5194
5210
|
const INVOKE_FLOW_TRIGGER_V1 = { init: function() {} };
|
|
@@ -5802,6 +5818,14 @@ javascriptGenerator.forBlock["func_entry_v1"] = function(blockBase) {
|
|
|
5802
5818
|
${handle}}`;
|
|
5803
5819
|
};
|
|
5804
5820
|
|
|
5821
|
+
//#endregion
|
|
5822
|
+
//#region src/core/blocks/compute/func/hasRoleFunc/v1/index.ts
|
|
5823
|
+
const HAS_ROLE_FUNC_V1 = { init: function() {} };
|
|
5824
|
+
Blocks.has_role_func_v1 = HAS_ROLE_FUNC_V1;
|
|
5825
|
+
javascriptGenerator.forBlock["has_role_func_v1"] = function() {
|
|
5826
|
+
return ``;
|
|
5827
|
+
};
|
|
5828
|
+
|
|
5805
5829
|
//#endregion
|
|
5806
5830
|
//#region src/core/blocks/compute/func/setFuncOutput/v1/index.ts
|
|
5807
5831
|
const SET_FUNC_OUTPUT_V1 = {
|
|
@@ -5924,7 +5948,7 @@ javascriptGenerator.forBlock["set_func_output_v1"] = function(blockBase) {
|
|
|
5924
5948
|
};
|
|
5925
5949
|
|
|
5926
5950
|
//#endregion
|
|
5927
|
-
//#region src/core/blocks/compute/
|
|
5951
|
+
//#region src/core/blocks/compute/system/computeDebugTrace/v1/index.ts
|
|
5928
5952
|
defineBlocksWithJsonArray([{
|
|
5929
5953
|
type: "compute_debug_trace_v1",
|
|
5930
5954
|
message0: "%{BKY_COMPUTE_V1_COMPUTE_DEBUG_TRACE_TITLE}",
|
|
@@ -5944,7 +5968,7 @@ javascriptGenerator.forBlock["compute_debug_trace_v1"] = function(block) {
|
|
|
5944
5968
|
};
|
|
5945
5969
|
|
|
5946
5970
|
//#endregion
|
|
5947
|
-
//#region src/core/blocks/compute/
|
|
5971
|
+
//#region src/core/blocks/compute/system/computeEnvIs/v1/index.ts
|
|
5948
5972
|
defineBlocksWithJsonArray([{
|
|
5949
5973
|
type: "compute_env_is_v1",
|
|
5950
5974
|
message0: "%{BKY_COMPUTE_V1_COMPUTE_ENV_IS_TITLE}",
|
|
@@ -7892,7 +7916,7 @@ const JSON_ARRAY_V1 = {
|
|
|
7892
7916
|
this.appendDummyInput("CLOSE_BRACKET").appendField(" ] ");
|
|
7893
7917
|
this.setInputsInline(false);
|
|
7894
7918
|
this.setOutput(true, "JsonArray");
|
|
7895
|
-
this.
|
|
7919
|
+
this.setStyle("list_blocks");
|
|
7896
7920
|
this.setTooltip("");
|
|
7897
7921
|
this.setHelpUrl("");
|
|
7898
7922
|
},
|
|
@@ -7913,6 +7937,7 @@ const JSON_ARRAY_V1 = {
|
|
|
7913
7937
|
for (let i = 0; i < this.length; i++) {
|
|
7914
7938
|
const name = "ENTRY" + i;
|
|
7915
7939
|
const input = this.appendValueInput(name);
|
|
7940
|
+
input.setShadowDom(shadowOfJsonNullV1());
|
|
7916
7941
|
input.appendField(new FieldImage(plusImage, 20, 20, void 0, () => {
|
|
7917
7942
|
if (this.isInFlyout) return;
|
|
7918
7943
|
this.addEntry_(input);
|
|
@@ -7934,6 +7959,7 @@ const JSON_ARRAY_V1 = {
|
|
|
7934
7959
|
input.fieldRow[1].setValue(i + 1);
|
|
7935
7960
|
}
|
|
7936
7961
|
const input = this.appendValueInput("ENTRY" + idx);
|
|
7962
|
+
input.setShadowDom(shadowOfJsonNullV1());
|
|
7937
7963
|
input.appendField(new FieldImage(plusImage, 20, 20, void 0, () => {
|
|
7938
7964
|
if (this.isInFlyout) return;
|
|
7939
7965
|
this.addEntry_(input);
|
|
@@ -7968,7 +7994,7 @@ Blocks.json_array_v1 = JSON_ARRAY_V1;
|
|
|
7968
7994
|
const JSON_BOOLEAN_V1 = { init: function() {
|
|
7969
7995
|
this.appendDummyInput().appendField(new FieldDropdown([["false", "false"], ["true", "true"]]), "VALUE");
|
|
7970
7996
|
this.setOutput(true, "JsonBoolean");
|
|
7971
|
-
this.
|
|
7997
|
+
this.setStyle("logic_blocks");
|
|
7972
7998
|
} };
|
|
7973
7999
|
Blocks.json_boolean_v1 = JSON_BOOLEAN_V1;
|
|
7974
8000
|
|
|
@@ -7986,7 +8012,7 @@ const JSON_MAP_V1 = {
|
|
|
7986
8012
|
this.appendDummyInput("CLOSE_BRACHET").appendField(" } ");
|
|
7987
8013
|
this.setInputsInline(false);
|
|
7988
8014
|
this.setOutput(true, "JsonMap");
|
|
7989
|
-
this.
|
|
8015
|
+
this.setStyle("object_blocks");
|
|
7990
8016
|
this.setTooltip("");
|
|
7991
8017
|
this.setHelpUrl("");
|
|
7992
8018
|
},
|
|
@@ -8017,6 +8043,7 @@ const JSON_MAP_V1 = {
|
|
|
8017
8043
|
const key = keys[i];
|
|
8018
8044
|
const name = "ENTRY" + i;
|
|
8019
8045
|
const input = this.appendValueInput(name);
|
|
8046
|
+
input.setShadowDom(shadowOfJsonNullV1());
|
|
8020
8047
|
input.appendField(new FieldImage(plusImage, 20, 20, void 0, () => {
|
|
8021
8048
|
if (this.isInFlyout) return;
|
|
8022
8049
|
this.addEntry_(input);
|
|
@@ -8037,6 +8064,7 @@ const JSON_MAP_V1 = {
|
|
|
8037
8064
|
this.getInput("ENTRY" + i).name = "ENTRY" + (i + 1);
|
|
8038
8065
|
}
|
|
8039
8066
|
const input = this.appendValueInput("ENTRY" + idx);
|
|
8067
|
+
input.setShadowDom(shadowOfJsonNullV1());
|
|
8040
8068
|
input.appendField(new FieldImage(plusImage, 20, 20, void 0, () => {
|
|
8041
8069
|
if (this.isInFlyout) return;
|
|
8042
8070
|
this.addEntry_(input);
|
|
@@ -8065,12 +8093,20 @@ const JSON_MAP_V1 = {
|
|
|
8065
8093
|
};
|
|
8066
8094
|
Blocks.json_map_v1 = JSON_MAP_V1;
|
|
8067
8095
|
|
|
8096
|
+
//#endregion
|
|
8097
|
+
//#region src/core/blocks/json/jsonNull/v1/index.ts
|
|
8098
|
+
const JSON_NULL_V1 = { init: function() {
|
|
8099
|
+
this.appendDummyInput().appendField("null");
|
|
8100
|
+
this.setOutput(true, "JsonNull");
|
|
8101
|
+
} };
|
|
8102
|
+
Blocks.json_null_v1 = JSON_NULL_V1;
|
|
8103
|
+
|
|
8068
8104
|
//#endregion
|
|
8069
8105
|
//#region src/core/blocks/json/jsonNumber/v1/index.ts
|
|
8070
8106
|
const JSON_NUMBER_V1 = { init: function() {
|
|
8071
8107
|
this.appendDummyInput().appendField(new FieldNumber(0), "VALUE");
|
|
8072
8108
|
this.setOutput(true, "JsonNumber");
|
|
8073
|
-
this.
|
|
8109
|
+
this.setStyle("math_blocks");
|
|
8074
8110
|
} };
|
|
8075
8111
|
Blocks.json_number_v1 = JSON_NUMBER_V1;
|
|
8076
8112
|
|
|
@@ -8078,9 +8114,13 @@ Blocks.json_number_v1 = JSON_NUMBER_V1;
|
|
|
8078
8114
|
//#region src/core/blocks/json/jsonRoot/v1/index.ts
|
|
8079
8115
|
const JSON_ROOT_V1 = { init: function() {
|
|
8080
8116
|
this.appendDummyInput().setAlign(inputs.Align.CENTRE).appendField("JSON");
|
|
8081
|
-
this.appendValueInput("JSON").setCheck([
|
|
8117
|
+
this.appendValueInput("JSON").setCheck([
|
|
8118
|
+
"JsonMap",
|
|
8119
|
+
"JsonArray",
|
|
8120
|
+
"JsonNull"
|
|
8121
|
+
]).setShadowDom(shadowOfJsonNullV1());
|
|
8082
8122
|
this.setDeletable(false);
|
|
8083
|
-
this.
|
|
8123
|
+
this.setStyle("variable_blocks");
|
|
8084
8124
|
this.setTooltip("");
|
|
8085
8125
|
this.setHelpUrl("");
|
|
8086
8126
|
} };
|
|
@@ -8091,7 +8131,7 @@ Blocks.json_root_v1 = JSON_ROOT_V1;
|
|
|
8091
8131
|
const JSON_STRING_V1 = { init: function() {
|
|
8092
8132
|
this.appendDummyInput().appendField("\"").appendField(new FieldTextInput(""), "VALUE").appendField("\"");
|
|
8093
8133
|
this.setOutput(true, "JsonString");
|
|
8094
|
-
this.
|
|
8134
|
+
this.setStyle("text_blocks");
|
|
8095
8135
|
} };
|
|
8096
8136
|
Blocks.json_string_v1 = JSON_STRING_V1;
|
|
8097
8137
|
|
|
@@ -11924,11 +11964,23 @@ var clean_default = index_vue_vue_type_script_setup_true_lang_default$7;
|
|
|
11924
11964
|
|
|
11925
11965
|
//#endregion
|
|
11926
11966
|
//#region src/components/blockly/jsonHelper.ts
|
|
11967
|
+
function getMeta(root, keys) {
|
|
11968
|
+
let target = root;
|
|
11969
|
+
for (const key of [...keys, "__meta__"]) {
|
|
11970
|
+
if (!target || !target[key]) return;
|
|
11971
|
+
target = target[key];
|
|
11972
|
+
}
|
|
11973
|
+
return target;
|
|
11974
|
+
}
|
|
11975
|
+
function applyMeta(block, meta) {
|
|
11976
|
+
if (!meta) return;
|
|
11977
|
+
if (meta["comment"]) block.setCommentText(meta["comment"]);
|
|
11978
|
+
if (meta["inline"]) block.setInputsInline(true);
|
|
11979
|
+
if (meta["collapsed"]) block.setCollapsed(true);
|
|
11980
|
+
if (meta["disabled"]) block.setDisabledReason(true, constants.MANUALLY_DISABLED);
|
|
11981
|
+
}
|
|
11927
11982
|
function loadFromJson(json, workspace) {
|
|
11928
|
-
const
|
|
11929
|
-
root.initSvg();
|
|
11930
|
-
root.render();
|
|
11931
|
-
const execNode = (node, parent) => {
|
|
11983
|
+
const execNode = (node, keys, parent) => {
|
|
11932
11984
|
if (node === null) return;
|
|
11933
11985
|
let type;
|
|
11934
11986
|
if (node instanceof Array) type = "json_array_v1";
|
|
@@ -11944,47 +11996,91 @@ function loadFromJson(json, workspace) {
|
|
|
11944
11996
|
target.initSvg();
|
|
11945
11997
|
target.render();
|
|
11946
11998
|
parent.connect(target.outputConnection);
|
|
11999
|
+
const m = getMeta(meta, keys);
|
|
12000
|
+
if (m) applyMeta(target, m);
|
|
11947
12001
|
if (type === "json_map_v1") {
|
|
11948
|
-
const
|
|
11949
|
-
|
|
11950
|
-
|
|
11951
|
-
|
|
11952
|
-
const key = keys[i];
|
|
12002
|
+
const fieldKeys = Object.keys(node);
|
|
12003
|
+
target.initData(fieldKeys);
|
|
12004
|
+
for (let i = 0; i < fieldKeys.length; i++) {
|
|
12005
|
+
const fieldKey = fieldKeys[i];
|
|
11953
12006
|
const input = target.getInput("ENTRY" + i);
|
|
11954
|
-
execNode(node[
|
|
12007
|
+
execNode(node[fieldKey], [...keys, fieldKey], input.connection);
|
|
11955
12008
|
}
|
|
11956
12009
|
} else if (type === "json_array_v1") {
|
|
11957
12010
|
target.initData(node.length);
|
|
11958
|
-
for (let i = 0; i < node.length; i++) execNode(node[i], target.getInput("ENTRY" + i).connection);
|
|
12011
|
+
for (let i = 0; i < node.length; i++) execNode(node[i], [...keys, i], target.getInput("ENTRY" + i).connection);
|
|
11959
12012
|
} else if (type === "json_string_v1") target.setFieldValue(node, "VALUE");
|
|
11960
12013
|
else if (type === "json_number_v1") target.setFieldValue(node, "VALUE");
|
|
11961
12014
|
else if (type === "json_boolean_v1") target.setFieldValue(node ? "true" : "false", "VALUE");
|
|
11962
12015
|
};
|
|
11963
|
-
|
|
12016
|
+
let data;
|
|
12017
|
+
let meta;
|
|
12018
|
+
if (json.__data__ || json.__meta__) {
|
|
12019
|
+
data = json.__data__;
|
|
12020
|
+
meta = json.__meta__;
|
|
12021
|
+
} else data = json;
|
|
12022
|
+
const root = workspace.newBlock("json_root_v1");
|
|
12023
|
+
root.initSvg();
|
|
12024
|
+
root.render();
|
|
12025
|
+
const m = getMeta(meta, []);
|
|
12026
|
+
if (m) applyMeta(root, m);
|
|
12027
|
+
execNode(data, ["data"], root.getInput("JSON").connection);
|
|
11964
12028
|
Events.fire(new (Events.get(Events.FINISHED_LOADING))(workspace));
|
|
11965
12029
|
}
|
|
12030
|
+
function toMeta(block) {
|
|
12031
|
+
const meta = {};
|
|
12032
|
+
const comment = block.getCommentText();
|
|
12033
|
+
if (comment) meta["comment"] = comment;
|
|
12034
|
+
if (block.getInputsInline()) meta["inline"] = true;
|
|
12035
|
+
if (block.isCollapsed()) meta["collapsed"] = true;
|
|
12036
|
+
if (!block.isEnabled()) meta["disabled"] = true;
|
|
12037
|
+
block.isEnabled();
|
|
12038
|
+
if (Object.keys(meta).length > 0) return meta;
|
|
12039
|
+
else return null;
|
|
12040
|
+
}
|
|
12041
|
+
function mergeMeta(root, keys, meta) {
|
|
12042
|
+
let target = root;
|
|
12043
|
+
for (const key of [...keys, "__meta__"]) {
|
|
12044
|
+
if (!target[key]) target[key] = {};
|
|
12045
|
+
target = target[key];
|
|
12046
|
+
}
|
|
12047
|
+
if (meta["comment"]) target["comment"] = meta["comment"];
|
|
12048
|
+
if (meta["inline"]) target["inline"] = true;
|
|
12049
|
+
if (meta["collapsed"]) target["collapsed"] = true;
|
|
12050
|
+
if (meta["disabled"]) target["disabled"] = true;
|
|
12051
|
+
}
|
|
11966
12052
|
function saveToJson(workspace) {
|
|
11967
|
-
const
|
|
12053
|
+
const meta = {};
|
|
12054
|
+
const execNode = (block, keys) => {
|
|
11968
12055
|
if (!block) return null;
|
|
11969
|
-
|
|
12056
|
+
const m = toMeta(block);
|
|
12057
|
+
if (m) mergeMeta(meta, keys, m);
|
|
12058
|
+
if (block.type === "json_root_v1") return execNode(block.getInputTargetBlock("JSON"), ["data"]);
|
|
11970
12059
|
else if (block.type === "json_map_v1") {
|
|
11971
12060
|
const values = {};
|
|
11972
12061
|
for (let i = 0; i < block.length; i++) {
|
|
11973
12062
|
const key = block.getFieldValue("KEY" + i);
|
|
11974
|
-
values[key] = execNode(block.getInputTargetBlock("ENTRY" + i));
|
|
12063
|
+
values[key] = execNode(block.getInputTargetBlock("ENTRY" + i), [...keys, key]);
|
|
11975
12064
|
}
|
|
11976
12065
|
return values;
|
|
11977
12066
|
} else if (block.type === "json_array_v1") {
|
|
11978
12067
|
const values = [];
|
|
11979
|
-
for (let i = 0; i < block.length; i++) values.push(execNode(block.getInputTargetBlock("ENTRY" + i)));
|
|
12068
|
+
for (let i = 0; i < block.length; i++) values.push(execNode(block.getInputTargetBlock("ENTRY" + i), [...keys, i]));
|
|
11980
12069
|
return values;
|
|
11981
12070
|
} else if (block.type === "json_string_v1") return block.getFieldValue("VALUE");
|
|
11982
12071
|
else if (block.type === "json_number_v1") return block.getFieldValue("VALUE");
|
|
11983
12072
|
else if (block.type === "json_boolean_v1") return block.getFieldValue("VALUE") === "true";
|
|
11984
|
-
else
|
|
12073
|
+
else return null;
|
|
11985
12074
|
};
|
|
11986
12075
|
const blocks = workspace.getTopBlocks();
|
|
11987
|
-
for (const block of blocks) if (block.type === "json_root_v1")
|
|
12076
|
+
for (const block of blocks) if (block.type === "json_root_v1") {
|
|
12077
|
+
const data = execNode(block, []);
|
|
12078
|
+
if (Object.keys(meta).length > 0) return {
|
|
12079
|
+
__data__: data,
|
|
12080
|
+
__meta__: meta
|
|
12081
|
+
};
|
|
12082
|
+
else return data;
|
|
12083
|
+
}
|
|
11988
12084
|
}
|
|
11989
12085
|
|
|
11990
12086
|
//#endregion
|
|
@@ -12032,7 +12128,7 @@ var lock_default = index_vue_vue_type_script_setup_true_lang_default$6;
|
|
|
12032
12128
|
//#endregion
|
|
12033
12129
|
//#region src/components/blockly/navigator/blockList/item.vue?vue&type=script&setup=true&lang.ts
|
|
12034
12130
|
const _hoisted_1$4 = { class: "d-flex flex-column" };
|
|
12035
|
-
const _hoisted_2
|
|
12131
|
+
const _hoisted_2 = { class: "text-body-large ml-6" };
|
|
12036
12132
|
const _hoisted_3 = {
|
|
12037
12133
|
key: 0,
|
|
12038
12134
|
class: "text-body-small text-grey text-truncate ml-6",
|
|
@@ -12095,7 +12191,7 @@ var item_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
12095
12191
|
key: 0,
|
|
12096
12192
|
style: normalizeStyle(flagStyle.value)
|
|
12097
12193
|
}, null, 4)) : createCommentVNode("v-if", true),
|
|
12098
|
-
createElementVNode("div", _hoisted_1$4, [createElementVNode("span", _hoisted_2
|
|
12194
|
+
createElementVNode("div", _hoisted_1$4, [createElementVNode("span", _hoisted_2, toDisplayString(__props.title), 1), __props.desc ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(__props.desc), 1)) : createCommentVNode("v-if", true)]),
|
|
12099
12195
|
createVNode(_component_v_spacer),
|
|
12100
12196
|
createVNode(_component_v_icon, {
|
|
12101
12197
|
class: "x-handle cursor-move mr-3",
|
|
@@ -12291,24 +12387,23 @@ var index_vue_vue_type_script_setup_true_lang_default$4 = /*@__PURE__*/ defineCo
|
|
|
12291
12387
|
setup(__props, { expose: __expose }) {
|
|
12292
12388
|
const open = useModel(__props, "modelValue");
|
|
12293
12389
|
const context = injectContext();
|
|
12294
|
-
|
|
12390
|
+
function update() {
|
|
12295
12391
|
if (!context.workspace) {
|
|
12296
12392
|
console.assert(false);
|
|
12297
12393
|
return;
|
|
12298
12394
|
}
|
|
12299
|
-
}
|
|
12395
|
+
}
|
|
12300
12396
|
__expose({ update });
|
|
12301
|
-
|
|
12302
|
-
|
|
12303
|
-
if (!workspace) {
|
|
12397
|
+
function onItemClick(id) {
|
|
12398
|
+
if (!context.workspace) {
|
|
12304
12399
|
console.assert(false);
|
|
12305
12400
|
return;
|
|
12306
12401
|
}
|
|
12307
|
-
const block = workspace.getBlockById(id);
|
|
12402
|
+
const block = context.workspace.getBlockById(id);
|
|
12308
12403
|
common.setSelected(block);
|
|
12309
12404
|
jumpTopBlock(id);
|
|
12310
12405
|
open.value = false;
|
|
12311
|
-
}
|
|
12406
|
+
}
|
|
12312
12407
|
return (_ctx, _cache) => {
|
|
12313
12408
|
return openBlock(), createElementBlock("div", { onClick: _cache[0] || (_cache[0] = ($event) => onItemClick("")) }, "blockTree");
|
|
12314
12409
|
};
|
|
@@ -12337,7 +12432,7 @@ var index_vue_vue_type_script_setup_true_lang_default$3 = /*@__PURE__*/ defineCo
|
|
|
12337
12432
|
setup(__props, { expose: __expose }) {
|
|
12338
12433
|
const { t } = useI18n();
|
|
12339
12434
|
const display = useDisplay();
|
|
12340
|
-
const {
|
|
12435
|
+
const { safeAreaInset } = useSystem();
|
|
12341
12436
|
const { backgroundColor1 } = useColor();
|
|
12342
12437
|
const disabled = computed(() => {
|
|
12343
12438
|
return display.smAndDown.value;
|
|
@@ -12352,16 +12447,12 @@ var index_vue_vue_type_script_setup_true_lang_default$3 = /*@__PURE__*/ defineCo
|
|
|
12352
12447
|
};
|
|
12353
12448
|
});
|
|
12354
12449
|
const contStyle = computed(() => {
|
|
12355
|
-
let h = 48;
|
|
12356
|
-
if (sysBarAvail.value) h += 24;
|
|
12357
12450
|
return {
|
|
12358
12451
|
position: "relative",
|
|
12359
|
-
height: `calc(100% - ${
|
|
12452
|
+
height: `calc(100% - ${safeAreaInset.top + 48 + safeAreaInset.bottom}px)`,
|
|
12453
|
+
paddingBottom: "60px"
|
|
12360
12454
|
};
|
|
12361
12455
|
});
|
|
12362
|
-
const tailStyle = computed(() => {
|
|
12363
|
-
return { height: "60px" };
|
|
12364
|
-
});
|
|
12365
12456
|
const { open } = useViewStack(`blocklyNavigatorDlg${useId()}`);
|
|
12366
12457
|
onUnmounted(() => {
|
|
12367
12458
|
open.value = false;
|
|
@@ -12400,11 +12491,11 @@ var index_vue_vue_type_script_setup_true_lang_default$3 = /*@__PURE__*/ defineCo
|
|
|
12400
12491
|
class: "elevation-2",
|
|
12401
12492
|
style: normalizeStyle(wrapStyle.value)
|
|
12402
12493
|
}, [
|
|
12403
|
-
unref(
|
|
12494
|
+
unref(safeAreaInset).top ? (openBlock(), createBlock(_component_v_sheet, {
|
|
12404
12495
|
key: 0,
|
|
12405
12496
|
color: "transparent",
|
|
12406
|
-
height:
|
|
12407
|
-
})) : createCommentVNode("v-if", true),
|
|
12497
|
+
height: unref(safeAreaInset).top
|
|
12498
|
+
}, null, 8, ["height"])) : createCommentVNode("v-if", true),
|
|
12408
12499
|
createVNode(_component_v_sheet, {
|
|
12409
12500
|
class: "d-flex align-center px-2",
|
|
12410
12501
|
color: "transparent",
|
|
@@ -12438,7 +12529,7 @@ var index_vue_vue_type_script_setup_true_lang_default$3 = /*@__PURE__*/ defineCo
|
|
|
12438
12529
|
ref: blockTree,
|
|
12439
12530
|
modelValue: unref(open),
|
|
12440
12531
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(open) ? open.value = $event : null)
|
|
12441
|
-
}, null, 8, ["modelValue"])) : createCommentVNode("v-if", true)
|
|
12532
|
+
}, null, 8, ["modelValue"])) : createCommentVNode("v-if", true)], 4)
|
|
12442
12533
|
], 4)], 32)]),
|
|
12443
12534
|
_: 1
|
|
12444
12535
|
}, 8, ["modelValue"]), createVNode(_component_v_tooltip, {
|
|
@@ -12581,7 +12672,6 @@ const appComputeCategoryV1 = {
|
|
|
12581
12672
|
//#region src/core/category/app/message/v1/index.ts
|
|
12582
12673
|
function callback$9() {
|
|
12583
12674
|
const root = [];
|
|
12584
|
-
root.push(createBlock$1("app_debug_trace_v1", [createShadowOfTextV1("OBJECT")]));
|
|
12585
12675
|
root.push(createBlock$1("popup_message_v1", [createShadowOfTextV1("TEXT")]));
|
|
12586
12676
|
root.push(createBlock$1("open_confirm_dlg_v1"));
|
|
12587
12677
|
root.push(createBlock$1("open_prompt_dlg_v1"));
|
|
@@ -12592,23 +12682,6 @@ const appMessageCategoryV1 = {
|
|
|
12592
12682
|
callback: callback$9
|
|
12593
12683
|
};
|
|
12594
12684
|
|
|
12595
|
-
//#endregion
|
|
12596
|
-
//#region src/core/category/app/misc/v1/index.ts
|
|
12597
|
-
function pageAvail() {
|
|
12598
|
-
for (const app of globalState.app.appList) if (app.pages.length > 0) return true;
|
|
12599
|
-
return false;
|
|
12600
|
-
}
|
|
12601
|
-
function callback$8() {
|
|
12602
|
-
const root = [];
|
|
12603
|
-
root.push(createBlock$1("app_env_is_v1"));
|
|
12604
|
-
if (pageAvail()) root.push(createBlock$1("navigate_to_v1"));
|
|
12605
|
-
return root;
|
|
12606
|
-
}
|
|
12607
|
-
const appMiscCategoryV1 = {
|
|
12608
|
-
name: "APP_MISC_CATEGORY",
|
|
12609
|
-
callback: callback$8
|
|
12610
|
-
};
|
|
12611
|
-
|
|
12612
12685
|
//#endregion
|
|
12613
12686
|
//#region src/core/category/app/page/v1/index.ts
|
|
12614
12687
|
function stateAvail() {
|
|
@@ -12623,7 +12696,7 @@ function argumentAvail() {
|
|
|
12623
12696
|
if (!activePage.meta.arguments || activePage.meta.arguments.length <= 0) return false;
|
|
12624
12697
|
return true;
|
|
12625
12698
|
}
|
|
12626
|
-
function callback$
|
|
12699
|
+
function callback$8() {
|
|
12627
12700
|
const root = [];
|
|
12628
12701
|
root.push(createLabel(localeMsg("LABEL_EVENT")));
|
|
12629
12702
|
if (isAvailOfNode("onEvent")) root.push(createBlock$1("on_app_event_v1"));
|
|
@@ -12652,12 +12725,12 @@ function callback$7() {
|
|
|
12652
12725
|
}
|
|
12653
12726
|
const appPageCategoryV1 = {
|
|
12654
12727
|
name: "APP_PAGE_CATEGORY",
|
|
12655
|
-
callback: callback$
|
|
12728
|
+
callback: callback$8
|
|
12656
12729
|
};
|
|
12657
12730
|
|
|
12658
12731
|
//#endregion
|
|
12659
12732
|
//#region src/core/category/app/resource/v1/index.ts
|
|
12660
|
-
function callback$
|
|
12733
|
+
function callback$7() {
|
|
12661
12734
|
const root = [];
|
|
12662
12735
|
root.push(createLabel(localeMsg("LABEL_RESOURCE")));
|
|
12663
12736
|
root.push(createBlock$1("upload_resource_v1"));
|
|
@@ -12665,6 +12738,24 @@ function callback$6() {
|
|
|
12665
12738
|
}
|
|
12666
12739
|
const appResourceCategoryV1 = {
|
|
12667
12740
|
name: "APP_RESOURCE_CATEGORY",
|
|
12741
|
+
callback: callback$7
|
|
12742
|
+
};
|
|
12743
|
+
|
|
12744
|
+
//#endregion
|
|
12745
|
+
//#region src/core/category/app/system/v1/index.ts
|
|
12746
|
+
function pageAvail() {
|
|
12747
|
+
for (const app of globalState.app.appList) if (app.pages.length > 0) return true;
|
|
12748
|
+
return false;
|
|
12749
|
+
}
|
|
12750
|
+
function callback$6() {
|
|
12751
|
+
const root = [];
|
|
12752
|
+
root.push(createBlock$1("app_env_is_v1"));
|
|
12753
|
+
root.push(createBlock$1("app_debug_trace_v1", [createShadowOfTextV1("OBJECT")]));
|
|
12754
|
+
if (pageAvail()) root.push(createBlock$1("navigate_to_v1"));
|
|
12755
|
+
return root;
|
|
12756
|
+
}
|
|
12757
|
+
const appSystemCategoryV1 = {
|
|
12758
|
+
name: "APP_SYSTEM_CATEGORY",
|
|
12668
12759
|
callback: callback$6
|
|
12669
12760
|
};
|
|
12670
12761
|
|
|
@@ -12790,7 +12881,10 @@ function callFlowAvail() {
|
|
|
12790
12881
|
function callback$2() {
|
|
12791
12882
|
const { activeObject } = globalState.compute;
|
|
12792
12883
|
const root = [];
|
|
12793
|
-
if (activeObject.type === "flow")
|
|
12884
|
+
if (activeObject.type === "flow") {
|
|
12885
|
+
root.push(createBlock$1("on_flow_state_event_v1"));
|
|
12886
|
+
root.push(createBlock$1("has_role_flow_v1"));
|
|
12887
|
+
}
|
|
12794
12888
|
if (callFlowAvail()) console.assert(true);
|
|
12795
12889
|
return root;
|
|
12796
12890
|
}
|
|
@@ -12811,6 +12905,7 @@ function callback$1() {
|
|
|
12811
12905
|
root.push(createBlock$1("func_entry_v1"));
|
|
12812
12906
|
if (activeFunc.outputs && activeFunc.outputs.length > 0) root.push(createBlock$1("set_func_output_v1"));
|
|
12813
12907
|
root.push(createBlock$1("procedure_return_v1"));
|
|
12908
|
+
root.push(createBlock$1("has_role_func_v1"));
|
|
12814
12909
|
}
|
|
12815
12910
|
if (callFuncAvail()) root.push(createBlock$1("call_func_internal_v1"));
|
|
12816
12911
|
return root;
|
|
@@ -12821,14 +12916,15 @@ const computeFuncCategoryV1 = {
|
|
|
12821
12916
|
};
|
|
12822
12917
|
|
|
12823
12918
|
//#endregion
|
|
12824
|
-
//#region src/core/category/compute/
|
|
12919
|
+
//#region src/core/category/compute/system/v1/index.ts
|
|
12825
12920
|
function callback() {
|
|
12826
12921
|
const root = [];
|
|
12922
|
+
root.push(createBlock$1("compute_env_is_v1"));
|
|
12827
12923
|
root.push(createBlock$1("compute_debug_trace_v1", [createShadowOfTextV1("OBJECT")]));
|
|
12828
12924
|
return root;
|
|
12829
12925
|
}
|
|
12830
|
-
const
|
|
12831
|
-
name: "
|
|
12926
|
+
const computeSystemCategoryV1 = {
|
|
12927
|
+
name: "COMPUTE_SYSTEM_CATEGORY",
|
|
12832
12928
|
callback
|
|
12833
12929
|
};
|
|
12834
12930
|
|
|
@@ -13385,9 +13481,9 @@ const compToolboxV1 = {
|
|
|
13385
13481
|
},
|
|
13386
13482
|
{
|
|
13387
13483
|
kind: "category",
|
|
13388
|
-
name: "%{
|
|
13484
|
+
name: "%{BKY_CATEGORY_SYSTEM}",
|
|
13389
13485
|
categorystyle: "misc_category",
|
|
13390
|
-
custom:
|
|
13486
|
+
custom: appSystemCategoryV1.name
|
|
13391
13487
|
},
|
|
13392
13488
|
loopV1,
|
|
13393
13489
|
logicV1,
|
|
@@ -13449,9 +13545,9 @@ const flowToolboxV1 = {
|
|
|
13449
13545
|
},
|
|
13450
13546
|
{
|
|
13451
13547
|
kind: "category",
|
|
13452
|
-
name: "%{
|
|
13548
|
+
name: "%{BKY_CATEGORY_SYSTEM}",
|
|
13453
13549
|
categorystyle: "misc_category",
|
|
13454
|
-
custom:
|
|
13550
|
+
custom: computeSystemCategoryV1.name
|
|
13455
13551
|
},
|
|
13456
13552
|
loopV1,
|
|
13457
13553
|
logicV1,
|
|
@@ -13500,9 +13596,9 @@ const funcToolboxV1 = {
|
|
|
13500
13596
|
},
|
|
13501
13597
|
{
|
|
13502
13598
|
kind: "category",
|
|
13503
|
-
name: "%{
|
|
13599
|
+
name: "%{BKY_CATEGORY_SYSTEM}",
|
|
13504
13600
|
categorystyle: "misc_category",
|
|
13505
|
-
custom:
|
|
13601
|
+
custom: computeSystemCategoryV1.name
|
|
13506
13602
|
},
|
|
13507
13603
|
loopV1,
|
|
13508
13604
|
logicV1,
|
|
@@ -13533,7 +13629,7 @@ const jsonToolboxV1 = {
|
|
|
13533
13629
|
contents: [{
|
|
13534
13630
|
kind: "category",
|
|
13535
13631
|
name: "%{BKY_CATEGORY_TYPE}",
|
|
13536
|
-
|
|
13632
|
+
categorystyle: "misc_category",
|
|
13537
13633
|
contents: [
|
|
13538
13634
|
{
|
|
13539
13635
|
kind: "block",
|
|
@@ -13578,9 +13674,9 @@ const pageToolboxV1 = {
|
|
|
13578
13674
|
},
|
|
13579
13675
|
{
|
|
13580
13676
|
kind: "category",
|
|
13581
|
-
name: "%{
|
|
13677
|
+
name: "%{BKY_CATEGORY_SYSTEM}",
|
|
13582
13678
|
categorystyle: "misc_category",
|
|
13583
|
-
custom:
|
|
13679
|
+
custom: appSystemCategoryV1.name
|
|
13584
13680
|
},
|
|
13585
13681
|
loopV1,
|
|
13586
13682
|
logicV1,
|
|
@@ -13687,7 +13783,7 @@ function regCustomCategory(workspace, type, version) {
|
|
|
13687
13783
|
if (version === "v1") {
|
|
13688
13784
|
reg(appPageCategoryV1);
|
|
13689
13785
|
reg(appMessageCategoryV1);
|
|
13690
|
-
reg(
|
|
13786
|
+
reg(appSystemCategoryV1);
|
|
13691
13787
|
reg(variableCategoryV1);
|
|
13692
13788
|
reg(procedureCategoryV1);
|
|
13693
13789
|
reg(appResourceCategoryV1);
|
|
@@ -13697,7 +13793,7 @@ function regCustomCategory(workspace, type, version) {
|
|
|
13697
13793
|
if (version === "v1") {
|
|
13698
13794
|
reg(appCompCategoryV1);
|
|
13699
13795
|
reg(appMessageCategoryV1);
|
|
13700
|
-
reg(
|
|
13796
|
+
reg(appSystemCategoryV1);
|
|
13701
13797
|
reg(variableCategoryV1);
|
|
13702
13798
|
reg(procedureCategoryV1);
|
|
13703
13799
|
reg(appResourceCategoryV1);
|
|
@@ -13708,7 +13804,7 @@ function regCustomCategory(workspace, type, version) {
|
|
|
13708
13804
|
reg(computeFuncCategoryV1);
|
|
13709
13805
|
reg(computeFlowCategoryV1);
|
|
13710
13806
|
reg(computeDataCategoryV1);
|
|
13711
|
-
reg(
|
|
13807
|
+
reg(computeSystemCategoryV1);
|
|
13712
13808
|
reg(variableCategoryV1);
|
|
13713
13809
|
reg(procedureCategoryV1);
|
|
13714
13810
|
}
|
|
@@ -13717,7 +13813,7 @@ function regCustomCategory(workspace, type, version) {
|
|
|
13717
13813
|
reg(computeFuncCategoryV1);
|
|
13718
13814
|
reg(computeFlowCategoryV1);
|
|
13719
13815
|
reg(computeDataCategoryV1);
|
|
13720
|
-
reg(
|
|
13816
|
+
reg(computeSystemCategoryV1);
|
|
13721
13817
|
reg(variableCategoryV1);
|
|
13722
13818
|
reg(procedureCategoryV1);
|
|
13723
13819
|
}
|
|
@@ -13905,7 +14001,7 @@ var index_vue_vue_type_script_setup_true_lang_default$2 = /*@__PURE__*/ defineCo
|
|
|
13905
14001
|
serialization.blocks.append(state, context.workspace);
|
|
13906
14002
|
}
|
|
13907
14003
|
function generateCode() {
|
|
13908
|
-
if (__props.type === "json")
|
|
14004
|
+
if (__props.type === "json") throw new Error(`no code in json`);
|
|
13909
14005
|
else return javascriptGenerator.workspaceToCode(context.workspace);
|
|
13910
14006
|
}
|
|
13911
14007
|
function generateReactivity() {
|
|
@@ -14062,20 +14158,17 @@ var content_default = index_vue_vue_type_script_setup_true_lang_default$1;
|
|
|
14062
14158
|
//#endregion
|
|
14063
14159
|
//#region src/components/sourceDlg/index.vue?vue&type=script&setup=true&lang.ts
|
|
14064
14160
|
const _hoisted_1 = { class: "text-body-large" };
|
|
14065
|
-
const _hoisted_2 = { class: "w-100 h-100 overflow-auto" };
|
|
14066
14161
|
var index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
14067
14162
|
__name: "index",
|
|
14068
14163
|
setup(__props) {
|
|
14069
14164
|
const { t } = useI18n();
|
|
14070
|
-
const {
|
|
14165
|
+
const { safeAreaInset } = useSystem();
|
|
14071
14166
|
const { backgroundColor0, backgroundColor2 } = useColor();
|
|
14072
14167
|
const code = ref("");
|
|
14073
14168
|
const contStyle = computed(() => {
|
|
14074
|
-
let h = 48;
|
|
14075
|
-
if (sysBarAvail.value) h += 24;
|
|
14076
14169
|
return {
|
|
14077
14170
|
position: "relative",
|
|
14078
|
-
height: `calc(100% - ${
|
|
14171
|
+
height: `calc(100% - ${safeAreaInset.top + 48 + safeAreaInset.bottom}px)`
|
|
14079
14172
|
};
|
|
14080
14173
|
});
|
|
14081
14174
|
const onOpen = (params) => {
|
|
@@ -14102,11 +14195,11 @@ var index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
14102
14195
|
width: "100%"
|
|
14103
14196
|
}, {
|
|
14104
14197
|
default: withCtx(() => [
|
|
14105
|
-
unref(
|
|
14198
|
+
unref(safeAreaInset).top ? (openBlock(), createBlock(_component_v_sheet, {
|
|
14106
14199
|
key: 0,
|
|
14107
14200
|
color: unref(backgroundColor2),
|
|
14108
|
-
height:
|
|
14109
|
-
}, null, 8, ["color"])) : createCommentVNode("v-if", true),
|
|
14201
|
+
height: unref(safeAreaInset).top
|
|
14202
|
+
}, null, 8, ["color", "height"])) : createCommentVNode("v-if", true),
|
|
14110
14203
|
createVNode(_component_v_sheet, {
|
|
14111
14204
|
class: "d-flex align-center px-2",
|
|
14112
14205
|
color: unref(backgroundColor2),
|
|
@@ -14124,7 +14217,10 @@ var index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
14124
14217
|
]),
|
|
14125
14218
|
_: 1
|
|
14126
14219
|
}, 8, ["color"]),
|
|
14127
|
-
createElementVNode("div", {
|
|
14220
|
+
createElementVNode("div", {
|
|
14221
|
+
class: "overflow-auto",
|
|
14222
|
+
style: normalizeStyle(contStyle.value)
|
|
14223
|
+
}, [createVNode(content_default, { code: code.value }, null, 8, ["code"])], 4)
|
|
14128
14224
|
]),
|
|
14129
14225
|
_: 1
|
|
14130
14226
|
}, 8, ["color"])]),
|
|
@@ -36959,4 +36959,4 @@ function javascript(hljs) {
|
|
|
36959
36959
|
}
|
|
36960
36960
|
|
|
36961
36961
|
//#endregion
|
|
36962
|
-
export { Names as A,
|
|
36962
|
+
export { Names as A, constants as B, FieldCheckbox as C, FieldNumber as D, FieldLabel as E, Themes as F, icons as G, dialog as H, Variables as I, registry as J, inject$1 as K, WorkspaceSvg as L, ShortcutItems as M, ShortcutRegistry as N, FieldTextInput as O, Theme as P, utils as Q, Xml as R, Extensions as S, FieldImage as T, getMainWorkspace as U, defineBlocksWithJsonArray as V, getSelected as W, setLocale as X, serialization as Y, svgResize as Z, javascriptGenerator as _, lo as a, ContextMenuRegistry as b, encodeString as c, snakeCase as d, parseInt$1 as f, Order as g, cloneDeep as h, require_dist as i, Procedures as j, Msg as k, require_dist$2 as l, debounce as m, o as n, useResizeObserver as o, isEqual as p, inputs as q, core_default as r, require_dist$1 as s, javascript as t, upperCase as u, Blocks as v, FieldDropdown as w, Events as x, ContextMenu as y, common as z };
|
|
@@ -301,11 +301,11 @@ var zhHans_default = {
|
|
|
301
301
|
CATEGORY_LOOP: "循环",
|
|
302
302
|
CATEGORY_MATH: "数学",
|
|
303
303
|
CATEGORY_MESSAGE: "消息",
|
|
304
|
-
CATEGORY_MISC: "杂项",
|
|
305
304
|
CATEGORY_OBJECT: "对象",
|
|
306
305
|
CATEGORY_PAGE: "页面",
|
|
307
306
|
CATEGORY_PROCEDURE: "过程",
|
|
308
307
|
CATEGORY_RESOURCE: "资源",
|
|
308
|
+
CATEGORY_SYSTEM: "系统",
|
|
309
309
|
CATEGORY_TEXT: "文本",
|
|
310
310
|
CATEGORY_TIME: "时间",
|
|
311
311
|
CATEGORY_TYPE: "类型",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x-block-lib",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.12",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -36,13 +36,14 @@
|
|
|
36
36
|
"lodash-es": "^4.18.1",
|
|
37
37
|
"oxfmt": "^0.67.0",
|
|
38
38
|
"oxlint": "^1.82.0",
|
|
39
|
+
"oxlint-tsgolint": "^7.0.2002",
|
|
39
40
|
"picomatch": "^4.0.7",
|
|
40
41
|
"sass": "^1.104.0",
|
|
41
42
|
"tsdown": "^0.23.0",
|
|
42
43
|
"typescript": "^6.0.3",
|
|
43
44
|
"vite": "^8.3.0",
|
|
44
45
|
"vue-draggable-plus": "^0.6.1",
|
|
45
|
-
"x-config-lib": "^0.1.
|
|
46
|
+
"x-config-lib": "^0.1.8",
|
|
46
47
|
"x-config-oxfmt": "^0.1.6",
|
|
47
48
|
"x-config-oxlint": "^0.1.7"
|
|
48
49
|
},
|
|
@@ -50,9 +51,9 @@
|
|
|
50
51
|
"vue": "^3.5.42",
|
|
51
52
|
"vue-i18n": "^11.4.10",
|
|
52
53
|
"vuetify": "^4.2.1",
|
|
53
|
-
"x-
|
|
54
|
-
"x-
|
|
55
|
-
"x-runtime-lib": "^0.10.
|
|
54
|
+
"x-essential-lib": "^0.11.11",
|
|
55
|
+
"x-permission-lib": "^0.1.6",
|
|
56
|
+
"x-runtime-lib": "^0.10.7",
|
|
56
57
|
"x-state-lib": "^0.4.5"
|
|
57
58
|
}
|
|
58
59
|
}
|