@builder.io/sdk-react-nextjs 0.17.1 → 0.17.2
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/blocks/text/text.cjs +1 -1
- package/lib/browser/blocks/text/text.mjs +6 -24
- package/lib/browser/components/block/block.cjs +1 -1
- package/lib/browser/components/block/block.mjs +27 -28
- package/lib/browser/components/content/components/enable-editor.cjs +1 -1
- package/lib/browser/components/content/components/enable-editor.mjs +102 -96
- package/lib/browser/constants/sdk-version.cjs +1 -1
- package/lib/browser/constants/sdk-version.mjs +1 -1
- package/lib/browser/functions/get-block-component-options.cjs +1 -1
- package/lib/browser/functions/get-block-component-options.mjs +21 -5
- package/lib/browser/functions/get-content/generate-content-url.cjs +1 -1
- package/lib/browser/functions/get-content/generate-content-url.mjs +60 -40
- package/lib/browser/functions/get-processed-block.cjs +1 -1
- package/lib/browser/functions/get-processed-block.mjs +18 -19
- package/lib/browser/helpers/flatten.cjs +1 -1
- package/lib/browser/helpers/flatten.mjs +28 -15
- package/lib/edge/blocks/text/text.cjs +1 -1
- package/lib/edge/blocks/text/text.mjs +6 -24
- package/lib/edge/components/block/block.cjs +1 -1
- package/lib/edge/components/block/block.mjs +27 -28
- package/lib/edge/components/content/components/enable-editor.cjs +1 -1
- package/lib/edge/components/content/components/enable-editor.mjs +102 -96
- package/lib/edge/constants/sdk-version.cjs +1 -1
- package/lib/edge/constants/sdk-version.mjs +1 -1
- package/lib/edge/functions/evaluate/edge-runtime/edge-runtime.cjs +5 -5
- package/lib/edge/functions/evaluate/edge-runtime/edge-runtime.mjs +25 -28
- package/lib/edge/functions/get-block-component-options.cjs +1 -1
- package/lib/edge/functions/get-block-component-options.mjs +21 -5
- package/lib/edge/functions/get-content/generate-content-url.cjs +1 -1
- package/lib/edge/functions/get-content/generate-content-url.mjs +60 -40
- package/lib/edge/functions/get-processed-block.cjs +1 -1
- package/lib/edge/functions/get-processed-block.mjs +18 -19
- package/lib/edge/helpers/flatten.cjs +1 -1
- package/lib/edge/helpers/flatten.mjs +28 -15
- package/lib/node/blocks/text/text.cjs +1 -1
- package/lib/node/blocks/text/text.mjs +6 -24
- package/lib/node/components/block/block.cjs +1 -1
- package/lib/node/components/block/block.mjs +27 -28
- package/lib/node/components/content/components/enable-editor.cjs +1 -1
- package/lib/node/components/content/components/enable-editor.mjs +102 -96
- package/lib/node/constants/sdk-version.cjs +1 -1
- package/lib/node/constants/sdk-version.mjs +1 -1
- package/lib/node/functions/get-block-component-options.cjs +1 -1
- package/lib/node/functions/get-block-component-options.mjs +21 -5
- package/lib/node/functions/get-content/generate-content-url.cjs +1 -1
- package/lib/node/functions/get-content/generate-content-url.mjs +60 -40
- package/lib/node/functions/get-processed-block.cjs +1 -1
- package/lib/node/functions/get-processed-block.mjs +18 -19
- package/lib/node/helpers/flatten.cjs +1 -1
- package/lib/node/helpers/flatten.mjs +28 -15
- package/package.json +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/get-block-component-options.d.ts +2 -1
- package/types/cjs/functions/get-processed-block.d.ts +1 -6
- package/types/cjs/helpers/flatten.d.ts +6 -0
- package/types/cjs/server-index.d.ts +1 -1
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/get-block-component-options.d.ts +2 -1
- package/types/esm/functions/get-processed-block.d.ts +1 -6
- package/types/esm/helpers/flatten.d.ts +6 -0
- package/types/esm/server-index.d.ts +1 -1
|
@@ -1,23 +1,36 @@
|
|
|
1
|
-
function
|
|
2
|
-
return Object.keys(
|
|
3
|
-
const
|
|
4
|
-
return [typeof
|
|
5
|
-
...
|
|
6
|
-
...
|
|
1
|
+
function c(l, s = null, o = ".") {
|
|
2
|
+
return Object.keys(l).reduce((n, t) => {
|
|
3
|
+
const e = l[t], r = [s, t].filter(Boolean).join(o);
|
|
4
|
+
return [typeof e == "object", e !== null, !(Array.isArray(e) && e.length === 0)].every(Boolean) ? {
|
|
5
|
+
...n,
|
|
6
|
+
...c(e, r, o)
|
|
7
7
|
} : {
|
|
8
|
-
...
|
|
9
|
-
[
|
|
8
|
+
...n,
|
|
9
|
+
[r]: e
|
|
10
10
|
};
|
|
11
11
|
}, {});
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
for (const
|
|
15
|
-
const
|
|
16
|
-
|
|
13
|
+
function i(l, s, o = {}) {
|
|
14
|
+
for (const n in l) {
|
|
15
|
+
const t = l[n], e = s ? s + "." + n : n;
|
|
16
|
+
t && typeof t == "object" && !Array.isArray(t) && !Object.keys(t).find((r) => r.startsWith("$")) ? i(t, e, o) : o[e] = t;
|
|
17
17
|
}
|
|
18
|
-
return
|
|
18
|
+
return o;
|
|
19
|
+
}
|
|
20
|
+
function u(l) {
|
|
21
|
+
const s = {};
|
|
22
|
+
for (const o in l) {
|
|
23
|
+
const n = o.split(".");
|
|
24
|
+
let t = s;
|
|
25
|
+
for (let e = 0; e < n.length; e++) {
|
|
26
|
+
const r = n[e];
|
|
27
|
+
e === n.length - 1 ? t[r] = l[o] : (t[r] = t[r] || {}, t = t[r]);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return s;
|
|
19
31
|
}
|
|
20
32
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
33
|
+
c as flatten,
|
|
34
|
+
i as flattenMongoQuery,
|
|
35
|
+
u as unflatten
|
|
23
36
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-react-nextjs",
|
|
3
3
|
"description": "Builder.io RSC SDK for NextJS App Directory",
|
|
4
|
-
"version": "0.17.
|
|
4
|
+
"version": "0.17.2",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/nextjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.17.
|
|
1
|
+
export declare const SDK_VERSION = "0.17.2";
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import type { BuilderContextInterface } from '../context/types.js';
|
|
1
2
|
import type { BuilderBlock } from '../types/builder-block.js';
|
|
2
|
-
export declare function getBlockComponentOptions(block: BuilderBlock): any;
|
|
3
|
+
export declare function getBlockComponentOptions(block: BuilderBlock, context: Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): any;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { BuilderContextInterface } from '../context/types.js';
|
|
2
2
|
import type { BuilderBlock } from '../types/builder-block.js';
|
|
3
3
|
export declare function deepCloneWithConditions<T = any>(obj: T): T;
|
|
4
|
-
export declare function getProcessedBlock({ block, context,
|
|
4
|
+
export declare function getProcessedBlock({ block, context, localState, rootState, rootSetState }: {
|
|
5
5
|
block: BuilderBlock;
|
|
6
|
-
/**
|
|
7
|
-
* In some cases, we want to avoid evaluating bindings and only want framework-specific block transformation. It is
|
|
8
|
-
* also sometimes too early to consider bindings, e.g. when we might be looking at a repeated block.
|
|
9
|
-
*/
|
|
10
|
-
shouldEvaluateBindings: boolean;
|
|
11
6
|
} & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): BuilderBlock;
|
|
@@ -14,3 +14,9 @@ export declare function flatten<T extends Record<string, any>>(object: T, path?:
|
|
|
14
14
|
export declare function flattenMongoQuery(obj: any, _current?: any, _res?: any): {
|
|
15
15
|
[key: string]: string;
|
|
16
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Unflatten a flat object with dot-separated keys back into a nested object.
|
|
19
|
+
*
|
|
20
|
+
* { 'foo.bar': 'baz' } -> { foo: { bar: 'baz' }}
|
|
21
|
+
*/
|
|
22
|
+
export declare function unflatten(obj: any): any;
|
|
@@ -15,7 +15,7 @@ export type { ContentVariantsPrps as ContentProps } from './components/content-v
|
|
|
15
15
|
/**
|
|
16
16
|
* General Builder types
|
|
17
17
|
*/
|
|
18
|
-
export type { RegisteredComponent } from './context/types.js';
|
|
18
|
+
export type { BuilderContextInterface, RegisteredComponent, RegisteredComponents } from './context/types.js';
|
|
19
19
|
export type { BuilderBlock } from './types/builder-block.js';
|
|
20
20
|
export type { BuilderContent } from './types/builder-content.js';
|
|
21
21
|
export type { ComponentInfo } from './types/components.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.17.
|
|
1
|
+
export declare const SDK_VERSION = "0.17.2";
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import type { BuilderContextInterface } from '../context/types.js';
|
|
1
2
|
import type { BuilderBlock } from '../types/builder-block.js';
|
|
2
|
-
export declare function getBlockComponentOptions(block: BuilderBlock): any;
|
|
3
|
+
export declare function getBlockComponentOptions(block: BuilderBlock, context: Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): any;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import type { BuilderContextInterface } from '../context/types.js';
|
|
2
2
|
import type { BuilderBlock } from '../types/builder-block.js';
|
|
3
3
|
export declare function deepCloneWithConditions<T = any>(obj: T): T;
|
|
4
|
-
export declare function getProcessedBlock({ block, context,
|
|
4
|
+
export declare function getProcessedBlock({ block, context, localState, rootState, rootSetState }: {
|
|
5
5
|
block: BuilderBlock;
|
|
6
|
-
/**
|
|
7
|
-
* In some cases, we want to avoid evaluating bindings and only want framework-specific block transformation. It is
|
|
8
|
-
* also sometimes too early to consider bindings, e.g. when we might be looking at a repeated block.
|
|
9
|
-
*/
|
|
10
|
-
shouldEvaluateBindings: boolean;
|
|
11
6
|
} & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): BuilderBlock;
|
|
@@ -14,3 +14,9 @@ export declare function flatten<T extends Record<string, any>>(object: T, path?:
|
|
|
14
14
|
export declare function flattenMongoQuery(obj: any, _current?: any, _res?: any): {
|
|
15
15
|
[key: string]: string;
|
|
16
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Unflatten a flat object with dot-separated keys back into a nested object.
|
|
19
|
+
*
|
|
20
|
+
* { 'foo.bar': 'baz' } -> { foo: { bar: 'baz' }}
|
|
21
|
+
*/
|
|
22
|
+
export declare function unflatten(obj: any): any;
|
|
@@ -15,7 +15,7 @@ export type { ContentVariantsPrps as ContentProps } from './components/content-v
|
|
|
15
15
|
/**
|
|
16
16
|
* General Builder types
|
|
17
17
|
*/
|
|
18
|
-
export type { RegisteredComponent } from './context/types.js';
|
|
18
|
+
export type { BuilderContextInterface, RegisteredComponent, RegisteredComponents } from './context/types.js';
|
|
19
19
|
export type { BuilderBlock } from './types/builder-block.js';
|
|
20
20
|
export type { BuilderContent } from './types/builder-content.js';
|
|
21
21
|
export type { ComponentInfo } from './types/components.js';
|