@builder.io/sdk-qwik 0.6.5-4 → 0.7.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/index.qwik.cjs +48 -61
- package/lib/browser/index.qwik.mjs +49 -62
- package/lib/edge/index.qwik.cjs +48 -61
- package/lib/edge/index.qwik.mjs +49 -62
- package/lib/node/index.qwik.cjs +48 -61
- package/lib/node/index.qwik.mjs +49 -62
- package/package.json +1 -1
- package/lib/index.qwik.cjs +0 -8790
- package/lib/index.qwik.mjs +0 -8790
- package/types/blocks/BaseText.d.ts +0 -5
- package/types/blocks/button/button.d.ts +0 -11
- package/types/blocks/button/component-info.d.ts +0 -2
- package/types/blocks/columns/columns.d.ts +0 -32
- package/types/blocks/columns/component-info.d.ts +0 -2
- package/types/blocks/custom-code/component-info.d.ts +0 -2
- package/types/blocks/custom-code/custom-code.d.ts +0 -7
- package/types/blocks/embed/component-info.d.ts +0 -2
- package/types/blocks/embed/embed.d.ts +0 -6
- package/types/blocks/embed/helpers.d.ts +0 -1
- package/types/blocks/form/component-info.d.ts +0 -2
- package/types/blocks/fragment/component-info.d.ts +0 -2
- package/types/blocks/fragment/fragment.d.ts +0 -7
- package/types/blocks/helpers.d.ts +0 -13
- package/types/blocks/image/component-info.d.ts +0 -2
- package/types/blocks/image/image.d.ts +0 -23
- package/types/blocks/image/image.helpers.d.ts +0 -1
- package/types/blocks/img/component-info.d.ts +0 -2
- package/types/blocks/img/img.d.ts +0 -12
- package/types/blocks/input/component-info.d.ts +0 -2
- package/types/blocks/input/input.d.ts +0 -13
- package/types/blocks/raw-text/component-info.d.ts +0 -2
- package/types/blocks/raw-text/raw-text.d.ts +0 -6
- package/types/blocks/section/component-info.d.ts +0 -2
- package/types/blocks/section/section.d.ts +0 -10
- package/types/blocks/select/component-info.d.ts +0 -2
- package/types/blocks/select/select.d.ts +0 -14
- package/types/blocks/submit-button/component-info.d.ts +0 -2
- package/types/blocks/submit-button/submit-button.d.ts +0 -8
- package/types/blocks/symbol/component-info.d.ts +0 -2
- package/types/blocks/symbol/symbol.d.ts +0 -24
- package/types/blocks/symbol/symbol.helpers.d.ts +0 -14
- package/types/blocks/text/component-info.d.ts +0 -2
- package/types/blocks/text/text.d.ts +0 -5
- package/types/blocks/textarea/component-info.d.ts +0 -2
- package/types/blocks/textarea/textarea.d.ts +0 -11
- package/types/blocks/video/component-info.d.ts +0 -2
- package/types/blocks/video/video.d.ts +0 -19
- package/types/components/block/block.d.ts +0 -9
- package/types/components/block/block.helpers.d.ts +0 -13
- package/types/components/block/components/block-styles.d.ts +0 -8
- package/types/components/block/components/block-wrapper.d.ts +0 -20
- package/types/components/block/components/component-ref/component-ref.d.ts +0 -3
- package/types/components/block/components/component-ref/component-ref.helpers.d.ts +0 -35
- package/types/components/block/components/interactive-element.d.ts +0 -11
- package/types/components/block/components/repeated-block.d.ts +0 -9
- package/types/components/block/types.d.ts +0 -6
- package/types/components/blocks/blocks-wrapper.d.ts +0 -13
- package/types/components/blocks/blocks.d.ts +0 -8
- package/types/components/blocks/deopt.d.ts +0 -4
- package/types/components/content/components/enable-editor.d.ts +0 -21
- package/types/components/content/components/styles.d.ts +0 -8
- package/types/components/content/components/styles.helpers.d.ts +0 -15
- package/types/components/content/content.d.ts +0 -5
- package/types/components/content/content.helpers.d.ts +0 -7
- package/types/components/content/content.types.d.ts +0 -24
- package/types/components/content/index.d.ts +0 -1
- package/types/components/content/wrap-component-ref.d.ts +0 -6
- package/types/components/content-variants/content-variants.d.ts +0 -9
- package/types/components/content-variants/content-variants.types.d.ts +0 -20
- package/types/components/content-variants/helpers.d.ts +0 -41
- package/types/components/inlined-script.d.ts +0 -6
- package/types/components/inlined-styles.d.ts +0 -6
- package/types/constants/builder-registered-components.d.ts +0 -6
- package/types/constants/device-sizes.d.ts +0 -13
- package/types/constants/sdk-version.d.ts +0 -1
- package/types/constants/target.d.ts +0 -2
- package/types/context/builder.context.d.ts +0 -2
- package/types/context/components.context.d.ts +0 -2
- package/types/context/types.d.ts +0 -35
- package/types/functions/apply-patch-with-mutation.d.ts +0 -10
- package/types/functions/camel-to-kebab-case.d.ts +0 -1
- package/types/functions/evaluate/browser-runtime/browser.d.ts +0 -4
- package/types/functions/evaluate/browser-runtime/index.d.ts +0 -1
- package/types/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +0 -2
- package/types/functions/evaluate/edge-runtime/edge-runtime.d.ts +0 -2
- package/types/functions/evaluate/edge-runtime/index.d.ts +0 -1
- package/types/functions/evaluate/evaluate.d.ts +0 -6
- package/types/functions/evaluate/helpers.d.ts +0 -18
- package/types/functions/evaluate/index.d.ts +0 -1
- package/types/functions/evaluate/node-runtime/index.d.ts +0 -1
- package/types/functions/evaluate/non-node-runtime/acorn-interpreter.d.ts +0 -2
- package/types/functions/evaluate/non-node-runtime/index.d.ts +0 -1
- package/types/functions/evaluate/non-node-runtime/non-node-runtime.d.ts +0 -2
- package/types/functions/evaluate/placeholder-runtime.d.ts +0 -2
- package/types/functions/event-handler-name.d.ts +0 -1
- package/types/functions/extract-text-styles.d.ts +0 -4
- package/types/functions/fast-clone.d.ts +0 -4
- package/types/functions/fetch-builder-props.d.ts +0 -40
- package/types/functions/get-block-actions-handler.d.ts +0 -5
- package/types/functions/get-block-actions.d.ts +0 -10
- package/types/functions/get-block-component-options.d.ts +0 -2
- package/types/functions/get-block-properties.d.ts +0 -11
- package/types/functions/get-builder-search-params/index.d.ts +0 -12
- package/types/functions/get-content/generate-content-url.d.ts +0 -2
- package/types/functions/get-content/index.d.ts +0 -28
- package/types/functions/get-content/types.d.ts +0 -51
- package/types/functions/get-fetch.d.ts +0 -1
- package/types/functions/get-global-this.d.ts +0 -4
- package/types/functions/get-processed-block.d.ts +0 -10
- package/types/functions/get-react-native-block-styles.d.ts +0 -7
- package/types/functions/is-browser.d.ts +0 -1
- package/types/functions/is-edge-runtime.d.ts +0 -4
- package/types/functions/is-editing.d.ts +0 -1
- package/types/functions/is-iframe.d.ts +0 -1
- package/types/functions/is-non-node-server.d.ts +0 -4
- package/types/functions/is-previewing.d.ts +0 -1
- package/types/functions/on-change.d.ts +0 -7
- package/types/functions/register-component.d.ts +0 -15
- package/types/functions/register.d.ts +0 -16
- package/types/functions/sanitize-react-native-block-styles.d.ts +0 -3
- package/types/functions/set-editor-settings.d.ts +0 -4
- package/types/functions/set.d.ts +0 -7
- package/types/functions/track/helpers.d.ts +0 -5
- package/types/functions/track/index.d.ts +0 -51
- package/types/functions/track/interaction.d.ts +0 -13
- package/types/functions/transform-block-properties.d.ts +0 -1
- package/types/functions/transform-block.d.ts +0 -2
- package/types/helpers/ab-tests.d.ts +0 -9
- package/types/helpers/canTrack.d.ts +0 -1
- package/types/helpers/cookie.d.ts +0 -19
- package/types/helpers/css.d.ts +0 -7
- package/types/helpers/flatten.d.ts +0 -6
- package/types/helpers/localStorage.d.ts +0 -9
- package/types/helpers/logger.d.ts +0 -6
- package/types/helpers/nullable.d.ts +0 -2
- package/types/helpers/preview-lru-cache/get.d.ts +0 -2
- package/types/helpers/preview-lru-cache/helpers.d.ts +0 -0
- package/types/helpers/preview-lru-cache/init.d.ts +0 -6
- package/types/helpers/preview-lru-cache/set.d.ts +0 -7
- package/types/helpers/preview-lru-cache/types.d.ts +0 -0
- package/types/helpers/sessionId.d.ts +0 -6
- package/types/helpers/time.d.ts +0 -1
- package/types/helpers/url.d.ts +0 -6
- package/types/helpers/uuid.d.ts +0 -8
- package/types/helpers/visitorId.d.ts +0 -6
- package/types/index-helpers/blocks-exports.d.ts +0 -21
- package/types/index-helpers/top-of-file.d.ts +0 -1
- package/types/index.d.ts +0 -7
- package/types/scripts/init-editing.d.ts +0 -6
- package/types/server-index.d.ts +0 -15
- package/types/src/blocks/BaseText.d.ts +0 -5
- package/types/src/blocks/button/button.d.ts +0 -11
- package/types/src/blocks/button/component-info.d.ts +0 -2
- package/types/src/blocks/columns/columns.d.ts +0 -32
- package/types/src/blocks/columns/component-info.d.ts +0 -2
- package/types/src/blocks/custom-code/component-info.d.ts +0 -2
- package/types/src/blocks/custom-code/custom-code.d.ts +0 -7
- package/types/src/blocks/embed/component-info.d.ts +0 -2
- package/types/src/blocks/embed/embed.d.ts +0 -6
- package/types/src/blocks/embed/helpers.d.ts +0 -1
- package/types/src/blocks/form/component-info.d.ts +0 -2
- package/types/src/blocks/fragment/component-info.d.ts +0 -2
- package/types/src/blocks/fragment/fragment.d.ts +0 -7
- package/types/src/blocks/helpers.d.ts +0 -13
- package/types/src/blocks/image/component-info.d.ts +0 -2
- package/types/src/blocks/image/image.d.ts +0 -22
- package/types/src/blocks/image/image.helpers.d.ts +0 -1
- package/types/src/blocks/img/component-info.d.ts +0 -2
- package/types/src/blocks/img/img.d.ts +0 -12
- package/types/src/blocks/input/component-info.d.ts +0 -2
- package/types/src/blocks/input/input.d.ts +0 -13
- package/types/src/blocks/raw-text/component-info.d.ts +0 -2
- package/types/src/blocks/raw-text/raw-text.d.ts +0 -6
- package/types/src/blocks/section/component-info.d.ts +0 -2
- package/types/src/blocks/section/section.d.ts +0 -10
- package/types/src/blocks/select/component-info.d.ts +0 -2
- package/types/src/blocks/select/select.d.ts +0 -14
- package/types/src/blocks/submit-button/component-info.d.ts +0 -2
- package/types/src/blocks/submit-button/submit-button.d.ts +0 -8
- package/types/src/blocks/symbol/component-info.d.ts +0 -2
- package/types/src/blocks/symbol/symbol.d.ts +0 -24
- package/types/src/blocks/symbol/symbol.helpers.d.ts +0 -14
- package/types/src/blocks/text/component-info.d.ts +0 -2
- package/types/src/blocks/text/text.d.ts +0 -5
- package/types/src/blocks/textarea/component-info.d.ts +0 -2
- package/types/src/blocks/textarea/textarea.d.ts +0 -11
- package/types/src/blocks/video/component-info.d.ts +0 -2
- package/types/src/blocks/video/video.d.ts +0 -19
- package/types/src/components/block/block.d.ts +0 -9
- package/types/src/components/block/block.helpers.d.ts +0 -13
- package/types/src/components/block/components/block-styles.d.ts +0 -8
- package/types/src/components/block/components/block-wrapper.d.ts +0 -20
- package/types/src/components/block/components/component-ref/component-ref.d.ts +0 -3
- package/types/src/components/block/components/component-ref/component-ref.helpers.d.ts +0 -35
- package/types/src/components/block/components/interactive-element.d.ts +0 -11
- package/types/src/components/block/components/repeated-block.d.ts +0 -9
- package/types/src/components/block/types.d.ts +0 -6
- package/types/src/components/blocks/blocks-wrapper.d.ts +0 -13
- package/types/src/components/blocks/blocks.d.ts +0 -8
- package/types/src/components/blocks/deopt.d.ts +0 -4
- package/types/src/components/content/components/enable-editor.d.ts +0 -25
- package/types/src/components/content/components/styles.d.ts +0 -8
- package/types/src/components/content/components/styles.helpers.d.ts +0 -15
- package/types/src/components/content/content.d.ts +0 -5
- package/types/src/components/content/content.helpers.d.ts +0 -7
- package/types/src/components/content/content.types.d.ts +0 -24
- package/types/src/components/content/index.d.ts +0 -1
- package/types/src/components/content/wrap-component-ref.d.ts +0 -6
- package/types/src/components/content-variants/content-variants.d.ts +0 -9
- package/types/src/components/content-variants/content-variants.types.d.ts +0 -20
- package/types/src/components/content-variants/helpers.d.ts +0 -41
- package/types/src/components/inlined-script.d.ts +0 -6
- package/types/src/components/inlined-styles.d.ts +0 -6
- package/types/src/constants/builder-registered-components.d.ts +0 -6
- package/types/src/constants/device-sizes.d.ts +0 -13
- package/types/src/constants/sdk-version.d.ts +0 -1
- package/types/src/constants/target.d.ts +0 -2
- package/types/src/context/builder.context.d.ts +0 -2
- package/types/src/context/components.context.d.ts +0 -2
- package/types/src/context/types.d.ts +0 -35
- package/types/src/functions/apply-patch-with-mutation.d.ts +0 -10
- package/types/src/functions/camel-to-kebab-case.d.ts +0 -1
- package/types/src/functions/deopt.d.ts +0 -4
- package/types/src/functions/evaluate/browser-runtime/browser.d.ts +0 -4
- package/types/src/functions/evaluate/browser-runtime/index.d.ts +0 -1
- package/types/src/functions/evaluate/edge-runtime/acorn-interpreter.d.ts +0 -2
- package/types/src/functions/evaluate/edge-runtime/edge-runtime.d.ts +0 -2
- package/types/src/functions/evaluate/edge-runtime/index.d.ts +0 -1
- package/types/src/functions/evaluate/evaluate.d.ts +0 -6
- package/types/src/functions/evaluate/helpers.d.ts +0 -18
- package/types/src/functions/evaluate/index.d.ts +0 -1
- package/types/src/functions/evaluate/node-runtime/index.d.ts +0 -1
- package/types/src/functions/evaluate/non-node-runtime/acorn-interpreter.d.ts +0 -2
- package/types/src/functions/evaluate/non-node-runtime/index.d.ts +0 -1
- package/types/src/functions/evaluate/non-node-runtime/non-node-runtime.d.ts +0 -2
- package/types/src/functions/evaluate/placeholder-runtime.d.ts +0 -2
- package/types/src/functions/event-handler-name.d.ts +0 -1
- package/types/src/functions/extract-text-styles.d.ts +0 -4
- package/types/src/functions/fast-clone.d.ts +0 -4
- package/types/src/functions/fetch-builder-props.d.ts +0 -53
- package/types/src/functions/get-block-actions-handler.d.ts +0 -5
- package/types/src/functions/get-block-actions.d.ts +0 -10
- package/types/src/functions/get-block-component-options.d.ts +0 -2
- package/types/src/functions/get-block-properties.d.ts +0 -11
- package/types/src/functions/get-builder-search-params/index.d.ts +0 -12
- package/types/src/functions/get-content/generate-content-url.d.ts +0 -2
- package/types/src/functions/get-content/index.d.ts +0 -28
- package/types/src/functions/get-content/types.d.ts +0 -51
- package/types/src/functions/get-fetch.d.ts +0 -1
- package/types/src/functions/get-global-this.d.ts +0 -4
- package/types/src/functions/get-processed-block.d.ts +0 -10
- package/types/src/functions/get-react-native-block-styles.d.ts +0 -7
- package/types/src/functions/is-browser.d.ts +0 -1
- package/types/src/functions/is-edge-runtime.d.ts +0 -4
- package/types/src/functions/is-editing.d.ts +0 -1
- package/types/src/functions/is-iframe.d.ts +0 -1
- package/types/src/functions/is-non-node-server.d.ts +0 -4
- package/types/src/functions/is-previewing.d.ts +0 -1
- package/types/src/functions/on-change.d.ts +0 -7
- package/types/src/functions/register-component.d.ts +0 -15
- package/types/src/functions/register.d.ts +0 -16
- package/types/src/functions/sanitize-react-native-block-styles.d.ts +0 -3
- package/types/src/functions/set-editor-settings.d.ts +0 -4
- package/types/src/functions/set.d.ts +0 -7
- package/types/src/functions/track/helpers.d.ts +0 -5
- package/types/src/functions/track/index.d.ts +0 -51
- package/types/src/functions/track/interaction.d.ts +0 -13
- package/types/src/functions/transform-block-properties.d.ts +0 -1
- package/types/src/functions/transform-block.d.ts +0 -2
- package/types/src/helpers/ab-tests.d.ts +0 -9
- package/types/src/helpers/canTrack.d.ts +0 -1
- package/types/src/helpers/cookie.d.ts +0 -19
- package/types/src/helpers/css.d.ts +0 -7
- package/types/src/helpers/flatten.d.ts +0 -6
- package/types/src/helpers/localStorage.d.ts +0 -9
- package/types/src/helpers/logger.d.ts +0 -6
- package/types/src/helpers/nullable.d.ts +0 -2
- package/types/src/helpers/preview-lru-cache/get.d.ts +0 -2
- package/types/src/helpers/preview-lru-cache/helpers.d.ts +0 -0
- package/types/src/helpers/preview-lru-cache/init.d.ts +0 -6
- package/types/src/helpers/preview-lru-cache/set.d.ts +0 -7
- package/types/src/helpers/preview-lru-cache/types.d.ts +0 -0
- package/types/src/helpers/sessionId.d.ts +0 -6
- package/types/src/helpers/time.d.ts +0 -1
- package/types/src/helpers/url.d.ts +0 -6
- package/types/src/helpers/uuid.d.ts +0 -8
- package/types/src/helpers/visitorId.d.ts +0 -6
- package/types/src/index-helpers/blocks-exports.d.ts +0 -21
- package/types/src/index-helpers/top-of-file.d.ts +0 -1
- package/types/src/index.d.ts +0 -7
- package/types/src/scripts/init-editing.d.ts +0 -6
- package/types/src/server-index.d.ts +0 -15
- package/types/src/types/api-version.d.ts +0 -2
- package/types/src/types/builder-block.d.ts +0 -66
- package/types/src/types/builder-content.d.ts +0 -44
- package/types/src/types/builder-props.d.ts +0 -9
- package/types/src/types/can-track.d.ts +0 -3
- package/types/src/types/components.d.ts +0 -110
- package/types/src/types/deep-partial.d.ts +0 -3
- package/types/src/types/element.d.ts +0 -59
- package/types/src/types/enforced-partials.d.ts +0 -21
- package/types/src/types/input.d.ts +0 -121
- package/types/src/types/targets.d.ts +0 -1
- package/types/src/types/typescript.d.ts +0 -11
- package/types/types/api-version.d.ts +0 -2
- package/types/types/builder-block.d.ts +0 -66
- package/types/types/builder-content.d.ts +0 -44
- package/types/types/builder-props.d.ts +0 -9
- package/types/types/can-track.d.ts +0 -3
- package/types/types/components.d.ts +0 -111
- package/types/types/deep-partial.d.ts +0 -3
- package/types/types/element.d.ts +0 -59
- package/types/types/enforced-partials.d.ts +0 -21
- package/types/types/input.d.ts +0 -121
- package/types/types/targets.d.ts +0 -1
- package/types/types/typescript.d.ts +0 -11
package/lib/node/index.qwik.cjs
CHANGED
|
@@ -2815,7 +2815,8 @@ const getBuilderSearchParamsFromWindow = () => {
|
|
|
2815
2815
|
const normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchParams ? convertSearchParamsToQueryObject(searchParams) : searchParams;
|
|
2816
2816
|
const DEFAULT_API_VERSION = "v3";
|
|
2817
2817
|
const generateContentUrl = (options) => {
|
|
2818
|
-
|
|
2818
|
+
let { noTraverse = false } = options;
|
|
2819
|
+
const { limit = 30, userAttributes, query, model, apiKey, includeRefs = true, enrich, locale, apiVersion = DEFAULT_API_VERSION } = options;
|
|
2819
2820
|
if (!apiKey)
|
|
2820
2821
|
throw new Error("Missing API key");
|
|
2821
2822
|
if (![
|
|
@@ -2823,6 +2824,8 @@ const generateContentUrl = (options) => {
|
|
|
2823
2824
|
"v3"
|
|
2824
2825
|
].includes(apiVersion))
|
|
2825
2826
|
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${apiVersion}'`);
|
|
2827
|
+
if ((options.limit === void 0 || options.limit > 1) && !("noTraverse" in options))
|
|
2828
|
+
noTraverse = true;
|
|
2826
2829
|
const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}?apiKey=${apiKey}&limit=${limit}&noTraverse=${noTraverse}&includeRefs=${includeRefs}${locale ? `&locale=${locale}` : ""}${enrich ? `&enrich=${enrich}` : ""}`);
|
|
2827
2830
|
const queryOptions = {
|
|
2828
2831
|
...getBuilderSearchParamsFromWindow(),
|
|
@@ -3097,7 +3100,7 @@ const getInteractionPropertiesForEvent = (event) => {
|
|
|
3097
3100
|
}
|
|
3098
3101
|
};
|
|
3099
3102
|
};
|
|
3100
|
-
const SDK_VERSION = "0.
|
|
3103
|
+
const SDK_VERSION = "0.7.0";
|
|
3101
3104
|
const registry = {};
|
|
3102
3105
|
function register(type, info) {
|
|
3103
3106
|
let typeList = registry[type];
|
|
@@ -3354,43 +3357,6 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
|
|
|
3354
3357
|
}
|
|
3355
3358
|
}));
|
|
3356
3359
|
};
|
|
3357
|
-
const initEditing = function initEditing2(props, state, elementRef, _event) {
|
|
3358
|
-
state.forceReRenderCount = state.forceReRenderCount + 1;
|
|
3359
|
-
window.addEventListener("message", processMessage.bind(null, props, state, elementRef));
|
|
3360
|
-
registerInsertMenu();
|
|
3361
|
-
setupBrowserForEditing({
|
|
3362
|
-
...props.locale ? {
|
|
3363
|
-
locale: props.locale
|
|
3364
|
-
} : {},
|
|
3365
|
-
...props.includeRefs ? {
|
|
3366
|
-
includeRefs: props.includeRefs
|
|
3367
|
-
} : {},
|
|
3368
|
-
...props.enrich ? {
|
|
3369
|
-
enrich: props.enrich
|
|
3370
|
-
} : {}
|
|
3371
|
-
});
|
|
3372
|
-
Object.values(props.builderContextSignal.componentInfos).forEach((registeredComponent) => {
|
|
3373
|
-
var _a;
|
|
3374
|
-
const message = createRegisterComponentMessage(registeredComponent);
|
|
3375
|
-
(_a = window.parent) == null ? void 0 : _a.postMessage(message, "*");
|
|
3376
|
-
});
|
|
3377
|
-
window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props, state, elementRef));
|
|
3378
|
-
};
|
|
3379
|
-
const initPreview = function initPreview2(props, state, elementRef, _event) {
|
|
3380
|
-
const searchParams = new URL(location.href).searchParams;
|
|
3381
|
-
const searchParamPreviewModel = searchParams.get("builder.preview");
|
|
3382
|
-
const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
|
|
3383
|
-
const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
|
|
3384
|
-
if (searchParamPreviewModel === props.model && previewApiKey === props.apiKey && (!props.content || searchParamPreviewId === props.content.id))
|
|
3385
|
-
fetchOneEntry({
|
|
3386
|
-
model: props.model,
|
|
3387
|
-
apiKey: props.apiKey,
|
|
3388
|
-
apiVersion: props.builderContextSignal.apiVersion
|
|
3389
|
-
}).then((content) => {
|
|
3390
|
-
if (content)
|
|
3391
|
-
mergeNewContent(props, state, elementRef, content);
|
|
3392
|
-
});
|
|
3393
|
-
};
|
|
3394
3360
|
const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inlinedQrl((props) => {
|
|
3395
3361
|
qwik._jsxBranch();
|
|
3396
3362
|
const elementRef = qwik.useSignal();
|
|
@@ -3403,31 +3369,35 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
3403
3369
|
}, {
|
|
3404
3370
|
deep: true
|
|
3405
3371
|
});
|
|
3406
|
-
qwik.useOn("initEditingBldr", /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
3407
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
3408
|
-
initEditing(props2, state2, elementRef2);
|
|
3409
|
-
}, "EnableEditor_component_useOn_Qs8c0yql2i0", [
|
|
3410
|
-
elementRef,
|
|
3411
|
-
props,
|
|
3412
|
-
state
|
|
3413
|
-
]));
|
|
3414
|
-
qwik.useOn("initPreviewingBldr", /* @__PURE__ */ qwik.inlinedQrl((event) => {
|
|
3415
|
-
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
3416
|
-
initPreview(props2, state2, elementRef2);
|
|
3417
|
-
}, "EnableEditor_component_useOn_1_F94YipmknvI", [
|
|
3418
|
-
elementRef,
|
|
3419
|
-
props,
|
|
3420
|
-
state
|
|
3421
|
-
]));
|
|
3422
3372
|
qwik.useContextProvider(builderContext, props.builderContextSignal);
|
|
3423
3373
|
qwik.useVisibleTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(() => {
|
|
3424
3374
|
var _a, _b;
|
|
3425
|
-
const [elementRef2, props2] = qwik.useLexicalScope();
|
|
3375
|
+
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
|
3426
3376
|
if (!props2.apiKey)
|
|
3427
3377
|
logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
|
|
3428
3378
|
if (isBrowser()) {
|
|
3429
|
-
if (isEditing()
|
|
3430
|
-
|
|
3379
|
+
if (isEditing()) {
|
|
3380
|
+
state2.forceReRenderCount = state2.forceReRenderCount + 1;
|
|
3381
|
+
window.addEventListener("message", processMessage.bind(null, props2, state2, elementRef2));
|
|
3382
|
+
registerInsertMenu();
|
|
3383
|
+
setupBrowserForEditing({
|
|
3384
|
+
...props2.locale ? {
|
|
3385
|
+
locale: props2.locale
|
|
3386
|
+
} : {},
|
|
3387
|
+
...props2.includeRefs ? {
|
|
3388
|
+
includeRefs: props2.includeRefs
|
|
3389
|
+
} : {},
|
|
3390
|
+
...props2.enrich ? {
|
|
3391
|
+
enrich: props2.enrich
|
|
3392
|
+
} : {}
|
|
3393
|
+
});
|
|
3394
|
+
Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
|
|
3395
|
+
var _a2;
|
|
3396
|
+
const message = createRegisterComponentMessage(registeredComponent);
|
|
3397
|
+
(_a2 = window.parent) == null ? void 0 : _a2.postMessage(message, "*");
|
|
3398
|
+
});
|
|
3399
|
+
window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, elementRef2));
|
|
3400
|
+
}
|
|
3431
3401
|
if (props2.builderContextSignal.content) {
|
|
3432
3402
|
const variationId = (_a = props2.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
|
|
3433
3403
|
const contentId = (_b = props2.builderContextSignal.content) == null ? void 0 : _b.id;
|
|
@@ -3439,12 +3409,29 @@ const EnableEditor = /* @__PURE__ */ qwik.componentQrl(/* @__PURE__ */ qwik.inli
|
|
|
3439
3409
|
variationId: variationId !== contentId ? variationId : void 0
|
|
3440
3410
|
});
|
|
3441
3411
|
}
|
|
3442
|
-
if (isPreviewing()
|
|
3443
|
-
|
|
3412
|
+
if (isPreviewing()) {
|
|
3413
|
+
const searchParams = new URL(location.href).searchParams;
|
|
3414
|
+
const searchParamPreviewModel = searchParams.get("builder.preview");
|
|
3415
|
+
const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
|
|
3416
|
+
const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
|
|
3417
|
+
if (searchParamPreviewModel === props2.model && previewApiKey === props2.apiKey && (!props2.content || searchParamPreviewId === props2.content.id))
|
|
3418
|
+
fetchOneEntry({
|
|
3419
|
+
model: props2.model,
|
|
3420
|
+
apiKey: props2.apiKey,
|
|
3421
|
+
apiVersion: props2.builderContextSignal.apiVersion
|
|
3422
|
+
}).then((content) => {
|
|
3423
|
+
if (content)
|
|
3424
|
+
mergeNewContent(props2, state2, elementRef2, content);
|
|
3425
|
+
});
|
|
3426
|
+
}
|
|
3427
|
+
evaluateJsCode(props2);
|
|
3428
|
+
runHttpRequests(props2, state2, elementRef2);
|
|
3429
|
+
emitStateUpdate(props2);
|
|
3444
3430
|
}
|
|
3445
3431
|
}, "EnableEditor_component_useVisibleTask_Olaxc9jCOFk", [
|
|
3446
3432
|
elementRef,
|
|
3447
|
-
props
|
|
3433
|
+
props,
|
|
3434
|
+
state
|
|
3448
3435
|
]));
|
|
3449
3436
|
qwik.useTaskQrl(/* @__PURE__ */ qwik.inlinedQrl(({ track: track2 }) => {
|
|
3450
3437
|
const [elementRef2, props2, state2] = qwik.useLexicalScope();
|
package/lib/node/index.qwik.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useComputedQrl, useLexicalScope, _IMMUTABLE, Slot, useStore, useContextProvider, _wrapProp, useContext, createElement, Fragment as Fragment$1, useSignal, useTaskQrl, useVisibleTaskQrl
|
|
1
|
+
import { componentQrl, inlinedQrl, useStylesScopedQrl, _jsxC, _jsxS, _fnSignal, createContextId, _jsxQ, _jsxBranch, useComputedQrl, useLexicalScope, _IMMUTABLE, Slot, useStore, useContextProvider, _wrapProp, useContext, createElement, Fragment as Fragment$1, useSignal, useTaskQrl, useVisibleTaskQrl } from "@builder.io/qwik";
|
|
2
2
|
import { Fragment } from "@builder.io/qwik/jsx-runtime";
|
|
3
3
|
const Button = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
4
4
|
useStylesScopedQrl(/* @__PURE__ */ inlinedQrl(STYLES$3, "Button_component_useStylesScoped_a1JZ0Q0Q2Oc"));
|
|
@@ -2813,7 +2813,8 @@ const getBuilderSearchParamsFromWindow = () => {
|
|
|
2813
2813
|
const normalizeSearchParams = (searchParams) => searchParams instanceof URLSearchParams ? convertSearchParamsToQueryObject(searchParams) : searchParams;
|
|
2814
2814
|
const DEFAULT_API_VERSION = "v3";
|
|
2815
2815
|
const generateContentUrl = (options) => {
|
|
2816
|
-
|
|
2816
|
+
let { noTraverse = false } = options;
|
|
2817
|
+
const { limit = 30, userAttributes, query, model, apiKey, includeRefs = true, enrich, locale, apiVersion = DEFAULT_API_VERSION } = options;
|
|
2817
2818
|
if (!apiKey)
|
|
2818
2819
|
throw new Error("Missing API key");
|
|
2819
2820
|
if (![
|
|
@@ -2821,6 +2822,8 @@ const generateContentUrl = (options) => {
|
|
|
2821
2822
|
"v3"
|
|
2822
2823
|
].includes(apiVersion))
|
|
2823
2824
|
throw new Error(`Invalid apiVersion: expected 'v2' or 'v3', received '${apiVersion}'`);
|
|
2825
|
+
if ((options.limit === void 0 || options.limit > 1) && !("noTraverse" in options))
|
|
2826
|
+
noTraverse = true;
|
|
2824
2827
|
const url = new URL(`https://cdn.builder.io/api/${apiVersion}/content/${model}?apiKey=${apiKey}&limit=${limit}&noTraverse=${noTraverse}&includeRefs=${includeRefs}${locale ? `&locale=${locale}` : ""}${enrich ? `&enrich=${enrich}` : ""}`);
|
|
2825
2828
|
const queryOptions = {
|
|
2826
2829
|
...getBuilderSearchParamsFromWindow(),
|
|
@@ -3095,7 +3098,7 @@ const getInteractionPropertiesForEvent = (event) => {
|
|
|
3095
3098
|
}
|
|
3096
3099
|
};
|
|
3097
3100
|
};
|
|
3098
|
-
const SDK_VERSION = "0.
|
|
3101
|
+
const SDK_VERSION = "0.7.0";
|
|
3099
3102
|
const registry = {};
|
|
3100
3103
|
function register(type, info) {
|
|
3101
3104
|
let typeList = registry[type];
|
|
@@ -3352,43 +3355,6 @@ const emitStateUpdate = function emitStateUpdate2(props, state, elementRef) {
|
|
|
3352
3355
|
}
|
|
3353
3356
|
}));
|
|
3354
3357
|
};
|
|
3355
|
-
const initEditing = function initEditing2(props, state, elementRef, _event) {
|
|
3356
|
-
state.forceReRenderCount = state.forceReRenderCount + 1;
|
|
3357
|
-
window.addEventListener("message", processMessage.bind(null, props, state, elementRef));
|
|
3358
|
-
registerInsertMenu();
|
|
3359
|
-
setupBrowserForEditing({
|
|
3360
|
-
...props.locale ? {
|
|
3361
|
-
locale: props.locale
|
|
3362
|
-
} : {},
|
|
3363
|
-
...props.includeRefs ? {
|
|
3364
|
-
includeRefs: props.includeRefs
|
|
3365
|
-
} : {},
|
|
3366
|
-
...props.enrich ? {
|
|
3367
|
-
enrich: props.enrich
|
|
3368
|
-
} : {}
|
|
3369
|
-
});
|
|
3370
|
-
Object.values(props.builderContextSignal.componentInfos).forEach((registeredComponent) => {
|
|
3371
|
-
var _a;
|
|
3372
|
-
const message = createRegisterComponentMessage(registeredComponent);
|
|
3373
|
-
(_a = window.parent) == null ? void 0 : _a.postMessage(message, "*");
|
|
3374
|
-
});
|
|
3375
|
-
window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props, state, elementRef));
|
|
3376
|
-
};
|
|
3377
|
-
const initPreview = function initPreview2(props, state, elementRef, _event) {
|
|
3378
|
-
const searchParams = new URL(location.href).searchParams;
|
|
3379
|
-
const searchParamPreviewModel = searchParams.get("builder.preview");
|
|
3380
|
-
const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
|
|
3381
|
-
const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
|
|
3382
|
-
if (searchParamPreviewModel === props.model && previewApiKey === props.apiKey && (!props.content || searchParamPreviewId === props.content.id))
|
|
3383
|
-
fetchOneEntry({
|
|
3384
|
-
model: props.model,
|
|
3385
|
-
apiKey: props.apiKey,
|
|
3386
|
-
apiVersion: props.builderContextSignal.apiVersion
|
|
3387
|
-
}).then((content) => {
|
|
3388
|
-
if (content)
|
|
3389
|
-
mergeNewContent(props, state, elementRef, content);
|
|
3390
|
-
});
|
|
3391
|
-
};
|
|
3392
3358
|
const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((props) => {
|
|
3393
3359
|
_jsxBranch();
|
|
3394
3360
|
const elementRef = useSignal();
|
|
@@ -3401,31 +3367,35 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
3401
3367
|
}, {
|
|
3402
3368
|
deep: true
|
|
3403
3369
|
});
|
|
3404
|
-
useOn("initEditingBldr", /* @__PURE__ */ inlinedQrl((event) => {
|
|
3405
|
-
const [elementRef2, props2, state2] = useLexicalScope();
|
|
3406
|
-
initEditing(props2, state2, elementRef2);
|
|
3407
|
-
}, "EnableEditor_component_useOn_Qs8c0yql2i0", [
|
|
3408
|
-
elementRef,
|
|
3409
|
-
props,
|
|
3410
|
-
state
|
|
3411
|
-
]));
|
|
3412
|
-
useOn("initPreviewingBldr", /* @__PURE__ */ inlinedQrl((event) => {
|
|
3413
|
-
const [elementRef2, props2, state2] = useLexicalScope();
|
|
3414
|
-
initPreview(props2, state2, elementRef2);
|
|
3415
|
-
}, "EnableEditor_component_useOn_1_F94YipmknvI", [
|
|
3416
|
-
elementRef,
|
|
3417
|
-
props,
|
|
3418
|
-
state
|
|
3419
|
-
]));
|
|
3420
3370
|
useContextProvider(builderContext, props.builderContextSignal);
|
|
3421
3371
|
useVisibleTaskQrl(/* @__PURE__ */ inlinedQrl(() => {
|
|
3422
3372
|
var _a, _b;
|
|
3423
|
-
const [elementRef2, props2] = useLexicalScope();
|
|
3373
|
+
const [elementRef2, props2, state2] = useLexicalScope();
|
|
3424
3374
|
if (!props2.apiKey)
|
|
3425
3375
|
logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop.");
|
|
3426
3376
|
if (isBrowser()) {
|
|
3427
|
-
if (isEditing()
|
|
3428
|
-
|
|
3377
|
+
if (isEditing()) {
|
|
3378
|
+
state2.forceReRenderCount = state2.forceReRenderCount + 1;
|
|
3379
|
+
window.addEventListener("message", processMessage.bind(null, props2, state2, elementRef2));
|
|
3380
|
+
registerInsertMenu();
|
|
3381
|
+
setupBrowserForEditing({
|
|
3382
|
+
...props2.locale ? {
|
|
3383
|
+
locale: props2.locale
|
|
3384
|
+
} : {},
|
|
3385
|
+
...props2.includeRefs ? {
|
|
3386
|
+
includeRefs: props2.includeRefs
|
|
3387
|
+
} : {},
|
|
3388
|
+
...props2.enrich ? {
|
|
3389
|
+
enrich: props2.enrich
|
|
3390
|
+
} : {}
|
|
3391
|
+
});
|
|
3392
|
+
Object.values(props2.builderContextSignal.componentInfos).forEach((registeredComponent) => {
|
|
3393
|
+
var _a2;
|
|
3394
|
+
const message = createRegisterComponentMessage(registeredComponent);
|
|
3395
|
+
(_a2 = window.parent) == null ? void 0 : _a2.postMessage(message, "*");
|
|
3396
|
+
});
|
|
3397
|
+
window.addEventListener("builder:component:stateChangeListenerActivated", emitStateUpdate.bind(null, props2, state2, elementRef2));
|
|
3398
|
+
}
|
|
3429
3399
|
if (props2.builderContextSignal.content) {
|
|
3430
3400
|
const variationId = (_a = props2.builderContextSignal.content) == null ? void 0 : _a.testVariationId;
|
|
3431
3401
|
const contentId = (_b = props2.builderContextSignal.content) == null ? void 0 : _b.id;
|
|
@@ -3437,12 +3407,29 @@ const EnableEditor = /* @__PURE__ */ componentQrl(/* @__PURE__ */ inlinedQrl((pr
|
|
|
3437
3407
|
variationId: variationId !== contentId ? variationId : void 0
|
|
3438
3408
|
});
|
|
3439
3409
|
}
|
|
3440
|
-
if (isPreviewing()
|
|
3441
|
-
|
|
3410
|
+
if (isPreviewing()) {
|
|
3411
|
+
const searchParams = new URL(location.href).searchParams;
|
|
3412
|
+
const searchParamPreviewModel = searchParams.get("builder.preview");
|
|
3413
|
+
const searchParamPreviewId = searchParams.get(`builder.preview.${searchParamPreviewModel}`);
|
|
3414
|
+
const previewApiKey = searchParams.get("apiKey") || searchParams.get("builder.space");
|
|
3415
|
+
if (searchParamPreviewModel === props2.model && previewApiKey === props2.apiKey && (!props2.content || searchParamPreviewId === props2.content.id))
|
|
3416
|
+
fetchOneEntry({
|
|
3417
|
+
model: props2.model,
|
|
3418
|
+
apiKey: props2.apiKey,
|
|
3419
|
+
apiVersion: props2.builderContextSignal.apiVersion
|
|
3420
|
+
}).then((content) => {
|
|
3421
|
+
if (content)
|
|
3422
|
+
mergeNewContent(props2, state2, elementRef2, content);
|
|
3423
|
+
});
|
|
3424
|
+
}
|
|
3425
|
+
evaluateJsCode(props2);
|
|
3426
|
+
runHttpRequests(props2, state2, elementRef2);
|
|
3427
|
+
emitStateUpdate(props2);
|
|
3442
3428
|
}
|
|
3443
3429
|
}, "EnableEditor_component_useVisibleTask_Olaxc9jCOFk", [
|
|
3444
3430
|
elementRef,
|
|
3445
|
-
props
|
|
3431
|
+
props,
|
|
3432
|
+
state
|
|
3446
3433
|
]));
|
|
3447
3434
|
useTaskQrl(/* @__PURE__ */ inlinedQrl(({ track: track2 }) => {
|
|
3448
3435
|
const [elementRef2, props2, state2] = useLexicalScope();
|