@wix/vibe-forms-app-plugin 0.10.0 → 0.12.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 +86 -41
- package/dist/index.cjs.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -146974,7 +146974,7 @@ var import_adm_zip = __toESM(require_adm_zip());
|
|
|
146974
146974
|
// src/constants.ts
|
|
146975
146975
|
var VERTICAL_NAME = "forms-app";
|
|
146976
146976
|
var FORMS_APP_DEF_ID = "225dd912-7dea-4738-8688-4b8c6955ffc2";
|
|
146977
|
-
var PLUGIN_FILES_ZIP_URL = "https://static.parastorage.com/services/forms-plugin-files/0.
|
|
146977
|
+
var PLUGIN_FILES_ZIP_URL = "https://static.parastorage.com/services/vibe-forms-plugin-files/0.9.0/forms-plugin-files-files.zip";
|
|
146978
146978
|
|
|
146979
146979
|
// src/wix-apis.ts
|
|
146980
146980
|
var isErrorWithRequestId = (error) => {
|
|
@@ -147351,65 +147351,108 @@ var unzipAndMergePluginFiles = async (env, zipUrl) => {
|
|
|
147351
147351
|
};
|
|
147352
147352
|
|
|
147353
147353
|
// src/forms-app-instructions.ts
|
|
147354
|
-
var
|
|
147355
|
-
|
|
147356
|
-
|
|
147357
|
-
|
|
147358
|
-
|
|
147354
|
+
var getRouterFileContent = () => {
|
|
147355
|
+
return dedent_default`
|
|
147356
|
+
import { MemberProvider } from '@/integrations';
|
|
147357
|
+
import {
|
|
147358
|
+
createBrowserRouter,
|
|
147359
|
+
RouterProvider,
|
|
147360
|
+
Navigate,
|
|
147361
|
+
} from 'react-router-dom';
|
|
147362
|
+
import { FormAppPage } from './forms/FormAppPage';
|
|
147363
|
+
|
|
147364
|
+
const router = createBrowserRouter([
|
|
147365
|
+
{
|
|
147366
|
+
path: '/',
|
|
147367
|
+
element: <Navigate to="/form" />,
|
|
147368
|
+
children: [
|
|
147369
|
+
{
|
|
147370
|
+
path: '/form',
|
|
147371
|
+
element: <FormAppPage />,
|
|
147372
|
+
},
|
|
147373
|
+
],
|
|
147374
|
+
},
|
|
147375
|
+
]);
|
|
147376
|
+
`;
|
|
147377
|
+
};
|
|
147378
|
+
var getFormsCodingInstructions = () => dedent_default`
|
|
147359
147379
|
<forms_instructions>
|
|
147360
147380
|
|
|
147361
147381
|
Your tasks for implementing and integrating the Forms features of the site are:
|
|
147362
147382
|
|
|
147363
|
-
# FIRST TASK:
|
|
147383
|
+
# FIRST TASK: INTEGRATE THE FORMS ROUTES INTO THE SITE ROUTER
|
|
147364
147384
|
|
|
147365
|
-
|
|
147385
|
+
Integrate the forms routes into the existing router of the app.
|
|
147366
147386
|
|
|
147367
|
-
**🚨 CRITICAL:
|
|
147387
|
+
**🚨 CRITICAL: FormAppPage is ALREADY IMPLEMENTED! DO NOT create/implement it - just import and use it!**
|
|
147368
147388
|
|
|
147369
|
-
##
|
|
147370
|
-
|
|
147371
|
-
### Form component
|
|
147389
|
+
## Example Forms Router File
|
|
147390
|
+
You should not use it as is, but rather use the content of the file as reference for how to implement the router in the app.
|
|
147372
147391
|
\`\`\`tsx
|
|
147373
|
-
|
|
147374
|
-
import { FormComponent } from '@/components/forms/Form';
|
|
147375
|
-
|
|
147376
|
-
<div>
|
|
147377
|
-
<h1>${purpose}</h1>
|
|
147378
|
-
<FormComponent formServiceConfig={{ formId: "${formId}" }} />
|
|
147379
|
-
</div>
|
|
147392
|
+
${getRouterFileContent()}
|
|
147380
147393
|
\`\`\`
|
|
147381
147394
|
|
|
147382
|
-
##
|
|
147395
|
+
## FormAppPage Usage
|
|
147383
147396
|
|
|
147384
|
-
|
|
147397
|
+
The FormAppPage is ALREADY IMPLEMENTED and does not accept any props - just import and use it!
|
|
147385
147398
|
|
|
147386
|
-
**Import Path:** Always use \`@/components/forms/
|
|
147399
|
+
**Import Path:** Always use \`@/components/forms/FormAppPage\` - this is the correct path to the existing FormAppPage.
|
|
147387
147400
|
|
|
147388
147401
|
\`\`\`tsx
|
|
147389
|
-
//
|
|
147390
|
-
<
|
|
147391
|
-
|
|
147392
|
-
// Or with pre-loaded form data
|
|
147393
|
-
<FormComponent formServiceConfig={{ form: formData }} />
|
|
147402
|
+
// FormAppPage usage - no props needed
|
|
147403
|
+
<FormAppPage />
|
|
147394
147404
|
\`\`\`
|
|
147395
147405
|
|
|
147396
|
-
**DO NOT IMPLEMENT
|
|
147406
|
+
**DO NOT IMPLEMENT FormAppPage - IT ALREADY EXISTS!**
|
|
147397
147407
|
|
|
147398
147408
|
|
|
147399
147409
|
|
|
147400
147410
|
# SECOND TASK: FORMS CODE CHANGES:
|
|
147401
|
-
|
|
147402
|
-
|
|
147403
|
-
|
|
147404
|
-
|
|
147405
|
-
|
|
147406
|
-
|
|
147407
|
-
|
|
147408
|
-
|
|
147409
|
-
|
|
147410
|
-
|
|
147411
|
-
|
|
147412
|
-
|
|
147411
|
+
|
|
147412
|
+
## 🚨 CRITICAL RULE: FORMS APP WORKS ONLY WITH SPECIFIC COMPONENTS
|
|
147413
|
+
|
|
147414
|
+
**ABSOLUTE PROHIBITION: DO NOT EDIT, MODIFY, OR IMPLEMENT ANY FORM COMPONENTS OR FORM FIELDS CODE!**
|
|
147415
|
+
|
|
147416
|
+
### 🚫 FORBIDDEN: Custom Form Components
|
|
147417
|
+
**DO NOT implement custom form components or use generic form UI components!**
|
|
147418
|
+
|
|
147419
|
+
**NEVER use these imports:**
|
|
147420
|
+
\`\`\`tsx
|
|
147421
|
+
// ❌ FORBIDDEN - Do not use these generic form components
|
|
147422
|
+
import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from '@/components/ui/form';
|
|
147423
|
+
\`\`\`
|
|
147424
|
+
|
|
147425
|
+
**NEVER implement custom form components like:**
|
|
147426
|
+
- Custom form wrappers
|
|
147427
|
+
- Custom form fields
|
|
147428
|
+
- Custom form validation components
|
|
147429
|
+
- Custom form submission handlers
|
|
147430
|
+
|
|
147431
|
+
### What is FORBIDDEN:
|
|
147432
|
+
- **NEVER implement FormAppPage** - it already exists! Just import it from '@/components/forms/FormAppPage'
|
|
147433
|
+
- **NEVER edit any files** in <code>src/components/forms/</code> directory
|
|
147434
|
+
- **NEVER modify form fields code** - use all form components exactly as they are
|
|
147435
|
+
- **NEVER change form functionality** - all form logic is already implemented
|
|
147436
|
+
- **NEVER read form component files** for implementation purposes
|
|
147437
|
+
|
|
147438
|
+
### ✅ ALLOWED: Only Use These Specific Components
|
|
147439
|
+
**ONLY use these pre-built form components:**
|
|
147440
|
+
- \`FormAppPage\` - Main form page component
|
|
147441
|
+
- \`FormAppFields\` - Form fields component
|
|
147442
|
+
- \`FormAppForm\` - Form wrapper component
|
|
147443
|
+
|
|
147444
|
+
### What you MUST do:
|
|
147445
|
+
- **ONLY import and use** the specific form components listed above
|
|
147446
|
+
- **ONLY integrate** form components into site routes
|
|
147447
|
+
- **USE EVERYTHING AS IS** from the forms components directory
|
|
147448
|
+
- **ONLY use** the exact import paths provided for form components
|
|
147449
|
+
|
|
147450
|
+
### Form Components Handle Everything:
|
|
147451
|
+
- The FormAppPage handles onChange, onBlur, onFocus, onSubmit events
|
|
147452
|
+
- Form components update form data automatically
|
|
147453
|
+
- Form components handle validation and error display
|
|
147454
|
+
- Form components manage all form state and behavior
|
|
147455
|
+
|
|
147413
147456
|
|
|
147414
147457
|
# THIRD TASK: CODE THE REST OF THE SITE PAGES
|
|
147415
147458
|
|
|
@@ -147417,6 +147460,8 @@ Forms are configured using a \`formServiceConfig\` object. The FormComponent is
|
|
|
147417
147460
|
<strong>ALL FORMS FEATURES (submit button, validation, etc.) ARE ALREADY IMPLEMENTED BY THE FORMS COMPONENTS.</strong>
|
|
147418
147461
|
<strong>THE REST OF THE SITE PAGES SHOULD BE IMPLEMENTED AS USUAL ACCORDING TO THE PLAN AND USER REQUESTS, FOLLOWING THE OTHER INSTRUCTIONS IN THE CONTEXT.</strong>
|
|
147419
147462
|
|
|
147463
|
+
<strong>🚨 REMEMBER: Forms app works ONLY with FormAppPage, FormAppFields, and FormAppForm components. Do NOT use generic form UI components or implement custom form components!</strong>
|
|
147464
|
+
|
|
147420
147465
|
</important_notes>
|
|
147421
147466
|
|
|
147422
147467
|
</forms_instructions>
|
|
@@ -147456,7 +147501,7 @@ var generateData = async (env) => {
|
|
|
147456
147501
|
return generatedData;
|
|
147457
147502
|
};
|
|
147458
147503
|
var getInstructions = async (params) => {
|
|
147459
|
-
const actualInstructions = getFormsCodingInstructions(
|
|
147504
|
+
const actualInstructions = getFormsCodingInstructions();
|
|
147460
147505
|
console.log(
|
|
147461
147506
|
`[${VERTICAL_NAME}-plugin-getInstructions] Getting instructions`,
|
|
147462
147507
|
{
|