@builder.io/sdk-qwik 0.22.1 → 0.23.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.
@@ -89,6 +89,15 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
89
89
  props,
90
90
  state
91
91
  ]));
92
+ qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track }) => {
93
+ const [props2, state2] = qwik.useLexicalScope();
94
+ track(() => props2.content);
95
+ track(() => props2.data);
96
+ track(() => props2.locale);
97
+ }, "ContentComponent_component_useTask_1_ewytT4CRbxo", [
98
+ props,
99
+ state
100
+ ]));
92
101
  return /* @__PURE__ */ qwik._jsxC(enableEditor.EnableEditor, {
93
102
  get apiHost() {
94
103
  return props.apiHost;
@@ -87,6 +87,15 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
87
87
  props,
88
88
  state
89
89
  ]));
90
+ useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track }) => {
91
+ const [props2, state2] = useLexicalScope();
92
+ track(() => props2.content);
93
+ track(() => props2.data);
94
+ track(() => props2.locale);
95
+ }, "ContentComponent_component_useTask_1_ewytT4CRbxo", [
96
+ props,
97
+ state
98
+ ]));
90
99
  return /* @__PURE__ */ _jsxC(EnableEditor, {
91
100
  get apiHost() {
92
101
  return props.apiHost;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const SDK_VERSION = "0.22.1";
3
+ const SDK_VERSION = "0.23.0";
4
4
  exports.SDK_VERSION = SDK_VERSION;
@@ -1,4 +1,4 @@
1
- const SDK_VERSION = "0.22.1";
1
+ const SDK_VERSION = "0.23.0";
2
2
  export {
3
3
  SDK_VERSION
4
4
  };
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const search = require("../helpers/search/search.qwik.cjs");
4
4
  const isBrowser = require("./is-browser.qwik.cjs");
5
- function isPreviewing(_search) {
6
- const search$1 = _search || (isBrowser.isBrowser() ? window.location.search : void 0);
7
- if (!search$1)
5
+ function isPreviewing(search$1) {
6
+ const searchToUse = search$1 || (isBrowser.isBrowser() ? window.location.search : void 0);
7
+ if (!searchToUse)
8
8
  return false;
9
- const normalizedSearch = search.getSearchString(search$1);
9
+ const normalizedSearch = search.getSearchString(searchToUse);
10
10
  return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
11
11
  }
12
12
  exports.isPreviewing = isPreviewing;
@@ -1,10 +1,10 @@
1
1
  import { getSearchString } from "../helpers/search/search.qwik.mjs";
2
2
  import { isBrowser } from "./is-browser.qwik.mjs";
3
- function isPreviewing(_search) {
4
- const search = _search || (isBrowser() ? window.location.search : void 0);
5
- if (!search)
3
+ function isPreviewing(search) {
4
+ const searchToUse = search || (isBrowser() ? window.location.search : void 0);
5
+ if (!searchToUse)
6
6
  return false;
7
- const normalizedSearch = getSearchString(search);
7
+ const normalizedSearch = getSearchString(searchToUse);
8
8
  return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
9
9
  }
10
10
  export {
@@ -89,6 +89,15 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
89
89
  props,
90
90
  state
91
91
  ]));
92
+ qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track }) => {
93
+ const [props2, state2] = qwik.useLexicalScope();
94
+ track(() => props2.content);
95
+ track(() => props2.data);
96
+ track(() => props2.locale);
97
+ }, "ContentComponent_component_useTask_1_ewytT4CRbxo", [
98
+ props,
99
+ state
100
+ ]));
92
101
  return /* @__PURE__ */ qwik._jsxC(enableEditor.EnableEditor, {
93
102
  get apiHost() {
94
103
  return props.apiHost;
@@ -87,6 +87,15 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
87
87
  props,
88
88
  state
89
89
  ]));
90
+ useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track }) => {
91
+ const [props2, state2] = useLexicalScope();
92
+ track(() => props2.content);
93
+ track(() => props2.data);
94
+ track(() => props2.locale);
95
+ }, "ContentComponent_component_useTask_1_ewytT4CRbxo", [
96
+ props,
97
+ state
98
+ ]));
90
99
  return /* @__PURE__ */ _jsxC(EnableEditor, {
91
100
  get apiHost() {
92
101
  return props.apiHost;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const SDK_VERSION = "0.22.1";
3
+ const SDK_VERSION = "0.23.0";
4
4
  exports.SDK_VERSION = SDK_VERSION;
@@ -1,4 +1,4 @@
1
- const SDK_VERSION = "0.22.1";
1
+ const SDK_VERSION = "0.23.0";
2
2
  export {
3
3
  SDK_VERSION
4
4
  };
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const search = require("../helpers/search/search.qwik.cjs");
4
4
  const isBrowser = require("./is-browser.qwik.cjs");
5
- function isPreviewing(_search) {
6
- const search$1 = _search || (isBrowser.isBrowser() ? window.location.search : void 0);
7
- if (!search$1)
5
+ function isPreviewing(search$1) {
6
+ const searchToUse = search$1 || (isBrowser.isBrowser() ? window.location.search : void 0);
7
+ if (!searchToUse)
8
8
  return false;
9
- const normalizedSearch = search.getSearchString(search$1);
9
+ const normalizedSearch = search.getSearchString(searchToUse);
10
10
  return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
11
11
  }
12
12
  exports.isPreviewing = isPreviewing;
@@ -1,10 +1,10 @@
1
1
  import { getSearchString } from "../helpers/search/search.qwik.mjs";
2
2
  import { isBrowser } from "./is-browser.qwik.mjs";
3
- function isPreviewing(_search) {
4
- const search = _search || (isBrowser() ? window.location.search : void 0);
5
- if (!search)
3
+ function isPreviewing(search) {
4
+ const searchToUse = search || (isBrowser() ? window.location.search : void 0);
5
+ if (!searchToUse)
6
6
  return false;
7
- const normalizedSearch = getSearchString(search);
7
+ const normalizedSearch = getSearchString(searchToUse);
8
8
  return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
9
9
  }
10
10
  export {
@@ -89,6 +89,15 @@ const ContentComponent = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.
89
89
  props,
90
90
  state
91
91
  ]));
92
+ qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track }) => {
93
+ const [props2, state2] = qwik.useLexicalScope();
94
+ track(() => props2.content);
95
+ track(() => props2.data);
96
+ track(() => props2.locale);
97
+ }, "ContentComponent_component_useTask_1_ewytT4CRbxo", [
98
+ props,
99
+ state
100
+ ]));
92
101
  return /* @__PURE__ */ qwik._jsxC(enableEditor.EnableEditor, {
93
102
  get apiHost() {
94
103
  return props.apiHost;
@@ -87,6 +87,15 @@ const ContentComponent = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl
87
87
  props,
88
88
  state
89
89
  ]));
