@wix/agent-skills 1.0.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.
Files changed (220) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +111 -0
  3. package/package.json +29 -0
  4. package/skills/wix-app/SKILL.md +344 -0
  5. package/skills/wix-app/references/APP_IDENTIFIERS.md +35 -0
  6. package/skills/wix-app/references/APP_MARKET_REVIEW.md +311 -0
  7. package/skills/wix-app/references/APP_VALIDATION.md +171 -0
  8. package/skills/wix-app/references/BACKEND_API.md +233 -0
  9. package/skills/wix-app/references/BACKEND_EVENT.md +116 -0
  10. package/skills/wix-app/references/CODE_QUALITY.md +33 -0
  11. package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +587 -0
  12. package/skills/wix-app/references/DASHBOARD_MENU_PLUGIN.md +157 -0
  13. package/skills/wix-app/references/DASHBOARD_MODAL.md +283 -0
  14. package/skills/wix-app/references/DASHBOARD_PAGE.md +403 -0
  15. package/skills/wix-app/references/DASHBOARD_PLUGIN.md +205 -0
  16. package/skills/wix-app/references/DATA_COLLECTION.md +451 -0
  17. package/skills/wix-app/references/DOCUMENTATION.md +42 -0
  18. package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +65 -0
  19. package/skills/wix-app/references/EMBEDDED_SCRIPT.md +468 -0
  20. package/skills/wix-app/references/EXTENSION_REGISTRATION.md +96 -0
  21. package/skills/wix-app/references/SERVICE_PLUGIN.md +235 -0
  22. package/skills/wix-app/references/SITE_PLUGIN.md +436 -0
  23. package/skills/wix-app/references/STORES_VERSIONING.md +334 -0
  24. package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +84 -0
  25. package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +345 -0
  26. package/skills/wix-app/references/dashboard-menu-plugin/blog-slots.md +71 -0
  27. package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +58 -0
  28. package/skills/wix-app/references/dashboard-menu-plugin/crm-slots.md +8 -0
  29. package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +17 -0
  30. package/skills/wix-app/references/dashboard-menu-plugin/events-slots.md +29 -0
  31. package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +27 -0
  32. package/skills/wix-app/references/dashboard-menu-plugin/stores-slots.md +35 -0
  33. package/skills/wix-app/references/dashboard-page/API_SPEC.md +138 -0
  34. package/skills/wix-app/references/dashboard-page/DASHBOARD_API.md +573 -0
  35. package/skills/wix-app/references/dashboard-page/DYNAMIC_PARAMETERS.md +269 -0
  36. package/skills/wix-app/references/dashboard-page/ECOM_NAVIGATION.md +164 -0
  37. package/skills/wix-app/references/dashboard-plugin/SLOTS.md +294 -0
  38. package/skills/wix-app/references/data-collection/WIX_DATA.md +270 -0
  39. package/skills/wix-app/references/data-collection/extension-template.ts +107 -0
  40. package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +138 -0
  41. package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +454 -0
  42. package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +165 -0
  43. package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +576 -0
  44. package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +170 -0
  45. package/skills/wix-app/references/editor-react-component/EDIT-FLOW.md +6 -0
  46. package/skills/wix-app/references/editor-react-component/PARTS.md +25 -0
  47. package/skills/wix-app/references/editor-react-component/PROPS-VS-CSS.md +203 -0
  48. package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +167 -0
  49. package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +137 -0
  50. package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +112 -0
  51. package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +118 -0
  52. package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +87 -0
  53. package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +86 -0
  54. package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +135 -0
  55. package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +79 -0
  56. package/skills/wix-app/references/service-plugin/VALIDATIONS.md +68 -0
  57. package/skills/wix-app/references/site-plugin/EXAMPLES.md +311 -0
  58. package/skills/wix-app/references/site-plugin/SLOTS.md +263 -0
  59. package/skills/wix-design-system/SKILL.md +129 -0
  60. package/skills/wix-design-system/references/file-structure.md +56 -0
  61. package/skills/wix-design-system/scripts/wds.cjs +531 -0
  62. package/skills/wix-headless/SKILL.md +418 -0
  63. package/skills/wix-headless/references/DISCOVERY.md +332 -0
  64. package/skills/wix-headless/references/ORCHESTRATION.md +269 -0
  65. package/skills/wix-headless/references/SETUP.md +154 -0
  66. package/skills/wix-headless/references/blog/BLOG_CONTENT.md +152 -0
  67. package/skills/wix-headless/references/blog/BLOG_PAGES.md +299 -0
  68. package/skills/wix-headless/references/blog/BLOG_SETUP.md +218 -0
  69. package/skills/wix-headless/references/blog/INSTRUCTIONS.md +32 -0
  70. package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +373 -0
  71. package/skills/wix-headless/references/cms/FAQ_KNOWLEDGE_BASE.md +229 -0
  72. package/skills/wix-headless/references/cms/INSTRUCTIONS.md +40 -0
  73. package/skills/wix-headless/references/cms/PORTFOLIO.md +454 -0
  74. package/skills/wix-headless/references/cms/RESOURCE_LIBRARY.md +356 -0
  75. package/skills/wix-headless/references/cms/TEAM_DIRECTORY.md +299 -0
  76. package/skills/wix-headless/references/commands/install-app.md +42 -0
  77. package/skills/wix-headless/references/commands/known-apps.json +5 -0
  78. package/skills/wix-headless/references/commands/mcp-bootstrap.md +28 -0
  79. package/skills/wix-headless/references/designer/INSTRUCTIONS.md +828 -0
  80. package/skills/wix-headless/references/ecom/CART_PAGES.md +120 -0
  81. package/skills/wix-headless/references/ecom/CART_WIRING.md +103 -0
  82. package/skills/wix-headless/references/ecom/COMPONENTS_CSS.md +132 -0
  83. package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +59 -0
  84. package/skills/wix-headless/references/forms/CONTACT_FORM.md +477 -0
  85. package/skills/wix-headless/references/forms/INSTRUCTIONS.md +43 -0
  86. package/skills/wix-headless/references/gift-cards/COMPONENTS.md +119 -0
  87. package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +51 -0
  88. package/skills/wix-headless/references/gift-cards/PAGES.md +129 -0
  89. package/skills/wix-headless/references/images/INSTRUCTIONS.md +359 -0
  90. package/skills/wix-headless/references/shared/BUILD_NOISE.md +8 -0
  91. package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +185 -0
  92. package/skills/wix-headless/references/shared/IMPLEMENTER.md +155 -0
  93. package/skills/wix-headless/references/shared/MCP_PREFIX.md +105 -0
  94. package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +97 -0
  95. package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +423 -0
  96. package/skills/wix-headless/references/shared/STYLING.md +117 -0
  97. package/skills/wix-headless/references/stores/BACK_IN_STOCK.md +178 -0
  98. package/skills/wix-headless/references/stores/CATEGORY_PAGES.md +86 -0
  99. package/skills/wix-headless/references/stores/COMPONENTS_CSS.md +129 -0
  100. package/skills/wix-headless/references/stores/HOME_AND_NAV.md +227 -0
  101. package/skills/wix-headless/references/stores/INSTRUCTIONS.md +96 -0
  102. package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +249 -0
  103. package/skills/wix-headless/references/stores/PRODUCT_PAGES.md +213 -0
  104. package/skills/wix-headless/references/stores/SHARED_WIRING.md +164 -0
  105. package/skills/wix-headless/references/verticals/_schema.json +160 -0
  106. package/skills/wix-headless/references/verticals/_schema.md +185 -0
  107. package/skills/wix-headless/references/verticals/blog.md +125 -0
  108. package/skills/wix-headless/references/verticals/cms.md +121 -0
  109. package/skills/wix-headless/references/verticals/ecom.md +96 -0
  110. package/skills/wix-headless/references/verticals/forms.md +106 -0
  111. package/skills/wix-headless/references/verticals/gift-cards.md +121 -0
  112. package/skills/wix-headless/references/verticals/stores.md +167 -0
  113. package/skills/wix-headless/scripts/check-manifest.mjs +198 -0
  114. package/skills/wix-headless/scripts/copy-utility-templates.mjs +153 -0
  115. package/skills/wix-headless/scripts/emit-design-tokens.mjs +77 -0
  116. package/skills/wix-headless/scripts/finalize-run-json.mjs +141 -0
  117. package/skills/wix-headless/scripts/init-site-json.mjs +63 -0
  118. package/skills/wix-headless/scripts/patch-decorative-slots.mjs +124 -0
  119. package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +190 -0
  120. package/skills/wix-headless/scripts/preview.sh +45 -0
  121. package/skills/wix-headless/scripts/release.sh +73 -0
  122. package/skills/wix-headless/scripts/scaffold.sh +53 -0
  123. package/skills/wix-headless/scripts/seed-utilities.sh +55 -0
  124. package/skills/wix-headless/shared-utilities/analytics.ts +40 -0
  125. package/skills/wix-headless/shared-utilities/ricos.ts +179 -0
  126. package/skills/wix-headless/shared-utilities/wix-image.ts +72 -0
  127. package/skills/wix-headless/templates/ecom/CartBadge.tsx +84 -0
  128. package/skills/wix-headless/templates/ecom/CartView.tsx +543 -0
  129. package/skills/wix-headless/templates/ecom/cart.astro +13 -0
  130. package/skills/wix-headless/templates/ecom/components-ecom.css +215 -0
  131. package/skills/wix-headless/templates/ecom/discounts.ts +71 -0
  132. package/skills/wix-headless/templates/ecom/thank-you.astro +24 -0
  133. package/skills/wix-headless/templates/gift-cards/GiftCardPurchase.tsx +172 -0
  134. package/skills/wix-headless/templates/gift-cards/_home-teaser-snippet.astro +42 -0
  135. package/skills/wix-headless/templates/gift-cards/_nav-snippet.astro +11 -0
  136. package/skills/wix-headless/templates/gift-cards/components-gift-cards.css +219 -0
  137. package/skills/wix-headless/templates/gift-cards/gift-cards.astro +51 -0
  138. package/skills/wix-headless/templates/gift-cards/gift-cards.ts +75 -0
  139. package/skills/wix-headless/templates/stores/AddToCartButton.tsx +77 -0
  140. package/skills/wix-headless/templates/stores/BackInStockForm.tsx +176 -0
  141. package/skills/wix-headless/templates/stores/CategoryRail.astro +69 -0
  142. package/skills/wix-headless/templates/stores/ProductCard.astro +79 -0
  143. package/skills/wix-headless/templates/stores/ProductPurchase.tsx +397 -0
  144. package/skills/wix-headless/templates/stores/SeoTags.astro +21 -0
  145. package/skills/wix-headless/templates/stores/back-in-stock.ts +67 -0
  146. package/skills/wix-headless/templates/stores/categories.ts +155 -0
  147. package/skills/wix-headless/templates/stores/category/[slug].astro +130 -0
  148. package/skills/wix-headless/templates/stores/components-stores.css +295 -0
  149. package/skills/wix-headless/templates/stores/products/[slug].astro +128 -0
  150. package/skills/wix-headless/templates/stores/products/index.astro +101 -0
  151. package/skills/wix-manage/SKILL.md +280 -0
  152. package/skills/wix-manage/references/app-installation/install-wix-apps.md +155 -0
  153. package/skills/wix-manage/references/app-installation/list-installed-apps.md +124 -0
  154. package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +226 -0
  155. package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +95 -0
  156. package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +416 -0
  157. package/skills/wix-manage/references/bookings/bookings-staff-setup.md +255 -0
  158. package/skills/wix-manage/references/bookings/create-and-update-booking-services.md +462 -0
  159. package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +278 -0
  160. package/skills/wix-manage/references/bookings/external-calendar-integration.md +258 -0
  161. package/skills/wix-manage/references/bookings/multi-resource-service-creation.md +231 -0
  162. package/skills/wix-manage/references/calendar/configure-default-business-hours.md +226 -0
  163. package/skills/wix-manage/references/cms/cms-data-items-crud.md +422 -0
  164. package/skills/wix-manage/references/cms/cms-data-operations-extended.md +263 -0
  165. package/skills/wix-manage/references/cms/cms-ecommerce-catalog-integration.md +136 -0
  166. package/skills/wix-manage/references/cms/cms-references-and-relationships.md +160 -0
  167. package/skills/wix-manage/references/cms/cms-schema-management.md +143 -0
  168. package/skills/wix-manage/references/contacts/bulk-delete-contacts.md +73 -0
  169. package/skills/wix-manage/references/contacts/bulk-label-and-unlabel-contacts.md +67 -0
  170. package/skills/wix-manage/references/domains/domain-search-and-purchase.md +434 -0
  171. package/skills/wix-manage/references/ecommerce/api-recommendation-tracking.md +420 -0
  172. package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +267 -0
  173. package/skills/wix-manage/references/ecommerce/flow-bundle-and-save.md +290 -0
  174. package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +300 -0
  175. package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +364 -0
  176. package/skills/wix-manage/references/ecommerce/flow-seasonal-promotion.md +315 -0
  177. package/skills/wix-manage/references/ecommerce/flow-stock-mover.md +308 -0
  178. package/skills/wix-manage/references/ecommerce/flow-upsell-boost.md +271 -0
  179. package/skills/wix-manage/references/ecommerce/goal-clear-inventory.md +118 -0
  180. package/skills/wix-manage/references/ecommerce/goal-drive-cross-sells.md +122 -0
  181. package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +132 -0
  182. package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +148 -0
  183. package/skills/wix-manage/references/ecommerce/goal-seasonal-revenue.md +146 -0
  184. package/skills/wix-manage/references/ecommerce/guardrail-discount-conflicts.md +118 -0
  185. package/skills/wix-manage/references/ecommerce/guardrail-margin-protection.md +88 -0
  186. package/skills/wix-manage/references/ecommerce/guardrail-rate-pricing-sanity.md +108 -0
  187. package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +124 -0
  188. package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +299 -0
  189. package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +582 -0
  190. package/skills/wix-manage/references/ecommerce/setup-coupons.md +338 -0
  191. package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +444 -0
  192. package/skills/wix-manage/references/ecommerce/setup-shipping-rates.md +86 -0
  193. package/skills/wix-manage/references/ecommerce/setup-shipping-regions.md +56 -0
  194. package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +209 -0
  195. package/skills/wix-manage/references/ecommerce/skill-graph.md +139 -0
  196. package/skills/wix-manage/references/ecommerce/troubleshoot-checkout-delivery-dropoff.md +124 -0
  197. package/skills/wix-manage/references/ecommerce/troubleshoot-discount-not-applying.md +95 -0
  198. package/skills/wix-manage/references/events/list-events.md +203 -0
  199. package/skills/wix-manage/references/forms/create-form.md +260 -0
  200. package/skills/wix-manage/references/get-paid/create-payment-links.md +212 -0
  201. package/skills/wix-manage/references/get-paid/how-to-setup-wix-payments.md +57 -0
  202. package/skills/wix-manage/references/get-paid/payment-links-for-bookings.md +101 -0
  203. package/skills/wix-manage/references/media/upload-media-to-wix.md +216 -0
  204. package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +77 -0
  205. package/skills/wix-manage/references/pricing-plans/pricing-plans-bookings-integration.md +166 -0
  206. package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +336 -0
  207. package/skills/wix-manage/references/rich-content/ricos-converter-service.md +295 -0
  208. package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +59 -0
  209. package/skills/wix-manage/references/sites/create-site-from-template.md +183 -0
  210. package/skills/wix-manage/references/sites/query-sites.md +125 -0
  211. package/skills/wix-manage/references/stores/add-store-pages-to-site.md +57 -0
  212. package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +1041 -0
  213. package/skills/wix-manage/references/stores/create-product-catalog-v1.md +125 -0
  214. package/skills/wix-manage/references/stores/create-product-from-image.md +824 -0
  215. package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +566 -0
  216. package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +194 -0
  217. package/skills/wix-manage/references/stores/query-products-catalog-v1.md +80 -0
  218. package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +99 -0
  219. package/skills/wix-manage/references/stores/update-product-pre-order.md +213 -0
  220. package/skills/wix-manage/references/stores/update-product-with-options.md +318 -0
