@builder.io/sdk-solid 1.0.16 → 1.0.17
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/lib/browser/dev.js +26 -32
- package/lib/browser/dev.jsx +31 -34
- package/lib/browser/index.js +25 -31
- package/lib/browser/index.jsx +30 -33
- package/lib/edge/dev.js +26 -32
- package/lib/edge/dev.jsx +31 -34
- package/lib/edge/index.js +25 -31
- package/lib/edge/index.jsx +30 -33
- package/lib/node/dev.js +26 -32
- package/lib/node/dev.jsx +31 -34
- package/lib/node/index.js +25 -31
- package/lib/node/index.jsx +30 -33
- package/package.json +1 -1
package/lib/browser/dev.js
CHANGED
|
@@ -4449,7 +4449,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4449
4449
|
}
|
|
4450
4450
|
|
|
4451
4451
|
// src/constants/sdk-version.ts
|
|
4452
|
-
var SDK_VERSION = "1.0.
|
|
4452
|
+
var SDK_VERSION = "1.0.17";
|
|
4453
4453
|
|
|
4454
4454
|
// src/functions/register.ts
|
|
4455
4455
|
var registry = {};
|
|
@@ -4650,6 +4650,7 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4650
4650
|
function EnableEditor(props) {
|
|
4651
4651
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
4652
4652
|
const [httpReqsData, setHttpReqsData] = createSignal({});
|
|
4653
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal({});
|
|
4653
4654
|
const [clicked, setClicked] = createSignal(false);
|
|
4654
4655
|
function mergeNewRootState(newData) {
|
|
4655
4656
|
const combinedState = {
|
|
@@ -4748,41 +4749,34 @@ function EnableEditor(props) {
|
|
|
4748
4749
|
setClicked(true);
|
|
4749
4750
|
}
|
|
4750
4751
|
}
|
|
4751
|
-
function evalExpression(expression) {
|
|
4752
|
-
return expression.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
|
|
4753
|
-
code: group,
|
|
4754
|
-
context: props.context || {},
|
|
4755
|
-
localState: void 0,
|
|
4756
|
-
rootState: props.builderContextSignal.rootState,
|
|
4757
|
-
rootSetState: props.builderContextSignal.rootSetState,
|
|
4758
|
-
enableCache: true
|
|
4759
|
-
})));
|
|
4760
|
-
}
|
|
4761
|
-
function handleRequest({
|
|
4762
|
-
url,
|
|
4763
|
-
key
|
|
4764
|
-
}) {
|
|
4765
|
-
fetch2(url).then((response) => response.json()).then((json) => {
|
|
4766
|
-
const newState = {
|
|
4767
|
-
...props.builderContextSignal.rootState,
|
|
4768
|
-
[key]: json
|
|
4769
|
-
};
|
|
4770
|
-
props.builderContextSignal.rootSetState?.(newState);
|
|
4771
|
-
httpReqsData()[key] = true;
|
|
4772
|
-
}).catch((err) => {
|
|
4773
|
-
console.error("error fetching dynamic data", url, err);
|
|
4774
|
-
});
|
|
4775
|
-
}
|
|
4776
4752
|
function runHttpRequests() {
|
|
4777
4753
|
const requests = props.builderContextSignal.content?.data?.httpRequests ?? {};
|
|
4778
4754
|
Object.entries(requests).forEach(([key, url]) => {
|
|
4779
|
-
if (url
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4755
|
+
if (!url)
|
|
4756
|
+
return;
|
|
4757
|
+
if (httpReqsPending()[key])
|
|
4758
|
+
return;
|
|
4759
|
+
if (httpReqsData()[key] && !isEditing())
|
|
4760
|
+
return;
|
|
4761
|
+
httpReqsPending()[key] = true;
|
|
4762
|
+
const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
|
|
4763
|
+
code: group,
|
|
4764
|
+
context: props.context || {},
|
|
4765
|
+
localState: void 0,
|
|
4766
|
+
rootState: props.builderContextSignal.rootState,
|
|
4767
|
+
rootSetState: props.builderContextSignal.rootSetState,
|
|
4768
|
+
enableCache: true
|
|
4769
|
+
})));
|
|
4770
|
+
fetch2(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
4771
|
+
mergeNewRootState({
|
|
4772
|
+
[key]: json
|
|
4784
4773
|
});
|
|
4785
|
-
|
|
4774
|
+
httpReqsData()[key] = true;
|
|
4775
|
+
}).catch((err) => {
|
|
4776
|
+
console.error("error fetching dynamic data", url, err);
|
|
4777
|
+
}).finally(() => {
|
|
4778
|
+
httpReqsPending()[key] = false;
|
|
4779
|
+
});
|
|
4786
4780
|
});
|
|
4787
4781
|
}
|
|
4788
4782
|
function emitStateUpdate() {
|
package/lib/browser/dev.jsx
CHANGED
|
@@ -4033,7 +4033,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4033
4033
|
}
|
|
4034
4034
|
|
|
4035
4035
|
// src/constants/sdk-version.ts
|
|
4036
|
-
var SDK_VERSION = "1.0.
|
|
4036
|
+
var SDK_VERSION = "1.0.17";
|
|
4037
4037
|
|
|
4038
4038
|
// src/functions/register.ts
|
|
4039
4039
|
var registry = {};
|
|
@@ -4236,6 +4236,7 @@ function EnableEditor(props) {
|
|
|
4236
4236
|
props.contentWrapper || "div"
|
|
4237
4237
|
);
|
|
4238
4238
|
const [httpReqsData, setHttpReqsData] = createSignal12({});
|
|
4239
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal12({});
|
|
4239
4240
|
const [clicked, setClicked] = createSignal12(false);
|
|
4240
4241
|
function mergeNewRootState(newData) {
|
|
4241
4242
|
const combinedState = {
|
|
@@ -4331,43 +4332,39 @@ function EnableEditor(props) {
|
|
|
4331
4332
|
setClicked(true);
|
|
4332
4333
|
}
|
|
4333
4334
|
}
|
|
4334
|
-
function evalExpression(expression) {
|
|
4335
|
-
return expression.replace(
|
|
4336
|
-
/{{([^}]+)}}/g,
|
|
4337
|
-
(_match, group) => String(
|
|
4338
|
-
evaluate({
|
|
4339
|
-
code: group,
|
|
4340
|
-
context: props.context || {},
|
|
4341
|
-
localState: void 0,
|
|
4342
|
-
rootState: props.builderContextSignal.rootState,
|
|
4343
|
-
rootSetState: props.builderContextSignal.rootSetState,
|
|
4344
|
-
enableCache: true
|
|
4345
|
-
})
|
|
4346
|
-
)
|
|
4347
|
-
);
|
|
4348
|
-
}
|
|
4349
|
-
function handleRequest({ url, key }) {
|
|
4350
|
-
fetch2(url).then((response) => response.json()).then((json) => {
|
|
4351
|
-
const newState = {
|
|
4352
|
-
...props.builderContextSignal.rootState,
|
|
4353
|
-
[key]: json
|
|
4354
|
-
};
|
|
4355
|
-
props.builderContextSignal.rootSetState?.(newState);
|
|
4356
|
-
httpReqsData()[key] = true;
|
|
4357
|
-
}).catch((err) => {
|
|
4358
|
-
console.error("error fetching dynamic data", url, err);
|
|
4359
|
-
});
|
|
4360
|
-
}
|
|
4361
4335
|
function runHttpRequests() {
|
|
4362
4336
|
const requests = props.builderContextSignal.content?.data?.httpRequests ?? {};
|
|
4363
4337
|
Object.entries(requests).forEach(([key, url]) => {
|
|
4364
|
-
if (url
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4338
|
+
if (!url)
|
|
4339
|
+
return;
|
|
4340
|
+
if (httpReqsPending()[key])
|
|
4341
|
+
return;
|
|
4342
|
+
if (httpReqsData()[key] && !isEditing())
|
|
4343
|
+
return;
|
|
4344
|
+
httpReqsPending()[key] = true;
|
|
4345
|
+
const evaluatedUrl = url.replace(
|
|
4346
|
+
/{{([^}]+)}}/g,
|
|
4347
|
+
(_match, group) => String(
|
|
4348
|
+
evaluate({
|
|
4349
|
+
code: group,
|
|
4350
|
+
context: props.context || {},
|
|
4351
|
+
localState: void 0,
|
|
4352
|
+
rootState: props.builderContextSignal.rootState,
|
|
4353
|
+
rootSetState: props.builderContextSignal.rootSetState,
|
|
4354
|
+
enableCache: true
|
|
4355
|
+
})
|
|
4356
|
+
)
|
|
4357
|
+
);
|
|
4358
|
+
fetch2(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
4359
|
+
mergeNewRootState({
|
|
4360
|
+
[key]: json
|
|
4369
4361
|
});
|
|
4370
|
-
|
|
4362
|
+
httpReqsData()[key] = true;
|
|
4363
|
+
}).catch((err) => {
|
|
4364
|
+
console.error("error fetching dynamic data", url, err);
|
|
4365
|
+
}).finally(() => {
|
|
4366
|
+
httpReqsPending()[key] = false;
|
|
4367
|
+
});
|
|
4371
4368
|
});
|
|
4372
4369
|
}
|
|
4373
4370
|
function emitStateUpdate() {
|
package/lib/browser/index.js
CHANGED
|
@@ -4434,7 +4434,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4434
4434
|
}
|
|
4435
4435
|
|
|
4436
4436
|
// src/constants/sdk-version.ts
|
|
4437
|
-
var SDK_VERSION = "1.0.
|
|
4437
|
+
var SDK_VERSION = "1.0.17";
|
|
4438
4438
|
|
|
4439
4439
|
// src/functions/register.ts
|
|
4440
4440
|
var registry = {};
|
|
@@ -4634,6 +4634,7 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4634
4634
|
function EnableEditor(props) {
|
|
4635
4635
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
4636
4636
|
const [httpReqsData, setHttpReqsData] = createSignal({});
|
|
4637
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal({});
|
|
4637
4638
|
const [clicked, setClicked] = createSignal(false);
|
|
4638
4639
|
function mergeNewRootState(newData) {
|
|
4639
4640
|
const combinedState = {
|
|
@@ -4732,40 +4733,33 @@ function EnableEditor(props) {
|
|
|
4732
4733
|
setClicked(true);
|
|
4733
4734
|
}
|
|
4734
4735
|
}
|
|
4735
|
-
function evalExpression(expression) {
|
|
4736
|
-
return expression.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
|
|
4737
|
-
code: group,
|
|
4738
|
-
context: props.context || {},
|
|
4739
|
-
localState: void 0,
|
|
4740
|
-
rootState: props.builderContextSignal.rootState,
|
|
4741
|
-
rootSetState: props.builderContextSignal.rootSetState,
|
|
4742
|
-
enableCache: true
|
|
4743
|
-
})));
|
|
4744
|
-
}
|
|
4745
|
-
function handleRequest({
|
|
4746
|
-
url,
|
|
4747
|
-
key
|
|
4748
|
-
}) {
|
|
4749
|
-
fetch2(url).then((response) => response.json()).then((json) => {
|
|
4750
|
-
const newState = {
|
|
4751
|
-
...props.builderContextSignal.rootState,
|
|
4752
|
-
[key]: json
|
|
4753
|
-
};
|
|
4754
|
-
props.builderContextSignal.rootSetState?.(newState);
|
|
4755
|
-
httpReqsData()[key] = true;
|
|
4756
|
-
}).catch((err) => {
|
|
4757
|
-
});
|
|
4758
|
-
}
|
|
4759
4736
|
function runHttpRequests() {
|
|
4760
4737
|
const requests = props.builderContextSignal.content?.data?.httpRequests ?? {};
|
|
4761
4738
|
Object.entries(requests).forEach(([key, url]) => {
|
|
4762
|
-
if (url
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4739
|
+
if (!url)
|
|
4740
|
+
return;
|
|
4741
|
+
if (httpReqsPending()[key])
|
|
4742
|
+
return;
|
|
4743
|
+
if (httpReqsData()[key] && !isEditing())
|
|
4744
|
+
return;
|
|
4745
|
+
httpReqsPending()[key] = true;
|
|
4746
|
+
const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
|
|
4747
|
+
code: group,
|
|
4748
|
+
context: props.context || {},
|
|
4749
|
+
localState: void 0,
|
|
4750
|
+
rootState: props.builderContextSignal.rootState,
|
|
4751
|
+
rootSetState: props.builderContextSignal.rootSetState,
|
|
4752
|
+
enableCache: true
|
|
4753
|
+
})));
|
|
4754
|
+
fetch2(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
4755
|
+
mergeNewRootState({
|
|
4756
|
+
[key]: json
|
|
4767
4757
|
});
|
|
4768
|
-
|
|
4758
|
+
httpReqsData()[key] = true;
|
|
4759
|
+
}).catch((err) => {
|
|
4760
|
+
}).finally(() => {
|
|
4761
|
+
httpReqsPending()[key] = false;
|
|
4762
|
+
});
|
|
4769
4763
|
});
|
|
4770
4764
|
}
|
|
4771
4765
|
function emitStateUpdate() {
|
package/lib/browser/index.jsx
CHANGED
|
@@ -4018,7 +4018,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4018
4018
|
}
|
|
4019
4019
|
|
|
4020
4020
|
// src/constants/sdk-version.ts
|
|
4021
|
-
var SDK_VERSION = "1.0.
|
|
4021
|
+
var SDK_VERSION = "1.0.17";
|
|
4022
4022
|
|
|
4023
4023
|
// src/functions/register.ts
|
|
4024
4024
|
var registry = {};
|
|
@@ -4220,6 +4220,7 @@ function EnableEditor(props) {
|
|
|
4220
4220
|
props.contentWrapper || "div"
|
|
4221
4221
|
);
|
|
4222
4222
|
const [httpReqsData, setHttpReqsData] = createSignal12({});
|
|
4223
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal12({});
|
|
4223
4224
|
const [clicked, setClicked] = createSignal12(false);
|
|
4224
4225
|
function mergeNewRootState(newData) {
|
|
4225
4226
|
const combinedState = {
|
|
@@ -4315,42 +4316,38 @@ function EnableEditor(props) {
|
|
|
4315
4316
|
setClicked(true);
|
|
4316
4317
|
}
|
|
4317
4318
|
}
|
|
4318
|
-
function evalExpression(expression) {
|
|
4319
|
-
return expression.replace(
|
|
4320
|
-
/{{([^}]+)}}/g,
|
|
4321
|
-
(_match, group) => String(
|
|
4322
|
-
evaluate({
|
|
4323
|
-
code: group,
|
|
4324
|
-
context: props.context || {},
|
|
4325
|
-
localState: void 0,
|
|
4326
|
-
rootState: props.builderContextSignal.rootState,
|
|
4327
|
-
rootSetState: props.builderContextSignal.rootSetState,
|
|
4328
|
-
enableCache: true
|
|
4329
|
-
})
|
|
4330
|
-
)
|
|
4331
|
-
);
|
|
4332
|
-
}
|
|
4333
|
-
function handleRequest({ url, key }) {
|
|
4334
|
-
fetch2(url).then((response) => response.json()).then((json) => {
|
|
4335
|
-
const newState = {
|
|
4336
|
-
...props.builderContextSignal.rootState,
|
|
4337
|
-
[key]: json
|
|
4338
|
-
};
|
|
4339
|
-
props.builderContextSignal.rootSetState?.(newState);
|
|
4340
|
-
httpReqsData()[key] = true;
|
|
4341
|
-
}).catch((err) => {
|
|
4342
|
-
});
|
|
4343
|
-
}
|
|
4344
4319
|
function runHttpRequests() {
|
|
4345
4320
|
const requests = props.builderContextSignal.content?.data?.httpRequests ?? {};
|
|
4346
4321
|
Object.entries(requests).forEach(([key, url]) => {
|
|
4347
|
-
if (url
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4322
|
+
if (!url)
|
|
4323
|
+
return;
|
|
4324
|
+
if (httpReqsPending()[key])
|
|
4325
|
+
return;
|
|
4326
|
+
if (httpReqsData()[key] && !isEditing())
|
|
4327
|
+
return;
|
|
4328
|
+
httpReqsPending()[key] = true;
|
|
4329
|
+
const evaluatedUrl = url.replace(
|
|
4330
|
+
/{{([^}]+)}}/g,
|
|
4331
|
+
(_match, group) => String(
|
|
4332
|
+
evaluate({
|
|
4333
|
+
code: group,
|
|
4334
|
+
context: props.context || {},
|
|
4335
|
+
localState: void 0,
|
|
4336
|
+
rootState: props.builderContextSignal.rootState,
|
|
4337
|
+
rootSetState: props.builderContextSignal.rootSetState,
|
|
4338
|
+
enableCache: true
|
|
4339
|
+
})
|
|
4340
|
+
)
|
|
4341
|
+
);
|
|
4342
|
+
fetch2(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
4343
|
+
mergeNewRootState({
|
|
4344
|
+
[key]: json
|
|
4352
4345
|
});
|
|
4353
|
-
|
|
4346
|
+
httpReqsData()[key] = true;
|
|
4347
|
+
}).catch((err) => {
|
|
4348
|
+
}).finally(() => {
|
|
4349
|
+
httpReqsPending()[key] = false;
|
|
4350
|
+
});
|
|
4354
4351
|
});
|
|
4355
4352
|
}
|
|
4356
4353
|
function emitStateUpdate() {
|
package/lib/edge/dev.js
CHANGED
|
@@ -7602,7 +7602,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7602
7602
|
}
|
|
7603
7603
|
|
|
7604
7604
|
// src/constants/sdk-version.ts
|
|
7605
|
-
var SDK_VERSION = "1.0.
|
|
7605
|
+
var SDK_VERSION = "1.0.17";
|
|
7606
7606
|
|
|
7607
7607
|
// src/functions/register.ts
|
|
7608
7608
|
var registry = {};
|
|
@@ -7803,6 +7803,7 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
7803
7803
|
function EnableEditor(props) {
|
|
7804
7804
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
7805
7805
|
const [httpReqsData, setHttpReqsData] = createSignal({});
|
|
7806
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal({});
|
|
7806
7807
|
const [clicked, setClicked] = createSignal(false);
|
|
7807
7808
|
function mergeNewRootState(newData) {
|
|
7808
7809
|
const combinedState = {
|
|
@@ -7901,41 +7902,34 @@ function EnableEditor(props) {
|
|
|
7901
7902
|
setClicked(true);
|
|
7902
7903
|
}
|
|
7903
7904
|
}
|
|
7904
|
-
function evalExpression(expression) {
|
|
7905
|
-
return expression.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
|
|
7906
|
-
code: group,
|
|
7907
|
-
context: props.context || {},
|
|
7908
|
-
localState: void 0,
|
|
7909
|
-
rootState: props.builderContextSignal.rootState,
|
|
7910
|
-
rootSetState: props.builderContextSignal.rootSetState,
|
|
7911
|
-
enableCache: true
|
|
7912
|
-
})));
|
|
7913
|
-
}
|
|
7914
|
-
function handleRequest({
|
|
7915
|
-
url,
|
|
7916
|
-
key
|
|
7917
|
-
}) {
|
|
7918
|
-
fetch2(url).then((response) => response.json()).then((json) => {
|
|
7919
|
-
const newState = {
|
|
7920
|
-
...props.builderContextSignal.rootState,
|
|
7921
|
-
[key]: json
|
|
7922
|
-
};
|
|
7923
|
-
props.builderContextSignal.rootSetState?.(newState);
|
|
7924
|
-
httpReqsData()[key] = true;
|
|
7925
|
-
}).catch((err) => {
|
|
7926
|
-
console.error("error fetching dynamic data", url, err);
|
|
7927
|
-
});
|
|
7928
|
-
}
|
|
7929
7905
|
function runHttpRequests() {
|
|
7930
7906
|
const requests = props.builderContextSignal.content?.data?.httpRequests ?? {};
|
|
7931
7907
|
Object.entries(requests).forEach(([key, url]) => {
|
|
7932
|
-
if (url
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7908
|
+
if (!url)
|
|
7909
|
+
return;
|
|
7910
|
+
if (httpReqsPending()[key])
|
|
7911
|
+
return;
|
|
7912
|
+
if (httpReqsData()[key] && !isEditing())
|
|
7913
|
+
return;
|
|
7914
|
+
httpReqsPending()[key] = true;
|
|
7915
|
+
const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
|
|
7916
|
+
code: group,
|
|
7917
|
+
context: props.context || {},
|
|
7918
|
+
localState: void 0,
|
|
7919
|
+
rootState: props.builderContextSignal.rootState,
|
|
7920
|
+
rootSetState: props.builderContextSignal.rootSetState,
|
|
7921
|
+
enableCache: true
|
|
7922
|
+
})));
|
|
7923
|
+
fetch2(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
7924
|
+
mergeNewRootState({
|
|
7925
|
+
[key]: json
|
|
7937
7926
|
});
|
|
7938
|
-
|
|
7927
|
+
httpReqsData()[key] = true;
|
|
7928
|
+
}).catch((err) => {
|
|
7929
|
+
console.error("error fetching dynamic data", url, err);
|
|
7930
|
+
}).finally(() => {
|
|
7931
|
+
httpReqsPending()[key] = false;
|
|
7932
|
+
});
|
|
7939
7933
|
});
|
|
7940
7934
|
}
|
|
7941
7935
|
function emitStateUpdate() {
|
package/lib/edge/dev.jsx
CHANGED
|
@@ -7188,7 +7188,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7188
7188
|
}
|
|
7189
7189
|
|
|
7190
7190
|
// src/constants/sdk-version.ts
|
|
7191
|
-
var SDK_VERSION = "1.0.
|
|
7191
|
+
var SDK_VERSION = "1.0.17";
|
|
7192
7192
|
|
|
7193
7193
|
// src/functions/register.ts
|
|
7194
7194
|
var registry = {};
|
|
@@ -7391,6 +7391,7 @@ function EnableEditor(props) {
|
|
|
7391
7391
|
props.contentWrapper || "div"
|
|
7392
7392
|
);
|
|
7393
7393
|
const [httpReqsData, setHttpReqsData] = createSignal12({});
|
|
7394
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal12({});
|
|
7394
7395
|
const [clicked, setClicked] = createSignal12(false);
|
|
7395
7396
|
function mergeNewRootState(newData) {
|
|
7396
7397
|
const combinedState = {
|
|
@@ -7486,43 +7487,39 @@ function EnableEditor(props) {
|
|
|
7486
7487
|
setClicked(true);
|
|
7487
7488
|
}
|
|
7488
7489
|
}
|
|
7489
|
-
function evalExpression(expression) {
|
|
7490
|
-
return expression.replace(
|
|
7491
|
-
/{{([^}]+)}}/g,
|
|
7492
|
-
(_match, group) => String(
|
|
7493
|
-
evaluate({
|
|
7494
|
-
code: group,
|
|
7495
|
-
context: props.context || {},
|
|
7496
|
-
localState: void 0,
|
|
7497
|
-
rootState: props.builderContextSignal.rootState,
|
|
7498
|
-
rootSetState: props.builderContextSignal.rootSetState,
|
|
7499
|
-
enableCache: true
|
|
7500
|
-
})
|
|
7501
|
-
)
|
|
7502
|
-
);
|
|
7503
|
-
}
|
|
7504
|
-
function handleRequest({ url, key }) {
|
|
7505
|
-
fetch2(url).then((response) => response.json()).then((json) => {
|
|
7506
|
-
const newState = {
|
|
7507
|
-
...props.builderContextSignal.rootState,
|
|
7508
|
-
[key]: json
|
|
7509
|
-
};
|
|
7510
|
-
props.builderContextSignal.rootSetState?.(newState);
|
|
7511
|
-
httpReqsData()[key] = true;
|
|
7512
|
-
}).catch((err) => {
|
|
7513
|
-
console.error("error fetching dynamic data", url, err);
|
|
7514
|
-
});
|
|
7515
|
-
}
|
|
7516
7490
|
function runHttpRequests() {
|
|
7517
7491
|
const requests = props.builderContextSignal.content?.data?.httpRequests ?? {};
|
|
7518
7492
|
Object.entries(requests).forEach(([key, url]) => {
|
|
7519
|
-
if (url
|
|
7520
|
-
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
7493
|
+
if (!url)
|
|
7494
|
+
return;
|
|
7495
|
+
if (httpReqsPending()[key])
|
|
7496
|
+
return;
|
|
7497
|
+
if (httpReqsData()[key] && !isEditing())
|
|
7498
|
+
return;
|
|
7499
|
+
httpReqsPending()[key] = true;
|
|
7500
|
+
const evaluatedUrl = url.replace(
|
|
7501
|
+
/{{([^}]+)}}/g,
|
|
7502
|
+
(_match, group) => String(
|
|
7503
|
+
evaluate({
|
|
7504
|
+
code: group,
|
|
7505
|
+
context: props.context || {},
|
|
7506
|
+
localState: void 0,
|
|
7507
|
+
rootState: props.builderContextSignal.rootState,
|
|
7508
|
+
rootSetState: props.builderContextSignal.rootSetState,
|
|
7509
|
+
enableCache: true
|
|
7510
|
+
})
|
|
7511
|
+
)
|
|
7512
|
+
);
|
|
7513
|
+
fetch2(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
7514
|
+
mergeNewRootState({
|
|
7515
|
+
[key]: json
|
|
7524
7516
|
});
|
|
7525
|
-
|
|
7517
|
+
httpReqsData()[key] = true;
|
|
7518
|
+
}).catch((err) => {
|
|
7519
|
+
console.error("error fetching dynamic data", url, err);
|
|
7520
|
+
}).finally(() => {
|
|
7521
|
+
httpReqsPending()[key] = false;
|
|
7522
|
+
});
|
|
7526
7523
|
});
|
|
7527
7524
|
}
|
|
7528
7525
|
function emitStateUpdate() {
|
package/lib/edge/index.js
CHANGED
|
@@ -7587,7 +7587,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7587
7587
|
}
|
|
7588
7588
|
|
|
7589
7589
|
// src/constants/sdk-version.ts
|
|
7590
|
-
var SDK_VERSION = "1.0.
|
|
7590
|
+
var SDK_VERSION = "1.0.17";
|
|
7591
7591
|
|
|
7592
7592
|
// src/functions/register.ts
|
|
7593
7593
|
var registry = {};
|
|
@@ -7787,6 +7787,7 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
7787
7787
|
function EnableEditor(props) {
|
|
7788
7788
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
7789
7789
|
const [httpReqsData, setHttpReqsData] = createSignal({});
|
|
7790
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal({});
|
|
7790
7791
|
const [clicked, setClicked] = createSignal(false);
|
|
7791
7792
|
function mergeNewRootState(newData) {
|
|
7792
7793
|
const combinedState = {
|
|
@@ -7885,40 +7886,33 @@ function EnableEditor(props) {
|
|
|
7885
7886
|
setClicked(true);
|
|
7886
7887
|
}
|
|
7887
7888
|
}
|
|
7888
|
-
function evalExpression(expression) {
|
|
7889
|
-
return expression.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
|
|
7890
|
-
code: group,
|
|
7891
|
-
context: props.context || {},
|
|
7892
|
-
localState: void 0,
|
|
7893
|
-
rootState: props.builderContextSignal.rootState,
|
|
7894
|
-
rootSetState: props.builderContextSignal.rootSetState,
|
|
7895
|
-
enableCache: true
|
|
7896
|
-
})));
|
|
7897
|
-
}
|
|
7898
|
-
function handleRequest({
|
|
7899
|
-
url,
|
|
7900
|
-
key
|
|
7901
|
-
}) {
|
|
7902
|
-
fetch2(url).then((response) => response.json()).then((json) => {
|
|
7903
|
-
const newState = {
|
|
7904
|
-
...props.builderContextSignal.rootState,
|
|
7905
|
-
[key]: json
|
|
7906
|
-
};
|
|
7907
|
-
props.builderContextSignal.rootSetState?.(newState);
|
|
7908
|
-
httpReqsData()[key] = true;
|
|
7909
|
-
}).catch((err) => {
|
|
7910
|
-
});
|
|
7911
|
-
}
|
|
7912
7889
|
function runHttpRequests() {
|
|
7913
7890
|
const requests = props.builderContextSignal.content?.data?.httpRequests ?? {};
|
|
7914
7891
|
Object.entries(requests).forEach(([key, url]) => {
|
|
7915
|
-
if (url
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7892
|
+
if (!url)
|
|
7893
|
+
return;
|
|
7894
|
+
if (httpReqsPending()[key])
|
|
7895
|
+
return;
|
|
7896
|
+
if (httpReqsData()[key] && !isEditing())
|
|
7897
|
+
return;
|
|
7898
|
+
httpReqsPending()[key] = true;
|
|
7899
|
+
const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
|
|
7900
|
+
code: group,
|
|
7901
|
+
context: props.context || {},
|
|
7902
|
+
localState: void 0,
|
|
7903
|
+
rootState: props.builderContextSignal.rootState,
|
|
7904
|
+
rootSetState: props.builderContextSignal.rootSetState,
|
|
7905
|
+
enableCache: true
|
|
7906
|
+
})));
|
|
7907
|
+
fetch2(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
7908
|
+
mergeNewRootState({
|
|
7909
|
+
[key]: json
|
|
7920
7910
|
});
|
|
7921
|
-
|
|
7911
|
+
httpReqsData()[key] = true;
|
|
7912
|
+
}).catch((err) => {
|
|
7913
|
+
}).finally(() => {
|
|
7914
|
+
httpReqsPending()[key] = false;
|
|
7915
|
+
});
|
|
7922
7916
|
});
|
|
7923
7917
|
}
|
|
7924
7918
|
function emitStateUpdate() {
|
package/lib/edge/index.jsx
CHANGED
|
@@ -7173,7 +7173,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
7173
7173
|
}
|
|
7174
7174
|
|
|
7175
7175
|
// src/constants/sdk-version.ts
|
|
7176
|
-
var SDK_VERSION = "1.0.
|
|
7176
|
+
var SDK_VERSION = "1.0.17";
|
|
7177
7177
|
|
|
7178
7178
|
// src/functions/register.ts
|
|
7179
7179
|
var registry = {};
|
|
@@ -7375,6 +7375,7 @@ function EnableEditor(props) {
|
|
|
7375
7375
|
props.contentWrapper || "div"
|
|
7376
7376
|
);
|
|
7377
7377
|
const [httpReqsData, setHttpReqsData] = createSignal12({});
|
|
7378
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal12({});
|
|
7378
7379
|
const [clicked, setClicked] = createSignal12(false);
|
|
7379
7380
|
function mergeNewRootState(newData) {
|
|
7380
7381
|
const combinedState = {
|
|
@@ -7470,42 +7471,38 @@ function EnableEditor(props) {
|
|
|
7470
7471
|
setClicked(true);
|
|
7471
7472
|
}
|
|
7472
7473
|
}
|
|
7473
|
-
function evalExpression(expression) {
|
|
7474
|
-
return expression.replace(
|
|
7475
|
-
/{{([^}]+)}}/g,
|
|
7476
|
-
(_match, group) => String(
|
|
7477
|
-
evaluate({
|
|
7478
|
-
code: group,
|
|
7479
|
-
context: props.context || {},
|
|
7480
|
-
localState: void 0,
|
|
7481
|
-
rootState: props.builderContextSignal.rootState,
|
|
7482
|
-
rootSetState: props.builderContextSignal.rootSetState,
|
|
7483
|
-
enableCache: true
|
|
7484
|
-
})
|
|
7485
|
-
)
|
|
7486
|
-
);
|
|
7487
|
-
}
|
|
7488
|
-
function handleRequest({ url, key }) {
|
|
7489
|
-
fetch2(url).then((response) => response.json()).then((json) => {
|
|
7490
|
-
const newState = {
|
|
7491
|
-
...props.builderContextSignal.rootState,
|
|
7492
|
-
[key]: json
|
|
7493
|
-
};
|
|
7494
|
-
props.builderContextSignal.rootSetState?.(newState);
|
|
7495
|
-
httpReqsData()[key] = true;
|
|
7496
|
-
}).catch((err) => {
|
|
7497
|
-
});
|
|
7498
|
-
}
|
|
7499
7474
|
function runHttpRequests() {
|
|
7500
7475
|
const requests = props.builderContextSignal.content?.data?.httpRequests ?? {};
|
|
7501
7476
|
Object.entries(requests).forEach(([key, url]) => {
|
|
7502
|
-
if (url
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7477
|
+
if (!url)
|
|
7478
|
+
return;
|
|
7479
|
+
if (httpReqsPending()[key])
|
|
7480
|
+
return;
|
|
7481
|
+
if (httpReqsData()[key] && !isEditing())
|
|
7482
|
+
return;
|
|
7483
|
+
httpReqsPending()[key] = true;
|
|
7484
|
+
const evaluatedUrl = url.replace(
|
|
7485
|
+
/{{([^}]+)}}/g,
|
|
7486
|
+
(_match, group) => String(
|
|
7487
|
+
evaluate({
|
|
7488
|
+
code: group,
|
|
7489
|
+
context: props.context || {},
|
|
7490
|
+
localState: void 0,
|
|
7491
|
+
rootState: props.builderContextSignal.rootState,
|
|
7492
|
+
rootSetState: props.builderContextSignal.rootSetState,
|
|
7493
|
+
enableCache: true
|
|
7494
|
+
})
|
|
7495
|
+
)
|
|
7496
|
+
);
|
|
7497
|
+
fetch2(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
7498
|
+
mergeNewRootState({
|
|
7499
|
+
[key]: json
|
|
7507
7500
|
});
|
|
7508
|
-
|
|
7501
|
+
httpReqsData()[key] = true;
|
|
7502
|
+
}).catch((err) => {
|
|
7503
|
+
}).finally(() => {
|
|
7504
|
+
httpReqsPending()[key] = false;
|
|
7505
|
+
});
|
|
7509
7506
|
});
|
|
7510
7507
|
}
|
|
7511
7508
|
function emitStateUpdate() {
|
package/lib/node/dev.js
CHANGED
|
@@ -4574,7 +4574,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4574
4574
|
}
|
|
4575
4575
|
|
|
4576
4576
|
// src/constants/sdk-version.ts
|
|
4577
|
-
var SDK_VERSION = "1.0.
|
|
4577
|
+
var SDK_VERSION = "1.0.17";
|
|
4578
4578
|
|
|
4579
4579
|
// src/functions/register.ts
|
|
4580
4580
|
var registry = {};
|
|
@@ -4775,6 +4775,7 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4775
4775
|
function EnableEditor(props) {
|
|
4776
4776
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
4777
4777
|
const [httpReqsData, setHttpReqsData] = createSignal({});
|
|
4778
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal({});
|
|
4778
4779
|
const [clicked, setClicked] = createSignal(false);
|
|
4779
4780
|
function mergeNewRootState(newData) {
|
|
4780
4781
|
const combinedState = {
|
|
@@ -4873,41 +4874,34 @@ function EnableEditor(props) {
|
|
|
4873
4874
|
setClicked(true);
|
|
4874
4875
|
}
|
|
4875
4876
|
}
|
|
4876
|
-
function evalExpression(expression) {
|
|
4877
|
-
return expression.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
|
|
4878
|
-
code: group,
|
|
4879
|
-
context: props.context || {},
|
|
4880
|
-
localState: void 0,
|
|
4881
|
-
rootState: props.builderContextSignal.rootState,
|
|
4882
|
-
rootSetState: props.builderContextSignal.rootSetState,
|
|
4883
|
-
enableCache: true
|
|
4884
|
-
})));
|
|
4885
|
-
}
|
|
4886
|
-
function handleRequest({
|
|
4887
|
-
url,
|
|
4888
|
-
key
|
|
4889
|
-
}) {
|
|
4890
|
-
fetch2(url).then((response) => response.json()).then((json) => {
|
|
4891
|
-
const newState = {
|
|
4892
|
-
...props.builderContextSignal.rootState,
|
|
4893
|
-
[key]: json
|
|
4894
|
-
};
|
|
4895
|
-
props.builderContextSignal.rootSetState?.(newState);
|
|
4896
|
-
httpReqsData()[key] = true;
|
|
4897
|
-
}).catch((err) => {
|
|
4898
|
-
console.error("error fetching dynamic data", url, err);
|
|
4899
|
-
});
|
|
4900
|
-
}
|
|
4901
4877
|
function runHttpRequests() {
|
|
4902
4878
|
const requests = props.builderContextSignal.content?.data?.httpRequests ?? {};
|
|
4903
4879
|
Object.entries(requests).forEach(([key, url]) => {
|
|
4904
|
-
if (url
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4880
|
+
if (!url)
|
|
4881
|
+
return;
|
|
4882
|
+
if (httpReqsPending()[key])
|
|
4883
|
+
return;
|
|
4884
|
+
if (httpReqsData()[key] && !isEditing())
|
|
4885
|
+
return;
|
|
4886
|
+
httpReqsPending()[key] = true;
|
|
4887
|
+
const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
|
|
4888
|
+
code: group,
|
|
4889
|
+
context: props.context || {},
|
|
4890
|
+
localState: void 0,
|
|
4891
|
+
rootState: props.builderContextSignal.rootState,
|
|
4892
|
+
rootSetState: props.builderContextSignal.rootSetState,
|
|
4893
|
+
enableCache: true
|
|
4894
|
+
})));
|
|
4895
|
+
fetch2(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
4896
|
+
mergeNewRootState({
|
|
4897
|
+
[key]: json
|
|
4909
4898
|
});
|
|
4910
|
-
|
|
4899
|
+
httpReqsData()[key] = true;
|
|
4900
|
+
}).catch((err) => {
|
|
4901
|
+
console.error("error fetching dynamic data", url, err);
|
|
4902
|
+
}).finally(() => {
|
|
4903
|
+
httpReqsPending()[key] = false;
|
|
4904
|
+
});
|
|
4911
4905
|
});
|
|
4912
4906
|
}
|
|
4913
4907
|
function emitStateUpdate() {
|
package/lib/node/dev.jsx
CHANGED
|
@@ -4160,7 +4160,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4160
4160
|
}
|
|
4161
4161
|
|
|
4162
4162
|
// src/constants/sdk-version.ts
|
|
4163
|
-
var SDK_VERSION = "1.0.
|
|
4163
|
+
var SDK_VERSION = "1.0.17";
|
|
4164
4164
|
|
|
4165
4165
|
// src/functions/register.ts
|
|
4166
4166
|
var registry = {};
|
|
@@ -4363,6 +4363,7 @@ function EnableEditor(props) {
|
|
|
4363
4363
|
props.contentWrapper || "div"
|
|
4364
4364
|
);
|
|
4365
4365
|
const [httpReqsData, setHttpReqsData] = createSignal12({});
|
|
4366
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal12({});
|
|
4366
4367
|
const [clicked, setClicked] = createSignal12(false);
|
|
4367
4368
|
function mergeNewRootState(newData) {
|
|
4368
4369
|
const combinedState = {
|
|
@@ -4458,43 +4459,39 @@ function EnableEditor(props) {
|
|
|
4458
4459
|
setClicked(true);
|
|
4459
4460
|
}
|
|
4460
4461
|
}
|
|
4461
|
-
function evalExpression(expression) {
|
|
4462
|
-
return expression.replace(
|
|
4463
|
-
/{{([^}]+)}}/g,
|
|
4464
|
-
(_match, group) => String(
|
|
4465
|
-
evaluate({
|
|
4466
|
-
code: group,
|
|
4467
|
-
context: props.context || {},
|
|
4468
|
-
localState: void 0,
|
|
4469
|
-
rootState: props.builderContextSignal.rootState,
|
|
4470
|
-
rootSetState: props.builderContextSignal.rootSetState,
|
|
4471
|
-
enableCache: true
|
|
4472
|
-
})
|
|
4473
|
-
)
|
|
4474
|
-
);
|
|
4475
|
-
}
|
|
4476
|
-
function handleRequest({ url, key }) {
|
|
4477
|
-
fetch2(url).then((response) => response.json()).then((json) => {
|
|
4478
|
-
const newState = {
|
|
4479
|
-
...props.builderContextSignal.rootState,
|
|
4480
|
-
[key]: json
|
|
4481
|
-
};
|
|
4482
|
-
props.builderContextSignal.rootSetState?.(newState);
|
|
4483
|
-
httpReqsData()[key] = true;
|
|
4484
|
-
}).catch((err) => {
|
|
4485
|
-
console.error("error fetching dynamic data", url, err);
|
|
4486
|
-
});
|
|
4487
|
-
}
|
|
4488
4462
|
function runHttpRequests() {
|
|
4489
4463
|
const requests = props.builderContextSignal.content?.data?.httpRequests ?? {};
|
|
4490
4464
|
Object.entries(requests).forEach(([key, url]) => {
|
|
4491
|
-
if (url
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4465
|
+
if (!url)
|
|
4466
|
+
return;
|
|
4467
|
+
if (httpReqsPending()[key])
|
|
4468
|
+
return;
|
|
4469
|
+
if (httpReqsData()[key] && !isEditing())
|
|
4470
|
+
return;
|
|
4471
|
+
httpReqsPending()[key] = true;
|
|
4472
|
+
const evaluatedUrl = url.replace(
|
|
4473
|
+
/{{([^}]+)}}/g,
|
|
4474
|
+
(_match, group) => String(
|
|
4475
|
+
evaluate({
|
|
4476
|
+
code: group,
|
|
4477
|
+
context: props.context || {},
|
|
4478
|
+
localState: void 0,
|
|
4479
|
+
rootState: props.builderContextSignal.rootState,
|
|
4480
|
+
rootSetState: props.builderContextSignal.rootSetState,
|
|
4481
|
+
enableCache: true
|
|
4482
|
+
})
|
|
4483
|
+
)
|
|
4484
|
+
);
|
|
4485
|
+
fetch2(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
4486
|
+
mergeNewRootState({
|
|
4487
|
+
[key]: json
|
|
4496
4488
|
});
|
|
4497
|
-
|
|
4489
|
+
httpReqsData()[key] = true;
|
|
4490
|
+
}).catch((err) => {
|
|
4491
|
+
console.error("error fetching dynamic data", url, err);
|
|
4492
|
+
}).finally(() => {
|
|
4493
|
+
httpReqsPending()[key] = false;
|
|
4494
|
+
});
|
|
4498
4495
|
});
|
|
4499
4496
|
}
|
|
4500
4497
|
function emitStateUpdate() {
|
package/lib/node/index.js
CHANGED
|
@@ -4558,7 +4558,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4558
4558
|
}
|
|
4559
4559
|
|
|
4560
4560
|
// src/constants/sdk-version.ts
|
|
4561
|
-
var SDK_VERSION = "1.0.
|
|
4561
|
+
var SDK_VERSION = "1.0.17";
|
|
4562
4562
|
|
|
4563
4563
|
// src/functions/register.ts
|
|
4564
4564
|
var registry = {};
|
|
@@ -4758,6 +4758,7 @@ var subscribeToEditor = (model, callback, options) => {
|
|
|
4758
4758
|
function EnableEditor(props) {
|
|
4759
4759
|
const [ContentWrapper, setContentWrapper] = createSignal(props.contentWrapper || "div");
|
|
4760
4760
|
const [httpReqsData, setHttpReqsData] = createSignal({});
|
|
4761
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal({});
|
|
4761
4762
|
const [clicked, setClicked] = createSignal(false);
|
|
4762
4763
|
function mergeNewRootState(newData) {
|
|
4763
4764
|
const combinedState = {
|
|
@@ -4856,40 +4857,33 @@ function EnableEditor(props) {
|
|
|
4856
4857
|
setClicked(true);
|
|
4857
4858
|
}
|
|
4858
4859
|
}
|
|
4859
|
-
function evalExpression(expression) {
|
|
4860
|
-
return expression.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
|
|
4861
|
-
code: group,
|
|
4862
|
-
context: props.context || {},
|
|
4863
|
-
localState: void 0,
|
|
4864
|
-
rootState: props.builderContextSignal.rootState,
|
|
4865
|
-
rootSetState: props.builderContextSignal.rootSetState,
|
|
4866
|
-
enableCache: true
|
|
4867
|
-
})));
|
|
4868
|
-
}
|
|
4869
|
-
function handleRequest({
|
|
4870
|
-
url,
|
|
4871
|
-
key
|
|
4872
|
-
}) {
|
|
4873
|
-
fetch2(url).then((response) => response.json()).then((json) => {
|
|
4874
|
-
const newState = {
|
|
4875
|
-
...props.builderContextSignal.rootState,
|
|
4876
|
-
[key]: json
|
|
4877
|
-
};
|
|
4878
|
-
props.builderContextSignal.rootSetState?.(newState);
|
|
4879
|
-
httpReqsData()[key] = true;
|
|
4880
|
-
}).catch((err) => {
|
|
4881
|
-
});
|
|
4882
|
-
}
|
|
4883
4860
|
function runHttpRequests() {
|
|
4884
4861
|
const requests = props.builderContextSignal.content?.data?.httpRequests ?? {};
|
|
4885
4862
|
Object.entries(requests).forEach(([key, url]) => {
|
|
4886
|
-
if (url
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4863
|
+
if (!url)
|
|
4864
|
+
return;
|
|
4865
|
+
if (httpReqsPending()[key])
|
|
4866
|
+
return;
|
|
4867
|
+
if (httpReqsData()[key] && !isEditing())
|
|
4868
|
+
return;
|
|
4869
|
+
httpReqsPending()[key] = true;
|
|
4870
|
+
const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
|
|
4871
|
+
code: group,
|
|
4872
|
+
context: props.context || {},
|
|
4873
|
+
localState: void 0,
|
|
4874
|
+
rootState: props.builderContextSignal.rootState,
|
|
4875
|
+
rootSetState: props.builderContextSignal.rootSetState,
|
|
4876
|
+
enableCache: true
|
|
4877
|
+
})));
|
|
4878
|
+
fetch2(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
4879
|
+
mergeNewRootState({
|
|
4880
|
+
[key]: json
|
|
4891
4881
|
});
|
|
4892
|
-
|
|
4882
|
+
httpReqsData()[key] = true;
|
|
4883
|
+
}).catch((err) => {
|
|
4884
|
+
}).finally(() => {
|
|
4885
|
+
httpReqsPending()[key] = false;
|
|
4886
|
+
});
|
|
4893
4887
|
});
|
|
4894
4888
|
}
|
|
4895
4889
|
function emitStateUpdate() {
|
package/lib/node/index.jsx
CHANGED
|
@@ -4144,7 +4144,7 @@ function isFromTrustedHost(trustedHosts, e) {
|
|
|
4144
4144
|
}
|
|
4145
4145
|
|
|
4146
4146
|
// src/constants/sdk-version.ts
|
|
4147
|
-
var SDK_VERSION = "1.0.
|
|
4147
|
+
var SDK_VERSION = "1.0.17";
|
|
4148
4148
|
|
|
4149
4149
|
// src/functions/register.ts
|
|
4150
4150
|
var registry = {};
|
|
@@ -4346,6 +4346,7 @@ function EnableEditor(props) {
|
|
|
4346
4346
|
props.contentWrapper || "div"
|
|
4347
4347
|
);
|
|
4348
4348
|
const [httpReqsData, setHttpReqsData] = createSignal12({});
|
|
4349
|
+
const [httpReqsPending, setHttpReqsPending] = createSignal12({});
|
|
4349
4350
|
const [clicked, setClicked] = createSignal12(false);
|
|
4350
4351
|
function mergeNewRootState(newData) {
|
|
4351
4352
|
const combinedState = {
|
|
@@ -4441,42 +4442,38 @@ function EnableEditor(props) {
|
|
|
4441
4442
|
setClicked(true);
|
|
4442
4443
|
}
|
|
4443
4444
|
}
|
|
4444
|
-
function evalExpression(expression) {
|
|
4445
|
-
return expression.replace(
|
|
4446
|
-
/{{([^}]+)}}/g,
|
|
4447
|
-
(_match, group) => String(
|
|
4448
|
-
evaluate({
|
|
4449
|
-
code: group,
|
|
4450
|
-
context: props.context || {},
|
|
4451
|
-
localState: void 0,
|
|
4452
|
-
rootState: props.builderContextSignal.rootState,
|
|
4453
|
-
rootSetState: props.builderContextSignal.rootSetState,
|
|
4454
|
-
enableCache: true
|
|
4455
|
-
})
|
|
4456
|
-
)
|
|
4457
|
-
);
|
|
4458
|
-
}
|
|
4459
|
-
function handleRequest({ url, key }) {
|
|
4460
|
-
fetch2(url).then((response) => response.json()).then((json) => {
|
|
4461
|
-
const newState = {
|
|
4462
|
-
...props.builderContextSignal.rootState,
|
|
4463
|
-
[key]: json
|
|
4464
|
-
};
|
|
4465
|
-
props.builderContextSignal.rootSetState?.(newState);
|
|
4466
|
-
httpReqsData()[key] = true;
|
|
4467
|
-
}).catch((err) => {
|
|
4468
|
-
});
|
|
4469
|
-
}
|
|
4470
4445
|
function runHttpRequests() {
|
|
4471
4446
|
const requests = props.builderContextSignal.content?.data?.httpRequests ?? {};
|
|
4472
4447
|
Object.entries(requests).forEach(([key, url]) => {
|
|
4473
|
-
if (url
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4448
|
+
if (!url)
|
|
4449
|
+
return;
|
|
4450
|
+
if (httpReqsPending()[key])
|
|
4451
|
+
return;
|
|
4452
|
+
if (httpReqsData()[key] && !isEditing())
|
|
4453
|
+
return;
|
|
4454
|
+
httpReqsPending()[key] = true;
|
|
4455
|
+
const evaluatedUrl = url.replace(
|
|
4456
|
+
/{{([^}]+)}}/g,
|
|
4457
|
+
(_match, group) => String(
|
|
4458
|
+
evaluate({
|
|
4459
|
+
code: group,
|
|
4460
|
+
context: props.context || {},
|
|
4461
|
+
localState: void 0,
|
|
4462
|
+
rootState: props.builderContextSignal.rootState,
|
|
4463
|
+
rootSetState: props.builderContextSignal.rootSetState,
|
|
4464
|
+
enableCache: true
|
|
4465
|
+
})
|
|
4466
|
+
)
|
|
4467
|
+
);
|
|
4468
|
+
fetch2(evaluatedUrl).then((response) => response.json()).then((json) => {
|
|
4469
|
+
mergeNewRootState({
|
|
4470
|
+
[key]: json
|
|
4478
4471
|
});
|
|
4479
|
-
|
|
4472
|
+
httpReqsData()[key] = true;
|
|
4473
|
+
}).catch((err) => {
|
|
4474
|
+
}).finally(() => {
|
|
4475
|
+
httpReqsPending()[key] = false;
|
|
4476
|
+
});
|
|
4480
4477
|
});
|
|
4481
4478
|
}
|
|
4482
4479
|
function emitStateUpdate() {
|