90
+ useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track }) => {
91
+ const [props2, state2] = useLexicalScope();
92
+ track(() => props2.content);
93
+ track(() => props2.data);
94
+ track(() => props2.locale);
95
+ }, "ContentComponent_component_useTask_1_ewytT4CRbxo", [
96
+ props,
97
+ state
98
+ ]));
90
99
  return /* @__PURE__ */ _jsxC(EnableEditor, {
91
100
  get apiHost() {
92
101
  return props.apiHost;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const SDK_VERSION = "0.22.1";
3
+ const SDK_VERSION = "0.23.0";
4
4
  exports.SDK_VERSION = SDK_VERSION;
@@ -1,4 +1,4 @@
1
- const SDK_VERSION = "0.22.1";
1
+ const SDK_VERSION = "0.23.0";
2
2
  export {
3
3
  SDK_VERSION
4
4
  };
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const search = require("../helpers/search/search.qwik.cjs");
4
4
  const isBrowser = require("./is-browser.qwik.cjs");
5
- function isPreviewing(_search) {
6
- const search$1 = _search || (isBrowser.isBrowser() ? window.location.search : void 0);
7
- if (!search$1)
5
+ function isPreviewing(search$1) {
6
+ const searchToUse = search$1 || (isBrowser.isBrowser() ? window.location.search : void 0);
7
+ if (!searchToUse)
8
8
  return false;
9
- const normalizedSearch = search.getSearchString(search$1);
9
+ const normalizedSearch = search.getSearchString(searchToUse);
10
10
  return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
11
11
  }
12
12
  exports.isPreviewing = isPreviewing;
@@ -1,10 +1,10 @@
1
1
  import { getSearchString } from "../helpers/search/search.qwik.mjs";
2
2
  import { isBrowser } from "./is-browser.qwik.mjs";
3
- function isPreviewing(_search) {
4
- const search = _search || (isBrowser() ? window.location.search : void 0);
5
- if (!search)
3
+ function isPreviewing(search) {
4
+ const searchToUse = search || (isBrowser() ? window.location.search : void 0);
5
+ if (!searchToUse)
6
6
  return false;
7
- const normalizedSearch = getSearchString(search);
7
+ const normalizedSearch = getSearchString(searchToUse);
8
8
  return Boolean(normalizedSearch.indexOf("builder.preview=") !== -1);
9
9
  }
10
10
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-qwik",
3
- "version": "0.22.1",
3
+ "version": "0.23.0",
4
4
  "homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/qwik",
5
5
  "repository": {
6
6
  "type": "git",
@@ -112,7 +112,7 @@
112
112
  "build:browser": "SDK_ENV=browser yarn build:one"
113
113
  },
114
114
  "dependencies": {
115
- "isolated-vm": "^5.0.0"
115
+ "isolated-vm": "^6.0.0"
116
116
  },
117
117
  "devDependencies": {
118
118
  "@builder.io/qwik": "^1.5.1",
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.22.1";
1
+ export declare const SDK_VERSION = "0.23.0";
@@ -1,7 +1,13 @@
1
1
  import type { QueryObject } from '../../helpers/search/search';
2
2
  /**
3
- * Receives a `URLSearchParams` object or a regular query object, and returns the subset of query params that are
4
- * relevant to the Builder SDK.
3
+ * Receives a `URLSearchParams` object or a regular query object, and returns
4
+ * the subset of query params that are relevant to the Builder SDK.
5
+ *
6
+ * Outputs a key-value object to be passed to `fetchOneEntry` or `fetchEntries`
7
+ * functions as the `options` argument.
8
+ *
9
+ * NOTE: This function is generally not needed. Instead, it is recommended to use `isPreviewing()`
10
+ * to check if the current page requires previewed content.
5
11
  *
6
12
  * @returns
7
13
  */
@@ -1,2 +1,12 @@
1
1
  import type { Search } from '../helpers/search/search';
2
- export declare function isPreviewing(_search?: Search): boolean;
2
+ /**
3
+ * Checks the current URL's search parameters to see if it is attempting to
4
+ * preview Builder Content.
5
+ *
6
+ * When called on the client, it uses `window.location.search`.
7
+ * When called on the server (SSR), it requires a `search` argument.
8
+ *
9
+ * @param search - The search parameters to check. Can be a URL string (containing the search parameters), `URLSearchParams`, or a key-value object containing the search parameters.
10
+ * @returns `true` if the current page is being previewed, `false` otherwise.
11
+ */
12
+ export declare function isPreviewing(search?: Search): boolean;