x-runtime-lib 0.8.57 → 0.8.58
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/index.js +103 -69
- package/dist/sandbox/runtime/event.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ function Mn(t) {
|
|
|
26
26
|
const e = t.substring(0, t.length - 1), i = parseFloat(e);
|
|
27
27
|
return !isNaN(i);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function Ou(t) {
|
|
30
30
|
if (typeof t != "string" || !t.endsWith("px"))
|
|
31
31
|
return;
|
|
32
32
|
const e = t.substring(0, t.length - 2), i = parseFloat(e);
|
|
@@ -93,8 +93,8 @@ function Sr(t, e = 2) {
|
|
|
93
93
|
function te(t) {
|
|
94
94
|
return t === "runtime" || t === "preview";
|
|
95
95
|
}
|
|
96
|
-
const
|
|
97
|
-
function
|
|
96
|
+
const Ku = ["string", "number", "boolean", "array", "object"];
|
|
97
|
+
function Uu(t) {
|
|
98
98
|
switch (t) {
|
|
99
99
|
case "string":
|
|
100
100
|
return "#5ba58c";
|
|
@@ -117,7 +117,7 @@ function ko(t) {
|
|
|
117
117
|
}
|
|
118
118
|
return !1;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function Xu(t, e, i, o, s) {
|
|
121
121
|
let r = t;
|
|
122
122
|
for (let c = 0; c < e.length; c++)
|
|
123
123
|
if (r = r.children[e[c]], !r) {
|
|
@@ -178,17 +178,17 @@ function Dn(t, e, i) {
|
|
|
178
178
|
a > 0 && (s += " - "), i ? s += o.global.t(r) : s += r;
|
|
179
179
|
}), s;
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function Yu(t, e) {
|
|
182
182
|
const { i18n: i } = ge;
|
|
183
183
|
let o = "";
|
|
184
184
|
return t === "elementProperty" || (t === "referenceProperty" ? o = i.global.t("x-runtime-lib.reference") : t === "multipleRefProperty" ? o = i.global.t("x-runtime-lib.multipleRef") : t === "customProperty" ? o = i.global.t("x-runtime-lib.custom") : t === "elementSlotProperty" || t === "customSlotProperty" ? o = i.global.t("x-runtime-lib.slot") : console.assert(!1)), Dn(o, e, Tr(t));
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function qu(t, e) {
|
|
187
187
|
const { i18n: i } = ge;
|
|
188
188
|
let o = "";
|
|
189
189
|
return t === "elementMethod" || (t === "referenceMethod" ? o = i.global.t("x-runtime-lib.reference") : t === "multipleRefMethod" ? o = i.global.t("x-runtime-lib.multipleRef") : t === "customMethod" ? o = i.global.t("x-runtime-lib.custom") : t === "elementSlotMethod" || t === "customSlotMethod" ? o = i.global.t("x-runtime-lib.slot") : console.assert(!1)), Dn(o, e, zr(t));
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function Ju(t, e) {
|
|
192
192
|
const { i18n: i } = ge;
|
|
193
193
|
let o = "";
|
|
194
194
|
return t === "elementEvent" || (t === "referenceEvent" ? o = i.global.t("x-runtime-lib.reference") : t === "multipleRefEvent" ? o = i.global.t("x-runtime-lib.multipleRef") : t === "customEvent" ? o = i.global.t("x-runtime-lib.custom") : t === "elementPropertyChangeEvent" || t === "customPropertyChangeEvent" ? o = i.global.t("x-runtime-lib.propertyChange") : t === "stateChangeEvent" ? o = i.global.t("x-runtime-lib.stateChange") : console.assert(!1)), Dn(o, e, Ar(t));
|
|
@@ -4157,7 +4157,7 @@ const hi = {
|
|
|
4157
4157
|
default: !1
|
|
4158
4158
|
}
|
|
4159
4159
|
]
|
|
4160
|
-
},
|
|
4160
|
+
}, Zu = {
|
|
4161
4161
|
key: Je,
|
|
4162
4162
|
name: "x-runtime-lib.badge",
|
|
4163
4163
|
comp: bl,
|
|
@@ -4990,7 +4990,7 @@ const Pi = {
|
|
|
4990
4990
|
key: "settings",
|
|
4991
4991
|
name: "x-runtime-lib.settings",
|
|
4992
4992
|
children: []
|
|
4993
|
-
},
|
|
4993
|
+
}, Qu = {
|
|
4994
4994
|
key: yt,
|
|
4995
4995
|
name: "x-runtime-lib.fileInput",
|
|
4996
4996
|
comp: Ll,
|
|
@@ -8062,7 +8062,7 @@ function T(t, e) {
|
|
|
8062
8062
|
}
|
|
8063
8063
|
e.forEach((o) => i(t, o));
|
|
8064
8064
|
}
|
|
8065
|
-
function
|
|
8065
|
+
function ep(t, e, i, o, s) {
|
|
8066
8066
|
const r = `type=${t} subtype=${e} version=${i} ref=${o} keyOrRefId=${s}`, a = A(t, e);
|
|
8067
8067
|
if (!a) {
|
|
8068
8068
|
console.error(`spawnNode property tag not found, ${r}`);
|
|
@@ -8127,7 +8127,7 @@ function Qu(t, e, i, o, s) {
|
|
|
8127
8127
|
}
|
|
8128
8128
|
}
|
|
8129
8129
|
}
|
|
8130
|
-
function
|
|
8130
|
+
function tp(t, e) {
|
|
8131
8131
|
function i(o) {
|
|
8132
8132
|
if (o.basic.id === e)
|
|
8133
8133
|
return o;
|
|
@@ -8151,56 +8151,56 @@ function xu(t) {
|
|
|
8151
8151
|
const i = W(t);
|
|
8152
8152
|
return e(i), i;
|
|
8153
8153
|
}
|
|
8154
|
-
function
|
|
8154
|
+
function np(t) {
|
|
8155
8155
|
const e = [];
|
|
8156
8156
|
return t.forEach((i) => {
|
|
8157
8157
|
e.push(xu(i));
|
|
8158
8158
|
}), e;
|
|
8159
8159
|
}
|
|
8160
8160
|
const Wo = "runtimeOrg", Ro = "runtimeEnv", Mo = "runtimeMode", Do = "runtimeDevice", Fo = "runtimeDark", No = "runtimeType", Go = "runtimeData", jo = "runtimeDepends", Ho = "runtimeSandbox";
|
|
8161
|
-
function
|
|
8161
|
+
function ip(t) {
|
|
8162
8162
|
ce(Wo, t);
|
|
8163
8163
|
}
|
|
8164
8164
|
function vu() {
|
|
8165
8165
|
return ae(Wo);
|
|
8166
8166
|
}
|
|
8167
|
-
function
|
|
8167
|
+
function op(t) {
|
|
8168
8168
|
ce(Ro, t);
|
|
8169
8169
|
}
|
|
8170
8170
|
function ku() {
|
|
8171
8171
|
return ae(Ro);
|
|
8172
8172
|
}
|
|
8173
|
-
function
|
|
8173
|
+
function rp(t) {
|
|
8174
8174
|
ce(Mo, t);
|
|
8175
8175
|
}
|
|
8176
8176
|
function H() {
|
|
8177
8177
|
return ae(Mo);
|
|
8178
8178
|
}
|
|
8179
|
-
function
|
|
8179
|
+
function sp(t) {
|
|
8180
8180
|
ce(Do, Rn(t));
|
|
8181
8181
|
}
|
|
8182
8182
|
function Ce() {
|
|
8183
8183
|
return ae(Do);
|
|
8184
8184
|
}
|
|
8185
|
-
function
|
|
8185
|
+
function lp(t) {
|
|
8186
8186
|
ce(Fo, Rn(t));
|
|
8187
8187
|
}
|
|
8188
8188
|
function Me() {
|
|
8189
8189
|
return ae(Fo);
|
|
8190
8190
|
}
|
|
8191
|
-
function
|
|
8191
|
+
function ap(t) {
|
|
8192
8192
|
ce(No, t);
|
|
8193
8193
|
}
|
|
8194
8194
|
function fe() {
|
|
8195
8195
|
return ae(No);
|
|
8196
8196
|
}
|
|
8197
|
-
function
|
|
8197
|
+
function cp(t) {
|
|
8198
8198
|
ce(Go, t);
|
|
8199
8199
|
}
|
|
8200
8200
|
function ke() {
|
|
8201
8201
|
return ae(Go);
|
|
8202
8202
|
}
|
|
8203
|
-
function
|
|
8203
|
+
function up(t) {
|
|
8204
8204
|
ce(jo, Rn(t));
|
|
8205
8205
|
}
|
|
8206
8206
|
function _u() {
|
|
@@ -8436,25 +8436,22 @@ function Su(t) {
|
|
|
8436
8436
|
);
|
|
8437
8437
|
}
|
|
8438
8438
|
function Cu(t) {
|
|
8439
|
-
t.
|
|
8440
|
-
"
|
|
8441
|
-
(e, i) => {
|
|
8442
|
-
t.
|
|
8443
|
-
|
|
8444
|
-
|
|
8439
|
+
t.bindNativeFunction(
|
|
8440
|
+
"__triggerEventV1__",
|
|
8441
|
+
(e, ...i) => {
|
|
8442
|
+
t.callFunction("__triggerEventInner__", e, ...i);
|
|
8443
|
+
const { kind: o, eventKey: s } = Vu(e);
|
|
8444
|
+
o === "customEvent" && (t.parent?.callFunction(
|
|
8445
|
+
"__triggerEventV1__",
|
|
8446
|
+
ne("referenceEvent", t.id, s),
|
|
8447
|
+
...i
|
|
8448
|
+
), t.parent?.callFunction(
|
|
8449
|
+
"__triggerEventV1__",
|
|
8450
|
+
ne("multipleRefEvent", t.id, s),
|
|
8451
|
+
...i
|
|
8452
|
+
));
|
|
8445
8453
|
}
|
|
8446
|
-
), t.bindNativeFunction(
|
|
8447
|
-
const o = [...i];
|
|
8448
|
-
t.eventBus.emit(e, { params: o });
|
|
8449
|
-
const { kind: s, eventKey: r } = Vu(e);
|
|
8450
|
-
s === "customEvent" && (t.parent?.eventBus.emit(
|
|
8451
|
-
ne("referenceEvent", t.id, r),
|
|
8452
|
-
{ params: o }
|
|
8453
|
-
), t.parent?.eventBus.emit(
|
|
8454
|
-
ne("multipleRefEvent", t.id, r),
|
|
8455
|
-
{ params: o }
|
|
8456
|
-
));
|
|
8457
|
-
}), t.bindNativeFunction(
|
|
8454
|
+
), t.bindNativeFunction(
|
|
8458
8455
|
"__getPropertyV1__",
|
|
8459
8456
|
(e, i) => {
|
|
8460
8457
|
const { kind: o, nodeId: s, propertyKey: r } = no(e);
|
|
@@ -8567,6 +8564,43 @@ function __getEnvV1__() {
|
|
|
8567
8564
|
var __pointerPosX__ = 0
|
|
8568
8565
|
var __pointerPosY__ = 0
|
|
8569
8566
|
`, zu = `
|
|
8567
|
+
var __events__ = {}
|
|
8568
|
+
|
|
8569
|
+
function __onEventV1__(id, callback) {
|
|
8570
|
+
if (typeof(id) !== 'string' || !id) {
|
|
8571
|
+
return
|
|
8572
|
+
}
|
|
8573
|
+
if (typeof(callback) !== 'function') {
|
|
8574
|
+
return
|
|
8575
|
+
}
|
|
8576
|
+
if (!__events__[id]) {
|
|
8577
|
+
__events__[id] = []
|
|
8578
|
+
}
|
|
8579
|
+
var callbacks = __events__[id]
|
|
8580
|
+
for (var i = 0; i < callbacks.length; i++) {
|
|
8581
|
+
if (callbacks[i] === callback) {
|
|
8582
|
+
return
|
|
8583
|
+
}
|
|
8584
|
+
}
|
|
8585
|
+
callbacks.push(callback)
|
|
8586
|
+
}
|
|
8587
|
+
|
|
8588
|
+
function __triggerEventInner__(id, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16) {
|
|
8589
|
+
if (typeof(id) !== 'string' || !id) {
|
|
8590
|
+
return
|
|
8591
|
+
}
|
|
8592
|
+
if (!__events__[id]) {
|
|
8593
|
+
return
|
|
8594
|
+
}
|
|
8595
|
+
var callbacks = __events__[id]
|
|
8596
|
+
if (!callbacks) {
|
|
8597
|
+
return
|
|
8598
|
+
}
|
|
8599
|
+
for (var i = 0; i < callbacks.length; i++) {
|
|
8600
|
+
callbacks[i](p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16)
|
|
8601
|
+
}
|
|
8602
|
+
}
|
|
8603
|
+
`, Au = `
|
|
8570
8604
|
var __timers__ = {}
|
|
8571
8605
|
var __currTimerId__ = 0
|
|
8572
8606
|
|
|
@@ -8608,19 +8642,19 @@ function __timeoutCallbackV1__(timerId) {
|
|
|
8608
8642
|
}
|
|
8609
8643
|
}
|
|
8610
8644
|
}
|
|
8611
|
-
`,
|
|
8645
|
+
`, Lu = `
|
|
8612
8646
|
function __destroy__() {
|
|
8613
8647
|
__events__ = {}
|
|
8614
8648
|
__timers__ = {}
|
|
8615
8649
|
}
|
|
8616
|
-
`,
|
|
8617
|
-
function
|
|
8650
|
+
`, Eu = Tu + zu + Au + Lu;
|
|
8651
|
+
function Bu(t) {
|
|
8618
8652
|
return t instanceof Array ? t.join(".") : t;
|
|
8619
8653
|
}
|
|
8620
8654
|
function io(t, ...e) {
|
|
8621
8655
|
console.log(t, ...e);
|
|
8622
8656
|
}
|
|
8623
|
-
class
|
|
8657
|
+
class Wu {
|
|
8624
8658
|
kind;
|
|
8625
8659
|
id;
|
|
8626
8660
|
refKey;
|
|
@@ -8649,7 +8683,7 @@ class Bu {
|
|
|
8649
8683
|
//--------------------------
|
|
8650
8684
|
interpreter;
|
|
8651
8685
|
createInterpreter(e) {
|
|
8652
|
-
this.interpreter = new wr(
|
|
8686
|
+
this.interpreter = new wr(Eu), Pu(this), this.runCode(e), this.setVariable("__env__", this.env), this.setVariable("__mode__", this.mode), this.callFunction(
|
|
8653
8687
|
"__triggerEventV1__",
|
|
8654
8688
|
ne("elementEvent", "globality", "startup")
|
|
8655
8689
|
);
|
|
@@ -8854,7 +8888,7 @@ function ei(t, e, i, o, s) {
|
|
|
8854
8888
|
ne(
|
|
8855
8889
|
"elementPropertyChangeEvent",
|
|
8856
8890
|
$,
|
|
8857
|
-
|
|
8891
|
+
Bu(S)
|
|
8858
8892
|
),
|
|
8859
8893
|
L,
|
|
8860
8894
|
E ?? L
|
|
@@ -8906,7 +8940,7 @@ function ei(t, e, i, o, s) {
|
|
|
8906
8940
|
S,
|
|
8907
8941
|
L
|
|
8908
8942
|
));
|
|
8909
|
-
}, v = new
|
|
8943
|
+
}, v = new Wu(e, i, o, s, r, a, c, m, {
|
|
8910
8944
|
onElementPropertyChange: p,
|
|
8911
8945
|
onCustomPropertyChange: f,
|
|
8912
8946
|
onAdaptSlotPropertyChange: b,
|
|
@@ -8944,19 +8978,19 @@ function ei(t, e, i, o, s) {
|
|
|
8944
8978
|
{ immediate: !0 }
|
|
8945
8979
|
);
|
|
8946
8980
|
}
|
|
8947
|
-
const
|
|
8981
|
+
const Ru = (t, e, i) => {
|
|
8948
8982
|
const o = t[e];
|
|
8949
8983
|
return o ? typeof o == "function" ? o() : Promise.resolve(o) : new Promise((s, r) => {
|
|
8950
8984
|
(typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(r.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + e + (e.split("/").length !== i ? ". Note that variables only represent file names one level deep." : ""))));
|
|
8951
8985
|
});
|
|
8952
8986
|
};
|
|
8953
|
-
async function
|
|
8954
|
-
return (await
|
|
8987
|
+
async function pp(t) {
|
|
8988
|
+
return (await Ru(/* @__PURE__ */ Object.assign({ "./locales/en/index.ts": () => import("./i18n-en.iwe5dp7b.js"), "./locales/zhHans/index.ts": () => import("./i18n-zhHans.bcugsp8c.js") }), `./locales/${t}/index.ts`, 4)).default;
|
|
8955
8989
|
}
|
|
8956
8990
|
export {
|
|
8957
8991
|
Sr as addIndent,
|
|
8958
8992
|
La as ambientLightV1,
|
|
8959
|
-
|
|
8993
|
+
Zu as badgeV1,
|
|
8960
8994
|
un as barChartV1,
|
|
8961
8995
|
an as boxGeometryV1,
|
|
8962
8996
|
xo as breakpoints,
|
|
@@ -8977,10 +9011,10 @@ export {
|
|
|
8977
9011
|
nc as dialogV1,
|
|
8978
9012
|
Ea as directionalLightV1,
|
|
8979
9013
|
xu as duplicateNode,
|
|
8980
|
-
|
|
9014
|
+
np as duplicateNodes,
|
|
8981
9015
|
ze as elements,
|
|
8982
|
-
|
|
8983
|
-
|
|
9016
|
+
Xu as ensureContext,
|
|
9017
|
+
Qu as fileInputV1,
|
|
8984
9018
|
bn as flexLayoutEntryV1,
|
|
8985
9019
|
We as flexLayoutV1,
|
|
8986
9020
|
xn as formV1,
|
|
@@ -8988,10 +9022,10 @@ export {
|
|
|
8988
9022
|
Pe as getBreakpointProp,
|
|
8989
9023
|
we as getField,
|
|
8990
9024
|
ni as getIndexOfBreakpoint,
|
|
8991
|
-
|
|
9025
|
+
tp as getNode,
|
|
8992
9026
|
to as getPropertyDefault,
|
|
8993
9027
|
A as getPropertyTag,
|
|
8994
|
-
|
|
9028
|
+
Uu as getTypeColor,
|
|
8995
9029
|
ja as globalityV1,
|
|
8996
9030
|
Ra as groupV1,
|
|
8997
9031
|
ac as iconV1,
|
|
@@ -9014,7 +9048,7 @@ export {
|
|
|
9014
9048
|
Ye as isPixelStr,
|
|
9015
9049
|
Va as keyboardControlsV1,
|
|
9016
9050
|
pn as lineChartV1,
|
|
9017
|
-
|
|
9051
|
+
pp as loadLocaleMessageRuntime,
|
|
9018
9052
|
ne as makeEventId,
|
|
9019
9053
|
Bn as makeMethodId,
|
|
9020
9054
|
Ne as makePropertyId,
|
|
@@ -9030,19 +9064,19 @@ export {
|
|
|
9030
9064
|
Cr as pageTypes,
|
|
9031
9065
|
pc as paginationV1,
|
|
9032
9066
|
Qt as parsePercentStr,
|
|
9033
|
-
|
|
9067
|
+
Ou as parsePixelStr,
|
|
9034
9068
|
va as perspectiveCameraV1,
|
|
9035
9069
|
gu as pkgs,
|
|
9036
9070
|
Ba as pointLightV1,
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9071
|
+
lp as provideDark,
|
|
9072
|
+
cp as provideData,
|
|
9073
|
+
up as provideDepends,
|
|
9074
|
+
sp as provideDevice,
|
|
9075
|
+
op as provideEnv,
|
|
9076
|
+
rp as provideMode,
|
|
9077
|
+
ip as provideOrg,
|
|
9044
9078
|
wu as provideSandbox,
|
|
9045
|
-
|
|
9079
|
+
ap as provideType,
|
|
9046
9080
|
_n as radioGroupV1,
|
|
9047
9081
|
kn as radioV1,
|
|
9048
9082
|
yc as rangeSliderV1,
|
|
@@ -9053,7 +9087,7 @@ export {
|
|
|
9053
9087
|
bc as selectV1,
|
|
9054
9088
|
vo as setField,
|
|
9055
9089
|
hc as sliderV1,
|
|
9056
|
-
|
|
9090
|
+
ep as spawnNode,
|
|
9057
9091
|
cn as sphereGeometryV1,
|
|
9058
9092
|
Wa as spotLightV1,
|
|
9059
9093
|
wn as stepperHeaderV1,
|
|
@@ -9069,11 +9103,11 @@ export {
|
|
|
9069
9103
|
Tn as textareaV1,
|
|
9070
9104
|
zn as timelineItemV1,
|
|
9071
9105
|
An as timelineV1,
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9106
|
+
Ju as toEventName,
|
|
9107
|
+
qu as toMethodName,
|
|
9108
|
+
Yu as toPropertyName,
|
|
9075
9109
|
Fe as triggerReactivity,
|
|
9076
|
-
|
|
9110
|
+
Ku as types,
|
|
9077
9111
|
Vu as unwrapEventId,
|
|
9078
9112
|
Oo as unwrapMethodId,
|
|
9079
9113
|
no as unwrapPropertyId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const event = "\nvar __events__ = {}\n\nfunction __onEventV1__(id, callback) {\n if (typeof(id) !== 'string' || !id) {\n return\n }\n if (typeof(callback) !== 'function') {\n return\n }\n if (!__events__[id]) {\n __events__[id] = []\n }\n var callbacks = __events__[id]\n for (var i = 0; i < callbacks.length; i++) {\n if (callbacks[i] === callback) {\n return\n }\n }\n callbacks.push(callback)\n}\n\nfunction
|
|
1
|
+
export declare const event = "\nvar __events__ = {}\n\nfunction __onEventV1__(id, callback) {\n if (typeof(id) !== 'string' || !id) {\n return\n }\n if (typeof(callback) !== 'function') {\n return\n }\n if (!__events__[id]) {\n __events__[id] = []\n }\n var callbacks = __events__[id]\n for (var i = 0; i < callbacks.length; i++) {\n if (callbacks[i] === callback) {\n return\n }\n }\n callbacks.push(callback)\n}\n\nfunction __triggerEventInner__(id, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16) {\n if (typeof(id) !== 'string' || !id) {\n return\n }\n if (!__events__[id]) {\n return\n }\n var callbacks = __events__[id]\n if (!callbacks) {\n return\n }\n for (var i = 0; i < callbacks.length; i++) {\n callbacks[i](p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16)\n }\n}\n";
|