@agg-build/ui 4.17.0 → 4.17.3

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.
Files changed (38) hide show
  1. package/dist/{chunk-D2BTU7QI.mjs → chunk-7E4UXCEX.mjs} +223 -169
  2. package/dist/{chunk-QGONLJLE.mjs → chunk-B5ALKYD5.mjs} +210 -184
  3. package/dist/{chunk-RR44PSKH.mjs → chunk-BBDFSTIA.mjs} +3 -1
  4. package/dist/{chunk-M6U2RKBD.mjs → chunk-DSQSQ4RG.mjs} +127 -62
  5. package/dist/{chunk-5SCDQSNA.mjs → chunk-JI5KV4QI.mjs} +2 -2
  6. package/dist/{chunk-NIRCF54M.mjs → chunk-RZLM3M5R.mjs} +2 -2
  7. package/dist/{chunk-HFMKCV4L.mjs → chunk-TK62UB5F.mjs} +27 -16
  8. package/dist/events.js +29 -16
  9. package/dist/events.mjs +3 -3
  10. package/dist/index.js +1060 -930
  11. package/dist/index.mjs +9 -38
  12. package/dist/modals.js +212 -184
  13. package/dist/modals.mjs +3 -3
  14. package/dist/pages.js +841 -684
  15. package/dist/pages.mjs +6 -6
  16. package/dist/primitives.js +3 -1
  17. package/dist/primitives.mjs +1 -1
  18. package/dist/styles.css +1 -1
  19. package/dist/tailwind.css +1 -1
  20. package/dist/trading.js +535 -442
  21. package/dist/trading.mjs +4 -4
  22. package/dist/types/auth/connect-button-view/connect-button-view.types.d.mts +0 -2
  23. package/dist/types/auth/connect-button-view/connect-button-view.types.d.ts +0 -2
  24. package/dist/types/auth/connect-button-view/index.d.mts +1 -1
  25. package/dist/types/auth/connect-button-view/index.d.ts +1 -1
  26. package/dist/types/pages/user-profile/components/available-balance-card.d.mts +3 -1
  27. package/dist/types/pages/user-profile/components/available-balance-card.d.ts +3 -1
  28. package/dist/types/pages/user-profile/cost-basis-display.d.mts +29 -0
  29. package/dist/types/pages/user-profile/cost-basis-display.d.ts +29 -0
  30. package/dist/types/pages/user-profile/user-profile.types.d.mts +8 -0
  31. package/dist/types/pages/user-profile/user-profile.types.d.ts +8 -0
  32. package/dist/types/primitives/modal/index.d.mts +1 -1
  33. package/dist/types/primitives/modal/index.d.ts +1 -1
  34. package/dist/types/primitives/modal/modal.types.d.mts +6 -0
  35. package/dist/types/primitives/modal/modal.types.d.ts +6 -0
  36. package/dist/types/trading/place-order/index.place-order.utils.d.mts +12 -1
  37. package/dist/types/trading/place-order/index.place-order.utils.d.ts +12 -1
  38. package/package.json +3 -3
