@uniformdev/next-app-router 20.81.1-alpha.18.sha-033e71b921 → 20.81.1-alpha.22.sha-d3709dc4ec

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.
@@ -1,7 +1,7 @@
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 { a as ResolvedRouteResult } from './composition-CGU7iH-k.js';
4
+ import { a as ResolvedRouteResult } from './composition-C7voY4YR.js';
5
5
 
6
6
  type CompositionCache = {
7
7
  getUniformComposition: ({ id }: {
@@ -35,7 +35,7 @@ type ResolveComponentFunction = (options: {
35
35
  component: ComponentInstance;
36
36
  }) => ResolveComponentResult;
37
37
  type ResolveEmptyPlaceholderFunction = (options: ResolveEmptyPlaceholderOptions) => ResolveEmptyPlaceholderResult;
38
- type UniformCompositionProps = {
38
+ type UniformResolvedCompositionProps = {
39
39
  /**
40
40
  * The result of any resolver, passed as is. A composition renders; a redirect or not found
41
41
  * renders nothing. To redirect or return a 404 instead, pass the result through
@@ -56,10 +56,10 @@ type UniformCompositionProps = {
56
56
  compositionCache?: CompositionCache;
57
57
  };
58
58
  /**
59
- * Renders a resolved composition, or nothing when the result is a redirect or not found. Render
60
- * `UniformContext` once on the page as well, which initializes Uniform context on the client and
59
+ * Renders a resolved composition, or nothing when the result is a redirect or not found. Wrap the
60
+ * page's compositions in one `UniformContext`, which initializes Uniform context on the client and
61
61
  * loads the contextual editing script.
62
62
  */
63
- declare function UniformComposition(props: UniformCompositionProps): React.JSX.Element;
63
+ declare function UniformResolvedComposition(props: UniformResolvedCompositionProps): React.JSX.Element;
64
64
 
65
- export { type CompositionCache as C, type ResolveComponentResult as R, type UniformCompositionProps as U, type ResolveComponentFunction as a, UniformComposition as b, createCompositionCache as c };
65
+ export { type CompositionCache as C, type ResolveComponentResult as R, type UniformResolvedCompositionProps as U, type ResolveComponentFunction as a, UniformResolvedComposition as b, createCompositionCache as c };
@@ -1,7 +1,7 @@
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 { a as ResolvedRouteResult } from './composition-CGU7iH-k.mjs';
4
+ import { a as ResolvedRouteResult } from './composition-C7voY4YR.mjs';
5
5
 
6
6
  type CompositionCache = {
7
7
  getUniformComposition: ({ id }: {
@@ -35,7 +35,7 @@ type ResolveComponentFunction = (options: {
35
35
  component: ComponentInstance;
36
36
  }) => ResolveComponentResult;
37
37
  type ResolveEmptyPlaceholderFunction = (options: ResolveEmptyPlaceholderOptions) => ResolveEmptyPlaceholderResult;
38
- type UniformCompositionProps = {
38
+ type UniformResolvedCompositionProps = {
39
39
  /**
40
40
  * The result of any resolver, passed as is. A composition renders; a redirect or not found
41
41
  * renders nothing. To redirect or return a 404 instead, pass the result through
@@ -56,10 +56,10 @@ type UniformCompositionProps = {
56
56
  compositionCache?: CompositionCache;
57
57
  };
58
58
  /**
59
- * Renders a resolved composition, or nothing when the result is a redirect or not found. Render
60
- * `UniformContext` once on the page as well, which initializes Uniform context on the client and
59
+ * Renders a resolved composition, or nothing when the result is a redirect or not found. Wrap the
60
+ * page's compositions in one `UniformContext`, which initializes Uniform context on the client and
61
61
  * loads the contextual editing script.
62
62
  */
63
- declare function UniformComposition(props: UniformCompositionProps): React.JSX.Element;
63
+ declare function UniformResolvedComposition(props: UniformResolvedCompositionProps): React.JSX.Element;
64
64
 
65
- export { type CompositionCache as C, type ResolveComponentResult as R, type UniformCompositionProps as U, type ResolveComponentFunction as a, UniformComposition as b, createCompositionCache as c };
65
+ export { type CompositionCache as C, type ResolveComponentResult as R, type UniformResolvedCompositionProps as U, type ResolveComponentFunction as a, UniformResolvedComposition as b, createCompositionCache as c };
package/dist/cache.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as ResolveCompositionByIdOptions, a as ResolveCompositionBySlugOptions, b as ResolveRouteFromCodeOptions, c as ResolveRouteFromPathOptions } from './resolveRouteFromPath-_rauUskz.mjs';
2
- import { R as ResolvedCompositionResult, a as ResolvedRouteResult } from './composition-CGU7iH-k.mjs';
1
+ import { R as ResolveCompositionByIdOptions, a as ResolveCompositionBySlugOptions, b as ResolveRouteFromCodeOptions, c as ResolveRouteFromPathOptions } from './resolveRouteFromPath-C62DO3_K.mjs';
2
+ import { R as ResolvedCompositionResult, a as ResolvedRouteResult } from './composition-C7voY4YR.mjs';
3
3
  import '@uniformdev/next-app-router-shared';
4
4
  import '@uniformdev/canvas';
5
5
 
package/dist/cache.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as ResolveCompositionByIdOptions, a as ResolveCompositionBySlugOptions, b as ResolveRouteFromCodeOptions, c as ResolveRouteFromPathOptions } from './resolveRouteFromPath-CnfnaxY2.js';
2
- import { R as ResolvedCompositionResult, a as ResolvedRouteResult } from './composition-CGU7iH-k.js';
1
+ import { R as ResolveCompositionByIdOptions, a as ResolveCompositionBySlugOptions, b as ResolveRouteFromCodeOptions, c as ResolveRouteFromPathOptions } from './resolveRouteFromPath-BVy72a9s.js';
2
+ import { R as ResolvedCompositionResult, a as ResolvedRouteResult } from './composition-C7voY4YR.js';
3
3
  import '@uniformdev/next-app-router-shared';
4
4
  import '@uniformdev/canvas';
5
5
 
package/dist/cache.js CHANGED
@@ -1516,6 +1516,7 @@ var getRouteClient = (options) => {
1516
1516
  };
1517
1517
 
1518
1518
  // src/data/client.ts
1519
+ var ID_ONLY = { fields: { only: [] }, slots: { depth: 0 } };
1519
1520
  var DataClient = class {
1520
1521
  constructor({ fetchCache = true } = {}) {
1521
1522
  this.fetchCache = fetchCache;
@@ -1533,19 +1534,50 @@ var DataClient = class {
1533
1534
  };
1534
1535
  return routeClient.get(parameters);
1535
1536
  }
1536
- /** Returns `null` when no composition matches the selector in the page state's composition state. */
1537
+ /**
1538
+ * Returns `null` when no composition matches the selector in the page state's composition state.
1539
+ * A published slug read through the fetch cache looks up the composition's id by slug, then
1540
+ * fetches the composition by id, so publishing the composition revalidates it whichever slug it
1541
+ * was read by. A slug the composition no longer has returns `null` once the by-id read refreshes.
1542
+ */
1537
1543
  async getComposition({
1538
1544
  pageState,
1539
1545
  selector
1540
1546
  }) {
1541
- const client = getCompositionDeliveryClient({ cache: this.resolveCache(pageState) });
1547
+ const cache = this.resolveCache(pageState);
1548
+ if (!("slug" in selector) || cache.type !== "force-cache") {
1549
+ return this.fetchComposition({ pageState, selector, cache });
1550
+ }
1551
+ const match = await this.fetchComposition({ pageState, selector, cache, select: ID_ONLY });
1552
+ if (!match) {
1553
+ return null;
1554
+ }
1555
+ const byId = { compositionId: match.composition._id };
1556
+ const composition = await this.fetchComposition({ pageState, selector: byId, cache });
1557
+ if (!composition || composition.composition._slug === selector.slug) {
1558
+ return composition;
1559
+ }
1560
+ if (!(Date.parse(match.modified) > Date.parse(composition.modified))) {
1561
+ return null;
1562
+ }
1563
+ const current = await this.fetchComposition({ pageState, selector: byId, cache: { type: "no-cache" } });
1564
+ return (current == null ? void 0 : current.composition._slug) === selector.slug ? current : null;
1565
+ }
1566
+ async fetchComposition({
1567
+ pageState,
1568
+ selector,
1569
+ cache,
1570
+ select
1571
+ }) {
1572
+ const client = getCompositionDeliveryClient({ cache });
1542
1573
  try {
1543
1574
  return await client.get({
1544
1575
  ...selector,
1545
1576
  state: pageState.compositionState,
1546
1577
  withComponentIDs: true,
1547
1578
  releaseId: pageState.releaseId,
1548
- locale: pageState.locale
1579
+ locale: pageState.locale,
1580
+ select
1549
1581
  });
1550
1582
  } catch (e) {
1551
1583
  if (e instanceof import_api26.ApiClientError && e.statusCode === 404) {
package/dist/cache.mjs CHANGED
@@ -1500,6 +1500,7 @@ var getRouteClient = (options) => {
1500
1500
  };
1501
1501
 
1502
1502
  // src/data/client.ts
1503
+ var ID_ONLY = { fields: { only: [] }, slots: { depth: 0 } };
1503
1504
  var DataClient = class {
1504
1505
  constructor({ fetchCache = true } = {}) {
1505
1506
  this.fetchCache = fetchCache;
@@ -1517,19 +1518,50 @@ var DataClient = class {
1517
1518
  };
1518
1519
  return routeClient.get(parameters);
1519
1520
  }
1520
- /** Returns `null` when no composition matches the selector in the page state's composition state. */
1521
+ /**
1522
+ * Returns `null` when no composition matches the selector in the page state's composition state.
1523
+ * A published slug read through the fetch cache looks up the composition's id by slug, then
1524
+ * fetches the composition by id, so publishing the composition revalidates it whichever slug it
1525
+ * was read by. A slug the composition no longer has returns `null` once the by-id read refreshes.
1526
+ */
1521
1527
  async getComposition({
1522
1528
  pageState,
1523
1529
  selector
1524
1530
  }) {
1525
- const client = getCompositionDeliveryClient({ cache: this.resolveCache(pageState) });
1531
+ const cache = this.resolveCache(pageState);
1532
+ if (!("slug" in selector) || cache.type !== "force-cache") {
1533
+ return this.fetchComposition({ pageState, selector, cache });
1534
+ }
1535
+ const match = await this.fetchComposition({ pageState, selector, cache, select: ID_ONLY });
1536
+ if (!match) {
1537
+ return null;
1538
+ }
1539
+ const byId = { compositionId: match.composition._id };
1540
+ const composition = await this.fetchComposition({ pageState, selector: byId, cache });
1541
+ if (!composition || composition.composition._slug === selector.slug) {
1542
+ return composition;
1543
+ }
1544
+ if (!(Date.parse(match.modified) > Date.parse(composition.modified))) {
1545
+ return null;
1546
+ }
1547
+ const current = await this.fetchComposition({ pageState, selector: byId, cache: { type: "no-cache" } });
1548
+ return (current == null ? void 0 : current.composition._slug) === selector.slug ? current : null;
1549
+ }
1550
+ async fetchComposition({
1551
+ pageState,
1552
+ selector,
1553
+ cache,
1554
+ select
1555
+ }) {
1556
+ const client = getCompositionDeliveryClient({ cache });
1526
1557
  try {
1527
1558
  return await client.get({
1528
1559
  ...selector,
1529
1560
  state: pageState.compositionState,
1530
1561
  withComponentIDs: true,
1531
1562
  releaseId: pageState.releaseId,
1532
- locale: pageState.locale
1563
+ locale: pageState.locale,
1564
+ select
1533
1565
  });
1534
1566
  } catch (e) {
1535
1567
  if (e instanceof ApiClientError5 && e.statusCode === 404) {
package/dist/compat.d.mts CHANGED
@@ -1,10 +1,10 @@
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-Doa1kKRm.mjs';
4
+ import { R as ResolveComponentResult, a as ResolveComponentFunction } from './UniformResolvedComposition-JOJTO1N5.mjs';
5
5
  import '@uniformdev/next-app-router-client';
6
6
  import '@uniformdev/canvas';
7
- import './composition-CGU7iH-k.mjs';
7
+ import './composition-C7voY4YR.mjs';
8
8
 
9
9
  type ComponentContext = ComponentProps$1['component'] & {
10
10
  parameters: Record<string, ComponentParameter>;
package/dist/compat.d.ts CHANGED
@@ -1,10 +1,10 @@
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-ChDH4dMd.js';
4
+ import { R as ResolveComponentResult, a as ResolveComponentFunction } from './UniformResolvedComposition-DxnyzdYY.js';
5
5
  import '@uniformdev/next-app-router-client';
6
6
  import '@uniformdev/canvas';
7
- import './composition-CGU7iH-k.js';
7
+ import './composition-C7voY4YR.js';
8
8
 
9
9
  type ComponentContext = ComponentProps$1['component'] & {
10
10
  parameters: Record<string, ComponentParameter>;
@@ -7,15 +7,6 @@ export { a as UniformText, U as UniformTextProps } from './UniformText-ChMwHBw4.
7
7
 
8
8
  declare const getUniformSlot: ({ slot, children }: UniformSlotProps) => ReactNode[] | undefined;
9
9
 
10
- /**
11
- * Renders the empty script the edge middleware fills with the visitor state it computed, such as
12
- * new test assignments and personalization control groups. The browser's Context reads it on
13
- * start. Place it at the end of `<body>` in the root layout when using `uniformEdgeMiddleware`.
14
- *
15
- * Optional: without it, test assignments still persist through the placements the edge kept.
16
- */
17
- declare function UniformEdgeState(): React.JSX.Element;
18
-
19
10
  type CustomSlotChildRenderFunc = (options: {
20
11
  child: ReactNode;
21
12
  _id: string;
@@ -67,4 +58,4 @@ declare const UniformRichText: React.ForwardRefExoticComponent<{
67
58
  }) => string | undefined);
68
59
  } & Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "placeholder"> & React.RefAttributes<unknown>>;
69
60
 
70
- export { UniformEdgeState, UniformRichText, UniformSlot, type UniformSlotProps, getUniformSlot };
61
+ export { UniformRichText, UniformSlot, type UniformSlotProps, getUniformSlot };
@@ -7,15 +7,6 @@ export { a as UniformText, U as UniformTextProps } from './UniformText-ChMwHBw4.
7
7
 
8
8
  declare const getUniformSlot: ({ slot, children }: UniformSlotProps) => ReactNode[] | undefined;
9
9
 
10
- /**
11
- * Renders the empty script the edge middleware fills with the visitor state it computed, such as
12
- * new test assignments and personalization control groups. The browser's Context reads it on
13
- * start. Place it at the end of `<body>` in the root layout when using `uniformEdgeMiddleware`.
14
- *
15
- * Optional: without it, test assignments still persist through the placements the edge kept.
16
- */
17
- declare function UniformEdgeState(): React.JSX.Element;
18
-
19
10
  type CustomSlotChildRenderFunc = (options: {
20
11
  child: ReactNode;
21
12
  _id: string;
@@ -67,4 +58,4 @@ declare const UniformRichText: React.ForwardRefExoticComponent<{
67
58
  }) => string | undefined);
68
59
  } & Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "placeholder"> & React.RefAttributes<unknown>>;
69
60
 
70
- export { UniformEdgeState, UniformRichText, UniformSlot, type UniformSlotProps, getUniformSlot };
61
+ export { UniformRichText, UniformSlot, type UniformSlotProps, getUniformSlot };
package/dist/component.js CHANGED
@@ -30,7 +30,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/component.ts
31
31
  var component_exports = {};
32
32
  __export(component_exports, {
33
- UniformEdgeState: () => UniformEdgeState,
34
33
  UniformRichText: () => UniformRichText,
35
34
  UniformSlot: () => UniformSlot,
36
35
  UniformText: () => UniformText,
@@ -67,21 +66,6 @@ var getUniformSlot = ({ slot, children }) => {
67
66
  return resolved.length > 0 ? resolved : void 0;
68
67
  };
69
68
 
70
- // src/components/UniformEdgeState.tsx
71
- var import_context = require("@uniformdev/context");
72
- var import_react = __toESM(require("react"));
73
- function UniformEdgeState() {
74
- return /* @__PURE__ */ import_react.default.createElement(
75
- "script",
76
- {
77
- id: import_context.SERVER_STATE_ID,
78
- type: "application/json",
79
- dangerouslySetInnerHTML: { __html: "" },
80
- suppressHydrationWarning: true
81
- }
82
- );
83
- }
84
-
85
69
  // src/components/UniformSlot.tsx
86
70
  var UniformSlot = ({ slot, children }) => {
87
71
  const resolved = [];
@@ -432,14 +416,14 @@ var ATTRIBUTE_PARAMETER_TYPE = "data-uniform-parameter-type";
432
416
 
433
417
  // src/components/UniformRichText.tsx
434
418
  var import_richtext8 = require("@uniformdev/richtext");
435
- var import_react13 = __toESM(require("react"));
419
+ var import_react12 = __toESM(require("react"));
436
420
 
437
421
  // src/components/UniformRichTextNode.tsx
438
422
  var import_richtext7 = require("@uniformdev/richtext");
439
- var import_react12 = __toESM(require("react"));
423
+ var import_react11 = __toESM(require("react"));
440
424
 
441
425
  // src/components/nodes/AssetRichTextNode.tsx
442
- var import_react2 = __toESM(require("react"));
426
+ var import_react = __toESM(require("react"));
443
427
  var AssetRichTextNode = ({ node }) => {
444
428
  var _a, _b;
445
429
  const { __asset } = node;
@@ -447,46 +431,46 @@ var AssetRichTextNode = ({ node }) => {
447
431
  return null;
448
432
  }
449
433
  if (__asset.type === "image") {
450
- return /* @__PURE__ */ import_react2.default.createElement("figure", null, /* @__PURE__ */ import_react2.default.createElement("img", { src: __asset.fields.url.value, alt: (_a = __asset.fields.title) == null ? void 0 : _a.value }), ((_b = __asset.fields.description) == null ? void 0 : _b.value) ? /* @__PURE__ */ import_react2.default.createElement("figcaption", null, __asset.fields.description.value) : null);
434
+ return /* @__PURE__ */ import_react.default.createElement("figure", null, /* @__PURE__ */ import_react.default.createElement("img", { src: __asset.fields.url.value, alt: (_a = __asset.fields.title) == null ? void 0 : _a.value }), ((_b = __asset.fields.description) == null ? void 0 : _b.value) ? /* @__PURE__ */ import_react.default.createElement("figcaption", null, __asset.fields.description.value) : null);
451
435
  }
452
436
  if (__asset.type === "video") {
453
- return /* @__PURE__ */ import_react2.default.createElement("video", { src: __asset.fields.url.value, controls: true });
437
+ return /* @__PURE__ */ import_react.default.createElement("video", { src: __asset.fields.url.value, controls: true });
454
438
  }
455
439
  if (__asset.type === "audio") {
456
- return /* @__PURE__ */ import_react2.default.createElement("audio", { src: __asset.fields.url.value, controls: true });
440
+ return /* @__PURE__ */ import_react.default.createElement("audio", { src: __asset.fields.url.value, controls: true });
457
441
  }
458
442
  return null;
459
443
  };
460
444
 
461
445
  // src/components/nodes/HeadingRichTextNode.tsx
462
- var import_react3 = __toESM(require("react"));
446
+ var import_react2 = __toESM(require("react"));
463
447
  var HeadingRichTextNode = ({ children, node }) => {
464
448
  const { tag } = node;
465
449
  const HTag = tag != null ? tag : "h1";
466
- return /* @__PURE__ */ import_react3.default.createElement(HTag, null, children);
450
+ return /* @__PURE__ */ import_react2.default.createElement(HTag, null, children);
467
451
  };
468
452
 
469
453
  // src/components/nodes/LinebreakRichTextNode.tsx
470
- var import_react4 = __toESM(require("react"));
454
+ var import_react3 = __toESM(require("react"));
471
455
  var LinebreakRichTextNode = () => {
472
- return /* @__PURE__ */ import_react4.default.createElement("br", null);
456
+ return /* @__PURE__ */ import_react3.default.createElement("br", null);
473
457
  };
474
458
 
475
459
  // src/components/nodes/LinkRichTextNode.tsx
476
460
  var import_richtext = require("@uniformdev/richtext");
477
- var import_react5 = __toESM(require("react"));
461
+ var import_react4 = __toESM(require("react"));
478
462
  var LinkRichTextNode = ({ children, node }) => {
479
463
  const { link } = node;
480
- return /* @__PURE__ */ import_react5.default.createElement("a", { ...(0, import_richtext.linkParamValueToAnchorProps)(link) }, children);
464
+ return /* @__PURE__ */ import_react4.default.createElement("a", { ...(0, import_richtext.linkParamValueToAnchorProps)(link) }, children);
481
465
  };
482
466
 
483
467
  // src/components/nodes/ListItemRichTextNode.tsx
484
468
  var import_richtext2 = require("@uniformdev/richtext");
485
- var import_react6 = __toESM(require("react"));
469
+ var import_react5 = __toESM(require("react"));
486
470
  var ListItemRichTextNode = ({ children, node }) => {
487
471
  const { value } = node;
488
472
  const normalizedValue = (0, import_richtext2.getRichTextListItemValue)(value);
489
- return /* @__PURE__ */ import_react6.default.createElement(
473
+ return /* @__PURE__ */ import_react5.default.createElement(
490
474
  "li",
491
475
  {
492
476
  value: typeof normalizedValue === "number" && Number.isFinite(normalizedValue) && normalizedValue > 0 ? normalizedValue : void 0
@@ -497,12 +481,12 @@ var ListItemRichTextNode = ({ children, node }) => {
497
481
 
498
482
  // src/components/nodes/ListRichTextNode.tsx
499
483
  var import_richtext3 = require("@uniformdev/richtext");
500
- var import_react7 = __toESM(require("react"));
484
+ var import_react6 = __toESM(require("react"));
501
485
  var ListRichTextNode = ({ children, node }) => {
502
486
  const { tag, start } = node;
503
487
  const ListTag = tag != null ? tag : "ul";
504
488
  const normalizedStart = (0, import_richtext3.getRichTextListStart)(start);
505
- return /* @__PURE__ */ import_react7.default.createElement(
489
+ return /* @__PURE__ */ import_react6.default.createElement(
506
490
  ListTag,
507
491
  {
508
492
  start: typeof normalizedStart === "number" && Number.isFinite(normalizedStart) && normalizedStart > 0 ? normalizedStart : void 0
@@ -513,10 +497,10 @@ var ListRichTextNode = ({ children, node }) => {
513
497
 
514
498
  // src/components/nodes/ParagraphRichTextNode.tsx
515
499
  var import_richtext4 = require("@uniformdev/richtext");
516
- var import_react8 = __toESM(require("react"));
500
+ var import_react7 = __toESM(require("react"));
517
501
  var ParagraphRichTextNode = ({ children, node }) => {
518
502
  const { format, direction } = node;
519
- return /* @__PURE__ */ import_react8.default.createElement(
503
+ return /* @__PURE__ */ import_react7.default.createElement(
520
504
  "p",
521
505
  {
522
506
  dir: (0, import_richtext4.isPureDirection)(direction) ? direction : void 0,
@@ -528,26 +512,26 @@ var ParagraphRichTextNode = ({ children, node }) => {
528
512
 
529
513
  // src/components/nodes/TableCellRichTextNode.tsx
530
514
  var import_richtext5 = require("@uniformdev/richtext");
531
- var import_react9 = __toESM(require("react"));
515
+ var import_react8 = __toESM(require("react"));
532
516
  var TableCellRichTextNode = ({ children, node }) => {
533
517
  const { headerState } = node;
534
518
  const TableCellTag = (0, import_richtext5.getRichTextTagFromTableCellHeaderState)(headerState);
535
- return /* @__PURE__ */ import_react9.default.createElement(TableCellTag, null, children);
519
+ return /* @__PURE__ */ import_react8.default.createElement(TableCellTag, null, children);
536
520
  };
537
521
 
538
522
  // src/components/nodes/TabRichTextNode.tsx
539
- var import_react10 = __toESM(require("react"));
523
+ var import_react9 = __toESM(require("react"));
540
524
  var TabRichTextNode = () => {
541
- return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, " ");
525
+ return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, null, " ");
542
526
  };
543
527
 
544
528
  // src/components/nodes/TextRichTextNode.tsx
545
529
  var import_richtext6 = require("@uniformdev/richtext");
546
- var import_react11 = __toESM(require("react"));
530
+ var import_react10 = __toESM(require("react"));
547
531
  var TextRichTextNode = ({ node }) => {
548
532
  const { text, format } = node;
549
533
  const tags = (0, import_richtext6.getRichTextTagsFromTextFormat)(format);
550
- return /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ import_react11.default.createElement(Tag, null, children), text) : text);
534
+ 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);
551
535
  };
552
536
 
553
537
  // src/components/UniformRichTextNode.tsx
@@ -561,8 +545,8 @@ function UniformRichTextNode({ node, ...props }) {
561
545
  if (!NodeRenderer) {
562
546
  return null;
563
547
  }
564
- const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ import_react12.default.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
565
- return /* @__PURE__ */ import_react12.default.createElement(NodeRenderer, { node }, children);
548
+ const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ import_react11.default.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
549
+ return /* @__PURE__ */ import_react11.default.createElement(NodeRenderer, { node }, children);
566
550
  }
567
551
  var rendererMap = /* @__PURE__ */ new Map([
568
552
  ["heading", HeadingRichTextNode],
@@ -571,19 +555,19 @@ var rendererMap = /* @__PURE__ */ new Map([
571
555
  ["list", ListRichTextNode],
572
556
  ["listitem", ListItemRichTextNode],
573
557
  ["paragraph", ParagraphRichTextNode],
574
- ["quote", ({ children }) => /* @__PURE__ */ import_react12.default.createElement("blockquote", null, children)],
558
+ ["quote", ({ children }) => /* @__PURE__ */ import_react11.default.createElement("blockquote", null, children)],
575
559
  [
576
560
  "code",
577
- ({ children }) => /* @__PURE__ */ import_react12.default.createElement("pre", null, /* @__PURE__ */ import_react12.default.createElement("code", null, children))
561
+ ({ children }) => /* @__PURE__ */ import_react11.default.createElement("pre", null, /* @__PURE__ */ import_react11.default.createElement("code", null, children))
578
562
  ],
579
- ["root", ({ children }) => /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, children)],
563
+ ["root", ({ children }) => /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, children)],
580
564
  ["text", TextRichTextNode],
581
565
  ["tab", TabRichTextNode],
582
566
  [
583
567
  "table",
584
- ({ children }) => /* @__PURE__ */ import_react12.default.createElement("table", null, /* @__PURE__ */ import_react12.default.createElement("tbody", null, children))
568
+ ({ children }) => /* @__PURE__ */ import_react11.default.createElement("table", null, /* @__PURE__ */ import_react11.default.createElement("tbody", null, children))
585
569
  ],
586
- ["tablerow", ({ children }) => /* @__PURE__ */ import_react12.default.createElement("tr", null, children)],
570
+ ["tablerow", ({ children }) => /* @__PURE__ */ import_react11.default.createElement("tr", null, children)],
587
571
  ["tablecell", TableCellRichTextNode],
588
572
  ["asset", AssetRichTextNode]
589
573
  ]);
@@ -592,7 +576,7 @@ var resolveRichTextDefaultRenderer = (node) => {
592
576
  };
593
577
 
594
578
  // src/components/UniformRichText.tsx
595
- var UniformRichText = import_react13.default.forwardRef(function UniformRichText2({
579
+ var UniformRichText = import_react12.default.forwardRef(function UniformRichText2({
596
580
  component,
597
581
  resolveRichTextRenderer,
598
582
  as: Tag = "div",
@@ -609,7 +593,7 @@ var UniformRichText = import_react13.default.forwardRef(function UniformRichText
609
593
  const value = parameter.value;
610
594
  if (!value || !(0, import_richtext8.isRichTextValue)(value)) return null;
611
595
  if (!isContextualEditing && (0, import_richtext8.isRichTextValueConsideredEmpty)(value)) return null;
612
- return Tag === null ? /* @__PURE__ */ import_react13.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react13.default.createElement(
596
+ return Tag === null ? /* @__PURE__ */ import_react12.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react12.default.createElement(
613
597
  Tag,
614
598
  {
615
599
  ref,
@@ -620,19 +604,18 @@ var UniformRichText = import_react13.default.forwardRef(function UniformRichText
620
604
  [ATTRIBUTE_PARAMETER_TYPE]: "richText"
621
605
  } : {}
622
606
  },
623
- (0, import_richtext8.isRichTextValueConsideredEmpty)(value) ? /* @__PURE__ */ import_react13.default.createElement("p", null, /* @__PURE__ */ import_react13.default.createElement("i", null, computedPlaceholder)) : /* @__PURE__ */ import_react13.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
607
+ (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 })
624
608
  );
625
609
  });
626
610
 
627
611
  // src/components/UniformText.tsx
628
612
  var import_next_app_router_client = require("@uniformdev/next-app-router-client");
629
- var import_react14 = __toESM(require("react"));
613
+ var import_react13 = __toESM(require("react"));
630
614
  var UniformText = (props) => {
631
- return /* @__PURE__ */ import_react14.default.createElement(import_next_app_router_client.ClientUniformText, { ...props });
615
+ return /* @__PURE__ */ import_react13.default.createElement(import_next_app_router_client.ClientUniformText, { ...props });
632
616
  };
633
617
  // Annotate the CommonJS export names for ESM import in node:
634
618
  0 && (module.exports = {
635
- UniformEdgeState,
636
619
  UniformRichText,
637
620
  UniformSlot,
638
621
  UniformText,