@homebound/beam 4.1.0 → 4.2.0

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.cjs CHANGED
@@ -10861,11 +10861,14 @@ function useAiProposal(value, proposedValue, format = String) {
10861
10861
  const onUserBlur = (0, import_react35.useCallback)(() => setIsReviewed((wasReviewed) => wasReviewed || hasTyped), [hasTyped]);
10862
10862
  const hasProposal = proposedValue !== void 0;
10863
10863
  const isAiMode = hasProposal && !hasTyped;
10864
+ const proposedText = hasProposal ? format(proposedValue) : void 0;
10865
+ const originalText = originalValue.current !== void 0 ? format(originalValue.current) : void 0;
10866
+ const isUnchanged = originalText === proposedText;
10864
10867
  return {
10865
10868
  effectiveValue: isAiMode ? proposedValue : value,
10866
10869
  proposalProps: {
10867
- proposedValue: isAiMode ? format(proposedValue) : void 0,
10868
- originalValue: hasProposal && !isReviewed && originalValue.current !== void 0 ? format(originalValue.current) : void 0,
10870
+ proposedValue: isAiMode ? proposedText : void 0,
10871
+ originalValue: hasProposal && !isReviewed && !isUnchanged ? originalText : void 0,
10869
10872
  onUserEdit,
10870
10873
  onUserBlur
10871
10874
  }