@wix/vibe-forms-app-plugin 0.8.0 → 0.10.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 +21 -26
- package/dist/index.cjs.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -147364,56 +147364,51 @@ Your tasks for implementing and integrating the Forms features of the site are:
|
|
|
147364
147364
|
|
|
147365
147365
|
Add the form component on a site page.
|
|
147366
147366
|
|
|
147367
|
+
**🚨 CRITICAL: FormComponent is ALREADY IMPLEMENTED! DO NOT create/implement it - just import and use it!**
|
|
147368
|
+
|
|
147367
147369
|
## Usage Examples
|
|
147368
147370
|
|
|
147369
147371
|
### Form component
|
|
147370
147372
|
\`\`\`tsx
|
|
147373
|
+
// Import the existing FormComponent (DO NOT implement it!)
|
|
147371
147374
|
import { FormComponent } from '@/components/forms/Form';
|
|
147372
147375
|
|
|
147373
147376
|
<div>
|
|
147374
147377
|
<h1>${purpose}</h1>
|
|
147375
|
-
<FormComponent formServiceConfig={{
|
|
147378
|
+
<FormComponent formServiceConfig={{ formId: "${formId}" }} />
|
|
147376
147379
|
</div>
|
|
147377
147380
|
\`\`\`
|
|
147378
147381
|
|
|
147379
147382
|
## Form Service Configuration
|
|
147380
147383
|
|
|
147381
|
-
Forms are configured using a \`formServiceConfig\` object
|
|
147382
|
-
|
|
147383
|
-
\`\`\`tsx
|
|
147384
|
-
interface FormProps {
|
|
147385
|
-
formServiceConfig: {
|
|
147386
|
-
form?: forms.Form; // Pre-loaded form data (SSR/SSG)
|
|
147387
|
-
formId?: string; // Form ID for lazy loading (client-side)
|
|
147388
|
-
};
|
|
147389
|
-
}
|
|
147384
|
+
Forms are configured using a \`formServiceConfig\` object. The FormComponent is ALREADY IMPLEMENTED - just import and use it!
|
|
147390
147385
|
|
|
147391
|
-
|
|
147386
|
+
**Import Path:** Always use \`@/components/forms/Form\` - this is the correct path to the existing FormComponent.
|
|
147392
147387
|
|
|
147393
|
-
|
|
147388
|
+
\`\`\`tsx
|
|
147389
|
+
// Example usage with formId
|
|
147390
|
+
<FormComponent formServiceConfig={{ formId: "${formId}" }} />
|
|
147394
147391
|
|
|
147395
|
-
// Or with pre-loaded data
|
|
147396
|
-
|
|
147397
|
-
form: formData, // Use pre-loaded form data
|
|
147398
|
-
};
|
|
147392
|
+
// Or with pre-loaded form data
|
|
147393
|
+
<FormComponent formServiceConfig={{ form: formData }} />
|
|
147399
147394
|
\`\`\`
|
|
147400
147395
|
|
|
147396
|
+
**DO NOT IMPLEMENT FormComponent - IT ALREADY EXISTS!**
|
|
147397
|
+
|
|
147401
147398
|
|
|
147402
147399
|
|
|
147403
147400
|
# SECOND TASK: FORMS CODE CHANGES:
|
|
147401
|
+
- **NEVER implement FormComponent - it already exists!** Just import it from '@/components/forms/Form'
|
|
147404
147402
|
- The general instruction is to NOT CHANGE THE FORMS COMPONENTS CODE and only integrate the forms components into a site page.
|
|
147405
147403
|
- The FormComponent handles the onChange, onBlur, onFocus, onSubmit, etc. events and updates the form data. It also handles validation & showing errors.
|
|
147406
|
-
- i.e DO NOT EDIT or READ ANY FILE in <code
|
|
147404
|
+
- i.e DO NOT EDIT or READ ANY FILE in <code>src/components/forms/</code> USE EVERYTHING AS IS!!
|
|
147407
147405
|
<code-changes-exceptions>
|
|
147408
|
-
-
|
|
147409
|
-
-
|
|
147410
|
-
|
|
147411
|
-
|
|
147412
|
-
|
|
147413
|
-
|
|
147414
|
-
\`\`\`
|
|
147415
|
-
|
|
147416
|
-
and change the static text the translate it to the new language.
|
|
147406
|
+
- **ONLY** make changes to forms components when the user explicitly requests language translation
|
|
147407
|
+
- **ONLY** edit these specific files for language changes:
|
|
147408
|
+
- \`src/components/forms/Form.tsx\` - for form-level text
|
|
147409
|
+
- \`src/components/forms/fields.tsx\` - for field-level text
|
|
147410
|
+
- **DO NOT** edit any other forms component files
|
|
147411
|
+
- **DO NOT** change functionality, only translate static text strings
|
|
147417
147412
|
</code-changes-exceptions>
|
|
147418
147413
|
|
|
147419
147414
|
# THIRD TASK: CODE THE REST OF THE SITE PAGES
|