@builder.io/sdk-qwik 0.0.17 → 0.0.19
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/index.qwik.cjs +32 -13
- package/lib/index.qwik.mjs +14 -13
- package/package.json +2 -2
- package/types-hacks.d.ts +0 -6
- package/lib/index.97024df8.js +0 -80165
- package/lib/index.d8c1e37f.cjs +0 -80165
package/lib/index.qwik.cjs
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const qwik = require("@builder.io/qwik");
|
|
4
4
|
const jsxRuntime = require("@builder.io/qwik/jsx-runtime");
|
|
5
|
+
function _interopNamespace(e) {
|
|
6
|
+
if (e && e.__esModule)
|
|
7
|
+
return e;
|
|
8
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
9
|
+
if (e) {
|
|
10
|
+
for (const k in e) {
|
|
11
|
+
if (k !== "default") {
|
|
12
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: () => e[k]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
5
23
|
const TARGET = "qwik";
|
|
6
24
|
function isBrowser() {
|
|
7
25
|
return typeof window !== "undefined" && typeof document !== "undefined";
|
|
@@ -821,7 +839,7 @@ left: 0;
|
|
|
821
839
|
width: 100%;
|
|
822
840
|
height: 100%; }`;
|
|
823
841
|
const Text = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props) => {
|
|
824
|
-
return /* @__PURE__ */ jsxRuntime.jsx("
|
|
842
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
825
843
|
class: "builder-text",
|
|
826
844
|
dangerouslySetInnerHTML: props.text
|
|
827
845
|
});
|
|
@@ -1779,13 +1797,17 @@ function getGlobalThis() {
|
|
|
1779
1797
|
return self;
|
|
1780
1798
|
return null;
|
|
1781
1799
|
}
|
|
1800
|
+
const NODE_FETCH_URL = () => "node-fetch";
|
|
1801
|
+
let fetch$1 = void 0;
|
|
1782
1802
|
async function getFetch() {
|
|
1803
|
+
if (fetch$1)
|
|
1804
|
+
return fetch$1;
|
|
1783
1805
|
const globalFetch = getGlobalThis().fetch;
|
|
1784
1806
|
if (typeof globalFetch === "undefined" && typeof global !== "undefined") {
|
|
1785
|
-
const nodeFetch = Promise.resolve().then(() => require(
|
|
1786
|
-
return nodeFetch.default || nodeFetch;
|
|
1807
|
+
const nodeFetch = Promise.resolve().then(() => /* @__PURE__ */ _interopNamespace(require(NODE_FETCH_URL()))).then((d) => d.default);
|
|
1808
|
+
return fetch$1 = nodeFetch.default || nodeFetch;
|
|
1787
1809
|
}
|
|
1788
|
-
return globalFetch.default || globalFetch;
|
|
1810
|
+
return fetch$1 = globalFetch.default || globalFetch;
|
|
1789
1811
|
}
|
|
1790
1812
|
const handleABTesting = (item, testGroups) => {
|
|
1791
1813
|
if (item.variations && Object.keys(item.variations).length) {
|
|
@@ -1821,7 +1843,6 @@ const handleABTesting = (item, testGroups) => {
|
|
|
1821
1843
|
}
|
|
1822
1844
|
}
|
|
1823
1845
|
};
|
|
1824
|
-
const fetch$ = getFetch();
|
|
1825
1846
|
async function getContent(options) {
|
|
1826
1847
|
return (await getAllContent({
|
|
1827
1848
|
...options,
|
|
@@ -1851,7 +1872,7 @@ const generateContentUrl = (options) => {
|
|
|
1851
1872
|
};
|
|
1852
1873
|
async function getAllContent(options) {
|
|
1853
1874
|
const url = generateContentUrl(options);
|
|
1854
|
-
const fetch2 = await
|
|
1875
|
+
const fetch2 = await getFetch();
|
|
1855
1876
|
const content = await fetch2(url.href).then((res) => res.json());
|
|
1856
1877
|
if (options.testGroups)
|
|
1857
1878
|
for (const item of content.results)
|
|
@@ -2225,17 +2246,15 @@ const evalExpression = function evalExpression2(props, state, elementRef, expres
|
|
|
2225
2246
|
}));
|
|
2226
2247
|
};
|
|
2227
2248
|
const handleRequest = function handleRequest2(props, state, elementRef, { url, key }) {
|
|
2228
|
-
|
|
2229
|
-
const fetch2 = await getFetch();
|
|
2230
|
-
const response = await fetch2(url);
|
|
2231
|
-
const json = await response.json();
|
|
2249
|
+
getFetch().then((fetch2) => fetch2(url)).then((response) => response.json()).then((json) => {
|
|
2232
2250
|
const newOverrideState = {
|
|
2233
2251
|
...state.overrideState,
|
|
2234
2252
|
[key]: json
|
|
2235
2253
|
};
|
|
2236
2254
|
state.overrideState = newOverrideState;
|
|
2237
|
-
}
|
|
2238
|
-
|
|
2255
|
+
}).catch((err) => {
|
|
2256
|
+
console.log("error fetching dynamic data", url, err);
|
|
2257
|
+
});
|
|
2239
2258
|
};
|
|
2240
2259
|
const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
|
|
2241
2260
|
const requests = useContent(props, state)?.data?.httpRequests ?? {};
|
|
@@ -2293,7 +2312,7 @@ const RenderContent = /* @__PURE__ */ qwik.componentQrl(qwik.inlinedQrl((props)
|
|
|
2293
2312
|
if (isBrowser()) {
|
|
2294
2313
|
if (isEditing()) {
|
|
2295
2314
|
state2.forceReRenderCount = state2.forceReRenderCount + 1;
|
|
2296
|
-
qwik._useMutableProps(elementRef2.current, true);
|
|
2315
|
+
elementRef2.current && qwik._useMutableProps(elementRef2.current, true);
|
|
2297
2316
|
registerInsertMenu();
|
|
2298
2317
|
setupBrowserForEditing();
|
|
2299
2318
|
Object.values(allRegisteredComponents(props2)).forEach((registeredComponent) => {
|
package/lib/index.qwik.mjs
CHANGED
|
@@ -819,7 +819,7 @@ left: 0;
|
|
|
819
819
|
width: 100%;
|
|
820
820
|
height: 100%; }`;
|
|
821
821
|
const Text = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
|
|
822
|
-
return /* @__PURE__ */ jsx("
|
|
822
|
+
return /* @__PURE__ */ jsx("span", {
|
|
823
823
|
class: "builder-text",
|
|
824
824
|
dangerouslySetInnerHTML: props.text
|
|
825
825
|
});
|
|
@@ -1777,13 +1777,17 @@ function getGlobalThis() {
|
|
|
1777
1777
|
return self;
|
|
1778
1778
|
return null;
|
|
1779
1779
|
}
|
|
1780
|
+
const NODE_FETCH_URL = () => "node-fetch";
|
|
1781
|
+
let fetch$1 = void 0;
|
|
1780
1782
|
async function getFetch() {
|
|
1783
|
+
if (fetch$1)
|
|
1784
|
+
return fetch$1;
|
|
1781
1785
|
const globalFetch = getGlobalThis().fetch;
|
|
1782
1786
|
if (typeof globalFetch === "undefined" && typeof global !== "undefined") {
|
|
1783
|
-
const nodeFetch = import(
|
|
1784
|
-
return nodeFetch.default || nodeFetch;
|
|
1787
|
+
const nodeFetch = import(NODE_FETCH_URL()).then((d) => d.default);
|
|
1788
|
+
return fetch$1 = nodeFetch.default || nodeFetch;
|
|
1785
1789
|
}
|
|
1786
|
-
return globalFetch.default || globalFetch;
|
|
1790
|
+
return fetch$1 = globalFetch.default || globalFetch;
|
|
1787
1791
|
}
|
|
1788
1792
|
const handleABTesting = (item, testGroups) => {
|
|
1789
1793
|
if (item.variations && Object.keys(item.variations).length) {
|
|
@@ -1819,7 +1823,6 @@ const handleABTesting = (item, testGroups) => {
|
|
|
1819
1823
|
}
|
|
1820
1824
|
}
|
|
1821
1825
|
};
|
|
1822
|
-
const fetch$ = getFetch();
|
|
1823
1826
|
async function getContent(options) {
|
|
1824
1827
|
return (await getAllContent({
|
|
1825
1828
|
...options,
|
|
@@ -1849,7 +1852,7 @@ const generateContentUrl = (options) => {
|
|
|
1849
1852
|
};
|
|
1850
1853
|
async function getAllContent(options) {
|
|
1851
1854
|
const url = generateContentUrl(options);
|
|
1852
|
-
const fetch2 = await
|
|
1855
|
+
const fetch2 = await getFetch();
|
|
1853
1856
|
const content = await fetch2(url.href).then((res) => res.json());
|
|
1854
1857
|
if (options.testGroups)
|
|
1855
1858
|
for (const item of content.results)
|
|
@@ -2223,17 +2226,15 @@ const evalExpression = function evalExpression2(props, state, elementRef, expres
|
|
|
2223
2226
|
}));
|
|
2224
2227
|
};
|
|
2225
2228
|
const handleRequest = function handleRequest2(props, state, elementRef, { url, key }) {
|
|
2226
|
-
|
|
2227
|
-
const fetch2 = await getFetch();
|
|
2228
|
-
const response = await fetch2(url);
|
|
2229
|
-
const json = await response.json();
|
|
2229
|
+
getFetch().then((fetch2) => fetch2(url)).then((response) => response.json()).then((json) => {
|
|
2230
2230
|
const newOverrideState = {
|
|
2231
2231
|
...state.overrideState,
|
|
2232
2232
|
[key]: json
|
|
2233
2233
|
};
|
|
2234
2234
|
state.overrideState = newOverrideState;
|
|
2235
|
-
}
|
|
2236
|
-
|
|
2235
|
+
}).catch((err) => {
|
|
2236
|
+
console.log("error fetching dynamic data", url, err);
|
|
2237
|
+
});
|
|
2237
2238
|
};
|
|
2238
2239
|
const runHttpRequests = function runHttpRequests2(props, state, elementRef) {
|
|
2239
2240
|
const requests = useContent(props, state)?.data?.httpRequests ?? {};
|
|
@@ -2291,7 +2292,7 @@ const RenderContent = /* @__PURE__ */ componentQrl(inlinedQrl((props) => {
|
|
|
2291
2292
|
if (isBrowser()) {
|
|
2292
2293
|
if (isEditing()) {
|
|
2293
2294
|
state2.forceReRenderCount = state2.forceReRenderCount + 1;
|
|
2294
|
-
_useMutableProps(elementRef2.current, true);
|
|
2295
|
+
elementRef2.current && _useMutableProps(elementRef2.current, true);
|
|
2295
2296
|
registerInsertMenu();
|
|
2296
2297
|
setupBrowserForEditing();
|
|
2297
2298
|
Object.values(allRegisteredComponents(props2)).forEach((registeredComponent) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-qwik",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "Builder.io Qwik SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.qwik.cjs",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"release:dev": "npm version prerelease --no-git-tag-version && npm publish --tag latest --access public"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@builder.io/qwik": "
|
|
22
|
+
"@builder.io/qwik": "BuilderIO/qwik-build#commit=08a6883d163f8eea8dc1710357b63b7ac01b2bef",
|
|
23
23
|
"@types/node": "latest",
|
|
24
24
|
"typescript": "4.7.4",
|
|
25
25
|
"vite": "3.0.2"
|
package/types-hacks.d.ts
CHANGED
|
@@ -10,10 +10,4 @@ declare const set: (obj: any, key: string, value: any) => void;
|
|
|
10
10
|
interface CSSProperties {
|
|
11
11
|
flexDirection: any;
|
|
12
12
|
}
|
|
13
|
-
interface HTMLAttributes {
|
|
14
|
-
style?: Record<string, string | number | undefined> | string | undefined;
|
|
15
|
-
}
|
|
16
|
-
interface ImgHTMLAttributes {
|
|
17
|
-
srcset: any;
|
|
18
|
-
}
|
|
19
13
|
declare const BuilderBlocks: (props: any) => any;
|