@uniformdev/next-app-router 20.74.6-alpha.6 → 20.74.6-alpha.7.sha-23d7a1d929
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/dist/{UniformComposition-BWxMuY7i.d.ts → UniformComposition-DBO-oo7J.d.ts} +7 -2
- package/dist/{UniformComposition-Bo6UsTDC.d.mts → UniformComposition-le6UEB_r.d.mts} +7 -2
- package/dist/cache.d.mts +2 -2
- package/dist/cache.d.ts +2 -2
- package/dist/cache.js +3 -1
- package/dist/cache.mjs +3 -1
- package/dist/{client-DRMp2gpi.d.mts → client-BElN_CWD.d.mts} +6 -0
- package/dist/{client-DRMp2gpi.d.ts → client-BElN_CWD.d.ts} +6 -0
- package/dist/compat.d.mts +3 -3
- package/dist/compat.d.ts +3 -3
- package/dist/component.d.mts +2 -2
- package/dist/component.d.ts +2 -2
- package/dist/component.js +31 -15
- package/dist/component.mjs +18 -2
- package/dist/handler.js +6 -3
- package/dist/handler.mjs +6 -3
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.esm.js +3243 -486
- package/dist/index.js +3251 -497
- package/dist/index.mjs +3243 -486
- package/dist/middleware.d.mts +1 -1
- package/dist/middleware.d.ts +1 -1
- package/dist/middleware.js +174 -214
- package/dist/middleware.mjs +171 -211
- package/dist/{resolveRouteFromCode-Bhz8EJBu.d.ts → resolveRouteFromCode-BOvjIvM2.d.ts} +1 -1
- package/dist/{resolveRouteFromCode-C0dkUV2T.d.mts → resolveRouteFromCode-CuJ4JHeb.d.mts} +1 -1
- package/package.json +10 -10
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RootComponentInstance, ComponentInstance } from '@uniformdev/canvas';
|
|
2
2
|
import { ComponentProps } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import React, { ComponentType } from 'react';
|
|
4
|
-
import { D as DataClient } from './client-
|
|
5
|
-
import { a as ResolvedRouteResult, R as ResolveRouteFunction } from './resolveRouteFromCode-
|
|
4
|
+
import { D as DataClient } from './client-BElN_CWD.js';
|
|
5
|
+
import { a as ResolvedRouteResult, R as ResolveRouteFunction } from './resolveRouteFromCode-BOvjIvM2.js';
|
|
6
6
|
import { ClientContextComponent } from '@uniformdev/next-app-router-client';
|
|
7
7
|
|
|
8
8
|
type CompositionCache = {
|
|
@@ -63,6 +63,11 @@ type UniformCompositionProps = {
|
|
|
63
63
|
resolveComponent: ResolveComponentFunction;
|
|
64
64
|
/**
|
|
65
65
|
* If provided, the composition will use the data client to retrieve data.
|
|
66
|
+
*
|
|
67
|
+
* Pass the same client here that you pass to `handleUniformRoute`. Without it, this component
|
|
68
|
+
* falls back to `DefaultDataClient` for the route it resolves and, on draft requests,
|
|
69
|
+
* for the manifest it evaluates personalization against - so a custom manifest source
|
|
70
|
+
* configured only on the middleware would not apply while the page renders.
|
|
66
71
|
*/
|
|
67
72
|
dataClient?: DataClient;
|
|
68
73
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RootComponentInstance, ComponentInstance } from '@uniformdev/canvas';
|
|
2
2
|
import { ComponentProps } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import React, { ComponentType } from 'react';
|
|
4
|
-
import { D as DataClient } from './client-
|
|
5
|
-
import { a as ResolvedRouteResult, R as ResolveRouteFunction } from './resolveRouteFromCode-
|
|
4
|
+
import { D as DataClient } from './client-BElN_CWD.mjs';
|
|
5
|
+
import { a as ResolvedRouteResult, R as ResolveRouteFunction } from './resolveRouteFromCode-CuJ4JHeb.mjs';
|
|
6
6
|
import { ClientContextComponent } from '@uniformdev/next-app-router-client';
|
|
7
7
|
|
|
8
8
|
type CompositionCache = {
|
|
@@ -63,6 +63,11 @@ type UniformCompositionProps = {
|
|
|
63
63
|
resolveComponent: ResolveComponentFunction;
|
|
64
64
|
/**
|
|
65
65
|
* If provided, the composition will use the data client to retrieve data.
|
|
66
|
+
*
|
|
67
|
+
* Pass the same client here that you pass to `handleUniformRoute`. Without it, this component
|
|
68
|
+
* falls back to `DefaultDataClient` for the route it resolves and, on draft requests,
|
|
69
|
+
* for the manifest it evaluates personalization against - so a custom manifest source
|
|
70
|
+
* configured only on the middleware would not apply while the page renders.
|
|
66
71
|
*/
|
|
67
72
|
dataClient?: DataClient;
|
|
68
73
|
/**
|
package/dist/cache.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { R as ResolveRouteFunction } from './resolveRouteFromCode-
|
|
1
|
+
import { R as ResolveRouteFunction } from './resolveRouteFromCode-CuJ4JHeb.mjs';
|
|
2
2
|
import '@uniformdev/canvas';
|
|
3
3
|
import '@uniformdev/next-app-router-shared';
|
|
4
|
-
import './client-
|
|
4
|
+
import './client-BElN_CWD.mjs';
|
|
5
5
|
import '@uniformdev/context';
|
|
6
6
|
|
|
7
7
|
declare const resolveRouteFromCode: ResolveRouteFunction;
|
package/dist/cache.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { R as ResolveRouteFunction } from './resolveRouteFromCode-
|
|
1
|
+
import { R as ResolveRouteFunction } from './resolveRouteFromCode-BOvjIvM2.js';
|
|
2
2
|
import '@uniformdev/canvas';
|
|
3
3
|
import '@uniformdev/next-app-router-shared';
|
|
4
|
-
import './client-
|
|
4
|
+
import './client-BElN_CWD.js';
|
|
5
5
|
import '@uniformdev/context';
|
|
6
6
|
|
|
7
7
|
declare const resolveRouteFromCode: ResolveRouteFunction;
|
package/dist/cache.js
CHANGED
|
@@ -2039,7 +2039,9 @@ var DefaultDataClient = class {
|
|
|
2039
2039
|
source: "middleware",
|
|
2040
2040
|
route: options.route,
|
|
2041
2041
|
routeClient,
|
|
2042
|
-
|
|
2042
|
+
// The runtime cache is keyed on the route path. Development bypasses it so an author sees
|
|
2043
|
+
// an edit right away, the same way the fetch cache is bypassed for development.
|
|
2044
|
+
enableRuntimeCache: options.route.state === CANVAS_PUBLISHED_STATE && getMiddlewareRuntimeCache() && !isDevelopmentEnvironment(),
|
|
2043
2045
|
disableSwrCache: getDisableSwrMiddlewareCache()
|
|
2044
2046
|
});
|
|
2045
2047
|
if (resolvedRoute.type === "composition") {
|
package/dist/cache.mjs
CHANGED
|
@@ -2026,7 +2026,9 @@ var DefaultDataClient = class {
|
|
|
2026
2026
|
source: "middleware",
|
|
2027
2027
|
route: options.route,
|
|
2028
2028
|
routeClient,
|
|
2029
|
-
|
|
2029
|
+
// The runtime cache is keyed on the route path. Development bypasses it so an author sees
|
|
2030
|
+
// an edit right away, the same way the fetch cache is bypassed for development.
|
|
2031
|
+
enableRuntimeCache: options.route.state === CANVAS_PUBLISHED_STATE && getMiddlewareRuntimeCache() && !isDevelopmentEnvironment(),
|
|
2030
2032
|
disableSwrCache: getDisableSwrMiddlewareCache()
|
|
2031
2033
|
});
|
|
2032
2034
|
if (resolvedRoute.type === "composition") {
|
|
@@ -134,6 +134,7 @@ declare class DefaultDataClient implements DataClient {
|
|
|
134
134
|
name: string;
|
|
135
135
|
value?: string;
|
|
136
136
|
helpText?: string;
|
|
137
|
+
editorVisibility?: "opt-in";
|
|
137
138
|
optionsSource?: {
|
|
138
139
|
source: "static";
|
|
139
140
|
options: {
|
|
@@ -226,6 +227,7 @@ declare class DefaultDataClient implements DataClient {
|
|
|
226
227
|
};
|
|
227
228
|
};
|
|
228
229
|
};
|
|
230
|
+
_patternOptedInQueryStrings?: string[];
|
|
229
231
|
_patternError?: "NOTFOUND" | "CYCLIC";
|
|
230
232
|
_overrides?: {
|
|
231
233
|
[key: string]: {
|
|
@@ -382,6 +384,7 @@ declare class DefaultDataClient implements DataClient {
|
|
|
382
384
|
};
|
|
383
385
|
};
|
|
384
386
|
};
|
|
387
|
+
_patternOptedInQueryStrings?: string[];
|
|
385
388
|
_dataResources?: {
|
|
386
389
|
[key: string]: {
|
|
387
390
|
type: string;
|
|
@@ -515,6 +518,7 @@ declare class DefaultDataClient implements DataClient {
|
|
|
515
518
|
};
|
|
516
519
|
};
|
|
517
520
|
};
|
|
521
|
+
_patternOptedInQueryStrings?: string[];
|
|
518
522
|
_patternError?: "NOTFOUND" | "CYCLIC";
|
|
519
523
|
_overrides?: {
|
|
520
524
|
[key: string]: /*elided*/ any;
|
|
@@ -667,6 +671,7 @@ declare class DefaultDataClient implements DataClient {
|
|
|
667
671
|
};
|
|
668
672
|
};
|
|
669
673
|
};
|
|
674
|
+
_patternOptedInQueryStrings?: string[];
|
|
670
675
|
_patternError?: "NOTFOUND" | "CYCLIC";
|
|
671
676
|
_overrides?: {
|
|
672
677
|
[key: string]: /*elided*/ any;
|
|
@@ -706,6 +711,7 @@ declare class DefaultDataClient implements DataClient {
|
|
|
706
711
|
hideLockedParameters?: boolean;
|
|
707
712
|
};
|
|
708
713
|
_locales?: string[];
|
|
714
|
+
_optedInQueryStrings?: string[];
|
|
709
715
|
};
|
|
710
716
|
workflowId?: string;
|
|
711
717
|
workflowStageId?: string;
|
|
@@ -134,6 +134,7 @@ declare class DefaultDataClient implements DataClient {
|
|
|
134
134
|
name: string;
|
|
135
135
|
value?: string;
|
|
136
136
|
helpText?: string;
|
|
137
|
+
editorVisibility?: "opt-in";
|
|
137
138
|
optionsSource?: {
|
|
138
139
|
source: "static";
|
|
139
140
|
options: {
|
|
@@ -226,6 +227,7 @@ declare class DefaultDataClient implements DataClient {
|
|
|
226
227
|
};
|
|
227
228
|
};
|
|
228
229
|
};
|
|
230
|
+
_patternOptedInQueryStrings?: string[];
|
|
229
231
|
_patternError?: "NOTFOUND" | "CYCLIC";
|
|
230
232
|
_overrides?: {
|
|
231
233
|
[key: string]: {
|
|
@@ -382,6 +384,7 @@ declare class DefaultDataClient implements DataClient {
|
|
|
382
384
|
};
|
|
383
385
|
};
|
|
384
386
|
};
|
|
387
|
+
_patternOptedInQueryStrings?: string[];
|
|
385
388
|
_dataResources?: {
|
|
386
389
|
[key: string]: {
|
|
387
390
|
type: string;
|
|
@@ -515,6 +518,7 @@ declare class DefaultDataClient implements DataClient {
|
|
|
515
518
|
};
|
|
516
519
|
};
|
|
517
520
|
};
|
|
521
|
+
_patternOptedInQueryStrings?: string[];
|
|
518
522
|
_patternError?: "NOTFOUND" | "CYCLIC";
|
|
519
523
|
_overrides?: {
|
|
520
524
|
[key: string]: /*elided*/ any;
|
|
@@ -667,6 +671,7 @@ declare class DefaultDataClient implements DataClient {
|
|
|
667
671
|
};
|
|
668
672
|
};
|
|
669
673
|
};
|
|
674
|
+
_patternOptedInQueryStrings?: string[];
|
|
670
675
|
_patternError?: "NOTFOUND" | "CYCLIC";
|
|
671
676
|
_overrides?: {
|
|
672
677
|
[key: string]: /*elided*/ any;
|
|
@@ -706,6 +711,7 @@ declare class DefaultDataClient implements DataClient {
|
|
|
706
711
|
hideLockedParameters?: boolean;
|
|
707
712
|
};
|
|
708
713
|
_locales?: string[];
|
|
714
|
+
_optedInQueryStrings?: string[];
|
|
709
715
|
};
|
|
710
716
|
workflowId?: string;
|
|
711
717
|
workflowStageId?: string;
|
package/dist/compat.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { ComponentType } from 'react';
|
|
2
2
|
import { ComponentProps as ComponentProps$1, ComponentParameter } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import { U as UniformTextProps$1 } from './UniformText-ChMwHBw4.mjs';
|
|
4
|
-
import { R as ResolveComponentResult, a as ResolveComponentFunction } from './UniformComposition-
|
|
4
|
+
import { R as ResolveComponentResult, a as ResolveComponentFunction } from './UniformComposition-le6UEB_r.mjs';
|
|
5
5
|
import '@uniformdev/next-app-router-client';
|
|
6
6
|
import '@uniformdev/canvas';
|
|
7
|
-
import './client-
|
|
7
|
+
import './client-BElN_CWD.mjs';
|
|
8
8
|
import '@uniformdev/context';
|
|
9
|
-
import './resolveRouteFromCode-
|
|
9
|
+
import './resolveRouteFromCode-CuJ4JHeb.mjs';
|
|
10
10
|
|
|
11
11
|
type ComponentContext = ComponentProps$1['component'] & {
|
|
12
12
|
parameters: Record<string, ComponentParameter>;
|
package/dist/compat.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { ComponentType } from 'react';
|
|
2
2
|
import { ComponentProps as ComponentProps$1, ComponentParameter } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import { U as UniformTextProps$1 } from './UniformText-ChMwHBw4.js';
|
|
4
|
-
import { R as ResolveComponentResult, a as ResolveComponentFunction } from './UniformComposition-
|
|
4
|
+
import { R as ResolveComponentResult, a as ResolveComponentFunction } from './UniformComposition-DBO-oo7J.js';
|
|
5
5
|
import '@uniformdev/next-app-router-client';
|
|
6
6
|
import '@uniformdev/canvas';
|
|
7
|
-
import './client-
|
|
7
|
+
import './client-BElN_CWD.js';
|
|
8
8
|
import '@uniformdev/context';
|
|
9
|
-
import './resolveRouteFromCode-
|
|
9
|
+
import './resolveRouteFromCode-BOvjIvM2.js';
|
|
10
10
|
|
|
11
11
|
type ComponentContext = ComponentProps$1['component'] & {
|
|
12
12
|
parameters: Record<string, ComponentParameter>;
|
package/dist/component.d.mts
CHANGED
|
@@ -36,7 +36,7 @@ type RenderRichTextComponentResolver = (node: RichTextNode) => RichTextRendererC
|
|
|
36
36
|
declare const UniformRichText: React.ForwardRefExoticComponent<{
|
|
37
37
|
/**
|
|
38
38
|
* The name of the HTML tag to render.
|
|
39
|
-
* @
|
|
39
|
+
* @defaultValue "div"
|
|
40
40
|
*/
|
|
41
41
|
as?: React.ElementType;
|
|
42
42
|
/**
|
|
@@ -51,7 +51,7 @@ declare const UniformRichText: React.ForwardRefExoticComponent<{
|
|
|
51
51
|
/**
|
|
52
52
|
* Sets the value to show in Canvas editor when the parameter value is empty.
|
|
53
53
|
* Can be a static string, or a function to generate the placeholder out of parameter info.
|
|
54
|
-
* @
|
|
54
|
+
* @defaultValue undefined
|
|
55
55
|
*/
|
|
56
56
|
placeholder?: string | ((parameter: {
|
|
57
57
|
id: string;
|
package/dist/component.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ type RenderRichTextComponentResolver = (node: RichTextNode) => RichTextRendererC
|
|
|
36
36
|
declare const UniformRichText: React.ForwardRefExoticComponent<{
|
|
37
37
|
/**
|
|
38
38
|
* The name of the HTML tag to render.
|
|
39
|
-
* @
|
|
39
|
+
* @defaultValue "div"
|
|
40
40
|
*/
|
|
41
41
|
as?: React.ElementType;
|
|
42
42
|
/**
|
|
@@ -51,7 +51,7 @@ declare const UniformRichText: React.ForwardRefExoticComponent<{
|
|
|
51
51
|
/**
|
|
52
52
|
* Sets the value to show in Canvas editor when the parameter value is empty.
|
|
53
53
|
* Can be a static string, or a function to generate the placeholder out of parameter info.
|
|
54
|
-
* @
|
|
54
|
+
* @defaultValue undefined
|
|
55
55
|
*/
|
|
56
56
|
placeholder?: string | ((parameter: {
|
|
57
57
|
id: string;
|
package/dist/component.js
CHANGED
|
@@ -936,11 +936,11 @@ var ATTRIBUTE_PARAMETER_ID = "data-uniform-parameter-id";
|
|
|
936
936
|
var ATTRIBUTE_PARAMETER_TYPE = "data-uniform-parameter-type";
|
|
937
937
|
|
|
938
938
|
// src/components/UniformRichText.tsx
|
|
939
|
-
var
|
|
939
|
+
var import_richtext8 = require("@uniformdev/richtext");
|
|
940
940
|
var import_react12 = __toESM(require("react"));
|
|
941
941
|
|
|
942
942
|
// src/components/UniformRichTextNode.tsx
|
|
943
|
-
var
|
|
943
|
+
var import_richtext7 = require("@uniformdev/richtext");
|
|
944
944
|
var import_react11 = __toESM(require("react"));
|
|
945
945
|
|
|
946
946
|
// src/components/nodes/AssetRichTextNode.tsx
|
|
@@ -986,41 +986,57 @@ var LinkRichTextNode = ({ children, node }) => {
|
|
|
986
986
|
};
|
|
987
987
|
|
|
988
988
|
// src/components/nodes/ListItemRichTextNode.tsx
|
|
989
|
+
var import_richtext2 = require("@uniformdev/richtext");
|
|
989
990
|
var import_react5 = __toESM(require("react"));
|
|
990
991
|
var ListItemRichTextNode = ({ children, node }) => {
|
|
991
992
|
const { value } = node;
|
|
992
|
-
|
|
993
|
+
const normalizedValue = (0, import_richtext2.getRichTextListItemValue)(value);
|
|
994
|
+
return /* @__PURE__ */ import_react5.default.createElement(
|
|
995
|
+
"li",
|
|
996
|
+
{
|
|
997
|
+
value: typeof normalizedValue === "number" && Number.isFinite(normalizedValue) && normalizedValue > 0 ? normalizedValue : void 0
|
|
998
|
+
},
|
|
999
|
+
children
|
|
1000
|
+
);
|
|
993
1001
|
};
|
|
994
1002
|
|
|
995
1003
|
// src/components/nodes/ListRichTextNode.tsx
|
|
1004
|
+
var import_richtext3 = require("@uniformdev/richtext");
|
|
996
1005
|
var import_react6 = __toESM(require("react"));
|
|
997
1006
|
var ListRichTextNode = ({ children, node }) => {
|
|
998
1007
|
const { tag, start } = node;
|
|
999
1008
|
const ListTag = tag != null ? tag : "ul";
|
|
1000
|
-
|
|
1009
|
+
const normalizedStart = (0, import_richtext3.getRichTextListStart)(start);
|
|
1010
|
+
return /* @__PURE__ */ import_react6.default.createElement(
|
|
1011
|
+
ListTag,
|
|
1012
|
+
{
|
|
1013
|
+
start: typeof normalizedStart === "number" && Number.isFinite(normalizedStart) && normalizedStart > 0 ? normalizedStart : void 0
|
|
1014
|
+
},
|
|
1015
|
+
children
|
|
1016
|
+
);
|
|
1001
1017
|
};
|
|
1002
1018
|
|
|
1003
1019
|
// src/components/nodes/ParagraphRichTextNode.tsx
|
|
1004
|
-
var
|
|
1020
|
+
var import_richtext4 = require("@uniformdev/richtext");
|
|
1005
1021
|
var import_react7 = __toESM(require("react"));
|
|
1006
1022
|
var ParagraphRichTextNode = ({ children, node }) => {
|
|
1007
1023
|
const { format, direction } = node;
|
|
1008
1024
|
return /* @__PURE__ */ import_react7.default.createElement(
|
|
1009
1025
|
"p",
|
|
1010
1026
|
{
|
|
1011
|
-
dir: (0,
|
|
1012
|
-
style: (0,
|
|
1027
|
+
dir: (0, import_richtext4.isPureDirection)(direction) ? direction : void 0,
|
|
1028
|
+
style: (0, import_richtext4.isPureTextAlign)(format) ? { textAlign: format } : void 0
|
|
1013
1029
|
},
|
|
1014
1030
|
children
|
|
1015
1031
|
);
|
|
1016
1032
|
};
|
|
1017
1033
|
|
|
1018
1034
|
// src/components/nodes/TableCellRichTextNode.tsx
|
|
1019
|
-
var
|
|
1035
|
+
var import_richtext5 = require("@uniformdev/richtext");
|
|
1020
1036
|
var import_react8 = __toESM(require("react"));
|
|
1021
1037
|
var TableCellRichTextNode = ({ children, node }) => {
|
|
1022
1038
|
const { headerState } = node;
|
|
1023
|
-
const TableCellTag = (0,
|
|
1039
|
+
const TableCellTag = (0, import_richtext5.getRichTextTagFromTableCellHeaderState)(headerState);
|
|
1024
1040
|
return /* @__PURE__ */ import_react8.default.createElement(TableCellTag, null, children);
|
|
1025
1041
|
};
|
|
1026
1042
|
|
|
@@ -1031,18 +1047,18 @@ var TabRichTextNode = () => {
|
|
|
1031
1047
|
};
|
|
1032
1048
|
|
|
1033
1049
|
// src/components/nodes/TextRichTextNode.tsx
|
|
1034
|
-
var
|
|
1050
|
+
var import_richtext6 = require("@uniformdev/richtext");
|
|
1035
1051
|
var import_react10 = __toESM(require("react"));
|
|
1036
1052
|
var TextRichTextNode = ({ node }) => {
|
|
1037
1053
|
const { text, format } = node;
|
|
1038
|
-
const tags = (0,
|
|
1054
|
+
const tags = (0, import_richtext6.getRichTextTagsFromTextFormat)(format);
|
|
1039
1055
|
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ import_react10.default.createElement(Tag, null, children), text) : text);
|
|
1040
1056
|
};
|
|
1041
1057
|
|
|
1042
1058
|
// src/components/UniformRichTextNode.tsx
|
|
1043
1059
|
function UniformRichTextNode({ node, ...props }) {
|
|
1044
1060
|
var _a;
|
|
1045
|
-
if (!(0,
|
|
1061
|
+
if (!(0, import_richtext7.isRichTextNode)(node)) return null;
|
|
1046
1062
|
let NodeRenderer = (_a = props.resolveRichTextRenderer) == null ? void 0 : _a.call(props, node);
|
|
1047
1063
|
if (typeof NodeRenderer === "undefined") {
|
|
1048
1064
|
NodeRenderer = resolveRichTextDefaultRenderer(node);
|
|
@@ -1096,8 +1112,8 @@ var UniformRichText = import_react12.default.forwardRef(function UniformRichText
|
|
|
1096
1112
|
}
|
|
1097
1113
|
const computedPlaceholder = typeof placeholder === "function" ? placeholder({ id: parameter.parameterId }) : placeholder;
|
|
1098
1114
|
const value = parameter.value;
|
|
1099
|
-
if (!value || !(0,
|
|
1100
|
-
if (!isContextualEditing && (0,
|
|
1115
|
+
if (!value || !(0, import_richtext8.isRichTextValue)(value)) return null;
|
|
1116
|
+
if (!isContextualEditing && (0, import_richtext8.isRichTextValueConsideredEmpty)(value)) return null;
|
|
1101
1117
|
return Tag === null ? /* @__PURE__ */ import_react12.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react12.default.createElement(
|
|
1102
1118
|
Tag,
|
|
1103
1119
|
{
|
|
@@ -1109,7 +1125,7 @@ var UniformRichText = import_react12.default.forwardRef(function UniformRichText
|
|
|
1109
1125
|
[ATTRIBUTE_PARAMETER_TYPE]: "richText"
|
|
1110
1126
|
} : {}
|
|
1111
1127
|
},
|
|
1112
|
-
(0,
|
|
1128
|
+
(0, import_richtext8.isRichTextValueConsideredEmpty)(value) ? /* @__PURE__ */ import_react12.default.createElement("p", null, /* @__PURE__ */ import_react12.default.createElement("i", null, computedPlaceholder)) : /* @__PURE__ */ import_react12.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
|
|
1113
1129
|
);
|
|
1114
1130
|
});
|
|
1115
1131
|
|
package/dist/component.mjs
CHANGED
|
@@ -974,18 +974,34 @@ var LinkRichTextNode = ({ children, node }) => {
|
|
|
974
974
|
};
|
|
975
975
|
|
|
976
976
|
// src/components/nodes/ListItemRichTextNode.tsx
|
|
977
|
+
import { getRichTextListItemValue } from "@uniformdev/richtext";
|
|
977
978
|
import React5 from "react";
|
|
978
979
|
var ListItemRichTextNode = ({ children, node }) => {
|
|
979
980
|
const { value } = node;
|
|
980
|
-
|
|
981
|
+
const normalizedValue = getRichTextListItemValue(value);
|
|
982
|
+
return /* @__PURE__ */ React5.createElement(
|
|
983
|
+
"li",
|
|
984
|
+
{
|
|
985
|
+
value: typeof normalizedValue === "number" && Number.isFinite(normalizedValue) && normalizedValue > 0 ? normalizedValue : void 0
|
|
986
|
+
},
|
|
987
|
+
children
|
|
988
|
+
);
|
|
981
989
|
};
|
|
982
990
|
|
|
983
991
|
// src/components/nodes/ListRichTextNode.tsx
|
|
992
|
+
import { getRichTextListStart } from "@uniformdev/richtext";
|
|
984
993
|
import React6 from "react";
|
|
985
994
|
var ListRichTextNode = ({ children, node }) => {
|
|
986
995
|
const { tag, start } = node;
|
|
987
996
|
const ListTag = tag != null ? tag : "ul";
|
|
988
|
-
|
|
997
|
+
const normalizedStart = getRichTextListStart(start);
|
|
998
|
+
return /* @__PURE__ */ React6.createElement(
|
|
999
|
+
ListTag,
|
|
1000
|
+
{
|
|
1001
|
+
start: typeof normalizedStart === "number" && Number.isFinite(normalizedStart) && normalizedStart > 0 ? normalizedStart : void 0
|
|
1002
|
+
},
|
|
1003
|
+
children
|
|
1004
|
+
);
|
|
989
1005
|
};
|
|
990
1006
|
|
|
991
1007
|
// src/components/nodes/ParagraphRichTextNode.tsx
|
package/dist/handler.js
CHANGED
|
@@ -1679,10 +1679,13 @@ _url22 = /* @__PURE__ */ new WeakMap();
|
|
|
1679
1679
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
1680
1680
|
__privateAdd3(_ProjectClient, _url22, "/api/v1/project");
|
|
1681
1681
|
__privateAdd3(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
1682
|
+
var ALLOWED_REFERRER_ORIGIN = /^https:\/\/([\w-]+\.)*(uniform\.(app|wtf)|uniformcode\.ai)$|^https?:\/\/localhost:\d{4}$/;
|
|
1682
1683
|
var isAllowedReferrer = (referrer) => {
|
|
1683
|
-
|
|
1684
|
-
referrer
|
|
1685
|
-
)
|
|
1684
|
+
try {
|
|
1685
|
+
return ALLOWED_REFERRER_ORIGIN.test(new URL(referrer != null ? referrer : "").origin);
|
|
1686
|
+
} catch (e) {
|
|
1687
|
+
return false;
|
|
1688
|
+
}
|
|
1686
1689
|
};
|
|
1687
1690
|
|
|
1688
1691
|
// src/handler/createPreviewGETRouteHandler.ts
|
package/dist/handler.mjs
CHANGED
|
@@ -1664,10 +1664,13 @@ _url22 = /* @__PURE__ */ new WeakMap();
|
|
|
1664
1664
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
1665
1665
|
__privateAdd3(_ProjectClient, _url22, "/api/v1/project");
|
|
1666
1666
|
__privateAdd3(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
1667
|
+
var ALLOWED_REFERRER_ORIGIN = /^https:\/\/([\w-]+\.)*(uniform\.(app|wtf)|uniformcode\.ai)$|^https?:\/\/localhost:\d{4}$/;
|
|
1667
1668
|
var isAllowedReferrer = (referrer) => {
|
|
1668
|
-
|
|
1669
|
-
referrer
|
|
1670
|
-
)
|
|
1669
|
+
try {
|
|
1670
|
+
return ALLOWED_REFERRER_ORIGIN.test(new URL(referrer != null ? referrer : "").origin);
|
|
1671
|
+
} catch (e) {
|
|
1672
|
+
return false;
|
|
1673
|
+
}
|
|
1671
1674
|
};
|
|
1672
1675
|
|
|
1673
1676
|
// src/handler/createPreviewGETRouteHandler.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -2,12 +2,12 @@ import { CanvasClient, CompositionDeliveryClient, RouteClient, ComponentInstance
|
|
|
2
2
|
import { CacheMode, CanvasCacheMode, ManifestCacheMode, ProjectMapCacheMode, RewriteRequestPathResult } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import { ManifestClient } from '@uniformdev/context/api';
|
|
4
4
|
import { ProjectMapClient } from '@uniformdev/project-map';
|
|
5
|
-
import { U as UniformCompositionProps } from './UniformComposition-
|
|
6
|
-
export { C as CompositionCache, a as ResolveComponentFunction, R as ResolveComponentResult, b as UniformComposition, c as createCompositionCache } from './UniformComposition-
|
|
5
|
+
import { U as UniformCompositionProps } from './UniformComposition-le6UEB_r.mjs';
|
|
6
|
+
export { C as CompositionCache, a as ResolveComponentFunction, R as ResolveComponentResult, b as UniformComposition, c as createCompositionCache } from './UniformComposition-le6UEB_r.mjs';
|
|
7
7
|
import React from 'react';
|
|
8
|
-
export { D as DataClient, a as DefaultDataClient, E as EnhanceRouteOptions, G as GetRouteFromMiddlewareOptions, b as GetRouteFromPageStateOptions, c as GetRouteOptions, R as RewriteRouteOptions, d as RewriteRouteResult, e as expireMiddlewareCacheTag } from './client-
|
|
9
|
-
import { a as ResolvedRouteResult } from './resolveRouteFromCode-
|
|
10
|
-
export { R as ResolveRouteFunction, r as resolveRouteFromCode } from './resolveRouteFromCode-
|
|
8
|
+
export { D as DataClient, a as DefaultDataClient, E as EnhanceRouteOptions, G as GetRouteFromMiddlewareOptions, b as GetRouteFromPageStateOptions, c as GetRouteOptions, R as RewriteRouteOptions, d as RewriteRouteResult, e as expireMiddlewareCacheTag } from './client-BElN_CWD.mjs';
|
|
9
|
+
import { a as ResolvedRouteResult } from './resolveRouteFromCode-CuJ4JHeb.mjs';
|
|
10
|
+
export { R as ResolveRouteFunction, r as resolveRouteFromCode } from './resolveRouteFromCode-CuJ4JHeb.mjs';
|
|
11
11
|
import '@uniformdev/next-app-router-client';
|
|
12
12
|
import '@uniformdev/context';
|
|
13
13
|
|
|
@@ -249,12 +249,12 @@ type EvaluatePersonalizationsFunction = (personalization: {
|
|
|
249
249
|
type PrecomputeCompositionOptions = Pick<ResolvedRouteResult, 'pageState' | 'route'> & {
|
|
250
250
|
/**
|
|
251
251
|
* Whether to evaluate tests
|
|
252
|
-
* @
|
|
252
|
+
* @defaultValue true
|
|
253
253
|
*/
|
|
254
254
|
evaluateTests?: boolean | EvaluateTestsFunction;
|
|
255
255
|
/**
|
|
256
256
|
* Whether to evaluate personalizations
|
|
257
|
-
* @
|
|
257
|
+
* @defaultValue true
|
|
258
258
|
*/
|
|
259
259
|
evaluatePersonalizations?: boolean | EvaluatePersonalizationsFunction;
|
|
260
260
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { CanvasClient, CompositionDeliveryClient, RouteClient, ComponentInstance
|
|
|
2
2
|
import { CacheMode, CanvasCacheMode, ManifestCacheMode, ProjectMapCacheMode, RewriteRequestPathResult } from '@uniformdev/next-app-router-shared';
|
|
3
3
|
import { ManifestClient } from '@uniformdev/context/api';
|
|
4
4
|
import { ProjectMapClient } from '@uniformdev/project-map';
|
|
5
|
-
import { U as UniformCompositionProps } from './UniformComposition-
|
|
6
|
-
export { C as CompositionCache, a as ResolveComponentFunction, R as ResolveComponentResult, b as UniformComposition, c as createCompositionCache } from './UniformComposition-
|
|
5
|
+
import { U as UniformCompositionProps } from './UniformComposition-DBO-oo7J.js';
|
|
6
|
+
export { C as CompositionCache, a as ResolveComponentFunction, R as ResolveComponentResult, b as UniformComposition, c as createCompositionCache } from './UniformComposition-DBO-oo7J.js';
|
|
7
7
|
import React from 'react';
|
|
8
|
-
export { D as DataClient, a as DefaultDataClient, E as EnhanceRouteOptions, G as GetRouteFromMiddlewareOptions, b as GetRouteFromPageStateOptions, c as GetRouteOptions, R as RewriteRouteOptions, d as RewriteRouteResult, e as expireMiddlewareCacheTag } from './client-
|
|
9
|
-
import { a as ResolvedRouteResult } from './resolveRouteFromCode-
|
|
10
|
-
export { R as ResolveRouteFunction, r as resolveRouteFromCode } from './resolveRouteFromCode-
|
|
8
|
+
export { D as DataClient, a as DefaultDataClient, E as EnhanceRouteOptions, G as GetRouteFromMiddlewareOptions, b as GetRouteFromPageStateOptions, c as GetRouteOptions, R as RewriteRouteOptions, d as RewriteRouteResult, e as expireMiddlewareCacheTag } from './client-BElN_CWD.js';
|
|
9
|
+
import { a as ResolvedRouteResult } from './resolveRouteFromCode-BOvjIvM2.js';
|
|
10
|
+
export { R as ResolveRouteFunction, r as resolveRouteFromCode } from './resolveRouteFromCode-BOvjIvM2.js';
|
|
11
11
|
import '@uniformdev/next-app-router-client';
|
|
12
12
|
import '@uniformdev/context';
|
|
13
13
|
|
|
@@ -249,12 +249,12 @@ type EvaluatePersonalizationsFunction = (personalization: {
|
|
|
249
249
|
type PrecomputeCompositionOptions = Pick<ResolvedRouteResult, 'pageState' | 'route'> & {
|
|
250
250
|
/**
|
|
251
251
|
* Whether to evaluate tests
|
|
252
|
-
* @
|
|
252
|
+
* @defaultValue true
|
|
253
253
|
*/
|
|
254
254
|
evaluateTests?: boolean | EvaluateTestsFunction;
|
|
255
255
|
/**
|
|
256
256
|
* Whether to evaluate personalizations
|
|
257
|
-
* @
|
|
257
|
+
* @defaultValue true
|
|
258
258
|
*/
|
|
259
259
|
evaluatePersonalizations?: boolean | EvaluatePersonalizationsFunction;
|
|
260
260
|
};
|