@wix/ditto-codegen-public 1.0.36 → 1.0.38

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
@@ -79140,10 +79140,7 @@ var require_errors = __commonJS({
79140
79140
  }
79141
79141
  return { formErrors, fieldErrors };
79142
79142
  }
79143
- function formatError(error, _mapper) {
79144
- const mapper = _mapper || function(issue) {
79145
- return issue.message;
79146
- };
79143
+ function formatError(error, mapper = (issue) => issue.message) {
79147
79144
  const fieldErrors = { _errors: [] };
79148
79145
  const processError = (error2) => {
79149
79146
  for (const issue of error2.issues) {
@@ -79176,10 +79173,7 @@ var require_errors = __commonJS({
79176
79173
  processError(error);
79177
79174
  return fieldErrors;
79178
79175
  }
79179
- function treeifyError(error, _mapper) {
79180
- const mapper = _mapper || function(issue) {
79181
- return issue.message;
79182
- };
79176
+ function treeifyError(error, mapper = (issue) => issue.message) {
79183
79177
  const result = { errors: [] };
79184
79178
  const processError = (error2, path2 = []) => {
79185
79179
  var _a2, _b;
@@ -80128,7 +80122,7 @@ var require_versions = __commonJS({
80128
80122
  exports2.version = {
80129
80123
  major: 4,
80130
80124
  minor: 1,
80131
- patch: 11
80125
+ patch: 12
80132
80126
  };
80133
80127
  }
80134
80128
  });
@@ -82533,6 +82527,172 @@ var require_be = __commonJS({
82533
82527
  }
82534
82528
  });
82535
82529
 
82530
+ // node_modules/zod/v4/locales/bg.cjs
82531
+ var require_bg = __commonJS({
82532
+ "node_modules/zod/v4/locales/bg.cjs"(exports2) {
82533
+ "use strict";
82534
+ var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
82535
+ if (k2 === void 0) k2 = k;
82536
+ var desc = Object.getOwnPropertyDescriptor(m, k);
82537
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
82538
+ desc = { enumerable: true, get: function() {
82539
+ return m[k];
82540
+ } };
82541
+ }
82542
+ Object.defineProperty(o, k2, desc);
82543
+ }) : (function(o, m, k, k2) {
82544
+ if (k2 === void 0) k2 = k;
82545
+ o[k2] = m[k];
82546
+ }));
82547
+ var __setModuleDefault2 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
82548
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
82549
+ }) : function(o, v) {
82550
+ o["default"] = v;
82551
+ });
82552
+ var __importStar2 = exports2 && exports2.__importStar || function(mod2) {
82553
+ if (mod2 && mod2.__esModule) return mod2;
82554
+ var result = {};
82555
+ if (mod2 != null) {
82556
+ for (var k in mod2) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod2, k)) __createBinding2(result, mod2, k);
82557
+ }
82558
+ __setModuleDefault2(result, mod2);
82559
+ return result;
82560
+ };
82561
+ Object.defineProperty(exports2, "__esModule", { value: true });
82562
+ exports2.parsedType = void 0;
82563
+ exports2.default = default_1;
82564
+ var util = __importStar2(require_util6());
82565
+ var parsedType = (data) => {
82566
+ const t = typeof data;
82567
+ switch (t) {
82568
+ case "number": {
82569
+ return Number.isNaN(data) ? "NaN" : "\u0447\u0438\u0441\u043B\u043E";
82570
+ }
82571
+ case "object": {
82572
+ if (Array.isArray(data)) {
82573
+ return "\u043C\u0430\u0441\u0438\u0432";
82574
+ }
82575
+ if (data === null) {
82576
+ return "null";
82577
+ }
82578
+ if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
82579
+ return data.constructor.name;
82580
+ }
82581
+ }
82582
+ }
82583
+ return t;
82584
+ };
82585
+ exports2.parsedType = parsedType;
82586
+ var error = () => {
82587
+ const Sizable = {
82588
+ string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" },
82589
+ file: { unit: "\u0431\u0430\u0439\u0442\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" },
82590
+ array: { unit: "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" },
82591
+ set: { unit: "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430", verb: "\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430" }
82592
+ };
82593
+ function getSizing(origin) {
82594
+ return Sizable[origin] ?? null;
82595
+ }
82596
+ const Nouns = {
82597
+ regex: "\u0432\u0445\u043E\u0434",
82598
+ email: "\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",
82599
+ url: "URL",
82600
+ emoji: "\u0435\u043C\u043E\u0434\u0436\u0438",
82601
+ uuid: "UUID",
82602
+ uuidv4: "UUIDv4",
82603
+ uuidv6: "UUIDv6",
82604
+ nanoid: "nanoid",
82605
+ guid: "GUID",
82606
+ cuid: "cuid",
82607
+ cuid2: "cuid2",
82608
+ ulid: "ULID",
82609
+ xid: "XID",
82610
+ ksuid: "KSUID",
82611
+ datetime: "ISO \u0432\u0440\u0435\u043C\u0435",
82612
+ date: "ISO \u0434\u0430\u0442\u0430",
82613
+ time: "ISO \u0432\u0440\u0435\u043C\u0435",
82614
+ duration: "ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",
82615
+ ipv4: "IPv4 \u0430\u0434\u0440\u0435\u0441",
82616
+ ipv6: "IPv6 \u0430\u0434\u0440\u0435\u0441",
82617
+ cidrv4: "IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",
82618
+ cidrv6: "IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",
82619
+ base64: "base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",
82620
+ base64url: "base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",
82621
+ json_string: "JSON \u043D\u0438\u0437",
82622
+ e164: "E.164 \u043D\u043E\u043C\u0435\u0440",
82623
+ jwt: "JWT",
82624
+ template_literal: "\u0432\u0445\u043E\u0434"
82625
+ };
82626
+ return (issue) => {
82627
+ switch (issue.code) {
82628
+ case "invalid_type":
82629
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${issue.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${(0, exports2.parsedType)(issue.input)}`;
82630
+ case "invalid_value":
82631
+ if (issue.values.length === 1)
82632
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${util.stringifyPrimitive(issue.values[0])}`;
82633
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${util.joinValues(issue.values, "|")}`;
82634
+ case "too_big": {
82635
+ const adj = issue.inclusive ? "<=" : "<";
82636
+ const sizing = getSizing(issue.origin);
82637
+ if (sizing)
82638
+ return `\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue.origin ?? "\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${adj}${issue.maximum.toString()} ${sizing.unit ?? "\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`;
82639
+ return `\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue.origin ?? "\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${adj}${issue.maximum.toString()}`;
82640
+ }
82641
+ case "too_small": {
82642
+ const adj = issue.inclusive ? ">=" : ">";
82643
+ const sizing = getSizing(issue.origin);
82644
+ if (sizing) {
82645
+ return `\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${adj}${issue.minimum.toString()} ${sizing.unit}`;
82646
+ }
82647
+ return `\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${issue.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${adj}${issue.minimum.toString()}`;
82648
+ }
82649
+ case "invalid_format": {
82650
+ const _issue = issue;
82651
+ if (_issue.format === "starts_with") {
82652
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${_issue.prefix}"`;
82653
+ }
82654
+ if (_issue.format === "ends_with")
82655
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${_issue.suffix}"`;
82656
+ if (_issue.format === "includes")
82657
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${_issue.includes}"`;
82658
+ if (_issue.format === "regex")
82659
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${_issue.pattern}`;
82660
+ let invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";
82661
+ if (_issue.format === "emoji")
82662
+ invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";
82663
+ if (_issue.format === "datetime")
82664
+ invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";
82665
+ if (_issue.format === "date")
82666
+ invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430";
82667
+ if (_issue.format === "time")
82668
+ invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";
82669
+ if (_issue.format === "duration")
82670
+ invalid_adj = "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430";
82671
+ return `${invalid_adj} ${Nouns[_issue.format] ?? issue.format}`;
82672
+ }
82673
+ case "not_multiple_of":
82674
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${issue.divisor}`;
82675
+ case "unrecognized_keys":
82676
+ return `\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${issue.keys.length > 1 ? "\u0438" : ""} \u043A\u043B\u044E\u0447${issue.keys.length > 1 ? "\u043E\u0432\u0435" : ""}: ${util.joinValues(issue.keys, ", ")}`;
82677
+ case "invalid_key":
82678
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${issue.origin}`;
82679
+ case "invalid_union":
82680
+ return "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";
82681
+ case "invalid_element":
82682
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${issue.origin}`;
82683
+ default:
82684
+ return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434`;
82685
+ }
82686
+ };
82687
+ };
82688
+ function default_1() {
82689
+ return {
82690
+ localeError: error()
82691
+ };
82692
+ }
82693
+ }
82694
+ });
82695
+
82536
82696
  // node_modules/zod/v4/locales/ca.cjs
82537
82697
  var require_ca = __commonJS({
82538
82698
  "node_modules/zod/v4/locales/ca.cjs"(exports2, module2) {
@@ -89135,7 +89295,7 @@ var require_locales = __commonJS({
89135
89295
  return mod2 && mod2.__esModule ? mod2 : { "default": mod2 };
89136
89296
  };
89137
89297
  Object.defineProperty(exports2, "__esModule", { value: true });
89138
- exports2.yo = exports2.zhTW = exports2.zhCN = exports2.vi = exports2.ur = exports2.uk = exports2.ua = exports2.tr = exports2.th = exports2.ta = exports2.sv = exports2.sl = exports2.ru = exports2.pt = exports2.pl = exports2.ps = exports2.ota = exports2.no = exports2.nl = exports2.ms = exports2.mk = exports2.lt = exports2.ko = exports2.km = exports2.kh = exports2.ka = exports2.ja = exports2.it = exports2.is = exports2.id = exports2.hu = exports2.he = exports2.frCA = exports2.fr = exports2.fi = exports2.fa = exports2.es = exports2.eo = exports2.en = exports2.de = exports2.da = exports2.cs = exports2.ca = exports2.be = exports2.az = exports2.ar = void 0;
89298
+ exports2.yo = exports2.zhTW = exports2.zhCN = exports2.vi = exports2.ur = exports2.uk = exports2.ua = exports2.tr = exports2.th = exports2.ta = exports2.sv = exports2.sl = exports2.ru = exports2.pt = exports2.pl = exports2.ps = exports2.ota = exports2.no = exports2.nl = exports2.ms = exports2.mk = exports2.lt = exports2.ko = exports2.km = exports2.kh = exports2.ka = exports2.ja = exports2.it = exports2.is = exports2.id = exports2.hu = exports2.he = exports2.frCA = exports2.fr = exports2.fi = exports2.fa = exports2.es = exports2.eo = exports2.en = exports2.de = exports2.da = exports2.cs = exports2.ca = exports2.bg = exports2.be = exports2.az = exports2.ar = void 0;
89139
89299
  var ar_js_1 = require_ar();
89140
89300
  Object.defineProperty(exports2, "ar", { enumerable: true, get: function() {
89141
89301
  return __importDefault2(ar_js_1).default;
@@ -89148,6 +89308,10 @@ var require_locales = __commonJS({
89148
89308
  Object.defineProperty(exports2, "be", { enumerable: true, get: function() {
89149
89309
  return __importDefault2(be_js_1).default;
89150
89310
  } });
89311
+ var bg_js_1 = require_bg();
89312
+ Object.defineProperty(exports2, "bg", { enumerable: true, get: function() {
89313
+ return __importDefault2(bg_js_1).default;
89314
+ } });
89151
89315
  var ca_js_1 = require_ca();
89152
89316
  Object.defineProperty(exports2, "ca", { enumerable: true, get: function() {
89153
89317
  return __importDefault2(ca_js_1).default;
@@ -93262,7 +93426,7 @@ var require_ZodError = __commonJS({
93262
93426
  return this.issues.length === 0;
93263
93427
  }
93264
93428
  flatten(mapper = (issue) => issue.message) {
93265
- const fieldErrors = {};
93429
+ const fieldErrors = /* @__PURE__ */ Object.create(null);
93266
93430
  const formErrors = [];
93267
93431
  for (const sub of this.issues) {
93268
93432
  if (sub.path.length > 0) {
@@ -0,0 +1,5 @@
1
+ export default class extends HTMLElement {
2
+ public connectedCallback() {
3
+ this.innerHTML = `<div data-testid="custom-element">Hello from custom element!</div>`;
4
+ }
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
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": "f78cfb6e7bdafb3a57f084c58b26c3a4b12662154bae77080decebba"
27
+ "falconPackageHash": "54a1561268bef386f7dd6078078063fd54c1a31c6d6a8da708fcc3d9"
28
28
  }
@@ -1,27 +0,0 @@
1
- {
2
- "$schema": "https://dev.wix.com/wix-cli/schemas/custom-element.json",
3
- "id": "6be9721d-6085-4bda-b50b-f4fe8e443263",
4
- "name": "My Widget",
5
- "width": {
6
- "defaultWidth": 450,
7
- "allowStretch": true
8
- },
9
- "height": {
10
- "defaultHeight": 250
11
- },
12
- "installation": {
13
- "autoAddToSite": true
14
- },
15
- "behaviors": {
16
- "dashboard": {
17
- "dashboardPageComponentId": "851162b4-65b1-47e5-9f4a-8a079204b368"
18
- }
19
- },
20
- "presets": [
21
- {
22
- "id": "3588cae1-09de-4a76-941d-66b81f921162",
23
- "thumbnailUrl": "../../../../assets/my-widget/thumbnail.png"
24
- }
25
- ]
26
- }
27
-
@@ -1,32 +0,0 @@
1
- :root {
2
- --background-color: #242A35;
3
- --text-color: #fcfdfd;
4
- --secondary-text-color: #c9c9c9;
5
- --code-color: #d7d7d7;
6
- }
7
-
8
- .root {
9
- width: 100%;
10
- height: 100%;
11
- background-color: var(--background-color);
12
- color: var(--text-color);
13
- box-sizing: border-box;
14
- padding: 3rem 1rem;
15
- font-size: 14px;
16
- }
17
-
18
- .root h2 {
19
- font-size: 1.5rem;
20
- margin-bottom: 5px;
21
- }
22
-
23
- .root p {
24
- color: var(--secondary-text-color);
25
- }
26
-
27
- .root code {
28
- color: var(--code-color);
29
- font-size: 0.8rem;
30
- font-weight: bolder;
31
- }
32
-
@@ -1,36 +0,0 @@
1
- import React, { type FC } from 'react';
2
- import ReactDOM from 'react-dom';
3
- import reactToWebComponent from 'react-to-webcomponent';
4
- import styles from './element.module.css';
5
-
6
- interface Props {
7
- displayName?: string;
8
- }
9
-
10
- const CustomElement: FC<Props> = ({
11
- displayName = `Your Widget's Title`,
12
- }) => {
13
- return (
14
- <div className={styles.root}>
15
- <h2>{displayName}</h2>
16
- <hr />
17
- <p>
18
- This is a Site Widget generated by Wix CLI.<br />
19
- Continue to develop this widget at <code>'src/site/widgets/custom-elements/my-widget'</code>.
20
- </p>
21
- </div>
22
- );
23
- };
24
-
25
- const customElement = reactToWebComponent(
26
- CustomElement,
27
- React,
28
- ReactDOM as any,
29
- {
30
- props: {
31
- displayName: 'string',
32
- },
33
- }
34
- );
35
-
36
- export default customElement;
@@ -1,54 +0,0 @@
1
- import React, { type FC, useState, useEffect, useCallback } from 'react';
2
- import { widget } from '@wix/editor';
3
- import {
4
- SidePanel,
5
- WixDesignSystemProvider,
6
- Input,
7
- FormField,
8
- SectionHelper,
9
- } from '@wix/design-system';
10
- import '@wix/design-system/styles.global.css';
11
-
12
- const SITE_WIDGETS_DOCS = 'https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/site-extensions/site-widgets/site-widget-extension-files-and-code';
13
-
14
- const Panel: FC = () => {
15
- const [displayName, setDisplayName] = useState<string>('');
16
-
17
- useEffect(() => {
18
- widget.getProp('display-name')
19
- .then(displayName => setDisplayName(displayName || `Your Widget's Title`))
20
- .catch(error => console.error('Failed to fetch display-name:', error));
21
- }, [setDisplayName]);
22
-
23
- const handleDisplayNameChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
24
- const newDisplayName = event.target.value;
25
- setDisplayName(newDisplayName);
26
- widget.setProp('display-name', newDisplayName);
27
- }, [setDisplayName]);
28
-
29
- return (
30
- <WixDesignSystemProvider>
31
- <SidePanel width="300" height="100vh">
32
- <SidePanel.Content noPadding stretchVertically>
33
- <SidePanel.Field>
34
- <FormField label="Display Name">
35
- <Input
36
- type="text"
37
- value={displayName}
38
- onChange={handleDisplayNameChange}
39
- aria-label="Display Name"
40
- />
41
- </FormField>
42
- </SidePanel.Field>
43
- </SidePanel.Content>
44
- <SidePanel.Footer noPadding>
45
- <SectionHelper fullWidth appearance="success" border="topBottom">
46
- Learn more about <a href={SITE_WIDGETS_DOCS} target="_blank" rel="noopener noreferrer" title="Site Widget docs">Site Widgets</a>
47
- </SectionHelper>
48
- </SidePanel.Footer>
49
- </SidePanel>
50
- </WixDesignSystemProvider>
51
- );
52
- };
53
-
54
- export default Panel;