@wix/agent-skills 1.20.0 → 1.21.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.
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +14 -112
- package/skills/wix-app/references/APP_TOOLS.md +2 -1
- package/skills/wix-app/references/BACKEND_EVENT.md +3 -3
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +41 -152
- package/skills/wix-app/references/DASHBOARD_MODAL.md +4 -4
- package/skills/wix-app/references/SDK_MODULE_MAP.md +44 -0
- package/skills/wix-app/references/SITE_PLUGIN.md +36 -190
- package/skills/wix-app/references/app-tools/TOOLS.md +3 -1
- package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +21 -0
- package/skills/wix-app/references/dashboard-page/ECOM_NAVIGATION.md +17 -0
- package/skills/wix-app/references/dashboard-plugin/SLOTS.md +4 -18
- package/skills/wix-app/references/site-plugin/EXAMPLES.md +1 -1
- package/skills/wix-headless-fast/SKILL.md +302 -51
- package/skills/wix-headless-fast/entry/skill.md +11 -2
- package/skills/wix-headless-fast/install/AGENTS.md +32 -0
- package/skills/wix-headless-fast/install/agents-md.mjs +39 -0
- package/skills/wix-headless-fast/install/attach.mjs +360 -0
- package/skills/wix-headless-fast/install/deploy.mjs +109 -9
- package/skills/wix-headless-fast/install/setup.mjs +239 -0
- package/skills/wix-headless-fast/references/blog/INSTRUCTIONS.md +226 -60
- package/skills/wix-headless-fast/references/blog/app/components/blog/BlogFeedView.tsx +2 -3
- package/skills/wix-headless-fast/references/blog/app/components/blog/PostView.tsx +2 -3
- package/skills/wix-headless-fast/references/blog/app/hooks/blog/useBlogFeed.ts +24 -116
- package/skills/wix-headless-fast/references/blog/app/hooks/blog/usePost.ts +16 -64
- package/skills/wix-headless-fast/references/blog/app/wix/blog/blog-feed-store.ts +137 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/post-store.ts +78 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/posts-core.ts +117 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/posts.ts +13 -60
- package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy-core.ts +47 -0
- package/skills/wix-headless-fast/references/blog/app/wix/blog/taxonomy.ts +10 -28
- package/skills/wix-headless-fast/references/blog/app-astro/pages/blog/[...slug].astro +2 -4
- package/skills/wix-headless-fast/references/blog/rest/posts.ts +42 -0
- package/skills/wix-headless-fast/references/blog/rest/taxonomy.ts +62 -0
- package/skills/wix-headless-fast/references/blog/seed/SEED.md +9 -0
- package/skills/wix-headless-fast/references/blog/seed/read-site.mjs +22 -0
- package/skills/wix-headless-fast/references/bookings/INSTRUCTIONS.md +181 -33
- package/skills/wix-headless-fast/references/bookings/app/components/bookings/ServiceBookingView.tsx +2 -1
- package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useBookingFlow.ts +26 -132
- package/skills/wix-headless-fast/references/bookings/app/hooks/bookings/useServices.ts +18 -49
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-core.ts +218 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking-flow-store.ts +169 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/booking.ts +57 -142
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-core.ts +92 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services-store.ts +90 -0
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/services.ts +22 -61
- package/skills/wix-headless-fast/references/bookings/app/wix/bookings/types.ts +3 -1
- package/skills/wix-headless-fast/references/bookings/rest/booking.ts +113 -0
- package/skills/wix-headless-fast/references/bookings/rest/services.ts +55 -0
- package/skills/wix-headless-fast/references/bookings/seed/SEED.md +10 -0
- package/skills/wix-headless-fast/references/bookings/seed/read-site.mjs +28 -0
- package/skills/wix-headless-fast/references/cms/INSTRUCTIONS.md +238 -62
- package/skills/wix-headless-fast/references/cms/app/hooks/cms/useCollection.ts +19 -52
- package/skills/wix-headless-fast/references/cms/app/hooks/cms/useItem.ts +16 -36
- package/skills/wix-headless-fast/references/cms/app/wix/cms/collection-store.ts +158 -0
- package/skills/wix-headless-fast/references/cms/app/wix/cms/item-store.ts +93 -0
- package/skills/wix-headless-fast/references/cms/app/wix/cms/items-core.ts +177 -0
- package/skills/wix-headless-fast/references/cms/app/wix/cms/items.ts +13 -41
- package/skills/wix-headless-fast/references/cms/rest/items.ts +125 -0
- package/skills/wix-headless-fast/references/cms/seed/SEED.md +9 -0
- package/skills/wix-headless-fast/references/cms/seed/read-site.mjs +20 -0
- package/skills/wix-headless-fast/references/events/INSTRUCTIONS.md +241 -83
- package/skills/wix-headless-fast/references/events/app/components/events/EventConfirmationView.tsx +1 -1
- package/skills/wix-headless-fast/references/events/app/components/events/EventRegistrationView.tsx +7 -5
- package/skills/wix-headless-fast/references/events/app/components/events/EventsView.tsx +2 -2
- package/skills/wix-headless-fast/references/events/app/hooks/events/useEventRegistration.ts +28 -110
- package/skills/wix-headless-fast/references/events/app/hooks/events/useEvents.ts +19 -54
- package/skills/wix-headless-fast/references/events/app/wix/events/events-core.ts +130 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/events-store.ts +97 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/events.ts +13 -94
- package/skills/wix-headless-fast/references/events/app/wix/events/registration-core.ts +113 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/registration-store.ts +156 -0
- package/skills/wix-headless-fast/references/events/app/wix/events/registration.ts +38 -69
- package/skills/wix-headless-fast/references/events/rest/events.ts +57 -0
- package/skills/wix-headless-fast/references/events/rest/registration.ts +83 -0
- package/skills/wix-headless-fast/references/events/seed/SEED.md +9 -0
- package/skills/wix-headless-fast/references/events/seed/read-site.mjs +26 -0
- package/skills/wix-headless-fast/references/forms/INSTRUCTIONS.md +216 -26
- package/skills/wix-headless-fast/references/forms/app/hooks/forms/useWixForm.ts +35 -267
- package/skills/wix-headless-fast/references/forms/app/wix/forms/form-store.ts +332 -0
- package/skills/wix-headless-fast/references/forms/app/wix/forms/forms-core.ts +238 -0
- package/skills/wix-headless-fast/references/forms/app/wix/forms/forms.ts +28 -243
- package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions-core.ts +216 -0
- package/skills/wix-headless-fast/references/forms/app/wix/forms/submissions.ts +32 -204
- package/skills/wix-headless-fast/references/forms/rest/forms.ts +34 -0
- package/skills/wix-headless-fast/references/forms/rest/submissions.ts +56 -0
- package/skills/wix-headless-fast/references/forms/seed/SEED.md +8 -0
- package/skills/wix-headless-fast/references/forms/seed/read-site.mjs +20 -0
- package/skills/wix-headless-fast/references/forms/seed/seed-forms.mjs +15 -8
- package/skills/wix-headless-fast/references/members/INSTRUCTIONS.md +316 -63
- package/skills/wix-headless-fast/references/members/app/components/members/LoginForm.tsx +1 -1
- package/skills/wix-headless-fast/references/members/app/wix/members/auth-core.ts +105 -0
- package/skills/wix-headless-fast/references/members/app/wix/members/auth.ts +36 -65
- package/skills/wix-headless-fast/references/members/app/wix/members/client.ts +1 -1
- package/skills/wix-headless-fast/references/members/app/wix/members/members-core.ts +43 -0
- package/skills/wix-headless-fast/references/members/app/wix/members/members.ts +11 -32
- package/skills/wix-headless-fast/references/members/rest/auth.ts +215 -0
- package/skills/wix-headless-fast/references/members/rest/members.ts +26 -0
- package/skills/wix-headless-fast/references/members/seed/read-site.mjs +15 -0
- package/skills/wix-headless-fast/references/portfolio/INSTRUCTIONS.md +240 -59
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionProjectsView.tsx +2 -2
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/CollectionsView.tsx +2 -2
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/GalleryMedia.tsx +35 -0
- package/skills/wix-headless-fast/references/portfolio/app/components/portfolio/ProjectDetailView.tsx +8 -38
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollectionProjects.ts +23 -50
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useCollections.ts +16 -34
- package/skills/wix-headless-fast/references/portfolio/app/hooks/portfolio/useProjectDetail.ts +22 -49
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collection-projects-store.ts +82 -0
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/collections-store.ts +58 -0
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio-core.ts +177 -0
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/portfolio.ts +31 -118
- package/skills/wix-headless-fast/references/portfolio/app/wix/portfolio/project-detail-store.ts +81 -0
- package/skills/wix-headless-fast/references/portfolio/rest/portfolio.ts +75 -0
- package/skills/wix-headless-fast/references/portfolio/seed/SEED.md +8 -0
- package/skills/wix-headless-fast/references/portfolio/seed/read-site.mjs +20 -0
- package/skills/wix-headless-fast/references/portfolio/seed/seed-portfolio.mjs +19 -21
- package/skills/wix-headless-fast/references/pricing-plans/INSTRUCTIONS.md +214 -51
- package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlanDetailView.tsx +9 -20
- package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/PlansView.tsx +7 -32
- package/skills/wix-headless-fast/references/pricing-plans/app/components/pricing-plans/SubscribeButton.tsx +41 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlanPurchase.ts +12 -33
- package/skills/wix-headless-fast/references/pricing-plans/app/hooks/pricing-plans/usePlans.ts +17 -34
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plan-purchase-store.ts +54 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-core.ts +106 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans-store.ts +64 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/plans.ts +7 -55
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase-core.ts +43 -0
- package/skills/wix-headless-fast/references/pricing-plans/app/wix/pricing-plans/purchase.ts +11 -34
- package/skills/wix-headless-fast/references/pricing-plans/rest/plans.ts +31 -0
- package/skills/wix-headless-fast/references/pricing-plans/rest/purchase.ts +20 -0
- package/skills/wix-headless-fast/references/pricing-plans/seed/SEED.md +8 -0
- package/skills/wix-headless-fast/references/pricing-plans/seed/read-site.mjs +21 -0
- package/skills/wix-headless-fast/references/restaurants/INSTRUCTIONS.md +242 -47
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/MenuView.tsx +2 -2
- package/skills/wix-headless-fast/references/restaurants/app/components/restaurants/OrderCartDrawer.tsx +2 -2
- package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useMenus.ts +14 -35
- package/skills/wix-headless-fast/references/restaurants/app/hooks/restaurants/useReservation.ts +28 -171
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-core.ts +155 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu-store.ts +89 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/menu.ts +23 -117
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering-core.ts +124 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/ordering.ts +45 -114
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservation-store.ts +193 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations-core.ts +94 -0
- package/skills/wix-headless-fast/references/restaurants/app/wix/restaurants/reservations.ts +15 -87
- package/skills/wix-headless-fast/references/restaurants/rest/menu.ts +60 -0
- package/skills/wix-headless-fast/references/restaurants/rest/ordering.ts +169 -0
- package/skills/wix-headless-fast/references/restaurants/rest/reservations.ts +68 -0
- package/skills/wix-headless-fast/references/restaurants/seed/SEED.md +8 -0
- package/skills/wix-headless-fast/references/restaurants/seed/read-site.mjs +25 -0
- package/skills/wix-headless-fast/references/restaurants/seed/seed-restaurants.mjs +25 -5
- package/skills/wix-headless-fast/references/shared/SUPPLIED-CONTENT.md +23 -0
- package/skills/wix-headless-fast/references/shared/app/wix/media.ts +45 -4
- package/skills/wix-headless-fast/references/shared/app/wix/sdk.ts +13 -0
- package/skills/wix-headless-fast/references/shared/rest/client.ts +155 -0
- package/skills/wix-headless-fast/references/shared/rest/config.ts +3 -0
- package/skills/wix-headless-fast/references/shared/rest/media.ts +65 -0
- package/skills/wix-headless-fast/references/shared/seed/read-site.mjs +99 -0
- package/skills/wix-headless-fast/references/storefront/INSTRUCTIONS.md +186 -63
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/OptionPicker.tsx +95 -0
- package/skills/wix-headless-fast/references/storefront/app/components/storefront/QuickAdd.tsx +29 -58
- package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useProductDetail.ts +29 -163
- package/skills/wix-headless-fast/references/storefront/app/hooks/storefront/useShop.ts +26 -300
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart-core.ts +121 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/cart.ts +49 -162
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog-core.ts +314 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/catalog.ts +47 -370
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/product-detail-store.ts +147 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/shop-store.ts +289 -0
- package/skills/wix-headless-fast/references/storefront/app/wix/storefront/types.ts +2 -0
- package/skills/wix-headless-fast/references/storefront/rest/cart.ts +132 -0
- package/skills/wix-headless-fast/references/storefront/rest/catalog.ts +123 -0
- package/skills/wix-headless-fast/references/storefront/seed/SEED.md +31 -9
- package/skills/wix-headless-fast/references/storefront/seed/read-site.mjs +38 -0
- package/skills/wix-headless-fast/references/storefront/seed/seed-store.mjs +57 -50
- package/skills/wix-manage/references/ecommerce/ecom-shipping.md +1 -1
- package/skills/wix-manage/references/ecommerce/pricing-promotions/ecom-pricing-create-coupon.md +10 -19
- package/skills/wix-manage/references/events/create-wix-event.md +5 -1
- package/skills/wix-vibe-headless/references/storefront/INSTRUCTIONS.md +0 -40
- package/skills/wix-vibe-headless/references/storefront/seed/SEED.md +3 -0
- package/skills/wix-vibe-headless/references/storefront/seed/seed-store.cjs +6 -0
- package/skills/wix-headless-fast/install/fast-path.mjs +0 -186
- package/skills/wix-headless-fast/install/pin-agents-md.mjs +0 -57
|
@@ -5,7 +5,7 @@ Site plugins are custom elements that integrate into predefined **slots** within
|
|
|
5
5
|
|
|
6
6
|
## Scaffold
|
|
7
7
|
|
|
8
|
-
Use `wix generate --params` with `extensionType: SITE_PLUGIN`. `slotId` is `<componentId>:<slotId>` — the colon-joined widget component ID and slot ID. Run `wix schema generate --type SITE_PLUGIN` to list the available `slotId` values
|
|
8
|
+
Use `wix generate --params` with `extensionType: SITE_PLUGIN`. `slotId` is `<componentId>:<slotId>` — the colon-joined widget component ID and slot ID. Run `wix schema generate --type SITE_PLUGIN` to list the available `slotId` values. The CLI generates the folder, the plugin `.tsx`, the settings panel `.tsx`, the builder file, the UUID, the logo SVG, and the `src/extensions.ts` registration.
|
|
9
9
|
|
|
10
10
|
## Architecture
|
|
11
11
|
|
|
@@ -43,49 +43,21 @@ Site plugins use native `HTMLElement` custom elements:
|
|
|
43
43
|
```typescript
|
|
44
44
|
// my-site-plugin.tsx
|
|
45
45
|
class MyElement extends HTMLElement {
|
|
46
|
-
static get observedAttributes() {
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
constructor() {
|
|
51
|
-
super();
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
connectedCallback() {
|
|
55
|
-
this.render();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
attributeChangedCallback() {
|
|
59
|
-
this.render();
|
|
60
|
-
}
|
|
46
|
+
static get observedAttributes() { return ['display-name']; }
|
|
47
|
+
connectedCallback() { this.render(); }
|
|
48
|
+
attributeChangedCallback() { this.render(); }
|
|
61
49
|
|
|
62
50
|
render() {
|
|
63
51
|
const displayName = this.getAttribute('display-name') || "Your Plugin's Title";
|
|
64
|
-
|
|
65
|
-
this.innerHTML = `
|
|
66
|
-
<div style="font-size: 16px; padding: 16px; border: 1px solid #ccc; border-radius: 8px; margin: 16px;">
|
|
67
|
-
<h2>${displayName}</h2>
|
|
68
|
-
<hr />
|
|
69
|
-
<p>
|
|
70
|
-
This is a Site Plugin generated by Wix CLI.<br />
|
|
71
|
-
Edit your element's code to change this text.
|
|
72
|
-
</p>
|
|
73
|
-
</div>
|
|
74
|
-
`;
|
|
52
|
+
this.innerHTML = `<div style="padding: 16px;"><h2>${displayName}</h2></div>`;
|
|
75
53
|
}
|
|
76
54
|
}
|
|
77
55
|
|
|
78
56
|
export default MyElement;
|
|
79
57
|
```
|
|
80
58
|
|
|
81
|
-
**Key Points
|
|
59
|
+
**Key Points** (beyond the structure already listed under [Architecture](#architecture)):
|
|
82
60
|
|
|
83
|
-
- Extend `HTMLElement` class directly
|
|
84
|
-
- Define `observedAttributes` static getter to list reactive attributes
|
|
85
|
-
- Attributes use **kebab-case** (e.g., `display-name`, `bg-color`)
|
|
86
|
-
- Implement `connectedCallback()` for initial render
|
|
87
|
-
- Implement `attributeChangedCallback()` to re-render when attributes change
|
|
88
|
-
- Use inline styles via template strings
|
|
89
61
|
- Use `this.getAttribute('attribute-name')` to read attribute values
|
|
90
62
|
- Wix handles `define()` for you — do NOT call `customElements.define()` in your code
|
|
91
63
|
|
|
@@ -93,30 +65,22 @@ export default MyElement;
|
|
|
93
65
|
|
|
94
66
|
```typescript
|
|
95
67
|
// my-site-plugin.panel.tsx
|
|
96
|
-
import
|
|
68
|
+
import { type FC, useState, useEffect, useCallback, type ChangeEvent } from 'react';
|
|
97
69
|
import { widget } from '@wix/editor';
|
|
98
|
-
import {
|
|
99
|
-
SidePanel,
|
|
100
|
-
WixDesignSystemProvider,
|
|
101
|
-
Input,
|
|
102
|
-
FormField,
|
|
103
|
-
} from '@wix/design-system';
|
|
70
|
+
import { SidePanel, WixDesignSystemProvider, Input, FormField } from '@wix/design-system';
|
|
104
71
|
import '@wix/design-system/styles.global.css';
|
|
105
72
|
|
|
106
73
|
const Panel: FC = () => {
|
|
107
|
-
const [displayName, setDisplayName] = useState
|
|
74
|
+
const [displayName, setDisplayName] = useState('');
|
|
108
75
|
|
|
109
76
|
useEffect(() => {
|
|
110
|
-
widget.getProp('display-name')
|
|
111
|
-
|
|
112
|
-
.catch(error => console.error('Failed to fetch display-name:', error));
|
|
113
|
-
}, [setDisplayName]);
|
|
77
|
+
widget.getProp('display-name').then(v => setDisplayName(v || "Your Plugin's Title"));
|
|
78
|
+
}, []);
|
|
114
79
|
|
|
115
|
-
const handleDisplayNameChange = useCallback((
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}, [setDisplayName]);
|
|
80
|
+
const handleDisplayNameChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {
|
|
81
|
+
setDisplayName(e.target.value);
|
|
82
|
+
widget.setProp('display-name', e.target.value);
|
|
83
|
+
}, []);
|
|
120
84
|
|
|
121
85
|
return (
|
|
122
86
|
<WixDesignSystemProvider>
|
|
@@ -124,12 +88,7 @@ const Panel: FC = () => {
|
|
|
124
88
|
<SidePanel.Content noPadding stretchVertically>
|
|
125
89
|
<SidePanel.Field>
|
|
126
90
|
<FormField label="Display Name">
|
|
127
|
-
<Input
|
|
128
|
-
type="text"
|
|
129
|
-
value={displayName}
|
|
130
|
-
onChange={handleDisplayNameChange}
|
|
131
|
-
aria-label="Display Name"
|
|
132
|
-
/>
|
|
91
|
+
<Input type="text" value={displayName} onChange={handleDisplayNameChange} aria-label="Display Name" />
|
|
133
92
|
</FormField>
|
|
134
93
|
</SidePanel.Field>
|
|
135
94
|
</SidePanel.Content>
|
|
@@ -141,13 +100,9 @@ const Panel: FC = () => {
|
|
|
141
100
|
export default Panel;
|
|
142
101
|
```
|
|
143
102
|
|
|
144
|
-
**Key Points
|
|
103
|
+
**Key Points** (beyond the structure already listed under [Architecture](#architecture)):
|
|
145
104
|
|
|
146
|
-
-
|
|
147
|
-
- Always update both local state AND widget prop in onChange handlers
|
|
148
|
-
- Widget properties are bound to custom element attributes — changes automatically update the corresponding attribute
|
|
149
|
-
- Wrap content in `WixDesignSystemProvider > SidePanel > SidePanel.Content`
|
|
150
|
-
- Use WDS components from `@wix/design-system`
|
|
105
|
+
- Always update both local state AND widget prop in the same onChange handler
|
|
151
106
|
- Import `@wix/design-system/styles.global.css` for styles
|
|
152
107
|
- Include `aria-label` for accessibility
|
|
153
108
|
|
|
@@ -160,28 +115,17 @@ Site plugin settings panels can use `inputs.selectColor()` and `inputs.selectFon
|
|
|
160
115
|
Opens the Wix color picker with theme colors, gradients, and more — **NOT** a basic HTML `<input type="color">`.
|
|
161
116
|
|
|
162
117
|
```typescript
|
|
163
|
-
import
|
|
118
|
+
import { type FC } from 'react';
|
|
164
119
|
import { inputs } from '@wix/editor';
|
|
165
120
|
import { FormField, Box, FillPreview, SidePanel } from '@wix/design-system';
|
|
166
121
|
|
|
167
|
-
interface ColorPickerFieldProps {
|
|
168
|
-
label: string;
|
|
169
|
-
value: string;
|
|
170
|
-
onChange: (value: string) => void;
|
|
171
|
-
}
|
|
122
|
+
interface ColorPickerFieldProps { label: string; value: string; onChange: (value: string) => void; }
|
|
172
123
|
|
|
173
|
-
export const ColorPickerField: FC<ColorPickerFieldProps> = ({
|
|
174
|
-
label,
|
|
175
|
-
value,
|
|
176
|
-
onChange,
|
|
177
|
-
}) => (
|
|
124
|
+
export const ColorPickerField: FC<ColorPickerFieldProps> = ({ label, value, onChange }) => (
|
|
178
125
|
<SidePanel.Field>
|
|
179
126
|
<FormField label={label}>
|
|
180
127
|
<Box width="30px" height="30px">
|
|
181
|
-
<FillPreview
|
|
182
|
-
fill={value}
|
|
183
|
-
onClick={() => inputs.selectColor(value, { onChange: (val) => { if (val) onChange(val); } })}
|
|
184
|
-
/>
|
|
128
|
+
<FillPreview fill={value} onClick={() => inputs.selectColor(value, { onChange: (val) => val && onChange(val) })} />
|
|
185
129
|
</Box>
|
|
186
130
|
</FormField>
|
|
187
131
|
</SidePanel.Field>
|
|
@@ -190,78 +134,21 @@ export const ColorPickerField: FC<ColorPickerFieldProps> = ({
|
|
|
190
134
|
|
|
191
135
|
### FontPickerField
|
|
192
136
|
|
|
193
|
-
Opens the Wix font picker
|
|
137
|
+
Opens the Wix font picker (family, size, bold, italic). Same shape as `ColorPickerField` above, with a `Button`+`Text` trigger instead of `FillPreview`, calling `inputs.selectFont(value, { onChange })` instead of `selectColor`. Value type: `{ font: string; textDecoration: string }`.
|
|
194
138
|
|
|
195
|
-
|
|
196
|
-
import React, { type FC } from 'react';
|
|
197
|
-
import { inputs } from '@wix/editor';
|
|
198
|
-
import { FormField, Button, Text, SidePanel } from '@wix/design-system';
|
|
199
|
-
|
|
200
|
-
interface FontValue {
|
|
201
|
-
font: string;
|
|
202
|
-
textDecoration: string;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
interface FontPickerFieldProps {
|
|
206
|
-
label: string;
|
|
207
|
-
value: FontValue;
|
|
208
|
-
onChange: (value: FontValue) => void;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
export const FontPickerField: FC<FontPickerFieldProps> = ({
|
|
212
|
-
label,
|
|
213
|
-
value,
|
|
214
|
-
onChange,
|
|
215
|
-
}) => (
|
|
216
|
-
<SidePanel.Field>
|
|
217
|
-
<FormField label={label}>
|
|
218
|
-
<Button
|
|
219
|
-
size="small"
|
|
220
|
-
priority="secondary"
|
|
221
|
-
onClick={() => inputs.selectFont(value, { onChange: (val) => onChange({ font: val.font, textDecoration: val.textDecoration || "" }) })}
|
|
222
|
-
fullWidth
|
|
223
|
-
>
|
|
224
|
-
<Text size="small" ellipsis>Change Font</Text>
|
|
225
|
-
</Button>
|
|
226
|
-
</FormField>
|
|
227
|
-
</SidePanel.Field>
|
|
228
|
-
);
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
**Important:**
|
|
232
|
-
- Always use `inputs.selectColor()` from `@wix/editor` with `FillPreview` — do NOT use `<Input type="color">`
|
|
233
|
-
- Always use `inputs.selectFont()` from `@wix/editor` with the callback pattern `inputs.selectFont(value, { onChange })`
|
|
234
|
-
- Import `inputs` from `@wix/editor` (not from `@wix/sdk`)
|
|
235
|
-
|
|
236
|
-
## Attribute Naming Convention
|
|
237
|
-
|
|
238
|
-
Site plugins use **kebab-case** consistently for HTML attributes:
|
|
239
|
-
|
|
240
|
-
| File | Convention | Example |
|
|
241
|
-
| --------------------------------- | ---------- | ---------------------------------- |
|
|
242
|
-
| `<plugin>.tsx` (getAttribute) | kebab-case | `this.getAttribute('display-name')` |
|
|
243
|
-
| `<plugin>.tsx` (observedAttributes) | kebab-case | `['display-name', 'bg-color']` |
|
|
244
|
-
| `<plugin>.panel.tsx` (widget API) | kebab-case | `widget.getProp('display-name')` |
|
|
139
|
+
**Important:** always go through `inputs` from `@wix/editor` (never `<Input type="color">`, never `@wix/sdk`) with the `{ onChange }` callback pattern shown above.
|
|
245
140
|
|
|
246
141
|
## References
|
|
247
142
|
|
|
248
143
|
| Topic | Reference |
|
|
249
144
|
| --- | --- |
|
|
250
145
|
| Complete Examples | [EXAMPLES.md](site-plugin/EXAMPLES.md) |
|
|
251
|
-
| Slots (App IDs, runtime APIs, design guidelines, multiple placements) | [SLOTS.md](site-plugin/SLOTS.md)
|
|
146
|
+
| Slots (App IDs, runtime APIs, design guidelines, multiple placements) | [SLOTS.md](site-plugin/SLOTS.md) |
|
|
252
147
|
| WDS Components | the `wix-design-system` skill |
|
|
253
148
|
|
|
254
149
|
## Available Slots
|
|
255
150
|
|
|
256
|
-
Site plugins integrate into predefined slots
|
|
257
|
-
|
|
258
|
-
- **appDefinitionId**: The ID of the Wix app (e.g., Stores, Bookings)
|
|
259
|
-
- **widgetId**: The ID of the page containing the slot
|
|
260
|
-
- **slotId**: The specific slot identifier
|
|
261
|
-
|
|
262
|
-
Common placement areas include product pages (Wix Stores), checkout and side cart (Wix eCommerce), booking pages (Wix Bookings), service pages, event pages, and blog post pages.
|
|
263
|
-
|
|
264
|
-
For App Definition IDs, per-slot runtime APIs, design guidelines, and placement constraints, see [SLOTS.md](site-plugin/SLOTS.md). Run `wix schema generate --type SITE_PLUGIN` for the authoritative `slotId` enum.
|
|
151
|
+
Site plugins integrate into predefined slots — product pages (Wix Stores), checkout and side cart (Wix eCommerce), booking pages (Wix Bookings), service pages, event pages, and blog post pages. See [SLOTS.md](site-plugin/SLOTS.md) for the App Definition IDs, per-slot runtime APIs, and design guidelines.
|
|
265
152
|
|
|
266
153
|
## Checkout Plugins
|
|
267
154
|
|
|
@@ -269,52 +156,27 @@ If you are building a plugin for the **checkout page**, it may not support autom
|
|
|
269
156
|
|
|
270
157
|
## Examples
|
|
271
158
|
|
|
272
|
-
For complete examples with all three required files (plugin component, settings panel, extension configuration), see [EXAMPLES.md](site-plugin/EXAMPLES.md).
|
|
273
|
-
|
|
274
|
-
**Example use cases:**
|
|
275
|
-
|
|
276
|
-
- **Best Seller Badge** - Customizable badge on product pages with text and color settings
|
|
277
|
-
- **Booking Confirmation** - Custom confirmation message for booking pages
|
|
278
|
-
- **Product Reviews Summary** - Star rating and review count display
|
|
279
|
-
- **Data-Driven Plugin** - Plugin with Wix Data API integration and editor environment handling
|
|
159
|
+
For complete examples with all three required files (plugin component, settings panel, extension configuration) — including a product-page badge, a booking confirmation message, a review-count display, and a Wix Data-driven plugin — see [EXAMPLES.md](site-plugin/EXAMPLES.md).
|
|
280
160
|
|
|
281
161
|
## Best Practices
|
|
282
162
|
|
|
283
163
|
### Implementation Guidelines
|
|
284
164
|
|
|
285
|
-
- **
|
|
286
|
-
- **
|
|
287
|
-
- **Do not call `define()`** - Wix handles `customElements.define()` for you automatically
|
|
288
|
-
- **Validate all input** - Check required props are present
|
|
289
|
-
- **Follow naming conventions** - kebab-case for all attributes and widget API
|
|
290
|
-
- **Keep plugins focused** - Each plugin should do one thing well
|
|
291
|
-
- **Test in multiple slots** - If supporting multiple placements, test each one
|
|
292
|
-
- **Support both Stores versions** - Include placements for both old and new Wix Stores product pages for maximum compatibility
|
|
165
|
+
- **Handle the editor environment** - show placeholders when in editor mode for data-dependent plugins (see [Editor Sandboxing](#editor-sandboxing) below)
|
|
166
|
+
- **Support both Stores versions** - include placements for both old and new Wix Stores product pages for maximum compatibility
|
|
293
167
|
|
|
294
168
|
### Editor Sandboxing
|
|
295
169
|
|
|
296
|
-
Site plugins are sandboxed when rendered in the editor
|
|
297
|
-
|
|
298
|
-
**Restricted APIs in the editor:**
|
|
299
|
-
- `localStorage` and `sessionStorage` (Web Storage API)
|
|
300
|
-
- `document.cookie` (Cookie Store API)
|
|
301
|
-
- IndexedDB API
|
|
302
|
-
- Cache API
|
|
170
|
+
Site plugins are sandboxed when rendered in the editor — treated as if from a different domain, which blocks `localStorage`/`sessionStorage`, `document.cookie`, IndexedDB, and the Cache API.
|
|
303
171
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
Use the `viewMode()` function from `@wix/site-window` to check the current mode before accessing restricted APIs:
|
|
172
|
+
Check the mode with `viewMode()` from `@wix/site-window` before touching any of those. That package isn't part of the CLI's default scaffolded `package.json` — install it first (`npm install @wix/site-window`), or the build fails with `Rollup failed to resolve import "@wix/site-window"`:
|
|
307
173
|
|
|
308
174
|
```typescript
|
|
309
175
|
import { window as wixWindow } from '@wix/site-window';
|
|
310
176
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
if (viewMode === 'Site') {
|
|
177
|
+
if ((await wixWindow.viewMode()) === 'Site') {
|
|
314
178
|
const item = localStorage.getItem('myKey');
|
|
315
|
-
} else
|
|
316
|
-
// Mock storage or modify API usage for editor mode
|
|
317
|
-
}
|
|
179
|
+
} // else: mock storage or skip, in editor mode
|
|
318
180
|
```
|
|
319
181
|
|
|
320
182
|
### Using Wix SDK Modules in Site Plugins
|
|
@@ -322,33 +184,23 @@ if (viewMode === 'Site') {
|
|
|
322
184
|
Site plugins can import and use Wix SDK modules directly — you do NOT need `createClient()`. The Wix runtime provides the client context automatically.
|
|
323
185
|
|
|
324
186
|
```typescript
|
|
325
|
-
// ✅ CORRECT —
|
|
187
|
+
// ✅ CORRECT — import directly, no createClient needed
|
|
326
188
|
import { items } from "@wix/data";
|
|
327
|
-
import { currentCartV2 } from "@wix/ecom";
|
|
328
|
-
import { products } from "@wix/stores";
|
|
329
189
|
|
|
330
190
|
class MyPlugin extends HTMLElement {
|
|
331
191
|
async loadData() {
|
|
332
|
-
// Call SDK methods directly — no createClient needed
|
|
333
192
|
const result = await items.query("MyCollection").find();
|
|
334
|
-
const { cart } = await currentCartV2.getCurrentCart();
|
|
335
|
-
const productList = await products.queryProducts().limit(10).find();
|
|
336
193
|
}
|
|
337
194
|
}
|
|
338
195
|
```
|
|
339
196
|
|
|
340
|
-
|
|
341
|
-
// ❌ WRONG — Do NOT use createClient in site plugins
|
|
342
|
-
import { createClient } from "@wix/sdk";
|
|
343
|
-
const wixClient = createClient({ modules: { items, products } });
|
|
344
|
-
await wixClient.items.query(...); // Wrong — API surface differs through client
|
|
345
|
-
```
|
|
197
|
+
The same applies to any other Wix SDK module (`@wix/ecom`, `@wix/stores`, etc. — see the table below for three specific calls). Do **not** wrap them in `createClient({ modules: {...} })` from `@wix/sdk` — that API surface differs from the direct-import one shown above, and site plugins don't need it.
|
|
346
198
|
|
|
347
199
|
### Identity of SDK Calls in Site Plugins
|
|
348
200
|
|
|
349
201
|
A plugin runs as the **site visitor or member**, never as the app — see [Identity and Elevation Requirement](../SKILL.md#identity-and-elevation-requirement) before routing any SDK call out to a backend endpoint.
|
|
350
202
|
|
|
351
|
-
|
|
203
|
+
Each of these three calls is correct to call directly, exactly as written, and each for a different reason:
|
|
352
204
|
|
|
353
205
|
| Call | Why it works directly |
|
|
354
206
|
| --- | --- |
|
|
@@ -356,9 +208,3 @@ The three calls above are correct exactly as written, and each for a different r
|
|
|
356
208
|
| `currentCartV2.getCurrentCart()` | Resolves the cart from the caller's session. Elevating it would return the app's cart, not the visitor's |
|
|
357
209
|
| `products.queryProducts()` | Catalog base fields are public. `MERCHANT_DATA` and non-visible products are withheld unless the app holds `SCOPE.STORES.PRODUCT_READ_ADMIN` — don't request them from a plugin |
|
|
358
210
|
|
|
359
|
-
### Performance Considerations
|
|
360
|
-
|
|
361
|
-
- Keep bundle size small - plugins load on user-facing pages
|
|
362
|
-
- Avoid heavy computations on initial render
|
|
363
|
-
- Lazy load data when possible
|
|
364
|
-
- Use efficient re-rendering patterns
|
|
@@ -25,6 +25,7 @@ export default extensions.appTools({
|
|
|
25
25
|
tools: [
|
|
26
26
|
{
|
|
27
27
|
methodName: 'get-order-status',
|
|
28
|
+
displayName: 'Get Order Status',
|
|
28
29
|
description: 'Returns the current fulfillment status, shipping carrier, and tracking number for a customer order. Use this tool when a collaborator or customer asks where their order is, whether it has shipped, when it will arrive, or needs a tracking number. Requires a valid orderId.',
|
|
29
30
|
requestSchema: {
|
|
30
31
|
type: 'object',
|
|
@@ -52,9 +53,10 @@ export default extensions.appTools({
|
|
|
52
53
|
| --- | --- | --- | --- |
|
|
53
54
|
| `methodName` | `string` | Yes | Unique word identifying the tool. Used to route calls in the service plugin handler. 1–30 characters. |
|
|
54
55
|
| `description` | `string` | Yes | Natural-language description the AI assistant uses to decide when to invoke this tool. Write it like a prompt: state what the tool does, list the user intents or trigger phrases that should activate it, and describe what it returns. A narrow one-liner reduces relevance matching — prefer 2–4 sentences covering intent, triggers, and output. 10–1000 characters. |
|
|
56
|
+
| `displayName` | `string` | No | Human-readable name for the tool, shown in AI agent UIs. 2–50 characters. The CLI's generated stub always fills this in — keep it when you replace the stub tool. |
|
|
55
57
|
| `requestSchema` | `Record<string, any>` | No | JSON Schema describing the tool's request payload. The AI assistant uses this for context — it is NOT validated by Wix at call time. |
|
|
56
58
|
| `responseSchema` | `Record<string, any>` | No | JSON Schema describing the tool's response payload. |
|
|
57
|
-
| `activated` | `boolean` |
|
|
59
|
+
| `activated` | `boolean` | No | Only tools with `activated: true` are called by the AI assistant. **Defaults to `false` if omitted** — there's no build-time or generate-time error for leaving it out, so a forgotten `activated` silently produces a tool the assistant will never call. Always set it explicitly. |
|
|
58
60
|
|
|
59
61
|
## Important Constraints
|
|
60
62
|
|
|
@@ -32,3 +32,24 @@ Wrap each picker in the standard `<SidePanel.Field><FormField label={label}>…<
|
|
|
32
32
|
</Button>
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
## Date & Time Fields
|
|
36
|
+
|
|
37
|
+
Use WDS `DatePicker` and `TimeInput` directly (no `@wix/editor` picker dialog involved) — but their `onChange` shapes differ, verified against the installed package's own types:
|
|
38
|
+
|
|
39
|
+
| Field | Value type | `onChange` signature |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| `DatePicker` | `Date` | `(date: Date) => void` — receives the date directly |
|
|
42
|
+
| `TimeInput` | `Date \| null` | `({ date }: { date: Date \| null }) => void` — receives a **destructured object**, not the date directly |
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import { FormField, DatePicker, TimeInput } from '@wix/design-system';
|
|
46
|
+
|
|
47
|
+
<FormField label="Target date">
|
|
48
|
+
<DatePicker value={targetDate} onChange={(date) => onDateChange(date)} />
|
|
49
|
+
</FormField>
|
|
50
|
+
|
|
51
|
+
<FormField label="Target time">
|
|
52
|
+
<TimeInput value={targetTime} onChange={({ date }) => onTimeChange(date)} />
|
|
53
|
+
</FormField>
|
|
54
|
+
```
|
|
55
|
+
|
|
@@ -141,6 +141,23 @@ dashboard.navigate(
|
|
|
141
141
|
);
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
+
## taxSettings()
|
|
145
|
+
|
|
146
|
+
Ecom Extensions Dashboard Pages 'taxSettings()' destination builder for navigating to the Tax Settings dashboard page.
|
|
147
|
+
|
|
148
|
+
**Request:**
|
|
149
|
+
This method does not take any parameters.
|
|
150
|
+
|
|
151
|
+
**Example:**
|
|
152
|
+
```typescript
|
|
153
|
+
import { dashboard } from "@wix/dashboard";
|
|
154
|
+
import { pages } from "@wix/ecom/dashboard";
|
|
155
|
+
|
|
156
|
+
dashboard.navigate(
|
|
157
|
+
pages.taxSettings(),
|
|
158
|
+
);
|
|
159
|
+
```
|
|
160
|
+
|
|
144
161
|
## orderRefund()
|
|
145
162
|
|
|
146
163
|
Ecom Extensions Dashboard Pages 'orderRefund()' destination builder for navigating to the Order Refund dashboard page.
|
|
@@ -66,8 +66,7 @@ Slots are UI placeholders on dashboard pages of Wix first-party business apps. E
|
|
|
66
66
|
| Name | Type | Description |
|
|
67
67
|
|------|------|-------------|
|
|
68
68
|
| `staffResourceId` | String | Staff resource ID |
|
|
69
|
-
| `
|
|
70
|
-
| `timezone` | String | Time zone |
|
|
69
|
+
| `staffId` | String | Staff member ID |
|
|
71
70
|
- **Multi-plugin:** Vertical, newest at top
|
|
72
71
|
- **Use case:** Display staff availability analytics or performance metrics.
|
|
73
72
|
|
|
@@ -108,12 +107,12 @@ Slots are UI placeholders on dashboard pages of Wix first-party business apps. E
|
|
|
108
107
|
| `onSuccess()` | `() => Promise<void>` | Progresses to the next modal after successful order update |
|
|
109
108
|
| `onCancel()` | `() => void` | Progresses to the next modal without changes |
|
|
110
109
|
| `menuOption` | Object | Data for the selected menu item |
|
|
111
|
-
| `menuOption.key` | String | `CHARGE_WITH_CREDIT_CARD`, `RECORD_ORDER_MANUAL_PAYMENT`, `CHARGE_WITH_INVOICE`, or `EXTENSION` |
|
|
110
|
+
| `menuOption.key` | String | `CHARGE_WITH_CREDIT_CARD`, `RECORD_ORDER_MANUAL_PAYMENT`, `CHARGE_WITH_INVOICE`, `CAPTURE_AUTHORIZED_PAYMENT`, `CREATE_AUTHORIZED_PAYMENT`, or `EXTENSION` |
|
|
112
111
|
| `menuOption.componentId` | String | Component ID when `EXTENSION` key is triggered |
|
|
113
112
|
- **Multi-plugin:** Sequential modals, each appearing before the default modal
|
|
114
113
|
- **Use case:** Add items to an order such as additional services, notes, or booking fees like insurance.
|
|
115
114
|
|
|
116
|
-
> **Note:** This slot also appears on the Wix eCommerce Order Page.
|
|
115
|
+
> **Note:** This slot also appears on the [Wix eCommerce Order Page](#order-page--pre-collect-payment-modal).
|
|
117
116
|
|
|
118
117
|
### Booking List Page
|
|
119
118
|
|
|
@@ -145,24 +144,11 @@ Slots are UI placeholders on dashboard pages of Wix first-party business apps. E
|
|
|
145
144
|
|
|
146
145
|
### Order Page — Pre-Collect Payment Modal
|
|
147
146
|
|
|
148
|
-
**Slot ID:** `b92f0e25-535f-4bef-b130-8e5abc85b2fe`
|
|
147
|
+
**Slot ID:** `b92f0e25-535f-4bef-b130-8e5abc85b2fe` — the same slot as [Bookings Calendar Page — Pre-Collect Payment Modal](#calendar-page--pre-collect-payment-modal) above (same parameters, multi-plugin behavior, and modal mechanics).
|
|
149
148
|
|
|
150
149
|
- **Dashboard path:** Sales > Orders > Order > Collect Payment
|
|
151
|
-
- **Location:** Custom modal displayed before the default Collect Payment modal
|
|
152
|
-
- **Parameters:**
|
|
153
|
-
| Name | Type | Description |
|
|
154
|
-
|------|------|-------------|
|
|
155
|
-
| `orderId` | String | Order ID |
|
|
156
|
-
| `onSuccess()` | `() => Promise<void>` | Progresses to the next modal after successful order update |
|
|
157
|
-
| `onCancel()` | `() => void` | Progresses to the next modal without changes |
|
|
158
|
-
| `menuOption` | Object | Data for the selected menu item |
|
|
159
|
-
| `menuOption.key` | String | `CHARGE_WITH_CREDIT_CARD`, `RECORD_ORDER_MANUAL_PAYMENT`, `CHARGE_WITH_INVOICE`, or `EXTENSION` |
|
|
160
|
-
| `menuOption.componentId` | String | Component ID when `EXTENSION` key is triggered |
|
|
161
|
-
- **Multi-plugin:** Sequential modals, each appearing before the default modal
|
|
162
150
|
- **Use case:** Add items to an order such as additional items, notes, or extra fees.
|
|
163
151
|
|
|
164
|
-
> **Note:** This slot also appears on the Wix Bookings Calendar Page.
|
|
165
|
-
|
|
166
152
|
---
|
|
167
153
|
|
|
168
154
|
## Wix Events
|
|
@@ -221,7 +221,7 @@ export default function PluginSettingsPage() {
|
|
|
221
221
|
|
|
222
222
|
## Wix Data API Integration
|
|
223
223
|
|
|
224
|
-
When using Wix Data API in plugins, handle the Wix Editor environment
|
|
224
|
+
When using Wix Data API in plugins, handle the Wix Editor environment. This example imports `@wix/site-window` — install it first (`npm install @wix/site-window`), since it's not part of the CLI's default scaffolded `package.json`:
|
|
225
225
|
|
|
226
226
|
```typescript
|
|
227
227
|
import { items } from "@wix/data";
|