@builder.io/sdk-qwik 0.19.3 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/components/content/components/enable-editor.qwik.cjs +20 -5
- package/lib/browser/components/content/components/enable-editor.qwik.mjs +20 -5
- package/lib/browser/constants/sdk-version.qwik.cjs +1 -1
- package/lib/browser/constants/sdk-version.qwik.mjs +1 -1
- package/lib/edge/components/content/components/enable-editor.qwik.cjs +20 -5
- package/lib/edge/components/content/components/enable-editor.qwik.mjs +20 -5
- package/lib/edge/constants/sdk-version.qwik.cjs +1 -1
- package/lib/edge/constants/sdk-version.qwik.mjs +1 -1
- package/lib/node/components/content/components/enable-editor.qwik.cjs +20 -5
- package/lib/node/components/content/components/enable-editor.qwik.mjs +20 -5
- package/lib/node/constants/sdk-version.qwik.cjs +1 -1
- package/lib/node/constants/sdk-version.qwik.mjs +1 -1
- package/package.json +1 -1
- package/types/src/constants/sdk-version.d.ts +1 -1
|
@@ -99,13 +99,15 @@ const onClick = function onClick2(props, state, showContentProps, elementRef, ev
|
|
|
99
99
|
const runHttpRequests = function runHttpRequests2(props, state, showContentProps, elementRef) {
|
|
100
100
|
var _a, _b;
|
|
101
101
|
const requests = ((_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.httpRequests) ?? {};
|
|
102
|
-
Object.entries(requests).forEach(([key,
|
|
103
|
-
if (!
|
|
102
|
+
Object.entries(requests).forEach(([key, httpRequest]) => {
|
|
103
|
+
if (!httpRequest)
|
|
104
104
|
return;
|
|
105
|
+
const isCoreRequest = typeof httpRequest === "object" && httpRequest["@type"] === "@builder.io/core:Request";
|
|
105
106
|
if (state.httpReqsPending[key])
|
|
106
107
|
return;
|
|
107
108
|
if (state.httpReqsData[key] && !isEditing.isEditing())
|
|
108
109
|
return;
|
|
110
|
+
const url = isCoreRequest ? httpRequest.request.url : httpRequest;
|
|
109
111
|
state.httpReqsPending[key] = true;
|
|
110
112
|
const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate.evaluate({
|
|
111
113
|
code: group,
|
|
@@ -114,14 +116,27 @@ const runHttpRequests = function runHttpRequests2(props, state, showContentProps
|
|
|
114
116
|
rootState: props.builderContextSignal.rootState,
|
|
115
117
|
rootSetState: props.builderContextSignal.rootSetState
|
|
116
118
|
})));
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
const fetchRequestObj = isCoreRequest ? {
|
|
120
|
+
url: evaluatedUrl,
|
|
121
|
+
method: httpRequest.request.method,
|
|
122
|
+
headers: httpRequest.request.headers,
|
|
123
|
+
body: httpRequest.request.body
|
|
124
|
+
} : {
|
|
125
|
+
url: evaluatedUrl,
|
|
126
|
+
method: "GET"
|
|
127
|
+
};
|
|
128
|
+
logFetch.logFetch(JSON.stringify(fetchRequestObj));
|
|
129
|
+
fetch(fetchRequestObj.url, {
|
|
130
|
+
method: fetchRequestObj.method,
|
|
131
|
+
headers: fetchRequestObj.headers,
|
|
132
|
+
body: fetchRequestObj.body
|
|
133
|
+
}).then((response) => response.json()).then((json) => {
|
|
119
134
|
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
120
135
|
[key]: json
|
|
121
136
|
});
|
|
122
137
|
state.httpReqsData[key] = true;
|
|
123
138
|
}).catch((err) => {
|
|
124
|
-
console.error("error fetching dynamic data",
|
|
139
|
+
console.error("error fetching dynamic data", JSON.stringify(httpRequest), err);
|
|
125
140
|
}).finally(() => {
|
|
126
141
|
state.httpReqsPending[key] = false;
|
|
127
142
|
});
|
|
@@ -97,13 +97,15 @@ const onClick = function onClick2(props, state, showContentProps, elementRef, ev
|
|
|
97
97
|
const runHttpRequests = function runHttpRequests2(props, state, showContentProps, elementRef) {
|
|
98
98
|
var _a, _b;
|
|
99
99
|
const requests = ((_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.httpRequests) ?? {};
|
|
100
|
-
Object.entries(requests).forEach(([key,
|
|
101
|
-
if (!
|
|
100
|
+
Object.entries(requests).forEach(([key, httpRequest]) => {
|
|
101
|
+
if (!httpRequest)
|
|
102
102
|
return;
|
|
103
|
+
const isCoreRequest = typeof httpRequest === "object" && httpRequest["@type"] === "@builder.io/core:Request";
|
|
103
104
|
if (state.httpReqsPending[key])
|
|
104
105
|
return;
|
|
105
106
|
if (state.httpReqsData[key] && !isEditing())
|
|
106
107
|
return;
|
|
108
|
+
const url = isCoreRequest ? httpRequest.request.url : httpRequest;
|
|
107
109
|
state.httpReqsPending[key] = true;
|
|
108
110
|
const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
|
|
109
111
|
code: group,
|
|
@@ -112,14 +114,27 @@ const runHttpRequests = function runHttpRequests2(props, state, showContentProps
|
|
|
112
114
|
rootState: props.builderContextSignal.rootState,
|
|
113
115
|
rootSetState: props.builderContextSignal.rootSetState
|
|
114
116
|
})));
|
|
115
|
-
|
|
116
|
-
|
|
117
|
+
const fetchRequestObj = isCoreRequest ? {
|
|
118
|
+
url: evaluatedUrl,
|
|
119
|
+
method: httpRequest.request.method,
|
|
120
|
+
headers: httpRequest.request.headers,
|
|
121
|
+
body: httpRequest.request.body
|
|
122
|
+
} : {
|
|
123
|
+
url: evaluatedUrl,
|
|
124
|
+
method: "GET"
|
|
125
|
+
};
|
|
126
|
+
logFetch(JSON.stringify(fetchRequestObj));
|
|
127
|
+
fetch(fetchRequestObj.url, {
|
|
128
|
+
method: fetchRequestObj.method,
|
|
129
|
+
headers: fetchRequestObj.headers,
|
|
130
|
+
body: fetchRequestObj.body
|
|
131
|
+
}).then((response) => response.json()).then((json) => {
|
|
117
132
|
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
118
133
|
[key]: json
|
|
119
134
|
});
|
|
120
135
|
state.httpReqsData[key] = true;
|
|
121
136
|
}).catch((err) => {
|
|
122
|
-
console.error("error fetching dynamic data",
|
|
137
|
+
console.error("error fetching dynamic data", JSON.stringify(httpRequest), err);
|
|
123
138
|
}).finally(() => {
|
|
124
139
|
state.httpReqsPending[key] = false;
|
|
125
140
|
});
|
|
@@ -99,13 +99,15 @@ const onClick = function onClick2(props, state, showContentProps, elementRef, ev
|
|
|
99
99
|
const runHttpRequests = function runHttpRequests2(props, state, showContentProps, elementRef) {
|
|
100
100
|
var _a, _b;
|
|
101
101
|
const requests = ((_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.httpRequests) ?? {};
|
|
102
|
-
Object.entries(requests).forEach(([key,
|
|
103
|
-
if (!
|
|
102
|
+
Object.entries(requests).forEach(([key, httpRequest]) => {
|
|
103
|
+
if (!httpRequest)
|
|
104
104
|
return;
|
|
105
|
+
const isCoreRequest = typeof httpRequest === "object" && httpRequest["@type"] === "@builder.io/core:Request";
|
|
105
106
|
if (state.httpReqsPending[key])
|
|
106
107
|
return;
|
|
107
108
|
if (state.httpReqsData[key] && !isEditing.isEditing())
|
|
108
109
|
return;
|
|
110
|
+
const url = isCoreRequest ? httpRequest.request.url : httpRequest;
|
|
109
111
|
state.httpReqsPending[key] = true;
|
|
110
112
|
const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate.evaluate({
|
|
111
113
|
code: group,
|
|
@@ -114,14 +116,27 @@ const runHttpRequests = function runHttpRequests2(props, state, showContentProps
|
|
|
114
116
|
rootState: props.builderContextSignal.rootState,
|
|
115
117
|
rootSetState: props.builderContextSignal.rootSetState
|
|
116
118
|
})));
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
const fetchRequestObj = isCoreRequest ? {
|
|
120
|
+
url: evaluatedUrl,
|
|
121
|
+
method: httpRequest.request.method,
|
|
122
|
+
headers: httpRequest.request.headers,
|
|
123
|
+
body: httpRequest.request.body
|
|
124
|
+
} : {
|
|
125
|
+
url: evaluatedUrl,
|
|
126
|
+
method: "GET"
|
|
127
|
+
};
|
|
128
|
+
logFetch.logFetch(JSON.stringify(fetchRequestObj));
|
|
129
|
+
fetch(fetchRequestObj.url, {
|
|
130
|
+
method: fetchRequestObj.method,
|
|
131
|
+
headers: fetchRequestObj.headers,
|
|
132
|
+
body: fetchRequestObj.body
|
|
133
|
+
}).then((response) => response.json()).then((json) => {
|
|
119
134
|
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
120
135
|
[key]: json
|
|
121
136
|
});
|
|
122
137
|
state.httpReqsData[key] = true;
|
|
123
138
|
}).catch((err) => {
|
|
124
|
-
console.error("error fetching dynamic data",
|
|
139
|
+
console.error("error fetching dynamic data", JSON.stringify(httpRequest), err);
|
|
125
140
|
}).finally(() => {
|
|
126
141
|
state.httpReqsPending[key] = false;
|
|
127
142
|
});
|
|
@@ -97,13 +97,15 @@ const onClick = function onClick2(props, state, showContentProps, elementRef, ev
|
|
|
97
97
|
const runHttpRequests = function runHttpRequests2(props, state, showContentProps, elementRef) {
|
|
98
98
|
var _a, _b;
|
|
99
99
|
const requests = ((_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.httpRequests) ?? {};
|
|
100
|
-
Object.entries(requests).forEach(([key,
|
|
101
|
-
if (!
|
|
100
|
+
Object.entries(requests).forEach(([key, httpRequest]) => {
|
|
101
|
+
if (!httpRequest)
|
|
102
102
|
return;
|
|
103
|
+
const isCoreRequest = typeof httpRequest === "object" && httpRequest["@type"] === "@builder.io/core:Request";
|
|
103
104
|
if (state.httpReqsPending[key])
|
|
104
105
|
return;
|
|
105
106
|
if (state.httpReqsData[key] && !isEditing())
|
|
106
107
|
return;
|
|
108
|
+
const url = isCoreRequest ? httpRequest.request.url : httpRequest;
|
|
107
109
|
state.httpReqsPending[key] = true;
|
|
108
110
|
const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
|
|
109
111
|
code: group,
|
|
@@ -112,14 +114,27 @@ const runHttpRequests = function runHttpRequests2(props, state, showContentProps
|
|
|
112
114
|
rootState: props.builderContextSignal.rootState,
|
|
113
115
|
rootSetState: props.builderContextSignal.rootSetState
|
|
114
116
|
})));
|
|
115
|
-
|
|
116
|
-
|
|
117
|
+
const fetchRequestObj = isCoreRequest ? {
|
|
118
|
+
url: evaluatedUrl,
|
|
119
|
+
method: httpRequest.request.method,
|
|
120
|
+
headers: httpRequest.request.headers,
|
|
121
|
+
body: httpRequest.request.body
|
|
122
|
+
} : {
|
|
123
|
+
url: evaluatedUrl,
|
|
124
|
+
method: "GET"
|
|
125
|
+
};
|
|
126
|
+
logFetch(JSON.stringify(fetchRequestObj));
|
|
127
|
+
fetch(fetchRequestObj.url, {
|
|
128
|
+
method: fetchRequestObj.method,
|
|
129
|
+
headers: fetchRequestObj.headers,
|
|
130
|
+
body: fetchRequestObj.body
|
|
131
|
+
}).then((response) => response.json()).then((json) => {
|
|
117
132
|
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
118
133
|
[key]: json
|
|
119
134
|
});
|
|
120
135
|
state.httpReqsData[key] = true;
|
|
121
136
|
}).catch((err) => {
|
|
122
|
-
console.error("error fetching dynamic data",
|
|
137
|
+
console.error("error fetching dynamic data", JSON.stringify(httpRequest), err);
|
|
123
138
|
}).finally(() => {
|
|
124
139
|
state.httpReqsPending[key] = false;
|
|
125
140
|
});
|
|
@@ -99,13 +99,15 @@ const onClick = function onClick2(props, state, showContentProps, elementRef, ev
|
|
|
99
99
|
const runHttpRequests = function runHttpRequests2(props, state, showContentProps, elementRef) {
|
|
100
100
|
var _a, _b;
|
|
101
101
|
const requests = ((_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.httpRequests) ?? {};
|
|
102
|
-
Object.entries(requests).forEach(([key,
|
|
103
|
-
if (!
|
|
102
|
+
Object.entries(requests).forEach(([key, httpRequest]) => {
|
|
103
|
+
if (!httpRequest)
|
|
104
104
|
return;
|
|
105
|
+
const isCoreRequest = typeof httpRequest === "object" && httpRequest["@type"] === "@builder.io/core:Request";
|
|
105
106
|
if (state.httpReqsPending[key])
|
|
106
107
|
return;
|
|
107
108
|
if (state.httpReqsData[key] && !isEditing.isEditing())
|
|
108
109
|
return;
|
|
110
|
+
const url = isCoreRequest ? httpRequest.request.url : httpRequest;
|
|
109
111
|
state.httpReqsPending[key] = true;
|
|
110
112
|
const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate.evaluate({
|
|
111
113
|
code: group,
|
|
@@ -114,14 +116,27 @@ const runHttpRequests = function runHttpRequests2(props, state, showContentProps
|
|
|
114
116
|
rootState: props.builderContextSignal.rootState,
|
|
115
117
|
rootSetState: props.builderContextSignal.rootSetState
|
|
116
118
|
})));
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
const fetchRequestObj = isCoreRequest ? {
|
|
120
|
+
url: evaluatedUrl,
|
|
121
|
+
method: httpRequest.request.method,
|
|
122
|
+
headers: httpRequest.request.headers,
|
|
123
|
+
body: httpRequest.request.body
|
|
124
|
+
} : {
|
|
125
|
+
url: evaluatedUrl,
|
|
126
|
+
method: "GET"
|
|
127
|
+
};
|
|
128
|
+
logFetch.logFetch(JSON.stringify(fetchRequestObj));
|
|
129
|
+
fetch(fetchRequestObj.url, {
|
|
130
|
+
method: fetchRequestObj.method,
|
|
131
|
+
headers: fetchRequestObj.headers,
|
|
132
|
+
body: fetchRequestObj.body
|
|
133
|
+
}).then((response) => response.json()).then((json) => {
|
|
119
134
|
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
120
135
|
[key]: json
|
|
121
136
|
});
|
|
122
137
|
state.httpReqsData[key] = true;
|
|
123
138
|
}).catch((err) => {
|
|
124
|
-
console.error("error fetching dynamic data",
|
|
139
|
+
console.error("error fetching dynamic data", JSON.stringify(httpRequest), err);
|
|
125
140
|
}).finally(() => {
|
|
126
141
|
state.httpReqsPending[key] = false;
|
|
127
142
|
});
|
|
@@ -97,13 +97,15 @@ const onClick = function onClick2(props, state, showContentProps, elementRef, ev
|
|
|
97
97
|
const runHttpRequests = function runHttpRequests2(props, state, showContentProps, elementRef) {
|
|
98
98
|
var _a, _b;
|
|
99
99
|
const requests = ((_b = (_a = props.builderContextSignal.content) == null ? void 0 : _a.data) == null ? void 0 : _b.httpRequests) ?? {};
|
|
100
|
-
Object.entries(requests).forEach(([key,
|
|
101
|
-
if (!
|
|
100
|
+
Object.entries(requests).forEach(([key, httpRequest]) => {
|
|
101
|
+
if (!httpRequest)
|
|
102
102
|
return;
|
|
103
|
+
const isCoreRequest = typeof httpRequest === "object" && httpRequest["@type"] === "@builder.io/core:Request";
|
|
103
104
|
if (state.httpReqsPending[key])
|
|
104
105
|
return;
|
|
105
106
|
if (state.httpReqsData[key] && !isEditing())
|
|
106
107
|
return;
|
|
108
|
+
const url = isCoreRequest ? httpRequest.request.url : httpRequest;
|
|
107
109
|
state.httpReqsPending[key] = true;
|
|
108
110
|
const evaluatedUrl = url.replace(/{{([^}]+)}}/g, (_match, group) => String(evaluate({
|
|
109
111
|
code: group,
|
|
@@ -112,14 +114,27 @@ const runHttpRequests = function runHttpRequests2(props, state, showContentProps
|
|
|
112
114
|
rootState: props.builderContextSignal.rootState,
|
|
113
115
|
rootSetState: props.builderContextSignal.rootSetState
|
|
114
116
|
})));
|
|
115
|
-
|
|
116
|
-
|
|
117
|
+
const fetchRequestObj = isCoreRequest ? {
|
|
118
|
+
url: evaluatedUrl,
|
|
119
|
+
method: httpRequest.request.method,
|
|
120
|
+
headers: httpRequest.request.headers,
|
|
121
|
+
body: httpRequest.request.body
|
|
122
|
+
} : {
|
|
123
|
+
url: evaluatedUrl,
|
|
124
|
+
method: "GET"
|
|
125
|
+
};
|
|
126
|
+
logFetch(JSON.stringify(fetchRequestObj));
|
|
127
|
+
fetch(fetchRequestObj.url, {
|
|
128
|
+
method: fetchRequestObj.method,
|
|
129
|
+
headers: fetchRequestObj.headers,
|
|
130
|
+
body: fetchRequestObj.body
|
|
131
|
+
}).then((response) => response.json()).then((json) => {
|
|
117
132
|
mergeNewRootState(props, state, showContentProps, elementRef, {
|
|
118
133
|
[key]: json
|
|
119
134
|
});
|
|
120
135
|
state.httpReqsData[key] = true;
|
|
121
136
|
}).catch((err) => {
|
|
122
|
-
console.error("error fetching dynamic data",
|
|
137
|
+
console.error("error fetching dynamic data", JSON.stringify(httpRequest), err);
|
|
123
138
|
}).finally(() => {
|
|
124
139
|
state.httpReqsPending[key] = false;
|
|
125
140
|
});
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.
|
|
1
|
+
export declare const SDK_VERSION = "0.20.0";
|