package/dist/events.js CHANGED
@@ -6623,7 +6623,8 @@ var ModalContainer = ({
6623
6623
  maxWidth = "600px",
6624
6624
  classNames,
6625
6625
  "aria-label": ariaLabel,
6626
- "aria-labelledby": ariaLabelledBy
6626
+ "aria-labelledby": ariaLabelledBy,
6627
+ onOpenAutoFocus
6627
6628
  }) => {
6628
6629
  const {
6629
6630
  general: { rootClassName },
@@ -6654,6 +6655,7 @@ var ModalContainer = ({
6654
6655
  ),
6655
6656
  "aria-label": ariaLabel,
6656
6657
  "aria-labelledby": ariaLabelledBy,
6658
+ onOpenAutoFocus,
6657
6659
  onCloseAutoFocus: (event) => {
6658
6660
  event.preventDefault();
6659
6661
  },
@@ -11411,13 +11413,14 @@ var parseSettlementDateMs = (value) => {
11411
11413
  var isDateLikeDifference = (canonicalKey) => {
11412
11414
  return canonicalKey === "resolution_timing" || canonicalKey === "start_date" || canonicalKey === "end_date";
11413
11415
  };
11414
- var hasEqualNormalizedDateValues = (difference, canonicalKey) => {
11415
- if (!isDateLikeDifference(canonicalKey)) return false;
11416
+ var hasEqualValuesAcrossVenues = (difference) => {
11416
11417
  const values = Object.values(difference.perVenue);
11417
11418
  if (values.length < 2) return false;
11418
11419
  const timestamps = values.map(parseSettlementDateMs);
11419
- if (timestamps.some((timestamp) => timestamp === null)) return false;
11420
- return new Set(timestamps).size === 1;
11420
+ if (timestamps.every((timestamp) => timestamp !== null)) {
11421
+ return new Set(timestamps).size === 1;
11422
+ }
11423
+ return new Set(values.map(normalizeSettlementForCompare)).size === 1;
11421
11424
  };
11422
11425
  var resolveDifferenceSeverity = (difference, canonicalKey) => {
11423
11426
  var _a;
@@ -11452,7 +11455,7 @@ var prepareSettlementDifferences = (differences) => {
11452
11455
  if (!title2 || Object.keys(perVenue).length === 0) continue;
11453
11456
  const difference = __spreadProps(__spreadValues({}, rawDifference), { title: title2, perVenue });
11454
11457
  const canonicalKey = resolveCanonicalDifferenceKey(difference);
11455
- if (hasEqualNormalizedDateValues(difference, canonicalKey)) continue;
11458
+ if (hasEqualValuesAcrossVenues(difference)) continue;
11456
11459
  const existing = byCanonicalKey.get(canonicalKey);
11457
11460
  if (existing) {
11458
11461
  byCanonicalKey.set(canonicalKey, __spreadProps(__spreadValues({}, existing), {
@@ -11466,7 +11469,7 @@ var prepareSettlementDifferences = (differences) => {
11466
11469
  originalIndex
11467
11470
  }));
11468
11471
  }
11469
- return Array.from(byCanonicalKey.values()).sort((left, right) => {
11472
+ return Array.from(byCanonicalKey.values()).filter((difference) => !hasEqualValuesAcrossVenues(difference)).sort((left, right) => {
11470
11473
  const severityDelta = Number(right.severity === "critical") - Number(left.severity === "critical");
11471
11474
  if (severityDelta !== 0) return severityDelta;
11472
11475
  return left.originalIndex - right.originalIndex;
@@ -11480,9 +11483,7 @@ var resolveSettlementVenueLabel = (venue, labels) => {
11480
11483
  return (_a = labels.venues[venue]) != null ? _a : formatVenueFallbackLabel(venue);
11481
11484
  };
11482
11485
  var resolveDifferenceVenueKeys = (difference, settlementVenues) => {
11483
- const explicitVenues = Object.keys(difference.perVenue);
11484
- if (!isDateLikeDifference(difference.canonicalKey)) return explicitVenues;
11485
- const allVenues = [...settlementVenues != null ? settlementVenues : [], ...explicitVenues];
11486
+ const allVenues = [...settlementVenues != null ? settlementVenues : [], ...Object.keys(difference.perVenue)];
11486
11487
  return Array.from(new Set(allVenues.filter((venue) => venue.trim().length > 0)));
11487
11488
  };
11488
11489
  var resolveDifferenceIconClassName = (canonicalKey) => {
@@ -11521,6 +11522,12 @@ var buildSettlementVenueRules = ({
11521
11522
  if (!venueRules.includes(content2)) venueRules.push(content2);
11522
11523
  rulesByVenue.set(venue2, venueRules);
11523
11524
  }
11525
+ if (rulesByVenue.size > 0) {
11526
+ for (const venue2 of settlementVenues != null ? settlementVenues : []) {
11527
+ const trimmedVenue = venue2.trim();
11528
+ if (trimmedVenue && !rulesByVenue.has(trimmedVenue)) rulesByVenue.set(trimmedVenue, []);
11529
+ }
11530
+ }
11524
11531
  return Array.from(rulesByVenue, ([venue2, contents]) => ({
11525
11532
  venue: venue2,
11526
11533
  content: contents.join("\n\n")
@@ -11530,6 +11537,11 @@ var buildSettlementVenueRules = ({
11530
11537
  const venue = (_b = settlementVenues == null ? void 0 : settlementVenues.find((candidate) => candidate.trim().length > 0)) == null ? void 0 : _b.trim();
11531
11538
  return content && venue ? [{ venue, content }] : [];
11532
11539
  };
11540
+ var repeatsQuestion = (content, question) => {
11541
+ const normalizedQuestion = normalizeSettlementForCompare(question != null ? question : "");
11542
+ if (!normalizedQuestion) return false;
11543
+ return normalizeSettlementForCompare(content) === normalizedQuestion;
11544
+ };
11533
11545
  var isDuplicatedByVenueRules = (content, venueRules) => {
11534
11546
  const normalizedContent = normalizeSettlementForCompare(content);
11535
11547
  if (!normalizedContent) return false;
@@ -11546,8 +11558,8 @@ var SettlementVenueRules = ({
11546
11558
  /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("p", { className: "text-agg-sm font-agg-bold leading-agg-5 text-agg-foreground", children: labels.trading.settlementFullRulesTitle }),
11547
11559
  /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "flex w-full flex-col items-start gap-4", children: rules.map((rule) => {
11548
11560
  const venueLabel = resolveSettlementVenueLabel(rule.venue, labels);
11549
- return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("details", { className: "group/agg-settlement-rule w-full", children: [
11550
- /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("summary", { className: "flex cursor-pointer list-none items-center gap-2 text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground group-hover/agg-settlement-rule:text-agg-muted-foreground transition-colors marker:hidden", children: [
11561
+ return /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("details", { className: "w-full", children: [
11562
+ /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("summary", { className: "group/agg-settlement-rule flex w-fit cursor-pointer list-none items-center gap-2 text-agg-sm font-agg-normal leading-agg-5 text-agg-foreground transition-colors marker:hidden", children: [
11551
11563
  /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
11552
11564
  VenueLogo,
11553
11565
  {
@@ -11571,7 +11583,7 @@ var SettlementVenueRules = ({
11571
11583
  }
11572
11584
  )
11573
11585
  ] }),
11574
- /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "mt-3 pl-6", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(SettlementTextRenderer, { content: rule.content }) })
11586
+ /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { className: "mt-3 pl-6", children: rule.content ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(SettlementTextRenderer, { content: rule.content }) : /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("p", { className: "text-agg-sm font-agg-normal leading-agg-5 text-agg-muted-foreground", children: labels.trading.settlementValueUnavailable }) })
11575
11587
  ] }, rule.venue);
11576
11588
  }) })
11577
11589
  ] });
@@ -11599,9 +11611,10 @@ var Settlement = ({
11599
11611
  }),
11600
11612
  [eventDescription, marketDescription, primaryRules]
11601
11613
  );
11614
+ const isSingleVenueCluster = settlementVenues !== void 0 && settlementVenues.length < 2;
11602
11615
  const settlementDifferences = (0, import_react16.useMemo)(
11603
- () => prepareSettlementDifferences(settlementDiff == null ? void 0 : settlementDiff.differences),
11604
- [settlementDiff == null ? void 0 : settlementDiff.differences]
11616
+ () => isSingleVenueCluster ? [] : prepareSettlementDifferences(settlementDiff == null ? void 0 : settlementDiff.differences),
11617
+ [isSingleVenueCluster, settlementDiff == null ? void 0 : settlementDiff.differences]
11605
11618
  );
11606
11619
  const eventBlock = (_a = blocks.find((block) => block.key === "eventDescription")) != null ? _a : null;
11607
11620
  const marketBlock = (_b = blocks.find((block) => block.key === "marketDescription")) != null ? _b : null;
@@ -11617,7 +11630,7 @@ var Settlement = ({
11617
11630
  );
11618
11631
  const hasSettlementDifferences = settlementDifferences.length > 0;
11619
11632
  const hasVenueSettlementRules = venueRuleBlocks.length > 0;
11620
- const standaloneEventBlock = eventBlock && !isDuplicatedByVenueRules(eventBlock.content, venueRuleBlocks) ? eventBlock : null;
11633
+ const standaloneEventBlock = eventBlock && !isDuplicatedByVenueRules(eventBlock.content, venueRuleBlocks) && !repeatsQuestion(eventBlock.content, question) ? eventBlock : null;
11621
11634
  const standaloneMarketBlock = hasVenueSettlementRules ? null : marketBlock;
11622
11635
  const standalonePrimaryRulesBlock = hasVenueSettlementRules ? null : primaryRulesBlock;
11623
11636
  const hasStandaloneSettlementText = hasVenueSettlementRules ? standaloneEventBlock !== null : blocks.length > 0;
package/dist/events.mjs CHANGED
@@ -17,13 +17,13 @@ import {
17
17
  orderbookRowLimitDefault,
18
18
  resolveEventDetailsSyncKey,
19
19
  useCenterOrderbookSpread
20
- } from "./chunk-NIRCF54M.mjs";
20
+ } from "./chunk-RZLM3M5R.mjs";
21
21
  import {
22
22
  formatProbabilityCents,
23
23
  resolveOrderBookRows,
24
24
  resolveUnifiedOrderBookEntries
25
- } from "./chunk-HFMKCV4L.mjs";
26
- import "./chunk-RR44PSKH.mjs";
25
+ } from "./chunk-TK62UB5F.mjs";
26
+ import "./chunk-BBDFSTIA.mjs";
27
27
  export {
28
28
  EventList,
29
29
  EventListItem,