@unlev/exeq 0.3.2 → 0.3.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.
package/dist/index.mjs CHANGED
@@ -2167,7 +2167,7 @@ async function renderFieldsOnPages(pages, fields, getFont, getSignature) {
2167
2167
  const font = await getFont(field.fontFamily || "Helvetica");
2168
2168
  const spacing = field.letterSpacing || 0;
2169
2169
  const textWidthAtSize = (text, size) => font.widthOfTextAtSize(text, size) + spacing * (text.length - 1);
2170
- let fontSize = Math.min(field.fontSize, h * 0.7);
2170
+ let fontSize = field.autoShrink ? Math.min(field.fontSize, h * 0.7) : field.fontSize;
2171
2171
  if (field.autoShrink) {
2172
2172
  const padding = 4;
2173
2173
  while (fontSize > 4) {
@@ -2744,9 +2744,9 @@ ${row.join(",")}`, "csv");
2744
2744
  );
2745
2745
  }, [signer, handleFieldUpdate, setSelectedFieldId]);
2746
2746
  useEffect3(() => {
2747
- const sigFields = fields.filter((f) => f.assignee === signer && f.type === "signature" && f.value);
2748
- if (sigFields.length > 0) {
2749
- const dateStr = (/* @__PURE__ */ new Date()).toLocaleDateString();
2747
+ const dateStr = (/* @__PURE__ */ new Date()).toLocaleDateString();
2748
+ const needsFill = fields.some((f) => f.assignee === signer && f.type === "signed-date" && !f.value);
2749
+ if (needsFill) {
2750
2750
  setFields((prev) => prev.map((f) => {
2751
2751
  if (f.assignee === signer && f.type === "signed-date" && !f.value) {
2752
2752
  return { ...f, value: dateStr };
@@ -2754,7 +2754,7 @@ ${row.join(",")}`, "csv");
2754
2754
  return f;
2755
2755
  }));
2756
2756
  }
2757
- }, [fields.filter((f) => f.type === "signature" && f.value).length]);
2757
+ }, [signer, fields.filter((f) => f.type === "signature" && f.value).length]);
2758
2758
  useEffect3(() => {
2759
2759
  const hasFormulas = fields.some((f) => f.formula);
2760
2760
  if (!hasFormulas) return;