@wix/vibe-forms-app-plugin 0.12.0 → 0.14.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.9.0/forms-plugin-files-files.zip";
146977
+ var PLUGIN_FILES_ZIP_URL = "https://static.parastorage.com/services/vibe-forms-plugin-files/0.14.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,7 +147355,7 @@ 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
  {
@@ -147369,6 +147365,7 @@ const router = createBrowserRouter([
147369
147365
  {
147370
147366
  path: '/form',
147371
147367
  element: <FormAppPage />,
147368
+ loader: formAppPageLoader,
147372
147369
  },
147373
147370
  ],
147374
147371
  },
@@ -147394,13 +147391,23 @@ ${getRouterFileContent()}
147394
147391
 
147395
147392
  ## FormAppPage Usage
147396
147393
 
147397
- The FormAppPage is ALREADY IMPLEMENTED and does not accept any props - just import and use it!
147394
+ The FormAppPage is ALREADY IMPLEMENTED and uses React Router's loader pattern for data fetching.
147398
147395
 
147399
147396
  **Import Path:** Always use \`@/components/forms/FormAppPage\` - this is the correct path to the existing FormAppPage.
147400
147397
 
147398
+ **Required Imports:**
147401
147399
  \`\`\`tsx
147402
- // FormAppPage usage - no props needed
147403
- <FormAppPage />
147400
+ import { FormAppPage, formAppPageLoader } from '@/components/forms/FormAppPage';
147401
+ \`\`\`
147402
+
147403
+ **Router Configuration:**
147404
+ \`\`\tsx
147405
+ // FormAppPage usage with loader
147406
+ {
147407
+ path: '/form',
147408
+ element: <FormAppPage />,
147409
+ loader: formAppPageLoader,
147410
+ }
147404
147411
  \`\`\`
147405
147412
 
147406
147413
  **DO NOT IMPLEMENT FormAppPage - IT ALREADY EXISTS!**
@@ -147437,22 +147444,26 @@ import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from '
147437
147444
 
147438
147445
  ### ✅ ALLOWED: Only Use These Specific Components
147439
147446
  **ONLY use these pre-built form components:**
147440
- - \`FormAppPage\` - Main form page component
147441
- - \`FormAppFields\` - Form fields component
147442
- - \`FormAppForm\` - Form wrapper component
147447
+ - \`FormAppPage\` - Main form page component with loader
147448
+ - \`formAppPageLoader\` - Data loader for form configuration
147449
+ - \`FormAppFields\` - Form fields component with FIELD_MAP
147450
+ - \`FormAppForm\` - Form wrapper component with Wix headless forms
147451
+ - Individual field components: \`TextInput\`, \`TextArea\`, \`NumberInput\`, \`PhoneInput\`, \`Checkbox\`, \`RadioGroup\`, \`CheckboxGroup\`, \`Dropdown\`, \`FileUpload\`, \`SubmitButton\`, \`RichText\`
147443
147452
 
147444
147453
  ### What you MUST do:
147445
147454
  - **ONLY import and use** the specific form components listed above
147446
- - **ONLY integrate** form components into site routes
147455
+ - **ONLY integrate** form page into site routes with proper loader configuration
147447
147456
  - **USE EVERYTHING AS IS** from the forms components directory
147448
147457
  - **ONLY use** the exact import paths provided for form components
147458
+ - **ALWAYS include the loader** when using FormAppPage in router configuration
147449
147459
 
147450
147460
  ### 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
-
147461
+ - The FormAppPage uses Wix headless forms service for data loading
147462
+ - Form components use semantic color/font system classes (text-foreground, bg-background, etc.)
147463
+ - Form components handle onChange, onBlur, onFocus, onSubmit events automatically
147464
+ - Form components update form data automatically with proper validation
147465
+ - Form components handle validation and error display with consistent styling
147466
+ - Form components manage all form state and behavior using Wix forms SDK
147456
147467
 
147457
147468
  # THIRD TASK: CODE THE REST OF THE SITE PAGES
147458
147469
 
@@ -147488,12 +147499,13 @@ var generateData = async (env) => {
147488
147499
  env
147489
147500
  );
147490
147501
  console.log(`[${VERTICAL_NAME}-plugin-generateData] Generating mock data...`);
147491
- const mockSchema = await generateMockData();
147492
- const form = await es_exports.createForm(mockSchema);
147502
+ const form = await es_exports.createForm(MOCK_SCHEMA);
147493
147503
  const generatedData = {
147494
147504
  formId: form?._id,
147495
147505
  purpose: form.name,
147496
- formSchema: mockSchema
147506
+ formServiceConfig: {
147507
+ formId: form?._id
147508
+ }
147497
147509
  };
147498
147510
  console.log(`
147499
147511
  \x1B[34m ==== Forms data generation completed ==== \x1B[0m