@wix/ditto-codegen-public 1.0.490 → 1.0.491

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 -0
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -12759,6 +12759,42 @@ For any persistent-data need (CMS collections, tables, schemas, data models):
12759
12759
  }
12760
12760
  });
12761
12761
 
12762
+ // ../codegen-common-logic/dist/rules/site-host-modules.js
12763
+ var require_site_host_modules = __commonJS({
12764
+ "../codegen-common-logic/dist/rules/site-host-modules.js"(exports2) {
12765
+ "use strict";
12766
+ Object.defineProperty(exports2, "__esModule", { value: true });
12767
+ exports2.SITE_HOST_MODULES_RULES = void 0;
12768
+ exports2.SITE_HOST_MODULES_RULES = `# Site Host Modules Rules
12769
+
12770
+ In React code that runs in the Studio 2 viewer (custom elements, Editor React Components, page code, context providers), never import \`@wix/site-*\` host modules (\`@wix/site-window\`, \`@wix/site-site\`, \`@wix/site-location\`, \`@wix/site-seo\`, ...). They call \`window.clientSdk\`, which Studio 2 pages do not have, so every call rejects with "Wix Site SDK only works in a Wix site environment" and nothing happens, in preview and on the published site.
12771
+
12772
+ Use the matching site service instead, read with \`useService\` from \`@wix/services-manager-react\`. Take the service's API from the installed package's types, not from memory:
12773
+
12774
+ | Instead of | Use |
12775
+ |---|---|
12776
+ | \`@wix/site-window\` \`openLightbox\` / \`lightbox.getContext\` / \`lightbox.close\` | \`@wix/site-service-lightbox\` |
12777
+ | \`@wix/site-window\` \`formFactor\` | \`@wix/site-service-device-info\`. Its device types are named differently from \`formFactor\`: use the values in its types |
12778
+ | \`@wix/site-window\` \`viewMode\` | \`@wix/site-service-editor-context\`. It only says whether the site is being previewed; it can't tell the editor from the live site |
12779
+ | \`@wix/site-window\` \`rendering.env\` | \`@wix/site-service-rendering-context\` |
12780
+ | \`@wix/site-window\` \`warmup-data\` \`get\` / \`set\` | \`@wix/site-service-warmup-data\` |
12781
+ | \`@wix/site-site\` \`regionalSettings\` / \`language\` / \`timezone\` (language, text direction, regional format, time zone) | \`@wix/site-service-locale\`. It reports the site's settings, not the language the visitor is viewing |
12782
+ | \`@wix/site-site\` \`getSiteDisplayName\` / \`revision\` | \`@wix/site-service-site-info\` |
12783
+ | \`@wix/site-site\` \`getSiteThemeHtml\` / \`getFontsHtml\` | \`@wix/site-service-site-theme\`. It returns the theme's colors and fonts as values, not HTML |
12784
+ | \`@wix/site-location\` \`to()\` | \`@wix/site-service-router\` |
12785
+ | \`@wix/site-location\` \`url\` | \`@wix/site-service-url\` |
12786
+ | \`@wix/site-site\` \`currentPage\` / site structure | \`@wix/site-service-pages\` |
12787
+
12788
+ There is no service yet for these, so Studio 2 can't do them from viewer code: \`@wix/site-window\` \`multilingual\` (reading or switching the display language), \`@wix/site-seo\` (setting SEO tags from the browser), \`@wix/site-members\`, \`@wix/site-storage\`, \`@wix/site-ecom\`, \`@wix/site-stores\`, \`@wix/site-pricing-plans\`, \`@wix/site-crm\`, \`@wix/site-pay\`, \`@wix/site-realtime\`, \`@wix/site-events\`, \`@wix/site-bookings\`, the \`@wix/site-location\` helpers other than \`to()\` and \`url\` (\`path\`, \`query\`, \`onChange\`, ...), and the \`@wix/site-window\` browser helpers (\`scrollTo\`, \`copyToClipboard\`, \`getCurrentGeolocation\`, \`referrer\`, \`postMessage\`, \`openModal\`, consent policy). Do not substitute \`navigator.language\` for the display language: it is the browser's preference and can differ from the language the site is shown in. Do not set SEO tags from client code: a client effect can't reach crawlers. For any of these, don't guess a workaround; say in your final message that Studio 2 doesn't support it yet.
12789
+
12790
+ If a host-module API you need isn't in the table, check the Wix docs for a supported replacement before choosing an approach. Never fall back to a \`@wix/site-*\` host module.
12791
+
12792
+ A live site loads a site service only when an extension declares it in the manifest's \`serviceDependencies\`. Preview loads every service, so a missing declaration works in preview and fails after publish: always declare each service you use.
12793
+
12794
+ **Embedded scripts are the exception.** They are plain HTML/JS injected into the page, with no services manager, so \`useService\` and \`serviceDependencies\` don't apply. Follow the \`wix-app\` embedded-script reference there, which creates its client from \`@wix/site\` and the \`@wix/site-*\` host modules.`;
12795
+ }
12796
+ });
12797
+
12762
12798
  // ../codegen-common-logic/dist/rules/telemetry.js
12763
12799
  var require_telemetry = __commonJS({
12764
12800
  "../codegen-common-logic/dist/rules/telemetry.js"(exports2) {
@@ -12869,6 +12905,7 @@ var require_rules = __commonJS({
12869
12905
  __exportStar2(require_brik_import(), exports2);
12870
12906
  __exportStar2(require_code_edits_scope(), exports2);
12871
12907
  __exportStar2(require_site_data_layer(), exports2);
12908
+ __exportStar2(require_site_host_modules(), exports2);
12872
12909
  __exportStar2(require_telemetry(), exports2);
12873
12910
  __exportStar2(require_stores_catalog_version(), exports2);
12874
12911
  __exportStar2(require_user_attachments(), exports2);
@@ -14130,6 +14167,10 @@ var require_dist8 = __commonJS({
14130
14167
  { filename: "brik-import-rules.md", content: codegen_common_logic_1.BRIK_IMPORT_RULES },
14131
14168
  { filename: "code-edits-scope-rules.md", content: codegen_common_logic_1.CODE_EDITS_SCOPE_RULES },
14132
14169
  { filename: "user-attachments-rules.md", content: codegen_common_logic_1.USER_ATTACHMENTS_RULES },
14170
+ {
14171
+ filename: "site-host-modules-rules.md",
14172
+ content: codegen_common_logic_1.SITE_HOST_MODULES_RULES
14173
+ },
14133
14174
  { filename: "telemetry-rules.md", content: codegen_common_logic_1.TELEMETRY_RULES }
14134
14175
  ],
14135
14176
  askRules: [{ filename: "telemetry-ask-rules.md", content: codegen_common_logic_1.TELEMETRY_RULES }],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.490",
3
+ "version": "1.0.491",
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": "7decfa063afb512f018a47dd2b1618621515a849ccea73a3917ab628"
32
+ "falconPackageHash": "391e252562c6169552e19a164b9aef3c38086e2e12244a9e99e091d6"
33
33
  }