@builder.io/sdk-svelte 1.0.13 → 1.0.15
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.svelte +13 -23
- package/lib/browser/constants/sdk-version.d.ts +1 -1
- package/lib/browser/constants/sdk-version.js +1 -1
- package/lib/browser/functions/get-content/index.js +2 -1
- package/lib/browser/functions/get-content/types.d.ts +8 -0
- package/lib/edge/components/content/components/enable-editor.svelte +13 -23
- package/lib/edge/constants/sdk-version.d.ts +1 -1
- package/lib/edge/constants/sdk-version.js +1 -1
- package/lib/edge/functions/get-content/index.js +2 -1
- package/lib/edge/functions/get-content/types.d.ts +8 -0
- package/lib/node/components/content/components/enable-editor.svelte +13 -23
- package/lib/node/constants/sdk-version.d.ts +1 -1
- package/lib/node/constants/sdk-version.js +1 -1
- package/lib/node/functions/get-content/index.js +2 -1
- package/lib/node/functions/get-content/types.d.ts +8 -0
- package/package.json +1 -1
- package/src/components/content/components/enable-editor.svelte +14 -26
- package/src/constants/sdk-version.ts +1 -1
- package/src/functions/get-content/index.ts +2 -1
- package/src/functions/get-content/types.ts +10 -0
|
@@ -76,7 +76,6 @@ function processMessage(event) {
|
|
|
76
76
|
breakpoints,
|
|
77
77
|
},
|
|
78
78
|
});
|
|
79
|
-
forceReRenderCount = forceReRenderCount + 1; // This is a hack to force Qwik to re-render.
|
|
80
79
|
}
|
|
81
80
|
},
|
|
82
81
|
animation: (animation) => {
|
|
@@ -84,7 +83,6 @@ function processMessage(event) {
|
|
|
84
83
|
},
|
|
85
84
|
contentUpdate: (newContent) => {
|
|
86
85
|
mergeNewContent(newContent);
|
|
87
|
-
forceReRenderCount = forceReRenderCount + 1; // This is a hack to force Qwik to re-render.
|
|
88
86
|
},
|
|
89
87
|
},
|
|
90
88
|
})(event);
|
|
@@ -174,7 +172,6 @@ function emitStateUpdate() {
|
|
|
174
172
|
}
|
|
175
173
|
}
|
|
176
174
|
function elementRef_onIniteditingbldr(event) {
|
|
177
|
-
forceReRenderCount = forceReRenderCount + 1;
|
|
178
175
|
window.addEventListener("message", processMessage);
|
|
179
176
|
registerInsertMenu();
|
|
180
177
|
setupBrowserForEditing({
|
|
@@ -229,10 +226,6 @@ function elementRef_onInitpreviewingbldr(event) {
|
|
|
229
226
|
}
|
|
230
227
|
}
|
|
231
228
|
let elementRef;
|
|
232
|
-
let forceReRenderCount = 0;
|
|
233
|
-
let firstRender = true;
|
|
234
|
-
let lastUpdated = 0;
|
|
235
|
-
let shouldSendResetCookie = false;
|
|
236
229
|
let ContentWrapper = contentWrapper || "div";
|
|
237
230
|
let httpReqsData = {};
|
|
238
231
|
let clicked = false;
|
|
@@ -278,40 +271,38 @@ function onUpdateFn_0(..._args) {
|
|
|
278
271
|
}
|
|
279
272
|
}
|
|
280
273
|
$: onUpdateFn_0(...[content]);
|
|
281
|
-
function onUpdateFn_1(..._args) {
|
|
282
|
-
$: onUpdateFn_1(...[shouldSendResetCookie]);
|
|
283
|
-
function onUpdateFn_2(..._args) {
|
|
274
|
+
function onUpdateFn_1(..._args) {
|
|
284
275
|
evaluateJsCode();
|
|
285
276
|
}
|
|
286
|
-
$:
|
|
277
|
+
$: onUpdateFn_1_builderContextSignal_content__data__jsCode =
|
|
287
278
|
$builderContextSignal.content?.data?.jsCode;
|
|
288
|
-
$:
|
|
289
|
-
function
|
|
279
|
+
$: onUpdateFn_1(...[onUpdateFn_1_builderContextSignal_content__data__jsCode]);
|
|
280
|
+
function onUpdateFn_2(..._args) {
|
|
290
281
|
runHttpRequests();
|
|
291
282
|
}
|
|
292
|
-
$:
|
|
283
|
+
$: onUpdateFn_2_builderContextSignal_content__data__httpRequests =
|
|
293
284
|
$builderContextSignal.content?.data?.httpRequests;
|
|
294
|
-
$:
|
|
295
|
-
function
|
|
285
|
+
$: onUpdateFn_2(...[onUpdateFn_2_builderContextSignal_content__data__httpRequests]);
|
|
286
|
+
function onUpdateFn_3(..._args) {
|
|
296
287
|
emitStateUpdate();
|
|
297
288
|
}
|
|
298
|
-
$:
|
|
289
|
+
$: onUpdateFn_3_builderContextSignal_rootState =
|
|
299
290
|
$builderContextSignal.rootState;
|
|
300
|
-
$:
|
|
301
|
-
function
|
|
291
|
+
$: onUpdateFn_3(...[onUpdateFn_3_builderContextSignal_rootState]);
|
|
292
|
+
function onUpdateFn_4(..._args) {
|
|
302
293
|
if (data) {
|
|
303
294
|
mergeNewRootState(data);
|
|
304
295
|
}
|
|
305
296
|
}
|
|
306
|
-
$:
|
|
307
|
-
function
|
|
297
|
+
$: onUpdateFn_4(...[data]);
|
|
298
|
+
function onUpdateFn_5(..._args) {
|
|
308
299
|
if (locale) {
|
|
309
300
|
mergeNewRootState({
|
|
310
301
|
locale: locale,
|
|
311
302
|
});
|
|
312
303
|
}
|
|
313
304
|
}
|
|
314
|
-
$:
|
|
305
|
+
$: onUpdateFn_5(...[locale]);
|
|
315
306
|
setContext(builderContext.key, builderContextSignal);
|
|
316
307
|
onDestroy(() => {
|
|
317
308
|
if (isBrowser()) {
|
|
@@ -325,7 +316,6 @@ onDestroy(() => {
|
|
|
325
316
|
<svelte:element
|
|
326
317
|
this={ContentWrapper}
|
|
327
318
|
{...{}}
|
|
328
|
-
key={forceReRenderCount}
|
|
329
319
|
bind:this={elementRef}
|
|
330
320
|
on:click={(event) => {
|
|
331
321
|
onClick(event);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.
|
|
1
|
+
export declare const SDK_VERSION = "1.0.15";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.0.
|
|
1
|
+
export const SDK_VERSION = "1.0.15";
|
|
@@ -22,7 +22,8 @@ export async function fetchOneEntry(options) {
|
|
|
22
22
|
}
|
|
23
23
|
const _fetchContent = async (options) => {
|
|
24
24
|
const url = generateContentUrl(options);
|
|
25
|
-
const
|
|
25
|
+
const _fetch = options.fetch ?? fetch;
|
|
26
|
+
const res = await _fetch(url.href, options.fetchOptions);
|
|
26
27
|
const content = await res.json();
|
|
27
28
|
return content;
|
|
28
29
|
};
|
|
@@ -128,4 +128,12 @@ export interface GetContentOptions {
|
|
|
128
128
|
* draft mode and un-archived. Default is false.
|
|
129
129
|
*/
|
|
130
130
|
includeUnpublished?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Optional override of the `fetch` function. (Defaults to global `fetch`)
|
|
133
|
+
*/
|
|
134
|
+
fetch?: typeof global.fetch;
|
|
135
|
+
/**
|
|
136
|
+
* Optional fetch options to be passed to the `fetch` function.
|
|
137
|
+
*/
|
|
138
|
+
fetchOptions?: RequestInit;
|
|
131
139
|
}
|
|
@@ -76,7 +76,6 @@ function processMessage(event) {
|
|
|
76
76
|
breakpoints,
|
|
77
77
|
},
|
|
78
78
|
});
|
|
79
|
-
forceReRenderCount = forceReRenderCount + 1; // This is a hack to force Qwik to re-render.
|
|
80
79
|
}
|
|
81
80
|
},
|
|
82
81
|
animation: (animation) => {
|
|
@@ -84,7 +83,6 @@ function processMessage(event) {
|
|
|
84
83
|
},
|
|
85
84
|
contentUpdate: (newContent) => {
|
|
86
85
|
mergeNewContent(newContent);
|
|
87
|
-
forceReRenderCount = forceReRenderCount + 1; // This is a hack to force Qwik to re-render.
|
|
88
86
|
},
|
|
89
87
|
},
|
|
90
88
|
})(event);
|
|
@@ -174,7 +172,6 @@ function emitStateUpdate() {
|
|
|
174
172
|
}
|
|
175
173
|
}
|
|
176
174
|
function elementRef_onIniteditingbldr(event) {
|
|
177
|
-
forceReRenderCount = forceReRenderCount + 1;
|
|
178
175
|
window.addEventListener("message", processMessage);
|
|
179
176
|
registerInsertMenu();
|
|
180
177
|
setupBrowserForEditing({
|
|
@@ -229,10 +226,6 @@ function elementRef_onInitpreviewingbldr(event) {
|
|
|
229
226
|
}
|
|
230
227
|
}
|
|
231
228
|
let elementRef;
|
|
232
|
-
let forceReRenderCount = 0;
|
|
233
|
-
let firstRender = true;
|
|
234
|
-
let lastUpdated = 0;
|
|
235
|
-
let shouldSendResetCookie = false;
|
|
236
229
|
let ContentWrapper = contentWrapper || "div";
|
|
237
230
|
let httpReqsData = {};
|
|
238
231
|
let clicked = false;
|
|
@@ -278,40 +271,38 @@ function onUpdateFn_0(..._args) {
|
|
|
278
271
|
}
|
|
279
272
|
}
|
|
280
273
|
$: onUpdateFn_0(...[content]);
|
|
281
|
-
function onUpdateFn_1(..._args) {
|
|
282
|
-
$: onUpdateFn_1(...[shouldSendResetCookie]);
|
|
283
|
-
function onUpdateFn_2(..._args) {
|
|
274
|
+
function onUpdateFn_1(..._args) {
|
|
284
275
|
evaluateJsCode();
|
|
285
276
|
}
|
|
286
|
-
$:
|
|
277
|
+
$: onUpdateFn_1_builderContextSignal_content__data__jsCode =
|
|
287
278
|
$builderContextSignal.content?.data?.jsCode;
|
|
288
|
-
$:
|
|
289
|
-
function
|
|
279
|
+
$: onUpdateFn_1(...[onUpdateFn_1_builderContextSignal_content__data__jsCode]);
|
|
280
|
+
function onUpdateFn_2(..._args) {
|
|
290
281
|
runHttpRequests();
|
|
291
282
|
}
|
|
292
|
-
$:
|
|
283
|
+
$: onUpdateFn_2_builderContextSignal_content__data__httpRequests =
|
|
293
284
|
$builderContextSignal.content?.data?.httpRequests;
|
|
294
|
-
$:
|
|
295
|
-
function
|
|
285
|
+
$: onUpdateFn_2(...[onUpdateFn_2_builderContextSignal_content__data__httpRequests]);
|
|
286
|
+
function onUpdateFn_3(..._args) {
|
|
296
287
|
emitStateUpdate();
|
|
297
288
|
}
|
|
298
|
-
$:
|
|
289
|
+
$: onUpdateFn_3_builderContextSignal_rootState =
|
|
299
290
|
$builderContextSignal.rootState;
|
|
300
|
-
$:
|
|
301
|
-
function
|
|
291
|
+
$: onUpdateFn_3(...[onUpdateFn_3_builderContextSignal_rootState]);
|
|
292
|
+
function onUpdateFn_4(..._args) {
|
|
302
293
|
if (data) {
|
|
303
294
|
mergeNewRootState(data);
|
|
304
295
|
}
|
|
305
296
|
}
|
|
306
|
-
$:
|
|
307
|
-
function
|
|
297
|
+
$: onUpdateFn_4(...[data]);
|
|
298
|
+
function onUpdateFn_5(..._args) {
|
|
308
299
|
if (locale) {
|
|
309
300
|
mergeNewRootState({
|
|
310
301
|
locale: locale,
|
|
311
302
|
});
|
|
312
303
|
}
|
|
313
304
|
}
|
|
314
|
-
$:
|
|
305
|
+
$: onUpdateFn_5(...[locale]);
|
|
315
306
|
setContext(builderContext.key, builderContextSignal);
|
|
316
307
|
onDestroy(() => {
|
|
317
308
|
if (isBrowser()) {
|
|
@@ -325,7 +316,6 @@ onDestroy(() => {
|
|
|
325
316
|
<svelte:element
|
|
326
317
|
this={ContentWrapper}
|
|
327
318
|
{...{}}
|
|
328
|
-
key={forceReRenderCount}
|
|
329
319
|
bind:this={elementRef}
|
|
330
320
|
on:click={(event) => {
|
|
331
321
|
onClick(event);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.
|
|
1
|
+
export declare const SDK_VERSION = "1.0.15";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.0.
|
|
1
|
+
export const SDK_VERSION = "1.0.15";
|
|
@@ -22,7 +22,8 @@ export async function fetchOneEntry(options) {
|
|
|
22
22
|
}
|
|
23
23
|
const _fetchContent = async (options) => {
|
|
24
24
|
const url = generateContentUrl(options);
|
|
25
|
-
const
|
|
25
|
+
const _fetch = options.fetch ?? fetch;
|
|
26
|
+
const res = await _fetch(url.href, options.fetchOptions);
|
|
26
27
|
const content = await res.json();
|
|
27
28
|
return content;
|
|
28
29
|
};
|
|
@@ -128,4 +128,12 @@ export interface GetContentOptions {
|
|
|
128
128
|
* draft mode and un-archived. Default is false.
|
|
129
129
|
*/
|
|
130
130
|
includeUnpublished?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Optional override of the `fetch` function. (Defaults to global `fetch`)
|
|
133
|
+
*/
|
|
134
|
+
fetch?: typeof global.fetch;
|
|
135
|
+
/**
|
|
136
|
+
* Optional fetch options to be passed to the `fetch` function.
|
|
137
|
+
*/
|
|
138
|
+
fetchOptions?: RequestInit;
|
|
131
139
|
}
|
|
@@ -76,7 +76,6 @@ function processMessage(event) {
|
|
|
76
76
|
breakpoints,
|
|
77
77
|
},
|
|
78
78
|
});
|
|
79
|
-
forceReRenderCount = forceReRenderCount + 1; // This is a hack to force Qwik to re-render.
|
|
80
79
|
}
|
|
81
80
|
},
|
|
82
81
|
animation: (animation) => {
|
|
@@ -84,7 +83,6 @@ function processMessage(event) {
|
|
|
84
83
|
},
|
|
85
84
|
contentUpdate: (newContent) => {
|
|
86
85
|
mergeNewContent(newContent);
|
|
87
|
-
forceReRenderCount = forceReRenderCount + 1; // This is a hack to force Qwik to re-render.
|
|
88
86
|
},
|
|
89
87
|
},
|
|
90
88
|
})(event);
|
|
@@ -174,7 +172,6 @@ function emitStateUpdate() {
|
|
|
174
172
|
}
|
|
175
173
|
}
|
|
176
174
|
function elementRef_onIniteditingbldr(event) {
|
|
177
|
-
forceReRenderCount = forceReRenderCount + 1;
|
|
178
175
|
window.addEventListener("message", processMessage);
|
|
179
176
|
registerInsertMenu();
|
|
180
177
|
setupBrowserForEditing({
|
|
@@ -229,10 +226,6 @@ function elementRef_onInitpreviewingbldr(event) {
|
|
|
229
226
|
}
|
|
230
227
|
}
|
|
231
228
|
let elementRef;
|
|
232
|
-
let forceReRenderCount = 0;
|
|
233
|
-
let firstRender = true;
|
|
234
|
-
let lastUpdated = 0;
|
|
235
|
-
let shouldSendResetCookie = false;
|
|
236
229
|
let ContentWrapper = contentWrapper || "div";
|
|
237
230
|
let httpReqsData = {};
|
|
238
231
|
let clicked = false;
|
|
@@ -278,40 +271,38 @@ function onUpdateFn_0(..._args) {
|
|
|
278
271
|
}
|
|
279
272
|
}
|
|
280
273
|
$: onUpdateFn_0(...[content]);
|
|
281
|
-
function onUpdateFn_1(..._args) {
|
|
282
|
-
$: onUpdateFn_1(...[shouldSendResetCookie]);
|
|
283
|
-
function onUpdateFn_2(..._args) {
|
|
274
|
+
function onUpdateFn_1(..._args) {
|
|
284
275
|
evaluateJsCode();
|
|
285
276
|
}
|
|
286
|
-
$:
|
|
277
|
+
$: onUpdateFn_1_builderContextSignal_content__data__jsCode =
|
|
287
278
|
$builderContextSignal.content?.data?.jsCode;
|
|
288
|
-
$:
|
|
289
|
-
function
|
|
279
|
+
$: onUpdateFn_1(...[onUpdateFn_1_builderContextSignal_content__data__jsCode]);
|
|
280
|
+
function onUpdateFn_2(..._args) {
|
|
290
281
|
runHttpRequests();
|
|
291
282
|
}
|
|
292
|
-
$:
|
|
283
|
+
$: onUpdateFn_2_builderContextSignal_content__data__httpRequests =
|
|
293
284
|
$builderContextSignal.content?.data?.httpRequests;
|
|
294
|
-
$:
|
|
295
|
-
function
|
|
285
|
+
$: onUpdateFn_2(...[onUpdateFn_2_builderContextSignal_content__data__httpRequests]);
|
|
286
|
+
function onUpdateFn_3(..._args) {
|
|
296
287
|
emitStateUpdate();
|
|
297
288
|
}
|
|
298
|
-
$:
|
|
289
|
+
$: onUpdateFn_3_builderContextSignal_rootState =
|
|
299
290
|
$builderContextSignal.rootState;
|
|
300
|
-
$:
|
|
301
|
-
function
|
|
291
|
+
$: onUpdateFn_3(...[onUpdateFn_3_builderContextSignal_rootState]);
|
|
292
|
+
function onUpdateFn_4(..._args) {
|
|
302
293
|
if (data) {
|
|
303
294
|
mergeNewRootState(data);
|
|
304
295
|
}
|
|
305
296
|
}
|
|
306
|
-
$:
|
|
307
|
-
function
|
|
297
|
+
$: onUpdateFn_4(...[data]);
|
|
298
|
+
function onUpdateFn_5(..._args) {
|
|
308
299
|
if (locale) {
|
|
309
300
|
mergeNewRootState({
|
|
310
301
|
locale: locale,
|
|
311
302
|
});
|
|
312
303
|
}
|
|
313
304
|
}
|
|
314
|
-
$:
|
|
305
|
+
$: onUpdateFn_5(...[locale]);
|
|
315
306
|
setContext(builderContext.key, builderContextSignal);
|
|
316
307
|
onDestroy(() => {
|
|
317
308
|
if (isBrowser()) {
|
|
@@ -325,7 +316,6 @@ onDestroy(() => {
|
|
|
325
316
|
<svelte:element
|
|
326
317
|
this={ContentWrapper}
|
|
327
318
|
{...{}}
|
|
328
|
-
key={forceReRenderCount}
|
|
329
319
|
bind:this={elementRef}
|
|
330
320
|
on:click={(event) => {
|
|
331
321
|
onClick(event);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.
|
|
1
|
+
export declare const SDK_VERSION = "1.0.15";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.0.
|
|
1
|
+
export const SDK_VERSION = "1.0.15";
|
|
@@ -22,7 +22,8 @@ export async function fetchOneEntry(options) {
|
|
|
22
22
|
}
|
|
23
23
|
const _fetchContent = async (options) => {
|
|
24
24
|
const url = generateContentUrl(options);
|
|
25
|
-
const
|
|
25
|
+
const _fetch = options.fetch ?? fetch;
|
|
26
|
+
const res = await _fetch(url.href, options.fetchOptions);
|
|
26
27
|
const content = await res.json();
|
|
27
28
|
return content;
|
|
28
29
|
};
|
|
@@ -128,4 +128,12 @@ export interface GetContentOptions {
|
|
|
128
128
|
* draft mode and un-archived. Default is false.
|
|
129
129
|
*/
|
|
130
130
|
includeUnpublished?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Optional override of the `fetch` function. (Defaults to global `fetch`)
|
|
133
|
+
*/
|
|
134
|
+
fetch?: typeof global.fetch;
|
|
135
|
+
/**
|
|
136
|
+
* Optional fetch options to be passed to the `fetch` function.
|
|
137
|
+
*/
|
|
138
|
+
fetchOptions?: RequestInit;
|
|
131
139
|
}
|
package/package.json
CHANGED
|
@@ -108,7 +108,6 @@
|
|
|
108
108
|
breakpoints,
|
|
109
109
|
},
|
|
110
110
|
});
|
|
111
|
-
forceReRenderCount = forceReRenderCount + 1; // This is a hack to force Qwik to re-render.
|
|
112
111
|
}
|
|
113
112
|
},
|
|
114
113
|
animation: (animation) => {
|
|
@@ -116,7 +115,6 @@
|
|
|
116
115
|
},
|
|
117
116
|
contentUpdate: (newContent) => {
|
|
118
117
|
mergeNewContent(newContent);
|
|
119
|
-
forceReRenderCount = forceReRenderCount + 1; // This is a hack to force Qwik to re-render.
|
|
120
118
|
},
|
|
121
119
|
},
|
|
122
120
|
})(event);
|
|
@@ -217,7 +215,6 @@
|
|
|
217
215
|
}
|
|
218
216
|
}
|
|
219
217
|
function elementRef_onIniteditingbldr(event) {
|
|
220
|
-
forceReRenderCount = forceReRenderCount + 1;
|
|
221
218
|
window.addEventListener("message", processMessage);
|
|
222
219
|
registerInsertMenu();
|
|
223
220
|
setupBrowserForEditing({
|
|
@@ -285,10 +282,6 @@
|
|
|
285
282
|
|
|
286
283
|
let elementRef;
|
|
287
284
|
|
|
288
|
-
let forceReRenderCount = 0;
|
|
289
|
-
let firstRender = true;
|
|
290
|
-
let lastUpdated = 0;
|
|
291
|
-
let shouldSendResetCookie = false;
|
|
292
285
|
let ContentWrapper = contentWrapper || "div";
|
|
293
286
|
let httpReqsData = {};
|
|
294
287
|
let clicked = false;
|
|
@@ -342,42 +335,38 @@
|
|
|
342
335
|
|
|
343
336
|
$: onUpdateFn_0(...[content]);
|
|
344
337
|
|
|
345
|
-
function onUpdateFn_1(..._args: any[]) {
|
|
346
|
-
|
|
347
|
-
$: onUpdateFn_1(...[shouldSendResetCookie]);
|
|
348
|
-
|
|
349
|
-
function onUpdateFn_2(..._args: any[]) {
|
|
338
|
+
function onUpdateFn_1(..._args: any[]) {
|
|
350
339
|
evaluateJsCode();
|
|
351
340
|
}
|
|
352
|
-
$:
|
|
341
|
+
$: onUpdateFn_1_builderContextSignal_content__data__jsCode =
|
|
353
342
|
$builderContextSignal.content?.data?.jsCode;
|
|
354
|
-
$:
|
|
343
|
+
$: onUpdateFn_1(...[onUpdateFn_1_builderContextSignal_content__data__jsCode]);
|
|
355
344
|
|
|
356
|
-
function
|
|
345
|
+
function onUpdateFn_2(..._args: any[]) {
|
|
357
346
|
runHttpRequests();
|
|
358
347
|
}
|
|
359
|
-
$:
|
|
348
|
+
$: onUpdateFn_2_builderContextSignal_content__data__httpRequests =
|
|
360
349
|
$builderContextSignal.content?.data?.httpRequests;
|
|
361
|
-
$:
|
|
362
|
-
...[
|
|
350
|
+
$: onUpdateFn_2(
|
|
351
|
+
...[onUpdateFn_2_builderContextSignal_content__data__httpRequests]
|
|
363
352
|
);
|
|
364
353
|
|
|
365
|
-
function
|
|
354
|
+
function onUpdateFn_3(..._args: any[]) {
|
|
366
355
|
emitStateUpdate();
|
|
367
356
|
}
|
|
368
|
-
$:
|
|
357
|
+
$: onUpdateFn_3_builderContextSignal_rootState =
|
|
369
358
|
$builderContextSignal.rootState;
|
|
370
|
-
$:
|
|
359
|
+
$: onUpdateFn_3(...[onUpdateFn_3_builderContextSignal_rootState]);
|
|
371
360
|
|
|
372
|
-
function
|
|
361
|
+
function onUpdateFn_4(..._args: any[]) {
|
|
373
362
|
if (data) {
|
|
374
363
|
mergeNewRootState(data);
|
|
375
364
|
}
|
|
376
365
|
}
|
|
377
366
|
|
|
378
|
-
$:
|
|
367
|
+
$: onUpdateFn_4(...[data]);
|
|
379
368
|
|
|
380
|
-
function
|
|
369
|
+
function onUpdateFn_5(..._args: any[]) {
|
|
381
370
|
if (locale) {
|
|
382
371
|
mergeNewRootState({
|
|
383
372
|
locale: locale,
|
|
@@ -385,7 +374,7 @@
|
|
|
385
374
|
}
|
|
386
375
|
}
|
|
387
376
|
|
|
388
|
-
$:
|
|
377
|
+
$: onUpdateFn_5(...[locale]);
|
|
389
378
|
|
|
390
379
|
setContext(builderContext.key, builderContextSignal);
|
|
391
380
|
|
|
@@ -404,7 +393,6 @@
|
|
|
404
393
|
<svelte:element
|
|
405
394
|
this={ContentWrapper}
|
|
406
395
|
{...{}}
|
|
407
|
-
key={forceReRenderCount}
|
|
408
396
|
bind:this={elementRef}
|
|
409
397
|
on:click={(event) => {
|
|
410
398
|
onClick(event);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.0.
|
|
1
|
+
export const SDK_VERSION = "1.0.15"
|
|
@@ -32,7 +32,8 @@ type ContentResponse = ContentResults | {
|
|
|
32
32
|
};
|
|
33
33
|
const _fetchContent = async (options: GetContentOptions) => {
|
|
34
34
|
const url = generateContentUrl(options);
|
|
35
|
-
const
|
|
35
|
+
const _fetch = options.fetch ?? fetch;
|
|
36
|
+
const res = await _fetch(url.href, options.fetchOptions);
|
|
36
37
|
const content = await (res.json() as Promise<ContentResponse>);
|
|
37
38
|
return content;
|
|
38
39
|
};
|
|
@@ -144,4 +144,14 @@ export interface GetContentOptions {
|
|
|
144
144
|
* draft mode and un-archived. Default is false.
|
|
145
145
|
*/
|
|
146
146
|
includeUnpublished?: boolean;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Optional override of the `fetch` function. (Defaults to global `fetch`)
|
|
150
|
+
*/
|
|
151
|
+
fetch?: typeof global.fetch;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Optional fetch options to be passed to the `fetch` function.
|
|
155
|
+
*/
|
|
156
|
+
fetchOptions?: RequestInit;
|
|
147
157
|
}
|