@wix/ditto-codegen-public 1.0.20 → 1.0.22

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/out.js CHANGED
@@ -74903,6 +74903,35 @@ var require_main = __commonJS({
74903
74903
  }
74904
74904
  });
74905
74905
 
74906
+ // dist/readAccessTokenFromDevMachine.js
74907
+ var require_readAccessTokenFromDevMachine = __commonJS({
74908
+ "dist/readAccessTokenFromDevMachine.js"(exports2) {
74909
+ "use strict";
74910
+ Object.defineProperty(exports2, "__esModule", { value: true });
74911
+ exports2.readAccessTokenFromDevMachine = readAccessTokenFromDevMachine;
74912
+ var fs_1 = require("fs");
74913
+ function readAccessTokenFromDevMachine() {
74914
+ const authFilePath = "/root/.wix/auth/api-key.json";
74915
+ if (!(0, fs_1.existsSync)(authFilePath)) {
74916
+ console.warn(`\u26A0\uFE0F ${authFilePath} doesn't exist so can't use it to get access token`);
74917
+ return void 0;
74918
+ }
74919
+ try {
74920
+ const fileContent = (0, fs_1.readFileSync)(authFilePath, "utf8");
74921
+ const authData = JSON.parse(fileContent);
74922
+ if (typeof authData.token === "string") {
74923
+ return authData.token;
74924
+ }
74925
+ console.warn(`\u26A0\uFE0F ${authFilePath} doesn't contain the auth token property`);
74926
+ return void 0;
74927
+ } catch (error) {
74928
+ console.warn(`\u26A0\uFE0F ${authFilePath} isn't found or isn't parseable`);
74929
+ return void 0;
74930
+ }
74931
+ }
74932
+ }
74933
+ });
74934
+
74906
74935
  // dist/context.js