@@ -0,0 +1,170 @@
1
+ # Component Directionality (RTL/LTR)
2
+
3
+ Rules and patterns for direction support in Editor React components.
4
+
5
+ ---
6
+
7
+ ## Rules
8
+
9
+ Direction support is mandatory for every component. The pattern uses native HTML `dir` attributes for standards-compliant, accessible directionality support, with mandatory fallback classes on root components.
10
+
11
+ ### Direction Resolution
12
+
13
+ ```typescript
14
+ const subComponentDirection = elementProps?.subComponent?.direction;
15
+ ```
16
+
17
+ - Sub-component directions only applied when explicitly set (to override inherited direction)
18
+ - When undefined: inherits direction from parent via CSS inheritance
19
+ - Root component always gets fallback class
20
+
21
+ ### Direction Anti-Patterns
22
+
23
+ ```scss
24
+ /* ❌ Don't use CSS variables for direction */
25
+ .component { direction: var(--component-direction, ltr); }
26
+ ```
27
+
28
+ ```tsx
29
+ /* ❌ Don't use conditional logic for fallback class */
30
+ className={classNames({
31
+ [styles.fallbackDirection]: !direction
32
+ })}
33
+ ```
34
+
35
+ ### RTL in SCSS
36
+
37
+ Use logical CSS properties — never physical `left`/`right`-only layouts. See §2.1 below.
38
+
39
+ ---
40
+
41
+ ## Patterns
42
+
43
+ ### Root Element Pattern
44
+
45
+ Apply on main component only:
46
+
47
+ ```typescript
48
+ <div
49
+ dir={direction}
50
+ className={classNames(
51
+ styles.root,
52
+ className,
53
+ styles.fallbackDirection,
54
+ )}
55
+ >
56
+ ```
57
+
58
+ ```scss
59
+ .fallbackDirection:not([dir]) {
60
+ direction: var(--wix-opt-in-direction);
61
+ }
62
+ ```
63
+
64
+ **Imports:**
65
+
66
+ ```typescript
67
+ import type { Direction } from '@wix/editor-react-types';
68
+ ```
69
+
70
+ ### Child Element Direction
71
+
72
+ Only when explicitly specified:
73
+
74
+ ```typescript
75
+ const labelDirection = elementProps?.label?.direction;
76
+
77
+ <span
78
+ dir={labelDirection}
79
+ >
80
+ ```
81
+
82
+ ### Runtime Direction Checking
83
+
84
+ **Environment Service (for site direction):**
85
+
86
+ Use service when direction drives JavaScript behavior (keyboard navigation, animation logic, conditional rendering).
87
+
88
+ ```typescript
89
+ import { useService } from '@wix/services-manager-react';
90
+ import { EnvironmentDefinition } from '@wix/environment-service/definition';
91
+
92
+ const environmentService = useService(EnvironmentDefinition);
93
+ const siteDirection = environmentService.getLanguageDirection();
94
+ const isRTL = siteDirection === 'rtl';
95
+ ```
96
+
97
+ **Fallback chain (for child components):**
98
+
99
+ ```typescript
100
+ const isRTL = (direction || parentDirection || siteDirection) === 'rtl';
101
+ ```
102
+
103
+ **CSS Variable**
104
+
105
+ Use css variable `--wix-opt-in-direction-multiplier` when direction only affects visual appearance (transforms, spacing, layout):
106
+
107
+ ```scss
108
+ .scrollButton {
109
+ scale: var(--wix-opt-in-direction-multiplier, 1) 1;
110
+ }
111
+ ```
112
+
113
+ ### RTL Support — Use Logical CSS Properties
114
+
115
+ **✅ Correct:**
116
+
117
+ ```scss
118
+ .element {
119
+ inset-inline-start: 0; // Instead of left
120
+ inset-inline-end: 0; // Instead of right
121
+ padding-inline-start: 8px; // Instead of padding-left
122
+ margin-inline-end: 4px; // Instead of margin-right
123
+ }
124
+ ```
125
+
126
+ **❌ Wrong:**
127
+
128
+ ```scss
129
+ .element {
130
+ padding-left: 8px;
131
+ [dir='rtl'] & {
132
+ padding-right: 8px; // Manual RTL - avoid
133
+ }
134
+ }
135
+ ```
136
+
137
+ Use logical CSS properties (e.g., `margin-inline-start` not `margin-left`) for RTL support.
138
+
139
+ ---
140
+
141
+ ## Common Mistake: Manual RTL Handling
142
+
143
+ **❌ Wrong:**
144
+
145
+ ```scss
146
+ .element {
147
+ padding-left: 8px;
148
+ [dir='rtl'] & {
149
+ padding-right: 8px; // Manual overrides
150
+ }
151
+ }
152
+ ```
153
+
154
+ **✅ Correct:**
155
+
156
+ ```scss
157
+ .element {
158
+ padding-inline-start: 8px; // Auto RTL/LTR
159
+ }
160
+ ```
161
+
162
+ ## Container Components and RTL Inheritance
163
+
164
+ Elements that render `React.ReactNode` content MUST have `dir="ltr"` to prevent RTL inheritance from the parent component:
165
+
166
+ ```tsx
167
+ <Accordion.Content dir="ltr">
168
+ {item.content} {/* React.ReactNode */}
169
+ </Accordion.Content>
170
+ ```
@@ -0,0 +1,6 @@
1
+ # React Site Component edition
2
+
3
+ Always follow this exact workflow:
4
+
5
+ 1. Make changes in the component's code
6
+ 2. Run `npx wix build && npx wix generate manifest` (PascalCase)
@@ -0,0 +1,25 @@
1
+ # What Qualifies as a Part
2
+
3
+ A **named part** is an element that a site owner would plausibly want to control independently in the editor. Zero config scans global class names and creates an editor element for each one. Each editor element can surface:
4
+
5
+ - **CSS properties** — styling controls (fill, typography, border, etc.)
6
+ - **Data** — content bindings (text, image, link, etc.)
7
+
8
+ An element deserves its own named part if a site owner would plausibly need to independently control either its styling **or** its data/content through the editor. Every named part gets exactly one global plain string class in JSX and one corresponding CSS rule. Elements that do not qualify should not get a global class.
9
+
10
+ ## Mandatory filter — apply to every candidate element
11
+
12
+ - ❌ **State or variant** (`active`, `selected`, `current`, `disabled`, `open`, `checked`) — not a part. Implement as a BEM modifier class toggled in JSX (e.g. `image-carousel__slide--active`) and a single-class CSS rule. The modifier class is CSS-only; it is not a named part.
13
+ - ❌ **Hidden/shown state of an existing part** — the hidden and shown states of a part are not separate parts. The element itself should be a named part (so the editor can control its visibility per breakpoint); creating an additional part to represent its hidden or shown variant is wrong.
14
+ - ❌ **Pure grouping wrapper** — not a part. A `<div>` whose only role is to hold already-named siblings has no independent editor surface; let layout live in the parent's CSS.
15
+ - ❌ **Child with no independent editor surface** — not a part if its styling and data are already fully owned by the parent. This applies regardless of how many siblings it has. Two ways a child's editor surface can already be covered by the parent: (1) its CSS properties are inherited or set via the parent's rule; (2) its data is defined on the parent. **Canonical example:** an `<img>` inside a carousel slide whose `src` and `alt` come from the parent slide's data, and whose visual properties (object-fit, border-radius) could equally be set on the slide's own CSS rule — the slide already owns both data and styling, so the `<img>` is not a named part. Use a CSS module class for any structural CSS it needs.
16
+ - ❌ **Positional duplicate** — not separate parts. Elements that are semantically identical and differ only in position (e.g. prev/next buttons) are one part; differentiate position with CSS (`:first-of-type` / `:last-of-type`, `data-` attribute, or `:nth-child`).
17
+ - ✅ **Passes all checks** — a named part. Classify as **Semantic** (needs `elementProps`: data, behavior, direction, event handlers) or **Styling-only** (CSS class is sufficient).
18
+
19
+ ## Sanity check — apply after producing the parts list
20
+
21
+ Before finalising, verify each proposed part against its parent:
22
+
23
+ > Would the editor controls generated for this part be a strict subset of its parent's controls?
24
+
25
+ If yes — the part adds no independent editor surface and should be removed. This catches rationalisation after-the-fact ("the parent *could* expose this CSS property too, but so could the child separately"). When in doubt, fewer parts is usully better.
@@ -0,0 +1,203 @@
1
+ # Props vs CSS
2
+
3
+ Rules and patterns for handling visual/layout properties that vary by breakpoint.
4
+
5
+ ---
6
+
7
+ ## Should This Be a React Prop or CSS?
8
+
9
+ ```
10
+ Is this a content/data property?
11
+ │
12
+ ├─ YES → Can it be derived from other props / internal state?
13
+ │ │
14
+ │ ├─ YES (subtotal = price × qty, fullName = first + last, etc.)
15
+ │ │ └─ ❌ NOT a prop → compute internally
16
+ │ │
17
+ │ └─ NO (label, items, imageSrc, link, title, etc.)
18
+ │ └─ ✅ React prop
19
+ │
20
+ └─ NO → Would a user want this to vary per breakpoint?
21
+ │
22
+ ├─ YES (showLabel, orientation, displayMode, iconPosition)
23
+ │ └─ ❌ NOT a prop → CSS only
24
+ │
25
+ └─ NO → Is it direction (RTL/LTR)?
26
+ │
27
+ ├─ YES
28
+ │ └─ ✅ React prop (internationalization)
29
+ │
30
+ └─ NO → Is it behavior (disabled, required)?
31
+ │
32
+ ├─ YES
33
+ │ └─ ✅ React prop
34
+ │
35
+ └─ NO
36
+ └─ ❌ NOT a prop → CSS only
37
+ ```
38
+
39
+ ---
40
+
41
+ ## Rules
42
+
43
+ Components must distinguish between content/data and visual/layout properties:
44
+
45
+ - **Content/Data** (same across all breakpoints) → React props ✅
46
+ - **Visual/Layout** (vary by breakpoint) → CSS only, NOT props ❌
47
+
48
+ ### What CAN be props
49
+
50
+ - Content data that stays the same: `label`, `items`, `imageSrc`, `link`, `title`
51
+ - Behavior that's consistent: `disabled`, `required`, `searchable`, `multiple`
52
+
53
+ ### What CANNOT be props (must be CSS)
54
+
55
+ - Visual display decisions: `showLabel`, `showIcon`, `displayMode`, `iconOnly`
56
+ - Layout decisions: `orientation`, `alignment`, `compact`
57
+ - Visibility toggles: `hideOnMobile`, `showOnDesktop`, `mobileView`
58
+
59
+ ### Critical: ALL Show/Hide Toggles Are Visual/Layout Properties
60
+
61
+ Props like `showProgressBar`, `showVolumeControls`, `showTimeDisplay`, `showNavigation`, `showControls` are visual display decisions that CANNOT be props.
62
+
63
+ **Why:** Show/hide decisions affect layout and users need breakpoint control:
64
+
65
+ - Show progress bar on desktop, hide on mobile
66
+ - Show cover art on desktop, hide on tablet
67
+ - Show full controls on large screens, minimal on small screens
68
+
69
+ **Pattern:** These look like "feature toggles" but they're actually "layout modes".
70
+
71
+ **Exception:** `direction` (RTL/LTR) is a mandatory prop for internationalization, not a breakpoint-responsive property.
72
+
73
+ **Critical Rule:** If a property should be customizable per breakpoint, it CANNOT be a React prop.
74
+
75
+ ### How to Implement
76
+
77
+ Visibility/display properties can be overridden per breakpoint by the user via the editor — but, just like background colors, the component still authors the resting defaults in CSS:
78
+
79
+ 1. **Always render all elements** — No conditional rendering with props
80
+ 2. **Do NOT hardcode visibility-toggling display in CSS** (e.g. `display: none` to hide an element by default) — visibility is user-controlled per breakpoint. Layout `display` (`flex`, `grid`, etc.) on layout containers is fine and expected. Resting visual properties (background, color, border-radius, padding, font) DO belong in CSS — see `CSS-GUIDELINES.md`.
81
+ 3. **Visibility is user-controlled** — Users control what shows/hides per breakpoint via the editor
82
+
83
+ ```tsx
84
+ // ✅ CORRECT: Always render
85
+ <div className={styles.progressBar}>...</div>
86
+ <div className={styles.volumeControls}>...</div>
87
+ <div className={styles.trackInfo}>...</div>
88
+
89
+ // SCSS: no `display: none` default — visibility is user-controlled per breakpoint
90
+ .progressBar {
91
+ position: relative;
92
+ }
93
+ ```
94
+
95
+ ### How to Identify
96
+
97
+ Ask these questions in order:
98
+
99
+ 1. **"Would a user want this to vary per breakpoint?"** (mobile vs desktop vs tablet)
100
+ - If YES → CSS only, NOT a prop
101
+
102
+ 2. **"Does this control WHAT is displayed vs WHICH content to display?"**
103
+ - `showProgressBar` → Controls WHAT (layout decision) → CSS only
104
+ - `audioUrl` → Specifies WHICH audio file (content) → Prop is OK
105
+
106
+ 3. **"Does it change the visual appearance or layout?"**
107
+ - `showControls`, `orientation`, `alignment` → Visual/layout → CSS only
108
+ - `disabled`, `required`, `autoPlay` → Behavior (not visual) → Props are OK
109
+
110
+ **Rule of thumb:** If the prop name starts with `show*`, `hide*`, `display*` → It's CSS-only.
111
+
112
+ **Examples:**
113
+
114
+ - ✅ **Visual properties:** Show/hide elements, display modes → CSS only
115
+ - ✅ **Layout properties:** Orientation, alignment, spacing variations, flex/grid directions → CSS only
116
+ - ❌ **Content properties:** Text, media URLs, links, data → Props are OK
117
+ - ❌ **Internationalization:** RTL/LTR (`direction` prop) → Props are OK (not breakpoint-responsive)
118
+
119
+ ---
120
+
121
+ ## Patterns
122
+
123
+ ### Correct: Only Data as Props
124
+
125
+ **❌ Wrong — visual properties as props:**
126
+
127
+ ```typescript
128
+ interface ButtonProps {
129
+ showLabel?: boolean; // ❌ Breakpoint-customizable
130
+ showIcon?: boolean; // ❌ Breakpoint-customizable
131
+ displayMode?: 'icon-only' | 'label-only' | 'both'; // ❌
132
+ iconPosition?: 'left' | 'right'; // ❌ Layout
133
+ orientation?: 'horizontal' | 'vertical'; // ❌ Layout
134
+ }
135
+ ```
136
+
137
+ **✅ Correct — only data as props:**
138
+
139
+ ```typescript
140
+ interface ButtonProps {
141
+ label: string; // ✅ Content data
142
+ icon: VectorArt; // ✅ Content data
143
+ }
144
+ ```
145
+
146
+ ### Correct: Always Render, Users Control Visibility
147
+
148
+ **❌ Wrong — show/hide as props:**
149
+
150
+ ```typescript
151
+ interface AudioPlayerProps {
152
+ showProgressBar?: boolean; // ❌ Layout decision
153
+ showVolumeControls?: boolean; // ❌ Layout decision
154
+ showTimeDisplay?: boolean; // ❌ Layout decision
155
+ showTrackInfo?: boolean; // ❌ Layout decision
156
+ }
157
+
158
+ // Conditional rendering
159
+ {showProgressBar && <div className={styles.progressBar}>...</div>}
160
+ ```
161
+
162
+ **✅ Correct — always render, users control visibility:**
163
+
164
+ ```typescript
165
+ interface AudioPlayerProps {
166
+ audioUrl: string; // ✅ Content data only
167
+ title?: string; // ✅ Content data
168
+ artist?: string; // ✅ Content data
169
+ }
170
+
171
+ // Always render all elements
172
+ <div className={styles.progressBar}>...</div>
173
+ <div className={styles.volumeControls}>...</div>
174
+ <div className={styles.trackInfo}>...</div>
175
+
176
+ // SCSS: no `display: none` default — visibility is user-controlled per breakpoint
177
+ .progressBar {
178
+ position: relative;
179
+ }
180
+ ```
181
+
182
+ ---
183
+
184
+ ## Common Mistake: Adding Visual Toggle Props
185
+
186
+ **❌ Wrong:**
187
+
188
+ ```typescript
189
+ export interface ButtonProps {
190
+ showIcon?: boolean; // ❌ Breakpoint-customizable
191
+ iconPosition?: 'left' | 'right'; // ❌ Layout
192
+ }
193
+ ```
194
+
195
+ **✅ Correct:**
196
+
197
+ ```typescript
198
+ export interface ButtonProps {
199
+ label: string;
200
+ icon: VectorArt;
201
+ // Visual variations via CSS
202
+ }
203
+ ```
@@ -0,0 +1,167 @@
1
+ # React Component Implementation Guide
2
+
3
+ This guide defines rules and guidance on **how to implement** production-quality Editor React components for Wix CLI applications. Editor React components are React components that integrate with the Wix Editor, allowing site owners to customize content, styling, and behavior through a visual interface.
4
+
5
+ **Topic reference files:**
6
+ - [`PARTS.md`](PARTS.md) — What qualifies as a named part (mandatory filter)
7
+ - [`ACCESSIBILITY.md`](ACCESSIBILITY.md) — ARIA/a11y rules and patterns
8
+ - [`DIRECTIONALITY.md`](DIRECTIONALITY.md) — RTL/LTR rules and patterns
9
+ - [`PROPS-VS-CSS.md`](PROPS-VS-CSS.md) — What should be a React prop vs CSS
10
+ - [`COMPONENT-API.md`](COMPONENT-API.md) — Props structure, elementProps, data types, file splitting, containers, array props
11
+ - [`REACT-PATTERNS.md`](REACT-PATTERNS.md) — SSR-safe patterns, CSS rules, common mistakes
12
+
13
+ ## React 18 features are not supported
14
+
15
+ The Wix runtime does not currently support React 18 features. Stick
16
+ to React 17-compatible APIs and avoid libraries that depend on
17
+ React 18 features.
18
+
19
+ # Part 0: Component Behavior Guide
20
+
21
+ Understand the component and infer its behavior. Extract what is provided; use reasonable defaults for anything not specified.
22
+
23
+ 1. **Identity** — Component name.
24
+ 2. **Structure** — Identify named parts by applying the mandatory filter in [`PARTS.md`](PARTS.md) to every candidate element before accepting it as a part. Include content/data props (labels, items, types, required vs optional) and configuration (toggles, choices, ranges, modes).
25
+ 3. **Interactions** — Clicks, hover/focus; what is exposed as event props vs handled internally.
26
+
27
+ **Understanding → implementation (checklist):** For every part, decide `elementProps` vs CSS-only; build the props interface (data + behavior); wire interaction in React (`useState`, `useEffect`, refs, native event handlers); generate TS + CSS. Infer reasonable defaults where anything is unspecified.
28
+
29
+ # Part 1: Standards & Conventions
30
+
31
+ These are the mandatory patterns and conventions for all components.
32
+
33
+ ## 1.1 Mandatory Features
34
+
35
+ Every component MUST include:
36
+
37
+ ### Direction Support (RTL/LTR)
38
+
39
+ Direction support is mandatory — see [`DIRECTIONALITY.md`](DIRECTIONALITY.md).
40
+
41
+ ### Accessibility ARIA Support
42
+
43
+ See [`ACCESSIBILITY.md`](ACCESSIBILITY.md) for full rules and patterns.
44
+
45
+ ### TypeScript
46
+
47
+ - All components must be fully typed
48
+ - NO `any` types
49
+ - Export all prop interfaces
50
+ - Use proper React types (`React.FC`, `React.ReactNode`, etc.)
51
+ - **Array type syntax:** Use `Array<T>` instead of `T[]` (e.g., `Array<Item>` not `Item[]`)
52
+ - **Array element types:** `T` must be an object with named keys — `Array<{ key: ValueType, ... }>` or a named interface that is itself a keyed object. Never `Array<string>`, `Array<number>`, `Array<boolean>`, or `Array<DataType>` (`Image`, `Link`, `Video`, `Audio`, `VectorArt`, `RichText`, etc.). See [`COMPONENT-API.md`](COMPONENT-API.md) for full rules.
53
+ - **Component function pattern:**
54
+ - Use inline arrow functions with `export const`
55
+ - Accept `props` as the argument (do NOT destructure in function signature)
56
+ - Destructure props inside the component body
57
+
58
+ ## 1.2 Implementation Standards
59
+
60
+ ### When to Use elementProps
61
+
62
+ See [`COMPONENT-API.md`](COMPONENT-API.md) for full elementProps rules and the decision tree.
63
+
64
+ ### React & Runtime Standards
65
+
66
+ All components MUST follow these patterns:
67
+
68
+ **1. SSR-Safe Implementation**
69
+
70
+ - NO browser APIs at module scope (window, document, navigator, etc.)
71
+ - Guard browser APIs with typeof checks or useEffect
72
+ - All browser-dependent logic must run client-side only
73
+
74
+ See [`REACT-PATTERNS.md`](REACT-PATTERNS.md) §1.1 for code examples.
75
+
76
+ **2. Clean Code**
77
+
78
+ - NO TypeScript errors
79
+ - NO unused variables or imports
80
+ - NO comments in React component files — code should be self-documenting through clear naming
81
+ - NO TODO comments in generated code
82
+ - **Remove ALL comments from the final component** — including any comments from templates/examples
83
+
84
+ **3. Data-Driven Components (NO children in exported props)**
85
+
86
+ See [`COMPONENT-API.md`](COMPONENT-API.md) for full rules and patterns.
87
+
88
+ **4. Breakpoint-Responsive Properties (NO props for visual variations)**
89
+
90
+ See [`PROPS-VS-CSS.md`](PROPS-VS-CSS.md) for full rules and patterns.
91
+
92
+ **5. Reactive to Prop Changes**
93
+
94
+ - Components MUST react to prop changes
95
+ - If state is derived from props, use `useEffect` with prop dependencies
96
+ - State initialized from props should update when props change
97
+
98
+ **6. Event Handler Scope (Internal by Default)**
99
+
100
+ Unless explicitly specified as a component capability/API in the specification, all event handlers are **internal** and NOT exposed as props.
101
+
102
+ **Internal handlers (default):**
103
+
104
+ - Used for component behavior (autoplay, animations, state management)
105
+ - NOT exposed in the component's props interface
106
+
107
+ **External handlers (only when specified):**
108
+
109
+ - Only expose handlers that are explicitly listed as component capabilities
110
+ - Example: If specification says "onClick callback for external control", then add `onClick?: () => void` to props
111
+
112
+ **Child component handlers:**
113
+
114
+ - Internal sub-components receive handlers from parent via props
115
+ - These are still internal to the main component
116
+
117
+ ## 1.3 Implementation Workflow
118
+
119
+ ### Step 1: Analyze Component Parts
120
+
121
+ For each part of the component, decide:
122
+
123
+ **CSS class only if**:
124
+
125
+ - ✅ Purely visual/decorative
126
+ - ✅ No data or configuration needed
127
+ - ✅ No direction override needed
128
+ - ✅ No custom behavior needed
129
+
130
+ **Use elementProps if**:
131
+
132
+ - ✅ Needs data/content
133
+ - ✅ Needs direction override
134
+ - ✅ Has state or behavior
135
+ - ✅ Needs event handlers
136
+
137
+ See [`COMPONENT-API.md`](COMPONENT-API.md) and [`PROPS-VS-CSS.md`](PROPS-VS-CSS.md) for the decision trees.
138
+
139
+ ### Step 2: Build Props Interface
140
+
141
+ Combine:
142
+
143
+ 1. Data/content props (from specification)
144
+ 2. Behavior props (from specification)
145
+ 3. Mandatory React props (direction, a11y, className, id)
146
+ 4. elementProps (only for parts that need it)
147
+
148
+ ### Step 3: Implement
149
+
150
+ Follow Part 2 templates with mandatory patterns applied.
151
+
152
+ # Part 2: CSS Rules
153
+
154
+ All CSS authoring rules — root layout, naming, RTL, state styles,
155
+ transitions, etc. — live in [`CSS-GUIDELINES.md`](CSS-GUIDELINES.md).
156
+
157
+ See [`PROPS-VS-CSS.md`](PROPS-VS-CSS.md) and [`COMPONENT-API.md`](COMPONENT-API.md) for the prop vs CSS vs `elementProps` decision trees.
158
+
159
+ # Part 3: Examples & Reference
160
+
161
+ ## 3.1 Implementation Checklist
162
+
163
+ **Phase 1: Analysis** — Parse information, map component structure (see Part 0)
164
+
165
+ **Phase 2: Component File** — Apply all §1.1 mandatory features and §1.2 implementation standards
166
+
167
+ **Phase 3: Styles** — Apply Part 2 SCSS rules