@builder.io/sdk-react-native 4.2.2 → 4.2.4
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/commonjs/blocks/img/component-info.js +33 -3
- package/lib/browser/commonjs/blocks/img/component-info.js.map +1 -1
- package/lib/browser/commonjs/blocks/img/img.js +21 -7
- package/lib/browser/commonjs/blocks/img/img.js.map +1 -1
- package/lib/browser/commonjs/blocks/text/component-info.js +0 -1
- package/lib/browser/commonjs/blocks/text/component-info.js.map +1 -1
- package/lib/browser/commonjs/components/block/block.js +4 -3
- package/lib/browser/commonjs/components/block/block.js.map +1 -1
- package/lib/browser/commonjs/components/block/components/interactive-element.js +8 -1
- package/lib/browser/commonjs/components/block/components/interactive-element.js.map +1 -1
- package/lib/browser/commonjs/components/block/components/live-edit-block-styles.js +107 -0
- package/lib/browser/commonjs/components/block/components/live-edit-block-styles.js.map +1 -0
- package/lib/browser/commonjs/components/block/components/style-wrapper.js +34 -0
- package/lib/browser/commonjs/components/block/components/style-wrapper.js.map +1 -0
- package/lib/browser/commonjs/components/content/components/enable-editor.js +15 -6
- package/lib/browser/commonjs/components/content/components/enable-editor.js.map +1 -1
- package/lib/browser/commonjs/components/live-edit.js +28 -0
- package/lib/browser/commonjs/components/live-edit.js.map +1 -0
- package/lib/browser/commonjs/constants/sdk-version.js +1 -1
- package/lib/browser/commonjs/functions/get-builder-search-params/index.js +8 -2
- package/lib/browser/commonjs/functions/get-builder-search-params/index.js.map +1 -1
- package/lib/browser/commonjs/functions/get-content/generate-content-url.js +3 -8
- package/lib/browser/commonjs/functions/get-content/generate-content-url.js.map +1 -1
- package/lib/browser/commonjs/functions/get-content/index.js +9 -0
- package/lib/browser/commonjs/functions/get-content/index.js.map +1 -1
- package/lib/browser/commonjs/functions/is-previewing.js +15 -5
- package/lib/browser/commonjs/functions/is-previewing.js.map +1 -1
- package/lib/browser/commonjs/helpers/find-block.js +49 -0
- package/lib/browser/commonjs/helpers/find-block.js.map +1 -0
- package/lib/browser/commonjs/helpers/subscribe-to-editor.js +4 -2
- package/lib/browser/commonjs/helpers/subscribe-to-editor.js.map +1 -1
- package/lib/browser/module/blocks/img/component-info.js +33 -3
- package/lib/browser/module/blocks/img/component-info.js.map +1 -1
- package/lib/browser/module/blocks/img/img.js +21 -7
- package/lib/browser/module/blocks/img/img.js.map +1 -1
- package/lib/browser/module/blocks/text/component-info.js +0 -1
- package/lib/browser/module/blocks/text/component-info.js.map +1 -1
- package/lib/browser/module/components/block/block.js +4 -3
- package/lib/browser/module/components/block/block.js.map +1 -1
- package/lib/browser/module/components/block/components/interactive-element.js +8 -1
- package/lib/browser/module/components/block/components/interactive-element.js.map +1 -1
- package/lib/browser/module/components/block/components/live-edit-block-styles.js +98 -0
- package/lib/browser/module/components/block/components/live-edit-block-styles.js.map +1 -0
- package/lib/browser/module/components/block/components/style-wrapper.js +25 -0
- package/lib/browser/module/components/block/components/style-wrapper.js.map +1 -0
- package/lib/browser/module/components/content/components/enable-editor.js +15 -6
- package/lib/browser/module/components/content/components/enable-editor.js.map +1 -1
- package/lib/browser/module/components/live-edit.js +20 -0
- package/lib/browser/module/components/live-edit.js.map +1 -0
- package/lib/browser/module/constants/sdk-version.js +1 -1
- package/lib/browser/module/functions/get-builder-search-params/index.js +8 -2
- package/lib/browser/module/functions/get-builder-search-params/index.js.map +1 -1
- package/lib/browser/module/functions/get-content/generate-content-url.js +3 -8
- package/lib/browser/module/functions/get-content/generate-content-url.js.map +1 -1
- package/lib/browser/module/functions/get-content/index.js +9 -0
- package/lib/browser/module/functions/get-content/index.js.map +1 -1
- package/lib/browser/module/functions/is-previewing.js +15 -4
- package/lib/browser/module/functions/is-previewing.js.map +1 -1
- package/lib/browser/module/helpers/find-block.js +41 -0
- package/lib/browser/module/helpers/find-block.js.map +1 -0
- package/lib/browser/module/helpers/subscribe-to-editor.js +4 -2
- package/lib/browser/module/helpers/subscribe-to-editor.js.map +1 -1
- package/lib/browser/typescript/blocks/text/component-info.d.ts.map +1 -1
- package/lib/browser/typescript/components/block/block.d.ts.map +1 -1
- package/lib/browser/typescript/components/block/components/interactive-element.d.ts.map +1 -1
- package/lib/browser/typescript/components/block/components/live-edit-block-styles.d.ts +9 -0
- package/lib/browser/typescript/components/block/components/live-edit-block-styles.d.ts.map +1 -0
- package/lib/browser/typescript/components/block/components/style-wrapper.d.ts +10 -0
- package/lib/browser/typescript/components/block/components/style-wrapper.d.ts.map +1 -0
- package/lib/browser/typescript/components/content/components/enable-editor.d.ts.map +1 -1
- package/lib/browser/typescript/components/live-edit.d.ts +10 -0
- package/lib/browser/typescript/components/live-edit.d.ts.map +1 -0
- package/lib/browser/typescript/constants/sdk-version.d.ts +1 -1
- package/lib/browser/typescript/context/index.d.ts +2 -0
- package/lib/browser/typescript/context/index.d.ts.map +1 -0
- package/lib/browser/typescript/functions/get-builder-search-params/index.d.ts +8 -2
- package/lib/browser/typescript/functions/get-builder-search-params/index.d.ts.map +1 -1
- package/lib/browser/typescript/functions/get-content/generate-content-url.d.ts.map +1 -1
- package/lib/browser/typescript/functions/get-content/index.d.ts.map +1 -1
- package/lib/browser/typescript/functions/is-previewing.d.ts +11 -1
- package/lib/browser/typescript/functions/is-previewing.d.ts.map +1 -1
- package/lib/browser/typescript/helpers/find-block.d.ts +19 -0
- package/lib/browser/typescript/helpers/find-block.d.ts.map +1 -0
- package/lib/browser/typescript/helpers/subscribe-to-editor.d.ts +3 -2
- package/lib/browser/typescript/helpers/subscribe-to-editor.d.ts.map +1 -1
- package/lib/edge/commonjs/blocks/img/component-info.js +33 -3
- package/lib/edge/commonjs/blocks/img/component-info.js.map +1 -1
- package/lib/edge/commonjs/blocks/img/img.js +21 -7
- package/lib/edge/commonjs/blocks/img/img.js.map +1 -1
- package/lib/edge/commonjs/blocks/text/component-info.js +0 -1
- package/lib/edge/commonjs/blocks/text/component-info.js.map +1 -1
- package/lib/edge/commonjs/components/block/block.js +4 -3
- package/lib/edge/commonjs/components/block/block.js.map +1 -1
- package/lib/edge/commonjs/components/block/components/interactive-element.js +8 -1
- package/lib/edge/commonjs/components/block/components/interactive-element.js.map +1 -1
- package/lib/edge/commonjs/components/block/components/live-edit-block-styles.js +107 -0
- package/lib/edge/commonjs/components/block/components/live-edit-block-styles.js.map +1 -0
- package/lib/edge/commonjs/components/block/components/style-wrapper.js +34 -0
- package/lib/edge/commonjs/components/block/components/style-wrapper.js.map +1 -0
- package/lib/edge/commonjs/components/content/components/enable-editor.js +15 -6
- package/lib/edge/commonjs/components/content/components/enable-editor.js.map +1 -1
- package/lib/edge/commonjs/components/live-edit.js +28 -0
- package/lib/edge/commonjs/components/live-edit.js.map +1 -0
- package/lib/edge/commonjs/constants/sdk-version.js +1 -1
- package/lib/edge/commonjs/functions/get-builder-search-params/index.js +8 -2
- package/lib/edge/commonjs/functions/get-builder-search-params/index.js.map +1 -1
- package/lib/edge/commonjs/functions/get-content/generate-content-url.js +3 -8
- package/lib/edge/commonjs/functions/get-content/generate-content-url.js.map +1 -1
- package/lib/edge/commonjs/functions/get-content/index.js +9 -0
- package/lib/edge/commonjs/functions/get-content/index.js.map +1 -1
- package/lib/edge/commonjs/functions/is-previewing.js +15 -5
- package/lib/edge/commonjs/functions/is-previewing.js.map +1 -1
- package/lib/edge/commonjs/helpers/find-block.js +49 -0
- package/lib/edge/commonjs/helpers/find-block.js.map +1 -0
- package/lib/edge/commonjs/helpers/subscribe-to-editor.js +4 -2
- package/lib/edge/commonjs/helpers/subscribe-to-editor.js.map +1 -1
- package/lib/edge/module/blocks/img/component-info.js +33 -3
- package/lib/edge/module/blocks/img/component-info.js.map +1 -1
- package/lib/edge/module/blocks/img/img.js +21 -7
- package/lib/edge/module/blocks/img/img.js.map +1 -1
- package/lib/edge/module/blocks/text/component-info.js +0 -1
- package/lib/edge/module/blocks/text/component-info.js.map +1 -1
- package/lib/edge/module/components/block/block.js +4 -3
- package/lib/edge/module/components/block/block.js.map +1 -1
- package/lib/edge/module/components/block/components/interactive-element.js +8 -1
- package/lib/edge/module/components/block/components/interactive-element.js.map +1 -1
- package/lib/edge/module/components/block/components/live-edit-block-styles.js +98 -0
- package/lib/edge/module/components/block/components/live-edit-block-styles.js.map +1 -0
- package/lib/edge/module/components/block/components/style-wrapper.js +25 -0
- package/lib/edge/module/components/block/components/style-wrapper.js.map +1 -0
- package/lib/edge/module/components/content/components/enable-editor.js +15 -6
- package/lib/edge/module/components/content/components/enable-editor.js.map +1 -1
- package/lib/edge/module/components/live-edit.js +20 -0
- package/lib/edge/module/components/live-edit.js.map +1 -0
- package/lib/edge/module/constants/sdk-version.js +1 -1
- package/lib/edge/module/functions/get-builder-search-params/index.js +8 -2
- package/lib/edge/module/functions/get-builder-search-params/index.js.map +1 -1
- package/lib/edge/module/functions/get-content/generate-content-url.js +3 -8
- package/lib/edge/module/functions/get-content/generate-content-url.js.map +1 -1
- package/lib/edge/module/functions/get-content/index.js +9 -0
- package/lib/edge/module/functions/get-content/index.js.map +1 -1
- package/lib/edge/module/functions/is-previewing.js +15 -4
- package/lib/edge/module/functions/is-previewing.js.map +1 -1
- package/lib/edge/module/helpers/find-block.js +41 -0
- package/lib/edge/module/helpers/find-block.js.map +1 -0
- package/lib/edge/module/helpers/subscribe-to-editor.js +4 -2
- package/lib/edge/module/helpers/subscribe-to-editor.js.map +1 -1
- package/lib/edge/typescript/blocks/text/component-info.d.ts.map +1 -1
- package/lib/edge/typescript/components/block/block.d.ts.map +1 -1
- package/lib/edge/typescript/components/block/components/interactive-element.d.ts.map +1 -1
- package/lib/edge/typescript/components/block/components/live-edit-block-styles.d.ts +9 -0
- package/lib/edge/typescript/components/block/components/live-edit-block-styles.d.ts.map +1 -0
- package/lib/edge/typescript/components/block/components/style-wrapper.d.ts +10 -0
- package/lib/edge/typescript/components/block/components/style-wrapper.d.ts.map +1 -0
- package/lib/edge/typescript/components/content/components/enable-editor.d.ts.map +1 -1
- package/lib/edge/typescript/components/live-edit.d.ts +10 -0
- package/lib/edge/typescript/components/live-edit.d.ts.map +1 -0
- package/lib/edge/typescript/constants/sdk-version.d.ts +1 -1
- package/lib/edge/typescript/context/index.d.ts +2 -0
- package/lib/edge/typescript/context/index.d.ts.map +1 -0
- package/lib/edge/typescript/functions/get-builder-search-params/index.d.ts +8 -2
- package/lib/edge/typescript/functions/get-builder-search-params/index.d.ts.map +1 -1
- package/lib/edge/typescript/functions/get-content/generate-content-url.d.ts.map +1 -1
- package/lib/edge/typescript/functions/get-content/index.d.ts.map +1 -1
- package/lib/edge/typescript/functions/is-previewing.d.ts +11 -1
- package/lib/edge/typescript/functions/is-previewing.d.ts.map +1 -1
- package/lib/edge/typescript/helpers/find-block.d.ts +19 -0
- package/lib/edge/typescript/helpers/find-block.d.ts.map +1 -0
- package/lib/edge/typescript/helpers/subscribe-to-editor.d.ts +3 -2
- package/lib/edge/typescript/helpers/subscribe-to-editor.d.ts.map +1 -1
- package/lib/node/commonjs/blocks/img/component-info.js +33 -3
- package/lib/node/commonjs/blocks/img/component-info.js.map +1 -1
- package/lib/node/commonjs/blocks/img/img.js +21 -7
- package/lib/node/commonjs/blocks/img/img.js.map +1 -1
- package/lib/node/commonjs/blocks/text/component-info.js +0 -1
- package/lib/node/commonjs/blocks/text/component-info.js.map +1 -1
- package/lib/node/commonjs/components/block/block.js +4 -3
- package/lib/node/commonjs/components/block/block.js.map +1 -1
- package/lib/node/commonjs/components/block/components/interactive-element.js +8 -1
- package/lib/node/commonjs/components/block/components/interactive-element.js.map +1 -1
- package/lib/node/commonjs/components/block/components/live-edit-block-styles.js +107 -0
- package/lib/node/commonjs/components/block/components/live-edit-block-styles.js.map +1 -0
- package/lib/node/commonjs/components/block/components/style-wrapper.js +34 -0
- package/lib/node/commonjs/components/block/components/style-wrapper.js.map +1 -0
- package/lib/node/commonjs/components/content/components/enable-editor.js +15 -6
- package/lib/node/commonjs/components/content/components/enable-editor.js.map +1 -1
- package/lib/node/commonjs/components/live-edit.js +28 -0
- package/lib/node/commonjs/components/live-edit.js.map +1 -0
- package/lib/node/commonjs/constants/sdk-version.js +1 -1
- package/lib/node/commonjs/functions/get-builder-search-params/index.js +8 -2
- package/lib/node/commonjs/functions/get-builder-search-params/index.js.map +1 -1
- package/lib/node/commonjs/functions/get-content/generate-content-url.js +3 -8
- package/lib/node/commonjs/functions/get-content/generate-content-url.js.map +1 -1
- package/lib/node/commonjs/functions/get-content/index.js +9 -0
- package/lib/node/commonjs/functions/get-content/index.js.map +1 -1
- package/lib/node/commonjs/functions/is-previewing.js +15 -5
- package/lib/node/commonjs/functions/is-previewing.js.map +1 -1
- package/lib/node/commonjs/helpers/find-block.js +49 -0
- package/lib/node/commonjs/helpers/find-block.js.map +1 -0
- package/lib/node/commonjs/helpers/subscribe-to-editor.js +4 -2
- package/lib/node/commonjs/helpers/subscribe-to-editor.js.map +1 -1
- package/lib/node/module/blocks/img/component-info.js +33 -3
- package/lib/node/module/blocks/img/component-info.js.map +1 -1
- package/lib/node/module/blocks/img/img.js +21 -7
- package/lib/node/module/blocks/img/img.js.map +1 -1
- package/lib/node/module/blocks/text/component-info.js +0 -1
- package/lib/node/module/blocks/text/component-info.js.map +1 -1
- package/lib/node/module/components/block/block.js +4 -3
- package/lib/node/module/components/block/block.js.map +1 -1
- package/lib/node/module/components/block/components/interactive-element.js +8 -1
- package/lib/node/module/components/block/components/interactive-element.js.map +1 -1
- package/lib/node/module/components/block/components/live-edit-block-styles.js +98 -0
- package/lib/node/module/components/block/components/live-edit-block-styles.js.map +1 -0
- package/lib/node/module/components/block/components/style-wrapper.js +25 -0
- package/lib/node/module/components/block/components/style-wrapper.js.map +1 -0
- package/lib/node/module/components/content/components/enable-editor.js +15 -6
- package/lib/node/module/components/content/components/enable-editor.js.map +1 -1
- package/lib/node/module/components/live-edit.js +20 -0
- package/lib/node/module/components/live-edit.js.map +1 -0
- package/lib/node/module/constants/sdk-version.js +1 -1
- package/lib/node/module/functions/get-builder-search-params/index.js +8 -2
- package/lib/node/module/functions/get-builder-search-params/index.js.map +1 -1
- package/lib/node/module/functions/get-content/generate-content-url.js +3 -8
- package/lib/node/module/functions/get-content/generate-content-url.js.map +1 -1
- package/lib/node/module/functions/get-content/index.js +9 -0
- package/lib/node/module/functions/get-content/index.js.map +1 -1
- package/lib/node/module/functions/is-previewing.js +15 -4
- package/lib/node/module/functions/is-previewing.js.map +1 -1
- package/lib/node/module/helpers/find-block.js +41 -0
- package/lib/node/module/helpers/find-block.js.map +1 -0
- package/lib/node/module/helpers/subscribe-to-editor.js +4 -2
- package/lib/node/module/helpers/subscribe-to-editor.js.map +1 -1
- package/lib/node/typescript/blocks/text/component-info.d.ts.map +1 -1
- package/lib/node/typescript/components/block/block.d.ts.map +1 -1
- package/lib/node/typescript/components/block/components/interactive-element.d.ts.map +1 -1
- package/lib/node/typescript/components/block/components/live-edit-block-styles.d.ts +9 -0
- package/lib/node/typescript/components/block/components/live-edit-block-styles.d.ts.map +1 -0
- package/lib/node/typescript/components/block/components/style-wrapper.d.ts +10 -0
- package/lib/node/typescript/components/block/components/style-wrapper.d.ts.map +1 -0
- package/lib/node/typescript/components/content/components/enable-editor.d.ts.map +1 -1
- package/lib/node/typescript/components/live-edit.d.ts +10 -0
- package/lib/node/typescript/components/live-edit.d.ts.map +1 -0
- package/lib/node/typescript/constants/sdk-version.d.ts +1 -1
- package/lib/node/typescript/context/index.d.ts +2 -0
- package/lib/node/typescript/context/index.d.ts.map +1 -0
- package/lib/node/typescript/functions/get-builder-search-params/index.d.ts +8 -2
- package/lib/node/typescript/functions/get-builder-search-params/index.d.ts.map +1 -1
- package/lib/node/typescript/functions/get-content/generate-content-url.d.ts.map +1 -1
- package/lib/node/typescript/functions/get-content/index.d.ts.map +1 -1
- package/lib/node/typescript/functions/is-previewing.d.ts +11 -1
- package/lib/node/typescript/functions/is-previewing.d.ts.map +1 -1
- package/lib/node/typescript/helpers/find-block.d.ts +19 -0
- package/lib/node/typescript/helpers/find-block.d.ts.map +1 -0
- package/lib/node/typescript/helpers/subscribe-to-editor.d.ts +3 -2
- package/lib/node/typescript/helpers/subscribe-to-editor.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/blocks/img/component-info.ts +33 -3
- package/src/blocks/img/img.tsx +22 -7
- package/src/blocks/text/component-info.ts +0 -1
- package/src/components/block/block.tsx +6 -2
- package/src/components/block/components/interactive-element.tsx +11 -0
- package/src/components/block/components/live-edit-block-styles.tsx +154 -0
- package/src/components/block/components/style-wrapper.tsx +53 -0
- package/src/components/content/components/enable-editor.tsx +22 -7
- package/src/components/live-edit.tsx +32 -0
- package/src/constants/sdk-version.ts +1 -1
- package/src/functions/get-builder-search-params/index.ts +8 -2
- package/src/functions/get-content/generate-content-url.ts +3 -8
- package/src/functions/get-content/index.ts +8 -0
- package/src/functions/is-previewing.ts +15 -4
- package/src/helpers/find-block.ts +40 -0
- package/src/helpers/subscribe-to-editor.ts +7 -4
|
@@ -38,15 +38,10 @@ export const generateContentUrl = options => {
|
|
|
38
38
|
url.searchParams.set('limit', String(limit));
|
|
39
39
|
url.searchParams.set('noTraverse', String(noTraverse));
|
|
40
40
|
url.searchParams.set('includeRefs', String(true));
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (finalLocale) {
|
|
44
|
-
url.searchParams.set('locale', finalLocale);
|
|
45
|
-
finalUserAttributes = {
|
|
46
|
-
locale: finalLocale,
|
|
47
|
-
...finalUserAttributes
|
|
48
|
-
};
|
|
41
|
+
if (locale) {
|
|
42
|
+
url.searchParams.set('locale', locale);
|
|
49
43
|
}
|
|
44
|
+
let finalUserAttributes = userAttributes || {};
|
|
50
45
|
if (enrich) url.searchParams.set('enrich', String(enrich));
|
|
51
46
|
url.searchParams.set('omit', omit ?? 'meta.componentsUsed');
|
|
52
47
|
if (fields) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["flatten","flattenMongoQuery","unflatten","normalizeSearchParams","DEFAULT_API_VERSION","getBuilderSearchParamsFromWindow","isBrowser","isPositiveNumber","thing","isNaN","generateContentUrl","options","limit","userAttributes","query","model","apiKey","enrich","locale","apiVersion","fields","omit","offset","cacheSeconds","staleCacheSeconds","sort","includeUnpublished","apiHost","Error","includes","noTraverse","baseUrl","url","URL","searchParams","set","String","
|
|
1
|
+
{"version":3,"names":["flatten","flattenMongoQuery","unflatten","normalizeSearchParams","DEFAULT_API_VERSION","getBuilderSearchParamsFromWindow","isBrowser","isPositiveNumber","thing","isNaN","generateContentUrl","options","limit","userAttributes","query","model","apiKey","enrich","locale","apiVersion","fields","omit","offset","cacheSeconds","staleCacheSeconds","sort","includeUnpublished","apiHost","Error","includes","noTraverse","baseUrl","url","URL","searchParams","set","String","finalUserAttributes","Number","isFinite","Math","floor","flattened","key","JSON","stringify","queryOptions","getUserAttributesAsJSON","Object","keys","length","getUserAttributesFromQueryOptions","newUserAttributes","startsWith","window","location","pathname","host","queryOptionsForUserAttributes"],"sourceRoot":"../../../../../src","sources":["functions/get-content/generate-content-url.ts"],"mappings":"AAAA,SAASA,OAAO,EAAEC,iBAAiB,EAAEC,SAAS;AAC9C,SAASC,qBAAqB;AAC9B,SAASC,mBAAmB;AAC5B,SAASC,gCAAgC;AACzC,SAASC,SAAS;AAElB,MAAMC,gBAAgB,GAAIC,KAAc,IAAK,OAAOA,KAAK,KAAK,QAAQ,IAAI,CAACC,KAAK,CAACD,KAAK,CAAC,IAAIA,KAAK,IAAI,CAAC;AACrG,OAAO,MAAME,kBAAkB,GAAIC,OAA0B,IAAU;EACrE,MAAM;IACJC,KAAK,GAAG,EAAE;IACVC,cAAc;IACdC,KAAK;IACLC,KAAK;IACLC,MAAM;IACNC,MAAM;IACNC,MAAM;IACNC,UAAU,GAAGf,mBAAmB;IAChCgB,MAAM;IACNC,IAAI;IACJC,MAAM;IACNC,YAAY;IACZC,iBAAiB;IACjBC,IAAI;IACJC,kBAAkB;IAClBC;EACF,CAAC,GAAGhB,OAAO;EACX,IAAI,CAACK,MAAM,EAAE;IACX,MAAM,IAAIY,KAAK,CAAC,iBAAiB,CAAC;EACpC;EACA,IAAI,CAAC,CAAC,IAAI,CAA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IAC5C,OAAO7C,cAAc;EACvB;EACA,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -13,6 +13,15 @@ const checkContentHasResults = content => 'results' in content;
|
|
|
13
13
|
* Returns the first content entry that matches the given options.
|
|
14
14
|
*/
|
|
15
15
|
export async function fetchOneEntry(options) {
|
|
16
|
+
var _options$userAttribut;
|
|
17
|
+
const finalLocale = options.locale || ((_options$userAttribut = options.userAttributes) === null || _options$userAttribut === void 0 ? void 0 : _options$userAttribut.locale);
|
|
18
|
+
if (finalLocale) {
|
|
19
|
+
options.locale = finalLocale;
|
|
20
|
+
options.userAttributes = {
|
|
21
|
+
locale: finalLocale,
|
|
22
|
+
...options.userAttributes
|
|
23
|
+
};
|
|
24
|
+
}
|
|
16
25
|
const allContent = await fetchEntries({
|
|
17
26
|
...options,
|
|
18
27
|
limit: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TARGET","handleABTesting","getDefaultCanTrack","logger","getPreviewContent","getSdkHeaders","fetch","isBrowser","generateContentUrl","checkContentHasResults","content","fetchOneEntry","options","allContent","fetchEntries","limit","_fetchContent","_options$fetchOptions","url","_fetch","fetchOptions","headers","res","href","json","_processContentResult","canTrack","isPreviewing","search","includes","newResults","item","results","previewContent","searchParams","push","e","error"],"sourceRoot":"../../../../../src","sources":["functions/get-content/index.ts"],"mappings":"AAAA,SAASA,MAAM;AACf,SAASC,eAAe;AACxB,SAASC,kBAAkB;AAC3B,SAASC,MAAM;AACf,SAASC,iBAAiB;AAC1B,SAASC,aAAa;AAEtB,SAASC,KAAK;AACd,SAASC,SAAS;AAClB,SAASC,kBAAkB;AAE3B,MAAMC,sBAAsB,GAAIC,OAAwB,IAAgC,SAAS,IAAIA,OAAO;;AAE5G;AACA;AACA;AACA,OAAO,eAAeC,aAAaA,CAACC,OAA0B,EAAkC;EAC9F,MAAMC,UAAU,GAAG,MAAMC,YAAY,CAAC;IACpC,
|
|
1
|
+
{"version":3,"names":["TARGET","handleABTesting","getDefaultCanTrack","logger","getPreviewContent","getSdkHeaders","fetch","isBrowser","generateContentUrl","checkContentHasResults","content","fetchOneEntry","options","_options$userAttribut","finalLocale","locale","userAttributes","allContent","fetchEntries","limit","_fetchContent","_options$fetchOptions","url","_fetch","fetchOptions","headers","res","href","json","_processContentResult","canTrack","isPreviewing","search","includes","newResults","item","results","previewContent","searchParams","push","e","error"],"sourceRoot":"../../../../../src","sources":["functions/get-content/index.ts"],"mappings":"AAAA,SAASA,MAAM;AACf,SAASC,eAAe;AACxB,SAASC,kBAAkB;AAC3B,SAASC,MAAM;AACf,SAASC,iBAAiB;AAC1B,SAASC,aAAa;AAEtB,SAASC,KAAK;AACd,SAASC,SAAS;AAClB,SAASC,kBAAkB;AAE3B,MAAMC,sBAAsB,GAAIC,OAAwB,IAAgC,SAAS,IAAIA,OAAO;;AAE5G;AACA;AACA;AACA,OAAO,eAAeC,aAAaA,CAACC,OAA0B,EAAkC;EAAA,IAAAC,qBAAA;EAC9F,MAAMC,WAAW,GAAGF,OAAO,CAACG,MAAM,MAAAF,qBAAA,GAAID,OAAO,CAACI,cAAc,cAAAH,qBAAA,uBAAtBA,qBAAA,CAAwBE,MAAM;EACpE,IAAID,WAAW,EAAE;IACfF,OAAO,CAACG,MAAM,GAAGD,WAAW;IAC5BF,OAAO,CAACI,cAAc,GAAG;MACvBD,MAAM,EAAED,WAAW;MACnB,GAAGF,OAAO,CAACI;IACb,CAAC;EACH;EACA,MAAMC,UAAU,GAAG,MAAMC,YAAY,CAAC;IACpC,GAAGN,OAAO;IACVO,KAAK,EAAE;EACT,CAAC,CAAC;EACF,IAAIF,UAAU,EAAE;IACd,OAAOA,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI;EAC9B;EACA,OAAO,IAAI;AACb;AAQA,MAAMG,aAAa,GAAG,MAAOR,OAA0B,IAAK;EAAA,IAAAS,qBAAA;EAC1D,MAAMC,GAAG,GAAGd,kBAAkB,CAACI,OAAO,CAAC;EACvC,MAAMW,MAAM,G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AACA;AACA;EACE,IAAI;IACF,MAAMF,UAA4B,GAAG,EAAE;IACvC,KAAK,MAAMC,IAAI,IAAIzB,OAAO,CAAC0B,OAAO,EAAE;MAClCF,UAAU,CAACK,IAAI,CAAC,MAAMtC,eAAe,CAAC;QACpCkC,IAAI;QACJL;MACF,CAAC,CAAC,CAAC;IACL;IACApB,OAAO,CAAC0B,OAAO,GAAGF,UAAU;EAC9B,CAAC,CAAC,OAAOM,CAAC,EAAE;IACVrC,MAAM,CAACsC,KAAK,CAAC,+BAA+B,EAAED,CAAC,CAAC;EAClD;EACA,OAAO9B,OAAO,CAAC0B,OAAO;AACxB,CAAC;;AAED;AACA;AACA;AACA,OAAO,eAAelB,YAAYA,CAACN,OAA0B,EAAE;EAC7D,MAAMU,GAAG,GAAGd,kBAAkB,CAACI,OAAO,CAAC;EACvC,MAAMF,OAAO,GAAG,MAAMU,aAAa,CAACR,OAAO,CAAC;EAC5C,IAAI,CAACH,sBAAsB,CAACC,OAAO,CAAC,EAAE;IACpCP,MAAM,CAACsC,KAAK,CAAC,uBAAuB,EAAE;MACpCnB,GAAG;MACHZ,OAAO;MACPE;IACF,CAAC,CAAC;IACF,MAAMF,OAAO;EACf;EACA,OAAOmB,qBAAqB,CAACjB,OAAO,EAAEF,OAAO,CAAC;AAChD"}
|
|
@@ -1,16 +1,27 @@
|
|
|
1
1
|
import { getSearchString } from "../helpers/search/search";
|
|
2
2
|
import { isBrowser } from "./is-browser";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Checks the current URL's search parameters to see if it is attempting to
|
|
6
|
+
* preview Builder Content.
|
|
7
|
+
*
|
|
8
|
+
* When called on the client, it uses `window.location.search`.
|
|
9
|
+
* When called on the server (SSR), it requires a `search` argument.
|
|
10
|
+
*
|
|
11
|
+
* @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.
|
|
12
|
+
* @returns `true` if the current page is being previewed, `false` otherwise.
|
|
13
|
+
*/
|
|
14
|
+
export function isPreviewing(search) {
|
|
15
|
+
const searchToUse = search || (isBrowser() ? window.location.search : undefined);
|
|
5
16
|
|
|
6
17
|
/**
|
|
7
18
|
* If this function is called on the server without an explicit `search` argument,
|
|
8
19
|
* then it can't check if the user is previewing, and will return `false`.
|
|
9
20
|
*/
|
|
10
|
-
if (!
|
|
21
|
+
if (!searchToUse) {
|
|
11
22
|
return false;
|
|
12
23
|
}
|
|
13
|
-
const normalizedSearch = getSearchString(
|
|
24
|
+
const normalizedSearch = getSearchString(searchToUse);
|
|
14
25
|
return Boolean(normalizedSearch.indexOf('builder.preview=') !== -1);
|
|
15
26
|
}
|
|
16
27
|
//# sourceMappingURL=is-previewing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getSearchString","isBrowser","isPreviewing","
|
|
1
|
+
{"version":3,"names":["getSearchString","isBrowser","isPreviewing","search","searchToUse","window","location","undefined","normalizedSearch","Boolean","indexOf"],"sourceRoot":"../../../../src","sources":["functions/is-previewing.ts"],"mappings":"AACA,SAASA,eAAe;AACxB,SAASC,SAAS;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAACC,MAAe,EAAE;EAC5C,MAAMC,WAAW,GAAGD,MAAM,KAAKF,SAAS,CAAC,CAAC,GAAGI,MAAM,CAACC,QAAQ,CAACH,MAAM,GAAGI,SAAS,CAAC;;EAEhF;AACF;AACA;AACA;EACE,IAAI,CAACH,WAAW,EAAE;IAChB,OAAO,KAAK;EACd;EACA,MAAMI,gBAAgB,GAAGR,eAAe,CAACI,WAAW,CAAC;EACrD,OAAOK,OAAO,CAACD,gBAAgB,CAACE,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;AACrE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively searches for a block by ID.
|
|
3
|
+
*
|
|
4
|
+
* @param content The Builder content to search through.
|
|
5
|
+
* @param id The ID of the block to search for.
|
|
6
|
+
* @returns The block if found, otherwise null.
|
|
7
|
+
*/
|
|
8
|
+
export const findBlockById = (content, id) => {
|
|
9
|
+
var _content$data;
|
|
10
|
+
return findBlockInTree((_content$data = content.data) === null || _content$data === void 0 ? void 0 : _content$data.blocks, id);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Helper function to recursively search through block tree.
|
|
15
|
+
*
|
|
16
|
+
* @param blocks The blocks to search through.
|
|
17
|
+
* @param id The ID of the block to search for.
|
|
18
|
+
* @returns The block if found, otherwise null.
|
|
19
|
+
* @private This is an internal implementation detail.
|
|
20
|
+
*/
|
|
21
|
+
export const findBlockInTree = (blocks, id) => {
|
|
22
|
+
if (!blocks) return null;
|
|
23
|
+
for (const block of blocks) {
|
|
24
|
+
var _block$component, _block$component2;
|
|
25
|
+
if (block.id === id) return block;
|
|
26
|
+
if (block.children) {
|
|
27
|
+
const child = findBlockInTree(block.children, id);
|
|
28
|
+
if (child) return child;
|
|
29
|
+
}
|
|
30
|
+
if (((_block$component = block.component) === null || _block$component === void 0 ? void 0 : _block$component.name) === 'Columns' && (_block$component2 = block.component) !== null && _block$component2 !== void 0 && (_block$component2 = _block$component2.options) !== null && _block$component2 !== void 0 && _block$component2.columns) {
|
|
31
|
+
for (const column of block.component.options.columns) {
|
|
32
|
+
if (column.blocks) {
|
|
33
|
+
const child = findBlockInTree(column.blocks, id);
|
|
34
|
+
if (child) return child;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=find-block.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["findBlockById","content","id","_content$data","findBlockInTree","data","blocks","block","_block$component","_block$component2","children","child","component","name","options","columns","column"],"sourceRoot":"../../../../src","sources":["helpers/find-block.ts"],"mappings":"A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CAAC"}
|
|
@@ -31,8 +31,9 @@ export const createEditorListener = ({
|
|
|
31
31
|
const messageContent = data.data;
|
|
32
32
|
const modelName = messageContent.model;
|
|
33
33
|
const newState = messageContent === null || messageContent === void 0 ? void 0 : messageContent.state;
|
|
34
|
+
const editType = messageContent.editType;
|
|
34
35
|
if (modelName === model && newState) {
|
|
35
|
-
callbacks.stateUpdate(newState);
|
|
36
|
+
callbacks.stateUpdate(newState, editType);
|
|
36
37
|
}
|
|
37
38
|
break;
|
|
38
39
|
}
|
|
@@ -41,8 +42,9 @@ export const createEditorListener = ({
|
|
|
41
42
|
const messageContent = data.data;
|
|
42
43
|
const key = messageContent.key || messageContent.alias || messageContent.entry || messageContent.modelName;
|
|
43
44
|
const contentData = messageContent.data;
|
|
45
|
+
const editType = messageContent.editType;
|
|
44
46
|
if (key === model) {
|
|
45
|
-
callbacks.contentUpdate(contentData);
|
|
47
|
+
callbacks.contentUpdate(contentData, editType);
|
|
46
48
|
}
|
|
47
49
|
break;
|
|
48
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isBrowser","isFromTrustedHost","setupBrowserForEditing","logger","createEditorListener","model","trustedHosts","callbacks","event","data","type","configureSdk","animation","messageContent","modelName","newState","state","stateUpdate","key","alias","entry","contentData","contentUpdate","subscribeToEditor","apiKey","callback","warn","listener","window","addEventListener","removeEventListener"],"sourceRoot":"../../../../src","sources":["helpers/subscribe-to-editor.ts"],"mappings":"AACA,SAASA,SAAS;AAClB,SAASC,iBAAiB;AAC1B,SAASC,sBAAsB;AAI/B,SAASC,MAAM;
|
|
1
|
+
{"version":3,"names":["isBrowser","isFromTrustedHost","setupBrowserForEditing","logger","createEditorListener","model","trustedHosts","callbacks","event","data","type","configureSdk","animation","messageContent","modelName","newState","state","editType","stateUpdate","key","alias","entry","contentData","contentUpdate","subscribeToEditor","apiKey","callback","warn","listener","window","addEventListener","removeEventListener"],"sourceRoot":"../../../../src","sources":["helpers/subscribe-to-editor.ts"],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AAKd,KAAK,EAAE;cACjBE,SAAS,CAACgB,aAAa,CAACD,WAAW,EAAEL,QAAQ,CAAC;YAChD;YACA;UACF;MACJ;IACF;EACF,CAAC;AACH,CAAC;AAyBD;AACA;AACA;AACA;AACA,OAAO,MAAMO,iBAAoC,GAAGA,CAAC;EACnDnB,KAAK;EACLoB,MAAM;EACNC,QAAQ;EACRpB;AACF,CAAC,KAAK;EACJ,IAAI,CAACN,SAAS,EAAE;IACdG,MAAM,CAACwB,IAAI,CAAC,gGAAgG,CAAC;IAC7G,OAAO,MAAM,CAAC,CAAC;EACjB;EACAzB,sBAAsB,CAAC;IACrBY,SAAS,EAAET,KAAK;IAChBoB;EACF,CAAC,CAAC;EACF,MAAMG,QAAQ,GAAGxB,oBAAoB,CAAC;IACpCG,SAAS,EAAE;MACTgB,aAAa,EAAEG,QAAQ;MACvBd,SAAS,EAAEA,CAAA,KAAM,CAAC,CAAC;MACnBD,YAAY,EAAEA,CAAA,KAAM,CAAC,CAAC;MACtBO,WAAW,EAAEA,CAAA,KAAM,CAAC;IACtB,CAAC;IACDb,KAAK;IACLC;EACF,CAAC,CAAC;EACFuB,MAAM,CAACC,gBAAgB,CAAC,SAAS,EAAEF,QAAQ,CAAC;EAC5C,OAAO,MAAM;IACXC,MAAM,CAACE,mBAAmB,CAAC,SAAS,EAAEH,QAAQ,CAAC;EACjD,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-info.d.ts","sourceRoot":"","sources":["../../../../../src/blocks/text/component-info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"component-info.d.ts","sourceRoot":"","sources":["../../../../../src/blocks/text/component-info.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,eAAO,MAAM,aAAa,EAAE,aAqB3B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../../../src/components/block/block.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,uBAAuB,CAAC;IACjC,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,aAAa,EAAE,GAAG,CAAC;CACpB,CAAC;AAEF,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAqB9D,iBAAS,KAAK,CAAC,KAAK,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../../../src/components/block/block.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,uBAAuB,CAAC;IACjC,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,aAAa,EAAE,GAAG,CAAC;CACpB,CAAC;AAEF,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAI7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAqB9D,iBAAS,KAAK,CAAC,KAAK,EAAE,UAAU,qBA0M/B;;AAED,wBAA2B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-element.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/components/interactive-element.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,uBAAuB,CAAC;IACjC,YAAY,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;IAC9B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,CAAC;
|
|
1
|
+
{"version":3,"file":"interactive-element.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/components/interactive-element.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,uBAAuB,CAAC;IACjC,YAAY,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;IAC9B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,CAAC;AAEF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAItE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAI5D,iBAAS,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,qBAuDzD;AAED,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type LiveEditBlockStylesProps = {
|
|
3
|
+
id?: any;
|
|
4
|
+
contextProvider: BuilderContextInterface;
|
|
5
|
+
};
|
|
6
|
+
import type { BuilderContextInterface } from "../../../server-index";
|
|
7
|
+
declare function LiveEditBlockStyles(props: LiveEditBlockStylesProps): React.JSX.Element;
|
|
8
|
+
export default LiveEditBlockStyles;
|
|
9
|
+
//# sourceMappingURL=live-edit-block-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-edit-block-styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/components/live-edit-block-styles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,KAAK,wBAAwB,GAAG;IAC9B,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,eAAe,EAAE,uBAAuB,CAAC;CAC1C,CAAC;AAWF,OAAO,KAAK,EAEV,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAG/B,iBAAS,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,qBAgI3D;AAED,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type StyleWrapperProps = {
|
|
3
|
+
block: BuilderBlock;
|
|
4
|
+
context: BuilderContextInterface;
|
|
5
|
+
id?: string;
|
|
6
|
+
};
|
|
7
|
+
import { BuilderBlock, BuilderContextInterface } from "../../../server-index";
|
|
8
|
+
declare function StyleWrapper(props: StyleWrapperProps): React.JSX.Element;
|
|
9
|
+
export default StyleWrapper;
|
|
10
|
+
//# sourceMappingURL=style-wrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-wrapper.d.ts","sourceRoot":"","sources":["../../../../../../src/components/block/components/style-wrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,EAAE,uBAAuB,CAAC;IACjC,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAGF,OAAO,EAEL,YAAY,EACZ,uBAAuB,EACxB,MAAM,uBAAuB,CAAC;AAI/B,iBAAS,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBA+B7C;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enable-editor.d.ts","sourceRoot":"","sources":["../../../../../../src/components/content/components/enable-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,kBAAkB,GAAG,IAAI,CAC5B,YAAY,EACV,kBAAkB,GAClB,YAAY,GACZ,aAAa,GACb,eAAe,GACf,oBAAoB,GACpB,eAAe,CAClB,GAAG;IACF,oBAAoB,EAAE,uBAAuB,CAAC;IAC9C,uBAAuB,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;IAC/C,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,CAAC;AAuBF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"enable-editor.d.ts","sourceRoot":"","sources":["../../../../../../src/components/content/components/enable-editor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,kBAAkB,GAAG,IAAI,CAC5B,YAAY,EACV,kBAAkB,GAClB,YAAY,GACZ,aAAa,GACb,eAAe,GACf,oBAAoB,GACpB,eAAe,CAClB,GAAG;IACF,oBAAoB,EAAE,uBAAuB,CAAC;IAC9C,uBAAuB,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,CAAC;IAC/C,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,CAAC;AAuBF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAwBtE,OAAO,KAAK,EAEV,YAAY,EACb,MAAM,kBAAkB,CAAC;AAK1B,iBAAS,YAAY,CAAC,KAAK,EAAE,kBAAkB,qBAwe9C;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type LiveEditProps = {
|
|
3
|
+
children?: any;
|
|
4
|
+
id?: any;
|
|
5
|
+
Wrapper?: any;
|
|
6
|
+
attributes?: any;
|
|
7
|
+
};
|
|
8
|
+
declare function LiveEdit(props: LiveEditProps): React.JSX.Element;
|
|
9
|
+
export default LiveEdit;
|
|
10
|
+
//# sourceMappingURL=live-edit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"live-edit.d.ts","sourceRoot":"","sources":["../../../../src/components/live-edit.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,aAAa,GAAG;IACnB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,EAAE,CAAC,EAAE,GAAG,CAAC;IACT,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,UAAU,CAAC,EAAE,GAAG,CAAC;CAClB,CAAC;AAIF,iBAAS,QAAQ,CAAC,KAAK,EAAE,aAAa,qBAgBrC;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "4.2.
|
|
1
|
+
export declare const SDK_VERSION = "4.2.4";
|
|
2
2
|
//# sourceMappingURL=sdk-version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -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
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/functions/get-builder-search-params/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAM/D
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/functions/get-builder-search-params/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAM/D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,aAAc,WAAW,GAAG,eAAe,GAAG,SAAS,gBAazF,CAAC;AACF,eAAO,MAAM,gCAAgC,mBAM5C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-content-url.d.ts","sourceRoot":"","sources":["../../../../../src/functions/get-content/generate-content-url.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,eAAO,MAAM,kBAAkB,YAAa,iBAAiB,KAAG,
|
|
1
|
+
{"version":3,"file":"generate-content-url.d.ts","sourceRoot":"","sources":["../../../../../src/functions/get-content/generate-content-url.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,eAAO,MAAM,kBAAkB,YAAa,iBAAiB,KAAG,GA0F/D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/functions/get-content/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAIlE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGjD;;GAEG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/functions/get-content/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAIlE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAGjD;;GAEG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAiB9F;AACD,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE,cAAc,EAAE,CAAC;CAC3B,CAAC;AAoBF;;GAEG;AACH,eAAO,MAAM,qBAAqB,YAAmB,iBAAiB,WAAW,cAAc,QAAO,GAAG,KAAiC,QAAQ,cAAc,EAAE,CAiCjK,CAAC;AAEF;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,iBAAiB,6BAY5D"}
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
import type { Search } from '../helpers/search/search';
|
|
2
|
-
|
|
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;
|
|
3
13
|
//# sourceMappingURL=is-previewing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-previewing.d.ts","sourceRoot":"","sources":["../../../../src/functions/is-previewing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"is-previewing.d.ts","sourceRoot":"","sources":["../../../../src/functions/is-previewing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAIvD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,WAY3C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { BuilderBlock, BuilderContent } from '../server-index';
|
|
2
|
+
/**
|
|
3
|
+
* Recursively searches for a block by ID.
|
|
4
|
+
*
|
|
5
|
+
* @param content The Builder content to search through.
|
|
6
|
+
* @param id The ID of the block to search for.
|
|
7
|
+
* @returns The block if found, otherwise null.
|
|
8
|
+
*/
|
|
9
|
+
export declare const findBlockById: (content: BuilderContent, id: string) => BuilderBlock | null;
|
|
10
|
+
/**
|
|
11
|
+
* Helper function to recursively search through block tree.
|
|
12
|
+
*
|
|
13
|
+
* @param blocks The blocks to search through.
|
|
14
|
+
* @param id The ID of the block to search for.
|
|
15
|
+
* @returns The block if found, otherwise null.
|
|
16
|
+
* @private This is an internal implementation detail.
|
|
17
|
+
*/
|
|
18
|
+
export declare const findBlockInTree: (blocks: BuilderBlock[] | undefined, id: string) => BuilderBlock | null;
|
|
19
|
+
//# sourceMappingURL=find-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-block.d.ts","sourceRoot":"","sources":["../../../../src/helpers/find-block.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEpE;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,YAAa,cAAc,MAAM,MAAM,KAAG,YAAY,GAAG,IAElF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,WAAY,YAAY,EAAE,GAAG,SAAS,MAAM,MAAM,KAAG,YAAY,GAAG,IAkB/F,CAAA"}
|
|
@@ -2,10 +2,11 @@ import type { ContentProps } from '../components/content/content.types';
|
|
|
2
2
|
import type { BuilderAnimation } from '../types/builder-block';
|
|
3
3
|
import type { BuilderContent } from '../types/builder-content';
|
|
4
4
|
import type { Dictionary } from '../types/typescript';
|
|
5
|
+
export type EditType = 'client' | 'server' | undefined;
|
|
5
6
|
type ContentListener = Required<Pick<ContentProps, 'model' | 'trustedHosts'>> & {
|
|
6
7
|
callbacks: {
|
|
7
|
-
contentUpdate: (updatedContent: BuilderContent) => void;
|
|
8
|
-
stateUpdate: (newState: Dictionary<string
|
|
8
|
+
contentUpdate: (updatedContent: BuilderContent, editType?: EditType) => void;
|
|
9
|
+
stateUpdate: (newState: Dictionary<string>, editType?: EditType) => void;
|
|
9
10
|
animation: (updatedContent: BuilderAnimation) => void;
|
|
10
11
|
configureSdk: (updatedContent: any) => void;
|
|
11
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscribe-to-editor.d.ts","sourceRoot":"","sources":["../../../../src/helpers/subscribe-to-editor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAIxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,KAAK,eAAe,GAAG,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,cAAc,CAAC,CAAC,GAAG;IAC9E,SAAS,EAAE;QACT,aAAa,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"subscribe-to-editor.d.ts","sourceRoot":"","sources":["../../../../src/helpers/subscribe-to-editor.ts"],"names":[],"mappings":"AAAA,OAAO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4B/B,CAAA"}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.componentInfo = void 0;
|
|
7
7
|
var _fileTypes = require("../../constants/file-types");
|
|
8
8
|
const componentInfo = exports.componentInfo = {
|
|
9
|
-
// friendlyName?
|
|
10
9
|
name: 'Raw:Img',
|
|
11
10
|
hideFromInsertMenu: true,
|
|
12
11
|
image: 'https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4',
|
|
@@ -16,8 +15,39 @@ const componentInfo = exports.componentInfo = {
|
|
|
16
15
|
type: 'file',
|
|
17
16
|
allowedFileTypes: _fileTypes.IMAGE_FILE_TYPES,
|
|
18
17
|
required: true
|
|
18
|
+
}, {
|
|
19
|
+
name: 'backgroundSize',
|
|
20
|
+
type: 'text',
|
|
21
|
+
defaultValue: 'cover',
|
|
22
|
+
enum: [{
|
|
23
|
+
label: 'contain',
|
|
24
|
+
value: 'contain',
|
|
25
|
+
helperText: 'The image should never get cropped'
|
|
26
|
+
}, {
|
|
27
|
+
label: 'cover',
|
|
28
|
+
value: 'cover',
|
|
29
|
+
helperText: "The image should fill it's box, cropping when needed"
|
|
30
|
+
}]
|
|
31
|
+
}, {
|
|
32
|
+
name: 'backgroundPosition',
|
|
33
|
+
type: 'text',
|
|
34
|
+
defaultValue: 'center',
|
|
35
|
+
enum: ['center', 'top', 'left', 'right', 'bottom', 'top left', 'top right', 'bottom left', 'bottom right']
|
|
36
|
+
}, {
|
|
37
|
+
name: 'altText',
|
|
38
|
+
type: 'string',
|
|
39
|
+
helperText: 'Text to display when the user has images off'
|
|
40
|
+
}, {
|
|
41
|
+
name: 'title',
|
|
42
|
+
type: 'string',
|
|
43
|
+
helperText: 'Text to display when hovering over the asset'
|
|
44
|
+
}, {
|
|
45
|
+
name: 'aspectRatio',
|
|
46
|
+
type: 'number',
|
|
47
|
+
helperText: "This is the ratio of height/width, e.g. set to 1.5 for a 300px wide and 200px tall photo. Set to 0 to not force the image to maintain it's aspect ratio",
|
|
48
|
+
advanced: true,
|
|
49
|
+
defaultValue: 0.7041
|
|
19
50
|
}],
|
|
20
|
-
noWrap: true
|
|
21
|
-
static: true
|
|
51
|
+
noWrap: true
|
|
22
52
|
};
|
|
23
53
|
//# sourceMappingURL=component-info.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_fileTypes","require","componentInfo","exports","name","hideFromInsertMenu","image","inputs","bubble","type","allowedFileTypes","IMAGE_FILE_TYPES","required","
|
|
1
|
+
{"version":3,"names":["_fileTypes","require","componentInfo","exports","name","hideFromInsertMenu","image","inputs","bubble","type","allowedFileTypes","IMAGE_FILE_TYPES","required","defaultValue","enum","label","value","helperText","advanced","noWrap"],"sourceRoot":"../../../../../src","sources":["blocks/img/component-info.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEO,MAAMC,aAA4B,GAAAC,OAAA,CAAAD,aAAA,GAAG;EAC1CE,IAAI,EAAE,SAAS;EACfC,kBAAkB,EAAE,IAAI;EACxBC,KAAK,EAAE,sKAAsK;EAC7KC,MAAM,EAAE,CAAC;IACPH,IAAI,EAAE,OAAO;IACbI,MAAM,EAAE,IAAI;IACZC,IAAI,EAAE,MAAM;IACZC,gBAAgB,EAAEC,2BAAgB;IAClCC,QAAQ,EAAE;EACZ,CAAC,EAAE;IACDR,IAAI,EAAE,gBAAgB;IACtBK,IAAI,EAAE,MAAM;IACZI,YAAY,EAAE,OAAO;IACrBC,IAAI,EAAE,CAAC;MACLC,KAAK,EAAE,SAAS;MAChBC,KAAK,EAAE,SAAS;MAChBC,UAAU,EAAE;IACd,CAAC,EAAE;MACDF,KAAK,EAAE,OAAO;MACdC,KAAK,EAAE,OAAO;MACdC,UAAU,EAAE;IACd,CAAC;EACH,CAAC,EAAE;IACDb,IAAI,EAAE,oBAAoB;IAC1BK,IAAI,EAAE,MAAM;IACZI,YAAY,EAAE,QAAQ;IACtBC,IAAI,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc;EAC3G,CAAC,EAAE;IACDV,IAAI,EAAE,SAAS;IACfK,IAAI,EAAE,QAAQ;IACdQ,UAAU,EAAE;EACd,CAAC,EAAE;IACDb,IAAI,EAAE,OAAO;IACbK,IAAI,EAAE,QAAQ;IACdQ,UAAU,EAAE;EACd,CAAC,EAAE;IACDb,IAAI,EAAE,aAAa;IACnBK,IAAI,EAAE,QAAQ;IACdQ,UAAU,EAAE,yJAAyJ;IACrKC,QAAQ,EAAE,IAAI;IACdL,YAAY,EAAE;EAChB,CAAC,CAAC;EACFM,MAAM,EAAE;AACV,CAAC"}
|
|
@@ -8,12 +8,14 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _isEditing = require("../../functions/is-editing");
|
|
10
10
|
var _image = require("../image/image.helpers");
|
|
11
|
+
var _getClassPropName = require("../../functions/get-class-prop-name");
|
|
11
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /**
|
|
14
15
|
* This import is used by the Svelte SDK. Do not remove.
|
|
15
16
|
*/
|
|
16
17
|
function ImgComponent(props) {
|
|
18
|
+
var _props$attributes;
|
|
17
19
|
function srcSetToUse() {
|
|
18
20
|
const url = props.imgSrc || props.image;
|
|
19
21
|
if (!url || typeof url !== "string") {
|
|
@@ -26,19 +28,31 @@ function ImgComponent(props) {
|
|
|
26
28
|
}
|
|
27
29
|
return (0, _image.getSrcSet)(url);
|
|
28
30
|
}
|
|
31
|
+
function imgAttrs() {
|
|
32
|
+
const attrs = {
|
|
33
|
+
...props.attributes,
|
|
34
|
+
...{},
|
|
35
|
+
[(0, _getClassPropName.getClassPropName)()]: `builder-raw-img ${props.attributes[(0, _getClassPropName.getClassPropName)()] || ""}`
|
|
36
|
+
};
|
|
37
|
+
delete attrs.style;
|
|
38
|
+
return attrs;
|
|
39
|
+
}
|
|
29
40
|
return /*#__PURE__*/React.createElement(_reactNative.Image, _extends({
|
|
30
41
|
loading: "lazy",
|
|
31
|
-
style: {
|
|
32
|
-
objectFit: props.backgroundSize || "cover",
|
|
33
|
-
objectPosition: props.backgroundPosition || "center"
|
|
34
|
-
},
|
|
35
42
|
key: (0, _isEditing.isEditing)() && props.imgSrc || "default-key",
|
|
36
43
|
alt: props.altText,
|
|
44
|
+
title: props.title,
|
|
37
45
|
source: {
|
|
38
46
|
uri: props.imgSrc || props.image
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
}
|
|
48
|
+
}, imgAttrs(), {
|
|
49
|
+
style: {
|
|
50
|
+
objectFit: props.backgroundSize || "cover",
|
|
51
|
+
objectPosition: props.backgroundPosition || "center",
|
|
52
|
+
aspectRatio: props.aspectRatio || undefined,
|
|
53
|
+
...(((_props$attributes = props.attributes) === null || _props$attributes === void 0 ? void 0 : _props$attributes.style) || {})
|
|
54
|
+
}
|
|
55
|
+
}));
|
|
42
56
|
}
|
|
43
57
|
var _default = exports.default = ImgComponent;
|
|
44
58
|
//# sourceMappingURL=img.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_isEditing","_image","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","ImgComponent","props","srcSetToUse","url","imgSrc","image","undefined","match","getSrcSet","
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_isEditing","_image","_getClassPropName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_extends","assign","bind","target","arguments","length","source","key","apply","ImgComponent","props","_props$attributes","srcSetToUse","url","imgSrc","image","undefined","match","getSrcSet","imgAttrs","attrs","attributes","getClassPropName","style","createElement","Image","loading","isEditing","alt","altText","title","uri","objectFit","backgroundSize","objectPosition","backgroundPosition","aspectRatio","_default","exports"],"sourceRoot":"../../../../../src","sources":["blocks/img/img.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AA0BA,IAAAE,UAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAAuE,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CA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IAAI,OAAO;MAC1CC,cAAc,EAAExB,KAAK,CAACyB,kBAAkB,IAAI,QAAQ;MACpDC,WAAW,EAAE1B,KAAK,CAAC0B,WAAW,IAAIpB,SAAS;MAC3C,IAAI,EAAAL,iBAAA,GAAAD,KAAK,CAACW,UAAU,cAAAV,iBAAA,uBAAhBA,iBAAA,CAAkBY,KAAK,KAAI,CAAC,CAAC;IACnC;EAAE,EACH,CAAC;AAEN;AAAC,IAAAc,QAAA,GAAAC,OAAA,CAAArD,OAAA,GAEcwB,YAAY"}
|
|
@@ -12,7 +12,6 @@ const componentInfo = exports.componentInfo = {
|
|
|
12
12
|
} : {},
|
|
13
13
|
name: 'Text',
|
|
14
14
|
static: true,
|
|
15
|
-
isRSC: true,
|
|
16
15
|
image: 'https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-text_fields-24px%20(1).svg?alt=media&token=12177b73-0ee3-42ca-98c6-0dd003de1929',
|
|
17
16
|
inputs: [{
|
|
18
17
|
name: 'text',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_target","require","componentInfo","exports","shouldReceiveBuilderProps","TARGET","builderBlock","builderContext","name","static","
|
|
1
|
+
{"version":3,"names":["_target","require","componentInfo","exports","shouldReceiveBuilderProps","TARGET","builderBlock","builderContext","name","static","image","inputs","type","required","autoFocus","bubble","defaultValue","defaultStyles","lineHeight","height","textAlign"],"sourceRoot":"../../../../../src","sources":["blocks/text/component-info.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEO,MAAMC,aAA4B,GAAAC,OAAA,CAAAD,aAAA,GAAG;EAC1CE,yBAAyB,EAAEC,cAAM,KAAK,aAAa,GAAG;IACpDC,YAAY,EAAE,IAAI;IAClBC,cAAc,EAAE;EAClB,CAAC,GAAG,CAAC,CAAC;EACNC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE,IAAI;EACZC,KAAK,EAAE,2KAA2K;EAClLC,MAAM,EAAE,CAAC;IACPH,IAAI,EAAE,MAAM;IACZI,IAAI,EAAE,MAAM;IACZC,QAAQ,EAAE,IAAI;IACdC,SAAS,EAAE,IAAI;IACfC,MAAM,EAAE,IAAI;IACZC,YAAY,EAAE;EAChB,CAAC,CAAC;EACFC,aAAa,EAAE;IACbC,UAAU,EAAE,QAAQ;IACpBC,MAAM,EAAE,MAAM;IACdC,SAAS,EAAE;EACb;AACF,CAAC"}
|
|
@@ -13,10 +13,10 @@ var _getBlockComponentOptions = require("../../functions/get-block-component-opt
|
|
|
13
13
|
var _getProcessedBlock = require("../../functions/get-processed-block");
|
|
14
14
|
var _serverIndex = require("../../server-index");
|
|
15
15
|
var _block = require("./block.helpers");
|
|
16
|
-
var _blockStyles = _interopRequireDefault(require("./components/block-styles"));
|
|
17
16
|
var _blockWrapper = _interopRequireDefault(require("./components/block-wrapper"));
|
|
18
17
|
var _componentRef = _interopRequireDefault(require("./components/component-ref/component-ref"));
|
|
19
18
|
var _repeatedBlock = _interopRequireDefault(require("./components/repeated-block"));
|
|
19
|
+
var _styleWrapper = _interopRequireDefault(require("./components/style-wrapper"));
|
|
20
20
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
21
21
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -115,9 +115,10 @@ function Block(props) {
|
|
|
115
115
|
(0, _react.useEffect)(() => {
|
|
116
116
|
_processedBlock.update = true;
|
|
117
117
|
});
|
|
118
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, canShowBlock() ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
118
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, canShowBlock() ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_styleWrapper.default, {
|
|
119
119
|
block: processedBlock(),
|
|
120
|
-
context: props.context
|
|
120
|
+
context: props.context,
|
|
121
|
+
id: props.block.id
|
|
121
122
|
}), !(blockComponent !== null && blockComponent !== void 0 && (_blockComponent5 = blockComponent()) !== null && _blockComponent5 !== void 0 && _blockComponent5.noWrap) ? /*#__PURE__*/React.createElement(React.Fragment, null, !repeatItem() ? /*#__PURE__*/React.createElement(_blockWrapper.default, {
|
|
122
123
|
Wrapper: Tag(),
|
|
123
124
|
block: processedBlock(),
|