@wix/vibe-forms-app-plugin 0.13.0 → 0.15.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
@@ -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/vibe-forms-plugin-files/0.12.0/forms-plugin-files-files.zip";
146977
+ var PLUGIN_FILES_ZIP_URL = "https://static.parastorage.com/services/vibe-forms-plugin-files/0.15.0/forms-plugin-files-files.zip";
146978
146978
 
146979
146979
  // src/wix-apis.ts
146980
146980
  var isErrorWithRequestId = (error) => {
@@ -147306,10 +147306,6 @@ var installFormsApp = async (env) => {
147306
147306
  await installWixApp(env, FORMS_APP_DEF_ID);
147307
147307
  console.log("[forms-app-plugin-install] Forms App installation completed");
147308
147308
  };
147309
- var generateMockData = async (env) => {
147310
- console.log(`[${VERTICAL_NAME}-plugin-generateData] Generating mock data...`);
147311
- return MOCK_SCHEMA;
147312
- };
147313
147309
  var unzipAndMergePluginFiles = async (env, zipUrl) => {
147314
147310
  console.log(
147315
147311
  `[${VERTICAL_NAME}-plugin-install] Unzipping plugin files from dependency...`
@@ -147359,18 +147355,13 @@ import {
147359
147355
  RouterProvider,
147360
147356
  Navigate,
147361
147357
  } from 'react-router-dom';
147362
- import { FormAppPage } from './forms/FormAppPage';
147358
+ import { FormAppPage, formAppPageLoader } from './forms/FormAppPage';
147363
147359
 
147364
147360
  const router = createBrowserRouter([
147365
147361
  {
147366
- path: '/',
147367
- element: <Navigate to="/form" />,
147368
- children: [
147369
- {
147370
- path: '/form',
147371
- element: <FormAppPage />,
147372
- },
147373
- ],
147362
+ path: '/forms/:formId',
147363
+ element: <FormAppPage />,
147364
+ loader: formAppPageLoader,
147374
147365
  },
147375
147366
  ]);
147376
147367
  `;
@@ -147394,17 +147385,21 @@ ${getRouterFileContent()}
147394
147385
 
147395
147386
  ## FormAppPage Usage
147396
147387
 
147397
- The FormAppPage is ALREADY IMPLEMENTED and does not accept any props - just import and use it!
147398
-
147399
- **Import Path:** Always use \`@/components/forms/FormAppPage\` - this is the correct path to the existing FormAppPage.
147388
+ The FormAppPage is ALREADY IMPLEMENTED and uses React Router's loader pattern for data fetching with slug-based routing.
147400
147389
 
147390
+ **Required Imports:**
147401
147391
  \`\`\`tsx
147402
- // FormAppPage usage - no props needed
147403
- <FormAppPage />
147392
+ import { FormAppPage, formAppPageLoader } from '@/components/forms/FormAppPage';
147404
147393
  \`\`\`
147405
147394
 
147406
- **DO NOT IMPLEMENT FormAppPage - IT ALREADY EXISTS!**
147407
-
147395
+ **Router Configuration:**
147396
+ \`\`\tsx
147397
+ {
147398
+ path: '/forms/:formId',
147399
+ element: <FormAppPage />,
147400
+ loader: formAppPageLoader,
147401
+ }
147402
+ \`\`\`
147408
147403
 
147409
147404
 
147410
147405
  # SECOND TASK: FORMS CODE CHANGES:
@@ -147429,7 +147424,6 @@ import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from '
147429
147424
  - Custom form submission handlers
147430
147425
 
147431
147426
  ### What is FORBIDDEN:
147432
- - **NEVER implement FormAppPage** - it already exists! Just import it from '@/components/forms/FormAppPage'
147433
147427
  - **NEVER edit any files** in <code>src/components/forms/</code> directory
147434
147428
  - **NEVER modify form fields code** - use all form components exactly as they are
147435
147429
  - **NEVER change form functionality** - all form logic is already implemented
@@ -147437,22 +147431,25 @@ import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from '
147437
147431
 
147438
147432
  ### ✅ ALLOWED: Only Use These Specific Components
147439
147433
  **ONLY use these pre-built form components:**
147440
- - \`FormAppPage\` - Main form page component
147441
- - \`FormAppFields\` - Form fields component
147442
- - \`FormAppForm\` - Form wrapper component
147434
+ - \`FormAppPage\` - Main form page component with loader
147435
+ - \`formAppPageLoader\` - Data loader for form configuration
147436
+ - \`FormAppFields\` - Form fields component with FIELD_MAP
147437
+ - \`FormAppForm\` - Form wrapper component with Wix headless forms
147438
+ - Individual field components: \`TextInput\`, \`TextArea\`, \`NumberInput\`, \`PhoneInput\`, \`Checkbox\`, \`RadioGroup\`, \`CheckboxGroup\`, \`Dropdown\`, \`FileUpload\`, \`SubmitButton\`, \`RichText\`
147443
147439
 
147444
147440
  ### What you MUST do:
147445
- - **ONLY import and use** the specific form components listed above
147446
- - **ONLY integrate** form components into site routes
147441
+ - **ONLY integrate** form page into site routes with proper loader configuration
147447
147442
  - **USE EVERYTHING AS IS** from the forms components directory
147448
- - **ONLY use** the exact import paths provided for form components
147443
+ - **ALWAYS include the loader** when using FormAppPage in router configuration
147449
147444
 
147450
147445
  ### 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
-
147446
+ - The FormAppPage uses Wix headless forms service for data loading with the formId from the URL slug
147447
+ - The loader receives the formId parameter from the route (e.g., \`/forms/3d2d2976-742e-447e-bbb9-9a92ac6a5376\` → formId = "3d2d2976-742e-447e-bbb9-9a92ac6a5376")
147448
+ - Form components use semantic color/font system classes (text-foreground, bg-background, etc.)
147449
+ - Form components handle onChange, onBlur, onFocus, onSubmit events automatically
147450
+ - Form components update form data automatically with proper validation
147451
+ - Form components handle validation and error display with consistent styling
147452
+ - Form components manage all form state and behavior using Wix forms SDK
147456
147453
 
147457
147454
  # THIRD TASK: CODE THE REST OF THE SITE PAGES
147458
147455
 
@@ -147460,8 +147457,6 @@ import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from '
147460
147457
  <strong>ALL FORMS FEATURES (submit button, validation, etc.) ARE ALREADY IMPLEMENTED BY THE FORMS COMPONENTS.</strong>
147461
147458
  <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>
147462
147459
 
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
-
147465
147460
  </important_notes>
147466
147461
 
147467
147462
  </forms_instructions>
@@ -147488,12 +147483,13 @@ var generateData = async (env) => {
147488
147483
  env
147489
147484
  );
147490
147485
  console.log(`[${VERTICAL_NAME}-plugin-generateData] Generating mock data...`);
147491
- const mockSchema = await generateMockData();
147492
- const form = await es_exports.createForm(mockSchema);
147486
+ const form = await es_exports.createForm(MOCK_SCHEMA);
147493
147487
  const generatedData = {
147494
147488
  formId: form?._id,
147495
147489
  purpose: form.name,
147496
- formSchema: mockSchema
147490
+ formServiceConfig: {
147491
+ formId: form?._id
147492
+ }
147497
147493
  };
147498
147494
  console.log(`
147499
147495
  \x1B[34m ==== Forms data generation completed ==== \x1B[0m