@ai-matrx/records-ui 0.93.85 → 0.93.86

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/index.d.cts CHANGED
@@ -2320,7 +2320,7 @@ interface CustomFieldsAgentDoor {
2320
2320
  setValues: (values: CustomFieldValuesRequest) => Promise<CustomFieldSetResult>;
2321
2321
  }
2322
2322
  declare const ADDABLE_TYPES: {
2323
- value: "number" | "attachment" | "currency" | "datetime" | "email" | "text" | "member" | "percent" | "phone" | "url" | "long_text";
2323
+ value: "number" | "member" | "text" | "long_text" | "currency" | "percent" | "datetime" | "email" | "url" | "phone" | "attachment";
2324
2324
  label: string;
2325
2325
  }[];
2326
2326
  /**
package/dist/index.d.ts CHANGED
@@ -2320,7 +2320,7 @@ interface CustomFieldsAgentDoor {
2320
2320
  setValues: (values: CustomFieldValuesRequest) => Promise<CustomFieldSetResult>;
2321
2321
  }
2322
2322
  declare const ADDABLE_TYPES: {
2323
- value: "number" | "attachment" | "currency" | "datetime" | "email" | "text" | "member" | "percent" | "phone" | "url" | "long_text";
2323
+ value: "number" | "member" | "text" | "long_text" | "currency" | "percent" | "datetime" | "email" | "url" | "phone" | "attachment";
2324
2324
  label: string;
2325
2325
  }[];
2326
2326
  /**
package/dist/index.js CHANGED
@@ -31517,14 +31517,14 @@ function ViewFilter({ tableId, view, onApply, className }) {
31517
31517
 
31518
31518
  // src/toolbarFit.ts
31519
31519
  import { useEffect as useEffect81, useState as useState93 } from "react";
31520
- var FOLDED_GUESS = { look: 104, chooser: 96, tools: 120, share: 0 };
31520
+ var FOLDED_GUESS = { look: 104, chooser: 96, tools: 120 };
31521
+ var SLOT_MIN = 36;
31521
31522
  function toolbarFold(input) {
31522
31523
  const { available, needsNow, gap, folded } = input;
31523
31524
  const pieces = [
31524
31525
  { piece: input.look, stage: 1, guess: FOLDED_GUESS.look },
31525
31526
  { piece: input.chooser, stage: 2, guess: FOLDED_GUESS.chooser },
31526
- ...input.tools ? [{ piece: input.tools, stage: 3, guess: FOLDED_GUESS.tools }] : [],
31527
- ...input.tools && input.share ? [{ piece: input.share, stage: 4, guess: FOLDED_GUESS.share }] : []
31527
+ ...input.tools ? [{ piece: input.tools, stage: 3, guess: FOLDED_GUESS.tools }] : []
31528
31528
  ];
31529
31529
  const widthAt = ({ piece, stage, guess }, fold) => {
31530
31530
  if (piece.now === 0 && piece.full === null) return 0;
@@ -31532,13 +31532,18 @@ function toolbarFold(input) {
31532
31532
  return piece.full ?? piece.now;
31533
31533
  };
31534
31534
  const withGap = (width) => width > 0 ? width + gap : 0;
31535
- const base = pieces.reduce((rest, p) => rest - withGap(p.piece.now), needsNow);
31536
- const stages = input.tools ? input.share ? [0, 1, 2, 3, 4] : [0, 1, 2, 3] : [0, 1, 2];
31537
- const needs = stages.map((fold) => pieces.reduce((sum, p) => sum + withGap(widthAt(p, fold)), base));
31535
+ const shareNow = input.share ? withGap(input.share.now) : 0;
31536
+ const base = pieces.reduce((rest, p) => rest - withGap(p.piece.now), needsNow - shareNow);
31537
+ const stages = input.tools ? [0, 1, 2, 3] : [0, 1, 2];
31538
+ const shareOn = input.share ? withGap(input.share.full ?? input.share.now) : 0;
31539
+ const needs = stages.map((fold) => pieces.reduce((sum, p) => sum + withGap(widthAt(p, fold)), base + shareOn));
31538
31540
  const fits = needs.findIndex((need) => need <= available + 0.5);
31539
31541
  if (fits >= 0) return stages[fits];
31540
31542
  const least = Math.min(...needs);
31541
- return stages[needs.findIndex((need) => need <= least + 0.5)];
31543
+ const most = stages[needs.findIndex((need) => need <= least + 0.5)];
31544
+ if (most < 3 || !input.tools || !input.share) return most;
31545
+ const fixed = pieces.reduce((sum, p) => sum + withGap(p.stage === 3 ? SLOT_MIN : widthAt(p, 3)), base + shareOn);
31546
+ return fixed > available + 0.5 ? 4 : 3;
31542
31547
  }
31543
31548
  function naturalWidth(el) {
31544
31549
  const html = el;