@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 +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10396,11 +10396,14 @@ function useAiProposal(value, proposedValue, format = String) {
|
|
|
10396
10396
|
const onUserBlur = useCallback10(() => setIsReviewed((wasReviewed) => wasReviewed || hasTyped), [hasTyped]);
|
|
10397
10397
|
const hasProposal = proposedValue !== void 0;
|
|
10398
10398
|
const isAiMode = hasProposal && !hasTyped;
|
|
10399
|
+
const proposedText = hasProposal ? format(proposedValue) : void 0;
|
|
10400
|
+
const originalText = originalValue.current !== void 0 ? format(originalValue.current) : void 0;
|
|
10401
|
+
const isUnchanged = originalText === proposedText;
|
|
10399
10402
|
return {
|
|
10400
10403
|
effectiveValue: isAiMode ? proposedValue : value,
|
|
10401
10404
|
proposalProps: {
|
|
10402
|
-
proposedValue: isAiMode ?
|
|
10403
|
-
originalValue: hasProposal && !isReviewed &&
|
|
10405
|
+
proposedValue: isAiMode ? proposedText : void 0,
|
|
10406
|
+
originalValue: hasProposal && !isReviewed && !isUnchanged ? originalText : void 0,
|
|
10404
10407
|
onUserEdit,
|
|
10405
10408
|
onUserBlur
|
|
10406
10409
|
}
|