@homefile/components-v2 2.36.13 → 2.36.15
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.
|
@@ -416,8 +416,8 @@
|
|
|
416
416
|
}
|
|
417
417
|
},
|
|
418
418
|
"details": "Provide details about your home’s",
|
|
419
|
-
"homeMonitor": "
|
|
420
|
-
"HomieMessages": "
|
|
419
|
+
"homeMonitor": "Homi - Your Home Assistant",
|
|
420
|
+
"HomieMessages": "Homi Messages ({{ count }})",
|
|
421
421
|
"homeMonitoring": "I’m learning about your home…",
|
|
422
422
|
"homeMonitoringAlerts": "I have {{ count }} new messages for you.",
|
|
423
423
|
"monitorAlerts": {
|
|
@@ -440,9 +440,9 @@
|
|
|
440
440
|
},
|
|
441
441
|
"title": "Homi - Set Up",
|
|
442
442
|
"tutorialButton": "Start Quick Setup",
|
|
443
|
-
"tutorialDescription": "
|
|
444
|
-
"tutorialTitle": "Let’s quickly set up
|
|
445
|
-
"tutorialNote": "Just a few set-up questions to help
|
|
443
|
+
"tutorialDescription": "Homi helps you manage every aspect of your home. We've added a short overview to help you learn more about it.",
|
|
444
|
+
"tutorialTitle": "Let’s quickly set up Homi, your friendly AI home assistant.",
|
|
445
|
+
"tutorialNote": "Just a few set-up questions to help Homi get going."
|
|
446
446
|
},
|
|
447
447
|
"homeBoard": {
|
|
448
448
|
"addRecords": "Add Property Records",
|
|
@@ -484,7 +484,7 @@
|
|
|
484
484
|
"addItem": "Upload a picture of your home item. (e.g. refrigerator label)",
|
|
485
485
|
"addReceipt": "Add a picture of a purchase receipt.",
|
|
486
486
|
"subTitle": "Give them a try.",
|
|
487
|
-
"title": "
|
|
487
|
+
"title": "Homi does the work for you."
|
|
488
488
|
},
|
|
489
489
|
"householdItems": {
|
|
490
490
|
"headers": {
|
|
@@ -5,17 +5,15 @@ import { DrawerHeader, DrawerBody, Stack, Text, DrawerFooter, } from '@chakra-ui
|
|
|
5
5
|
import { IA } from '../../../assets/images';
|
|
6
6
|
import { ApplianceSteps, SimpleDynamicForm, FooterButtons, HomeAssistantPanelStep, PanelHeader, Loading, HomeAssistantWizardSteps, DynamicForm, } from '../../../components';
|
|
7
7
|
import { homeAssistantSteps } from '../../../helpers';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { homeAssistantProxy } from '../../../proxies';
|
|
9
|
+
import { getMutableFields } from '../../../utils';
|
|
10
10
|
export const HomeAssistantPanel = ({ children, currentForm, currentStep, onApplianceClick = () => { }, onBack, onClose, onNext, onSave, backDisabled, nextDisabled, hasCompleted, isLoading, }) => {
|
|
11
11
|
var _a, _b;
|
|
12
|
-
const { fields } = useSnapshot(dynamicFormProxy);
|
|
13
12
|
const [addedAppliances, updateAddedAppliances] = useState([]);
|
|
14
13
|
const title = (_b = (_a = homeAssistantSteps === null || homeAssistantSteps === void 0 ? void 0 : homeAssistantSteps[currentStep - 1]) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : '';
|
|
15
14
|
const text = `${t('homeAssistant.details')} ${title.toLowerCase()}:`;
|
|
16
15
|
const isAppliances = currentStep === 4;
|
|
17
16
|
const { setHighlight } = homeAssistantProxy;
|
|
18
|
-
const fieldsCopy = [...fields];
|
|
19
17
|
useEffect(() => {
|
|
20
18
|
var _a;
|
|
21
19
|
setHighlight(true);
|
|
@@ -47,7 +45,7 @@ export const HomeAssistantPanel = ({ children, currentForm, currentStep, onAppli
|
|
|
47
45
|
label: !hasCompleted && currentStep === 6
|
|
48
46
|
? t('buttons.finish')
|
|
49
47
|
: t('buttons.saveStep'),
|
|
50
|
-
onClick: () => onSave === null || onSave === void 0 ? void 0 : onSave(
|
|
48
|
+
onClick: () => onSave === null || onSave === void 0 ? void 0 : onSave(getMutableFields()),
|
|
51
49
|
}, button3: !hasCompleted && currentStep === 6
|
|
52
50
|
? undefined
|
|
53
51
|
: {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { dynamicFormProxy } from '../proxies';
|
|
1
2
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
|
+
import { snapshot } from 'valtio';
|
|
2
4
|
const MAX_DEPTH = 10;
|
|
3
5
|
const FIELDS_TO_IGNORE = ['_id', '__v', 'createdAt', 'updatedAt'];
|
|
4
6
|
const NESTED_RECURSION_DEPTH = 1;
|
|
@@ -100,7 +102,7 @@ value, visible = true) => {
|
|
|
100
102
|
value,
|
|
101
103
|
type: 'collapsible',
|
|
102
104
|
visible,
|
|
103
|
-
children: [childObj]
|
|
105
|
+
children: [childObj],
|
|
104
106
|
};
|
|
105
107
|
};
|
|
106
108
|
const renderObjectArray = (arr) => arr
|
|
@@ -142,3 +144,8 @@ const flattenObject = (obj, parentKey = '') => Object.entries(obj).reduce((acc,
|
|
|
142
144
|
}
|
|
143
145
|
return acc;
|
|
144
146
|
}, {});
|
|
147
|
+
export function getMutableFields() {
|
|
148
|
+
const snap = snapshot(dynamicFormProxy);
|
|
149
|
+
const cloned = structuredClone(snap.fields).map((field) => (Object.assign({}, field)));
|
|
150
|
+
return cloned;
|
|
151
|
+
}
|