@wix/ditto-codegen-public 1.0.523 → 1.0.525

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.
Files changed (2) hide show
  1. package/dist/out.js +41 -37
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -1663,25 +1663,24 @@ var require_env_util = __commonJS({
1663
1663
  "../../node_modules/@wix/http-client/dist/src/env-util.js"(exports2) {
1664
1664
  "use strict";
1665
1665
  Object.defineProperty(exports2, "__esModule", { value: true });
1666
- exports2.isProduction = exports2.isNode = exports2.isWebWorker = exports2.isBrowser = void 0;
1666
+ exports2.isBrowser = isBrowser;
1667
+ exports2.isWebWorker = isWebWorker;
1668
+ exports2.isNode = isNode;
1669
+ exports2.isProduction = isProduction;
1667
1670
  function isBrowser() {
1668
1671
  return typeof window !== "undefined";
1669
1672
  }
1670
- exports2.isBrowser = isBrowser;
1671
1673
  function isWebWorker() {
1672
1674
  var _a;
1673
1675
  return typeof self === "object" && ((_a = self === null || self === void 0 ? void 0 : self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope";
1674
1676
  }
1675
- exports2.isWebWorker = isWebWorker;
1676
1677
  function isNode() {
1677
1678
  var _a;
1678
1679
  return typeof process !== "undefined" && ((_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) != null;
1679
1680
  }
1680
- exports2.isNode = isNode;
1681
1681
  function isProduction() {
1682
1682
  return process.env.NODE_ENV === "production";
1683
1683
  }
1684
- exports2.isProduction = isProduction;
1685
1684
  }
1686
1685
  });
1687
1686
 
@@ -1690,27 +1689,35 @@ var require_utils2 = __commonJS({
1690
1689
  "../../node_modules/@wix/http-client/dist/src/utils.js"(exports2) {
1691
1690
  "use strict";
1692
1691
  Object.defineProperty(exports2, "__esModule", { value: true });
1693
- exports2.toSearchQueryParams = exports2.shouldAllowUnmocked = exports2.isHttpMockServerEnabled = exports2.getGlobalConfig = exports2.changeHost = exports2.extractHost = exports2.extractProtocol = exports2.resolveProtocol = exports2.resolveHost = exports2.extractProp = exports2.silent = exports2.isAbsoluteUrl = void 0;
1692
+ exports2.isAbsoluteUrl = isAbsoluteUrl;
1693
+ exports2.silent = silent;
1694
+ exports2.extractProp = extractProp;
1695
+ exports2.resolveHost = resolveHost;
1696
+ exports2.resolveProtocol = resolveProtocol;
1697
+ exports2.extractProtocol = extractProtocol;
1698
+ exports2.extractHost = extractHost;
1699
+ exports2.changeHost = changeHost;
1700
+ exports2.getGlobalConfig = getGlobalConfig;
1701
+ exports2.isHttpMockServerEnabled = isHttpMockServerEnabled;
1702
+ exports2.shouldAllowUnmocked = shouldAllowUnmocked;
1703
+ exports2.toSearchQueryParams = toSearchQueryParams;
1694
1704
  var constants_1 = require_constants();
1695
1705
  var env_util_1 = require_env_util();
1696
1706
  function isAbsoluteUrl(url) {
1697
1707
  if (typeof url !== "string") {
1698
1708
  throw new TypeError(`Expected a \`string\`, got \`${typeof url}\``);
1699
1709
  }
1700
- return /(^https?:)|(^\/\/)/.test(url);
1710
+ return /(^https?:)|(^\/\/)/i.test(url);
1701
1711
  }
1702
- exports2.isAbsoluteUrl = isAbsoluteUrl;
1703
1712
  async function silent(fn) {
1704
1713
  try {
1705
1714
  await fn();
1706
1715
  } catch (_a) {
1707
1716
  }
1708
1717
  }
1709
- exports2.silent = silent;
1710
1718
  function extractProp(data, path) {
1711
1719
  return path.split(".").filter((prop) => prop).reduce((result, prop) => result[prop], data);
1712
1720
  }
1713
- exports2.extractProp = extractProp;
1714
1721
  function resolveHost(opts) {
1715
1722
  if (opts.baseURL) {
1716
1723
  return extractHost(opts.baseURL);
@@ -1722,7 +1729,6 @@ var require_utils2 = __commonJS({
1722
1729
  return "";
1723
1730
  }
1724
1731
  }
1725
- exports2.resolveHost = resolveHost;
1726
1732
  function resolveProtocol(opts) {
1727
1733
  if (opts.baseURL) {
1728
1734
  return extractProtocol(opts.baseURL);
@@ -1734,7 +1740,6 @@ var require_utils2 = __commonJS({
1734
1740
  return "";
1735
1741
  }
1736
1742
  }
1737
- exports2.resolveProtocol = resolveProtocol;
1738
1743
  function extractProtocol(url) {
1739
1744
  try {
1740
1745
  const asUrl = new URL(url);
@@ -1744,7 +1749,6 @@ var require_utils2 = __commonJS({
1744
1749
  return hostAndProtocol.protocol;
1745
1750
  }
1746
1751
  }
1747
- exports2.extractProtocol = extractProtocol;
1748
1752
  function extractHost(url) {
1749
1753
  let asUrl;
1750
1754
  try {
@@ -1759,7 +1763,6 @@ var require_utils2 = __commonJS({
1759
1763
  return hostAndProtocol.host;
1760
1764
  }
1761
1765
  }
1762
- exports2.extractHost = extractHost;
1763
1766
  function extractHostAndProtocolUsingRegExp(url) {
1764
1767
  const regExp = new RegExp("^(.*:)//([A-Za-z0-9-.]+)(:[0-9]+)?(.*)$");
1765
1768
  try {
@@ -1781,7 +1784,6 @@ var require_utils2 = __commonJS({
1781
1784
  }
1782
1785
  return url.toString();
1783
1786
  }
1784
- exports2.changeHost = changeHost;
1785
1787
  function getGlobalConfig() {
1786
1788
  const defaultConfig = { httpMockServer: { enabled: false } };
1787
1789
  let globalConfig;
@@ -1799,21 +1801,17 @@ var require_utils2 = __commonJS({
1799
1801
  }
1800
1802
  return globalConfig || defaultConfig;
1801
1803
  }
1802
- exports2.getGlobalConfig = getGlobalConfig;
1803
1804
  function isHttpMockServerEnabled() {
1804
1805
  const globalConfig = getGlobalConfig();
1805
1806
  return globalConfig.httpMockServer.enabled;
1806
1807
  }
1807
- exports2.isHttpMockServerEnabled = isHttpMockServerEnabled;
1808
1808
  function shouldAllowUnmocked() {
1809
1809
  const globalConfig = getGlobalConfig();
1810
1810
  return globalConfig.httpMockServer.allowUnmocked;
1811
1811
  }
1812
- exports2.shouldAllowUnmocked = shouldAllowUnmocked;
1813
1812
  function toSearchQueryParams(params) {
1814
1813
  return Object.entries(params).map(([key, value]) => `${key}=${encodeURIComponent(value)}`).flat().join("&");
1815
1814
  }
1816
- exports2.toSearchQueryParams = toSearchQueryParams;
1817
1815
  }
1818
1816
  });
1819
1817
 
@@ -1835,7 +1833,9 @@ var require_headers = __commonJS({
1835
1833
  "../../node_modules/@wix/http-client/dist/src/headers.js"(exports2) {
1836
1834
  "use strict";
1837
1835
  Object.defineProperty(exports2, "__esModule", { value: true });
1838
- exports2.isWixDomain = exports2.composeHeaders = exports2.requestIdOrEmptyString = void 0;
1836
+ exports2.composeHeaders = void 0;
1837
+ exports2.requestIdOrEmptyString = requestIdOrEmptyString;
1838
+ exports2.isWixDomain = isWixDomain;
1839
1839
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
1840
1840
  var headers_1 = require_cjs();
1841
1841
  var utils_12 = require_utils2();
@@ -1844,7 +1844,6 @@ var require_headers = __commonJS({
1844
1844
  var _a;
1845
1845
  return ((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a["x-wix-request-id"]) || "";
1846
1846
  }
1847
- exports2.requestIdOrEmptyString = requestIdOrEmptyString;
1848
1847
  var composeHeaders = ({ url, disableWixHeaders, includeWixHeaders, wixHeadersOpts }) => {
1849
1848
  const shouldAssignWixHeaders = includeWixHeaders || !disableWixHeaders && isWixDomain(url);
1850
1849
  return shouldAssignWixHeaders ? (0, headers_1.createHeaders)(wixHeadersOpts) : {};
@@ -1859,7 +1858,6 @@ var require_headers = __commonJS({
1859
1858
  const isWhitelisted = whitelist_json_1.default.find((wixHost) => host.endsWith(`.${wixHost}`));
1860
1859
  return !!isWhitelisted;
1861
1860
  }
1862
- exports2.isWixDomain = isWixDomain;
1863
1861
  }
1864
1862
  });
1865
1863
 
@@ -1868,7 +1866,8 @@ var require_error = __commonJS({
1868
1866
  "../../node_modules/@wix/http-client/dist/src/error.js"(exports2) {
1869
1867
  "use strict";
1870
1868
  Object.defineProperty(exports2, "__esModule", { value: true });
1871
- exports2.createHttpError = exports2.HttpError = exports2.axiosErrorFields = void 0;
1869
+ exports2.HttpError = exports2.axiosErrorFields = void 0;
1870
+ exports2.createHttpError = createHttpError;
1872
1871
  var headers_1 = require_headers();
1873
1872
  exports2.axiosErrorFields = [
1874
1873
  "code",
@@ -1899,7 +1898,6 @@ var require_error = __commonJS({
1899
1898
  function createHttpError(...args) {
1900
1899
  return new HttpError(...args);
1901
1900
  }
1902
- exports2.createHttpError = createHttpError;
1903
1901
  }
1904
1902
  });
1905
1903
 
@@ -5477,7 +5475,8 @@ var require_http_client = __commonJS({
5477
5475
  "../../node_modules/@wix/http-client/dist/src/http-client.js"(exports2) {
5478
5476
  "use strict";
5479
5477
  Object.defineProperty(exports2, "__esModule", { value: true });
5480
- exports2.createHttpClient = exports2.HttpClient = void 0;
5478
+ exports2.HttpClient = void 0;
5479
+ exports2.createHttpClient = createHttpClient;
5481
5480
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
5482
5481
  var axios_1 = tslib_1.__importDefault(require_axios2());
5483
5482
  var xhr_1 = tslib_1.__importDefault(require_xhr());
@@ -5488,6 +5487,9 @@ var require_http_client = __commonJS({
5488
5487
  var options_1 = require_options();
5489
5488
  var utils_12 = require_utils2();
5490
5489
  var HttpClient = class {
5490
+ static isHttpError(payload) {
5491
+ return !!(payload === null || payload === void 0 ? void 0 : payload.isWixHttpError);
5492
+ }
5491
5493
  constructor(opts = {}) {
5492
5494
  this.opts = opts;
5493
5495
  this.opts = defaultClientOptions(this.opts);
@@ -5496,9 +5498,6 @@ var require_http_client = __commonJS({
5496
5498
  sanitizerPocEnabled: checkSanitizerPocEnabled()
5497
5499
  };
5498
5500
  }
5499
- static isHttpError(payload) {
5500
- return !!(payload === null || payload === void 0 ? void 0 : payload.isWixHttpError);
5501
- }
5502
5501
  setErrorHandler(errorHandler) {
5503
5502
  this.opts.errorHandler = errorHandler;
5504
5503
  }
@@ -5704,7 +5703,6 @@ var require_http_client = __commonJS({
5704
5703
  function createHttpClient(...args) {
5705
5704
  return new HttpClient(...args);
5706
5705
  }
5707
- exports2.createHttpClient = createHttpClient;
5708
5706
  }
5709
5707
  });
5710
5708
 
@@ -5713,7 +5711,8 @@ var require_http_client_node = __commonJS({
5713
5711
  "../../node_modules/@wix/http-client/dist/src/http-client-node.js"(exports2) {
5714
5712
  "use strict";
5715
5713
  Object.defineProperty(exports2, "__esModule", { value: true });
5716
- exports2.HttpClient = exports2.createHttpClient = void 0;
5714
+ exports2.HttpClient = void 0;
5715
+ exports2.createHttpClient = createHttpClientNode;
5717
5716
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
5718
5717
  var http_1 = tslib_1.__importDefault(require_http());
5719
5718
  var http_proxy_agent_1 = require_dist2();
@@ -5748,7 +5747,6 @@ var require_http_client_node = __commonJS({
5748
5747
  function createHttpClientNode(...args) {
5749
5748
  return new HttpClientNode(...args);
5750
5749
  }
5751
- exports2.createHttpClient = createHttpClientNode;
5752
5750
  function resolveProxyOptions(disableSquidProxy) {
5753
5751
  if (disableSquidProxy) {
5754
5752
  return {};
@@ -12735,12 +12733,17 @@ var require_code_edits_scope = __commonJS({
12735
12733
  exports2.CODE_EDITS_SCOPE_RULES = void 0;
12736
12734
  exports2.CODE_EDITS_SCOPE_RULES = `# Code Edits Scope Rules
12737
12735
 
12738
- When the request lists specific extensions to generate (each with a type), alongside a broader description of the feature:
12736
+ When the request lists extensions (each with a type) alongside a broader description:
12737
+
12738
+ 1. **Generate exactly the listed extensions**, plus any extension a listed one cannot work without (an embedded script needs a dashboard page that calls \`embedScript()\`).
12739
+ 2. **The rest of the description is built elsewhere** (for example as native elements). Do not implement it, even if the request reads as if you should.
12740
+ 3. **What the user asked of a listed extension is part of its item**, even when the item leaves it out.
12741
+ 4. **Report only what you built**, each companion extension and why, and anything asked of a listed extension you did not do.
12742
+
12743
+ When working from an existing extension:
12739
12744
 
12740
- 1. **The list is the complete scope.** Generate exactly the listed extensions, of the stated types, each covering only what its item describes. Do not add extensions or behavior that no item asks for, other than what rule 2 requires.
12741
- 2. **Also generate any extension a listed one cannot work without.** If a listed extension does nothing until another extension exists, generate that one too, even though no item lists it. For example, an embedded script must be paired with a dashboard page that calls \`embedScript()\`.
12742
- 3. **The broader description is background, not a task.** The parts of it that no item covers are built elsewhere in the flow (for example as native elements on the page). Do not implement them, even when the request reads as if your extensions should deliver the whole feature.
12743
- 4. **Report only what you built.** The final message describes the listed items, not the feature as a whole. State each companion extension you added under rule 2 and that it was added because the listed one needs it.`;
12745
+ 5. **A variant starts from a copy of the original's code**, including the local files it imports; change only what is asked. Restore a look from the code that had it.
12746
+ 6. **Keep what the request does not change.** After changing sizes, spacing or structure, check the code that depends on them, such as size-based animations.`;
12744
12747
  }
12745
12748
  });
12746
12749
 
@@ -14252,7 +14255,8 @@ ${environmentIdentity}`;
14252
14255
  - Match their technical level: include code/technical detail only if their request was technical; otherwise describe the outcome in plain language (no code, file/type names, or internals).
14253
14256
  - List any manual setup the user must still do for the feature to work, as short "next steps" (e.g. installing a dependent app or enabling a dashboard setting).
14254
14257
  - Be honest: if you didn't fully build what was asked (e.g. stored data but didn't send it), say so. Keep it short.`;
14255
- exports2.OUTCOME_MESSAGE_RULES = `- Lead with whether the request succeeded or failed and what changed (e.g. "Added\u2026", "Removed\u2026"). Never report validation, build, or type-check status as the outcome, and re-state the outcome in your last message even if you already said it earlier.`;
14258
+ exports2.OUTCOME_MESSAGE_RULES = `- Lead with whether the request succeeded or failed and what changed (e.g. "Added\u2026", "Removed\u2026"). Never report validation, build, or type-check status as the outcome, and re-state the outcome in your last message even if you already said it earlier.
14259
+ - You cannot see how the result renders: never say a look is restored or visible, say to check it on the page. If you changed a component's default props, say that copies already on the page keep their current values.`;
14256
14260
  function buildFileOperationsRules(multiEditContextClause) {
14257
14261
  return `- Package dependencies \u2014 \`npm install <pkg>\` any package not already in \`package.json\` BEFORE the first \`validate\` (do NOT wait for \`TS2307\`); install all needed packages in ONE command, except heavy ones: the sandbox has a memory limit and an install that exceeds it kills the machine and loses the whole run, so install those in several smaller commands. Do NOT hand-edit \`package.json\` for deps unless npm cannot be used. Never pass \`--package-lock=false\`.
14258
14262
  - File operations \u2014 pick the BATCH tool whenever you have 2+ files; the single-file variants are 5\u201310\xD7 slower:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.523",
3
+ "version": "1.0.525",
4
4
  "description": "AI-powered Wix CLI app generator - standalone executable",
5
5
  "scripts": {
6
6
  "build": "node build.mjs",
@@ -29,5 +29,5 @@
29
29
  "esbuild": "^0.27.2",
30
30
  "vitest": "^4.0.16"
31
31
  },
32
- "falconPackageHash": "445a3b5d1d62a5852420e590592faf6f13b2bf8c98d0382371bc0a64"
32
+ "falconPackageHash": "c3255a6a16e7c07e357747f2576fb29446de2f8518743c9495c19db8"
33
33
  }