74907
74936
  var require_context = __commonJS({
74908
74937
  "dist/context.js"(exports2) {
@@ -74915,6 +74944,7 @@ var require_context = __commonJS({
74915
74944
  var CodeGenService_1 = require_CodeGenService();
74916
74945
  var dotenv_1 = __importDefault2(require_main());
74917
74946
  var path_1 = __importDefault2(require("path"));
74947
+ var readAccessTokenFromDevMachine_1 = require_readAccessTokenFromDevMachine();
74918
74948
  dotenv_1.default.config({ path: path_1.default.join(__dirname, "../.env"), override: true });
74919
74949
  var HistoryManager = class {
74920
74950
  constructor() {
@@ -74939,7 +74969,7 @@ var require_context = __commonJS({
74939
74969
  projectId: process.env.PROJECT_ID || "test",
74940
74970
  apiKey: process.env.ANTHROPIC_API_KEY,
74941
74971
  siteId: process.env.SITE_ID,
74942
- accessToken: process.env.ACCESS_TOKEN,
74972
+ accessToken: (0, readAccessTokenFromDevMachine_1.readAccessTokenFromDevMachine)() || process.env.ACCESS_TOKEN,
74943
74973
  hasActiveJobs: () => {
74944
74974
  return Object.keys(exports2.ctx.activeJobs).some((jobId) => exports2.ctx.activeJobs[jobId] === CodeGenService_1.TaskStatus.RUNNING);
74945
74975
  },
@@ -114344,11 +114374,24 @@ var require_load_examples = __commonJS({
114344
114374
  [types.CustomElementPlugin]: [],
114345
114375
  [types.CustomElementWidget]: []
114346
114376
  }
114377
+ },
114378
+ SurveyManager: {
114379
+ path: "survey-manager",
114380
+ description: "A dashboard app that allows administrators to create and manage rating (1-5) survey questions and view aggregated results",
114381
+ files: {
114382
+ [types.APIExtension]: [],
114383
+ [types.DashboardPage]: ["survey-manager/src/dashboard/pages/page.tsx"],
114384
+ [types.EmbeddedScript]: [],
114385
+ [types.ServicePluginExtension]: [],
114386
+ [types.CustomElementPlugin]: [],
114387
+ [types.CustomElementWidget]: []
114388
+ }
114347
114389
  }
114348
114390
  };
114349
114391
  exports2.examples = {
114350
114392
  [types.APIExtension]: [appsExamples.AIChatbot],
114351
114393
  [types.DashboardPage]: [
114394
+ appsExamples.SurveyManager,
114352
114395
  appsExamples.AIChatbot,
114353
114396
  appsExamples.CustomProductsCatalog,
114354
114397
  appsExamples.MixPanelAnalystic,
@@ -115233,196 +115276,12 @@ dashboard.onBeforeUnload(() => {
115233
115276
  }
115234
115277
  });
115235
115278
 
115236
- // dist/system-prompts/dashboardPage/buttonAndModalExamples.js
115237
- var require_buttonAndModalExamples = __commonJS({
115238
- "dist/system-prompts/dashboardPage/buttonAndModalExamples.js"(exports2) {
115239
- "use strict";
115240
- Object.defineProperty(exports2, "__esModule", { value: true });
115241
- exports2.buttonAndModalExamples = void 0;
115242
- exports2.buttonAndModalExamples = `
115243
- ## Dashboard UI Components - Buttons and Modals Examples
115244
-
115245
- ### Essential Imports for Dashboard Components
115246
-
115247
- \`\`\`typescript
115248
- import React, { type FC, useState, useEffect } from 'react';
115249
- import { dashboard } from '@wix/dashboard';
115250
- import {
115251
- Button,
115252
- Page,
115253
- WixDesignSystemProvider,
115254
- Tabs,
115255
- Card,
115256
- Table,
115257
- TableActionCell,
115258
- TableToolbar,
115259
- Modal,
115260
- CustomModalLayout,
115261
- FormField,
115262
- Input,
115263
- ToggleSwitch,
115264
- Layout,
115265
- Cell,
115266
- Badge,
115267
- Box,
115268
- Text,
115269
- } from '@wix/design-system';
115270
- import '@wix/design-system/styles.global.css';
115271
- import * as Icons from '@wix/wix-ui-icons-common';
115272
- import { items } from "@wix/data";
115273
- \`\`\`
115274
-
115275
- ### Button Examples
115276
-
115277
- #### Primary Action Buttons
115278
- \`\`\`typescript
115279
- // Add/Create button with icon
115280
- <Button
115281
- size="small"
115282
- prefixIcon={<Icons.Add />}
115283
- onClick={() => openModal('item')}
115284
- >
115285
- Add Item
115286
- </Button>
115287
-
115288
- // Save button (primary)
115289
- <Button
115290
- priority="primary"
115291
- onClick={handleSave}
115292
- disabled={loading}
115293
- >
115294
- {loading ? 'Saving...' : 'Save'}
115295
- </Button>
115296
- \`\`\`
115297
-
115298
- #### Table Action Buttons
115299
- \`\`\`typescript
115300
- const columns = [
115301
- { title: 'Name', render: (row: YourType) => row.name },
115302
- {
115303
- render: (row: YourType) => (
115304
- <TableActionCell
115305
- primaryAction={{
115306
- text: 'Edit',
115307
- onClick: () => openModal('item', row)
115308
- }}
115309
- secondaryActions={[
115310
- {
115311
- text: 'Delete',
115312
- icon: <Icons.DeleteSmall />,
115313
- onClick: () => handleDelete(row._id!)
115314
- }
115315
- ]}
115316
- />
115317
- )
115318
- }
115319
- ];
115320
- \`\`\`
115321
-
115322
- ### Modal Examples
115323
-
115324
- #### State Management for Modals
115325
- \`\`\`typescript
115326
- const [isModalOpen, setIsModalOpen] = useState(false);
115327
- const [modalType, setModalType] = useState<'item'>('item');
115328
- const [editingItem, setEditingItem] = useState<YourType | null>(null);
115329
- const [formData, setFormData] = useState<any>({});
115330
-
115331
- const openModal = (type: 'item', item?: YourType) => {
115332
- setModalType(type);
115333
- setEditingItem(item || null);
115334
-
115335
- // Initialize form data based on editing or creating
115336
- if (item) {
115337
- setFormData({
115338
- name: item.name,
115339
- description: item.description,
115340
- isActive: item.isActive,
115341
- // ... other fields
115342
- });
115343
- } else {
115344
- setFormData({
115345
- name: '',
115346
- description: '',
115347
- isActive: true,
115348
- // ... default values
115349
- });
115350
- }
115351
-
115352
- setIsModalOpen(true);
115353
- };
115354
-
115355
- const closeModal = () => {
115356
- setIsModalOpen(false);
115357
- setEditingItem(null);
115358
- setFormData({});
115359
- };
115360
- \`\`\`
115361
-
115362
- #### Basic Modal with Form
115363
- \`\`\`typescript
115364
- <Modal isOpen={isModalOpen} onRequestClose={closeModal}>
115365
- <CustomModalLayout
115366
- primaryButtonText="Save"
115367
- secondaryButtonText="Cancel"
115368
- onCloseButtonClick={closeModal}
115369
- primaryButtonOnClick={handleSave}
115370
- secondaryButtonOnClick={closeModal}
115371
- title={\`\${editingItem ? 'Edit' : 'Add'} Item\`}
115372
- content={
115373
- <Layout gap="24px">
115374
- <Cell span={12}>
115375
- <FormField label="Name">
115376
- <Input
115377
- value={formData.name || ''}
115378
- onChange={(e) => setFormData({ ...formData, name: e.target.value })}
115379
- placeholder="Enter item name"
115380
- />
115381
- </FormField>
115382
- </Cell>
115383
- <Cell span={12}>
115384
- <FormField label="Description">
115385
- <Input
115386
- value={formData.description || ''}
115387
- onChange={(e) => setFormData({ ...formData, description: e.target.value })}
115388
- placeholder="Enter description"
115389
- />
115390
- </FormField>
115391
- </Cell>
115392
- <Cell span={6}>
115393
- <FormField label="Price">
115394
- <Input
115395
- type="number"
115396
- value={formData.price || ''}
115397
- onChange={(e) => setFormData({ ...formData, price: Number(e.target.value) })}
115398
- placeholder="0.00"
115399
- />
115400
- </FormField>
115401
- </Cell>
115402
- <Cell span={6}>
115403
- <FormField label="Active" labelPlacement="right" stretchContent={false}>
115404
- <ToggleSwitch
115405
- checked={formData.isActive || false}
115406
- onChange={() => setFormData({ ...formData, isActive: !formData.isActive })}
115407
- />
115408
- </FormField>
115409
- </Cell>
115410
- </Layout>
115411
- }
115412
- />
115413
- </Modal>
115414
- \`\`\`
115415
- `;
115416
- }
115417
- });
115418
-
115419
115279
  // dist/system-prompts/dashboardPage/wdsPackage.js
115420
115280
  var require_wdsPackage = __commonJS({
115421
115281
  "dist/system-prompts/dashboardPage/wdsPackage.js"(exports2) {
115422
115282
  "use strict";
115423
115283
  Object.defineProperty(exports2, "__esModule", { value: true });
115424
115284
  exports2.buildWdsSystemPrompt = buildWdsSystemPrompt;
115425
- var buttonAndModalExamples_1 = require_buttonAndModalExamples();
115426
115285
  var STORIES_URL = "https://mykolass.wixsite.com/storybook-builder/_functions/getStoriesList?production=true&library=wix-style-react";
115427
115286
  function normalize(text) {
115428
115287
  return (text || "").toLowerCase();
@@ -115475,9 +115334,6 @@ ${exampleLines}
115475
115334
  <wds_reference>
115476
115335
  <source>Wix Design System \u2014 filtered components</source>
115477
115336
  ${blocks}
115478
-
115479
- ${buttonAndModalExamples_1.buttonAndModalExamples}
115480
-
115481
115337
  </wds_reference>`;
115482
115338
  }
115483
115339
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "AI-powered Wix CLI app generator - standalone executable",
5
5
  "scripts": {
6
6
  "build": "node build.mjs",
@@ -24,5 +24,5 @@
24
24
  "@wix/ditto-codegen": "1.0.0",
25
25
  "esbuild": "^0.25.9"
26
26
  },
27
- "falconPackageHash": "e7f707cde56bb07ac5cf65afd75b1734a16d629892b00bb81abbc1c2"
27
+ "falconPackageHash": "ea5d702999c28f45f1fa9f0646c069609905eb2fce58a3c0dba9261a"
28
28
  }