@wix/astro 2.10.1 → 2.12.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 (33) hide show
  1. package/CHANGELOG.md +319 -0
  2. package/build/dependencies/astro-auth/browser-runtime/setup.js +1 -1
  3. package/build/dependencies/astro-backend-extensions/types/index.d.ts +89 -0
  4. package/build/dependencies/astro-backoffice-extensions/types/index.d.ts +68 -0
  5. package/build/dependencies/astro-core/types/index.d.ts +106 -0
  6. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/customElementHmr.d.ts +6 -0
  7. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/{index.js → customElementHmr.js} +3 -34
  8. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/reactHmr.d.ts +1 -0
  9. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/reactHmr.js +26 -0
  10. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/renderSettingsPanel.d.ts +5 -0
  11. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/renderSettingsPanel.js +23 -0
  12. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/wrapCustomElement.d.ts +6 -0
  13. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/wrapCustomElement.js +30 -0
  14. package/build/dependencies/astro-custom-elements-extensions/types/index.d.ts +27 -0
  15. package/build/dependencies/astro-embedded-scripts-extensions/browser-runtime/setupContext.js +6 -10
  16. package/build/dependencies/astro-embedded-scripts-extensions/types/index.d.ts +18 -0
  17. package/build/dependencies/astro-site-component-panels-extensions/browser-runtime/hmr.js +26 -0
  18. package/build/dependencies/astro-site-component-panels-extensions/browser-runtime/sdk.js +12 -0
  19. package/build/dependencies/astro-site-component-panels-extensions/types/index.d.ts +21 -0
  20. package/build/dependencies/astro-site-components-extensions/browser-runtime/sdk.js +21 -0
  21. package/build/dependencies/astro-site-components-extensions/types/index.d.ts +36 -0
  22. package/build/dependencies/astro-site-plugins-extensions/types/index.d.ts +22 -0
  23. package/build/integration/builders.d.ts +322 -7
  24. package/build/integration/builders.js +18 -13
  25. package/build/integration/builders.js.map +1 -1
  26. package/build/integration/{chunk-JFJIM45R.js → chunk-UBCQK5ZU.js} +1859 -436
  27. package/build/integration/chunk-UBCQK5ZU.js.map +1 -0
  28. package/build/integration/index.d.ts +1 -1
  29. package/build/integration/index.js +28 -38
  30. package/build/integration/index.js.map +1 -1
  31. package/package.json +10 -6
  32. package/build/dependencies/astro-custom-elements-extensions/browser-runtime/index.d.ts +0 -11
  33. package/build/integration/chunk-JFJIM45R.js.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,319 @@
1
+ # @wix/astro
2
+
3
+ ## 2.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#413](https://github.com/wix-incubator/headless-integrations/pull/413) [`c7d33d0`](https://github.com/wix-incubator/headless-integrations/commit/c7d33d0d84269be5d210d491315943c6242992ba) Thanks [@ronami](https://github.com/ronami)! - Add support for using a settings panel:
8
+
9
+ ```ts
10
+ import { app } from '@wix/astro/builders';
11
+ import * as extensions from '@wix/astro/builders';
12
+
13
+ export default app().use(
14
+ extensions.customElement({
15
+ id: '7e89117e-1e36-4e87-bf0e-fd4ba8570c91',
16
+ name: 'custom-element',
17
+ base: { name: 'custom-element' },
18
+ behaviors: {},
19
+ dependencies: [],
20
+ element: './extensions/custom-element/element.ts',
21
+ installation: { base: { autoAdd: true } },
22
+ settings: './extensions/custom-element/settings.tsx',
23
+ size: { height: { defaultHeight: 500 }, width: { defaultWidth: 500 } },
24
+ tagName: 'custom-element',
25
+ })
26
+ );
27
+ ```
28
+
29
+ ## 2.11.1
30
+
31
+ ### Patch Changes
32
+
33
+ - [#397](https://github.com/wix-incubator/headless-integrations/pull/397) [`305c73b`](https://github.com/wix-incubator/headless-integrations/commit/305c73bddf3634fe63b4399765c857011fb81dcd) Thanks [@BrooklynKing](https://github.com/BrooklynKing)! - Adding support for presets in Site Components
34
+
35
+ - [#412](https://github.com/wix-incubator/headless-integrations/pull/412) [`e892255`](https://github.com/wix-incubator/headless-integrations/commit/e8922555c5af076ce7c9e984fec2dbf3810cf584) Thanks [@BrooklynKing](https://github.com/BrooklynKing)! - Adding support for Editor Preview in Site Components
36
+
37
+ - [#399](https://github.com/wix-incubator/headless-integrations/pull/399) [`aad4bc4`](https://github.com/wix-incubator/headless-integrations/commit/aad4bc4ce45375e5a856274ff91ec188b53af5d2) Thanks [@BrooklynKing](https://github.com/BrooklynKing)! - Adding support for sdk in Site Components
38
+
39
+ ## 2.11.0
40
+
41
+ ### Minor Changes
42
+
43
+ - [#400](https://github.com/wix-incubator/headless-integrations/pull/400) [`30d11e8`](https://github.com/wix-incubator/headless-integrations/commit/30d11e879d9e8a7c3d637c4b683b0a01e6a2d8b6) Thanks [@mastertheblaster](https://github.com/mastertheblaster)! - Rename backofficeExtensionMenuPlugin > dashboardMenuPlugin, backofficeModal > dashboardModal, backofficePage > dashboardPage, backofficeExtensionWidget > dashboardWidget.
44
+
45
+ ### Patch Changes
46
+
47
+ - [#386](https://github.com/wix-incubator/headless-integrations/pull/386) [`3f55571`](https://github.com/wix-incubator/headless-integrations/commit/3f55571d741afcbcd05c7545b00cc1386f62785e) Thanks [@BrooklynKing](https://github.com/BrooklynKing)! - Added support for Site Components Panels
48
+
49
+ - [#373](https://github.com/wix-incubator/headless-integrations/pull/373) [`af3fd17`](https://github.com/wix-incubator/headless-integrations/commit/af3fd1749be57dbdea7102eecb6ca3cc640d06e2) Thanks [@tomsa9](https://github.com/tomsa9)! - Update headless SDK
50
+
51
+ - [#398](https://github.com/wix-incubator/headless-integrations/pull/398) [`33510ca`](https://github.com/wix-incubator/headless-integrations/commit/33510ca7864fe0768f4f7cf2115f3dd39f023b55) Thanks [@kfirstri](https://github.com/kfirstri)! - Add custom component runtime and entries to the vite optimization list
52
+
53
+ - [#193](https://github.com/wix-incubator/headless-integrations/pull/193) [`44baa6c`](https://github.com/wix-incubator/headless-integrations/commit/44baa6cdaa2141f650d2e7c8a8cc371c8ebf50c7) Thanks [@fantua](https://github.com/fantua)! - Added SDK support for Site Components extensions
54
+
55
+ - [#393](https://github.com/wix-incubator/headless-integrations/pull/393) [`5384a4a`](https://github.com/wix-incubator/headless-integrations/commit/5384a4ac591e3a982d05e3526b7c9e903be050a7) Thanks [@mastertheblaster](https://github.com/mastertheblaster)! - Renamed builders ecomDiscountsTrigger and ecomGiftCardsProvider to ecomDiscountTriggers and ecomGiftCards.
56
+
57
+ ## 2.10.1
58
+
59
+ ### Patch Changes
60
+
61
+ - [#363](https://github.com/wix-incubator/headless-integrations/pull/363) [`d1ccad9`](https://github.com/wix-incubator/headless-integrations/commit/d1ccad960c7b7d530d330e0856e845a697145269) Thanks [@dor-chaouat](https://github.com/dor-chaouat)! - bypass auth middleware for app extensions
62
+
63
+ ## 2.10.0
64
+
65
+ ### Minor Changes
66
+
67
+ - [#345](https://github.com/wix-incubator/headless-integrations/pull/345) [`e6044ee`](https://github.com/wix-incubator/headless-integrations/commit/e6044ee4b99d2ad39e0e06c117ad4c7d5c7d6b9d) Thanks [@mastertheblaster](https://github.com/mastertheblaster)! - Refactored the codebase to consolidate everything into a single publishable package, removing all nested dependent packages.
68
+
69
+ ## 2.9.0
70
+
71
+ ### Minor Changes
72
+
73
+ - [#263](https://github.com/wix-incubator/headless-integrations/pull/263) [`76be268`](https://github.com/wix-incubator/headless-integrations/commit/76be268fdc1853ecda132a93c87fda8db6eb74b9) Thanks [@dor-chaouat](https://github.com/dor-chaouat)! - Add Viewer API route support for Wix services integration
74
+
75
+ This release introduces a new Viewer API route handler that enables Wix services such as Invoices, Price Quotes, and other viewer-based APIs that are served from `_api` under the user's domain. The route automatically proxies requests from the user's Astro domain to their corresponding Wix domain.
76
+
77
+ **Example Usage:**
78
+ When a user visits:
79
+
80
+ ```
81
+ https://www.user-astro-domain.com/_api/invoice/33ad59bb-fb18-4515-80b9-2f630ad035e4/view?token=123
82
+ ```
83
+
84
+ The request is automatically redirected to:
85
+
86
+ ```
87
+ https://www.user-wix-domain.com/_api/invoice/33ad59bb-fb18-4515-80b9-2f630ad035e4/view?token=123
88
+ ```
89
+
90
+ ### Patch Changes
91
+
92
+ - [#145](https://github.com/wix-incubator/headless-integrations/pull/145) [`3ef6e99`](https://github.com/wix-incubator/headless-integrations/commit/3ef6e994a25c45adc3672926fbfe2f836acb58fd) Thanks [@fantua](https://github.com/fantua)! - Added Site Component extensions support
93
+
94
+ - [#320](https://github.com/wix-incubator/headless-integrations/pull/320) [`54a7fbf`](https://github.com/wix-incubator/headless-integrations/commit/54a7fbfce9062b301d005bb11489300b0e7905d4) Thanks [@mastertheblaster](https://github.com/mastertheblaster)! - Implement placeholders in the app manifest and introduce a development metadata endpoint to provide runtime metadata during dev.
95
+
96
+ - Updated dependencies [[`3ef6e99`](https://github.com/wix-incubator/headless-integrations/commit/3ef6e994a25c45adc3672926fbfe2f836acb58fd), [`54a7fbf`](https://github.com/wix-incubator/headless-integrations/commit/54a7fbfce9062b301d005bb11489300b0e7905d4), [`59add11`](https://github.com/wix-incubator/headless-integrations/commit/59add11c442ca649990c6594123132c3434c88d4), [`41c8148`](https://github.com/wix-incubator/headless-integrations/commit/41c8148bb2de5ef24c201409e0b40066434679b1), [`76be268`](https://github.com/wix-incubator/headless-integrations/commit/76be268fdc1853ecda132a93c87fda8db6eb74b9), [`0641ef9`](https://github.com/wix-incubator/headless-integrations/commit/0641ef94744b26f7c82a433d420805cfe476615a), [`d60d10a`](https://github.com/wix-incubator/headless-integrations/commit/d60d10a63a984732bd20b593ab648a776ca360c1)]:
97
+ - @wix/astro-site-components-extensions@2.3.1
98
+ - @wix/astro-auth@2.3.1
99
+ - @wix/astro-backend-extensions@2.3.1
100
+ - @wix/astro-backoffice-extensions@2.4.1
101
+ - @wix/astro-core@2.4.0
102
+ - @wix/astro-custom-elements-extensions@2.4.0
103
+ - @wix/astro-embedded-scripts-extensions@2.4.0
104
+ - @wix/astro-html-embeds@2.3.1
105
+ - @wix/astro-payment-links@2.3.1
106
+ - @wix/astro-robots@2.3.1
107
+ - @wix/astro-site-plugins-extensions@2.3.1
108
+ - @wix/astro-viewer-api@3.0.0
109
+
110
+ ## 2.6.0
111
+
112
+ ### Minor Changes
113
+
114
+ - [#269](https://github.com/wix-incubator/headless-integrations/pull/269) [`5420b6d`](https://github.com/wix-incubator/headless-integrations/commit/5420b6db5663933b7f44d3407f38393fff79605a) Thanks [@dor-chaouat](https://github.com/dor-chaouat)! - adjust app manifest to write required extension data
115
+
116
+ ### Patch Changes
117
+
118
+ - Updated dependencies [[`5420b6d`](https://github.com/wix-incubator/headless-integrations/commit/5420b6db5663933b7f44d3407f38393fff79605a)]:
119
+ - @wix/astro-custom-elements-extensions@2.2.0
120
+
121
+ ## 2.5.0
122
+
123
+ ### Minor Changes
124
+
125
+ - [#264](https://github.com/wix-incubator/headless-integrations/pull/264) [`d0e99bc`](https://github.com/wix-incubator/headless-integrations/commit/d0e99bc187193896f207a194e8753fc70bcbc897) Thanks [@dor-chaouat](https://github.com/dor-chaouat)! - add missing files property for `@wix/astro-site-plugins-extensions`
126
+
127
+ ### Patch Changes
128
+
129
+ - Updated dependencies [[`d0e99bc`](https://github.com/wix-incubator/headless-integrations/commit/d0e99bc187193896f207a194e8753fc70bcbc897)]:
130
+ - @wix/astro-site-plugins-extensions@2.2.0
131
+
132
+ ## 2.4.0
133
+
134
+ ### Minor Changes
135
+
136
+ - [#194](https://github.com/wix-incubator/headless-integrations/pull/194) [`bf6dc8a`](https://github.com/wix-incubator/headless-integrations/commit/bf6dc8aa6faef7c99549a9a782076eef23e5a4dc) Thanks [@ronami](https://github.com/ronami)! - add initial support for using site plugin extension:
137
+
138
+ #### `src/extensions.ts`
139
+
140
+ ```ts
141
+ import { app } from '@wix/astro/builders';
142
+ import * as extensions from '@wix/astro/builders';
143
+
144
+ export default app().use(
145
+ extensions.sitePlugin({
146
+ id: '57512654-b94e-460b-91e4-88624b5afea3',
147
+ marketData: { name: '' },
148
+ placements: [],
149
+ referenceComponentId: '',
150
+ })
151
+ );
152
+ ```
153
+
154
+ ### Patch Changes
155
+
156
+ - Updated dependencies [[`bf6dc8a`](https://github.com/wix-incubator/headless-integrations/commit/bf6dc8aa6faef7c99549a9a782076eef23e5a4dc)]:
157
+ - @wix/astro-site-plugins-extensions@2.1.0
158
+
159
+ ## 2.3.0
160
+
161
+ ### Minor Changes
162
+
163
+ - [#139](https://github.com/wix-incubator/headless-integrations/pull/139) [`e86ec26`](https://github.com/wix-incubator/headless-integrations/commit/e86ec26db343d92c2bb9c436942ca3cedd429da1) Thanks [@ronami](https://github.com/ronami)! - add initial support for custom element extension:
164
+
165
+ #### `src/extensions.ts`
166
+
167
+ ```ts
168
+ import { app } from '@wix/astro/builders';
169
+ import * as extensions from '@wix/astro/builders';
170
+
171
+ export default app().use(
172
+ extensions.customElement({
173
+ element: './extensions/custom-element/element.ts',
174
+ id: '57512654-b94e-460b-91e4-88624b5afea3',
175
+ name: 'custom-element',
176
+ tagName: 'custom-element',
177
+ })
178
+ );
179
+ ```
180
+
181
+ #### `src/extensions/custom-element/element.ts`
182
+
183
+ ```ts
184
+ export default class extends HTMLElement {
185
+ public connectedCallback() {
186
+ this.innerHTML = `<div data-testid="custom-element">Hello from custom element!</div>`;
187
+ }
188
+ }
189
+ ```
190
+
191
+ - [#168](https://github.com/wix-incubator/headless-integrations/pull/168) [`0c92d0a`](https://github.com/wix-incubator/headless-integrations/commit/0c92d0af2d8398716d530185246546dacaaa3851) Thanks [@mastertheblaster](https://github.com/mastertheblaster)! - Introduces built-in support for `robots.txt`. Here’s an example:
192
+
193
+ ```ts
194
+ import wix from '@wix/astro';
195
+ import { defineConfig } from 'astro/config';
196
+
197
+ export default defineConfig({
198
+ integrations: [wix({ enableRobots: false })],
199
+ });
200
+ ```
201
+
202
+ - [#132](https://github.com/wix-incubator/headless-integrations/pull/132) [`f81e2fe`](https://github.com/wix-incubator/headless-integrations/commit/f81e2fe637867afb9f09c150229098a0f9bb4bb9) Thanks [@ronami](https://github.com/ronami)! - add initial support for embedded scripts
203
+
204
+ - [#196](https://github.com/wix-incubator/headless-integrations/pull/196) [`b2509de`](https://github.com/wix-incubator/headless-integrations/commit/b2509de8e9f30ab569a12f03c76cdb0e0e12daf5) Thanks [@mastertheblaster](https://github.com/mastertheblaster)! - The configuration for the Astro Wix extension has been changed.
205
+
206
+ Previous API:
207
+
208
+ ```ts
209
+ import wix from '@wix/astro';
210
+
211
+ wix({
212
+ enableAuthRoutes: true,
213
+ enableHtmlEmbeds: true,
214
+ enableRobots: true,
215
+ });
216
+ ```
217
+
218
+ Current API:
219
+
220
+ ```ts
221
+ import wix from '@wix/astro';
222
+
223
+ wix({
224
+ auth: true, // or auth: { enable: true }
225
+ htmlEmbeds: true, // or htmlEmbeds: { enable: true }
226
+ robots: true, // or robots: { enable: true }
227
+ });
228
+ ```
229
+
230
+ ### Patch Changes
231
+
232
+ - Updated dependencies [[`e86ec26`](https://github.com/wix-incubator/headless-integrations/commit/e86ec26db343d92c2bb9c436942ca3cedd429da1), [`0c92d0a`](https://github.com/wix-incubator/headless-integrations/commit/0c92d0af2d8398716d530185246546dacaaa3851), [`8431423`](https://github.com/wix-incubator/headless-integrations/commit/84314238bba6ecb5278a39abce2c2d7c0245b2fe), [`f81e2fe`](https://github.com/wix-incubator/headless-integrations/commit/f81e2fe637867afb9f09c150229098a0f9bb4bb9), [`73c4c7f`](https://github.com/wix-incubator/headless-integrations/commit/73c4c7f548e7269eb509abb86443c79718e52143)]:
233
+ - @wix/astro-custom-elements-extensions@2.1.0
234
+ - @wix/astro-core@2.2.0
235
+ - @wix/astro-robots@2.1.0
236
+ - @wix/astro-payment-links@2.2.0
237
+ - @wix/astro-embedded-scripts-extensions@2.1.0
238
+ - @wix/astro-auth@2.2.0
239
+
240
+ ## 2.2.0
241
+
242
+ ### Minor Changes
243
+
244
+ - [#121](https://github.com/wix-incubator/headless-integrations/pull/121) [`903244c`](https://github.com/wix-incubator/headless-integrations/commit/903244ce7aae605eedd187ceecedc2c65796817e) Thanks [@ronami](https://github.com/ronami)! - Release minor version of packages after recently failed releases
245
+
246
+ ### Patch Changes
247
+
248
+ - Updated dependencies [[`903244c`](https://github.com/wix-incubator/headless-integrations/commit/903244ce7aae605eedd187ceecedc2c65796817e), [`d5f3624`](https://github.com/wix-incubator/headless-integrations/commit/d5f36244bc5b424702825631df8e1a91b6cf3359)]:
249
+ - @wix/astro-auth@2.1.0
250
+ - @wix/astro-backend-extensions@2.1.0
251
+ - @wix/astro-backoffice-extensions@2.1.0
252
+ - @wix/astro-core@2.1.0
253
+ - @wix/astro-html-embeds@2.1.0
254
+ - @wix/astro-payment-links@2.1.0
255
+
256
+ ## 2.1.0
257
+
258
+ ### Minor Changes
259
+
260
+ - [#25](https://github.com/wix-incubator/headless-integrations/pull/25) [`4e0b6c2`](https://github.com/wix-incubator/headless-integrations/commit/4e0b6c23054bd2fb7230f437d59d45bb54b3bed0) Thanks [@ronami](https://github.com/ronami)! - Adjusts the way to define the Wix app manifest. Instead of the current convention of using a filesystem convention (e.g. `src/extensions/*/extension.json`), a single file is expected: `src/extensions.ts` (and it's optional).
261
+
262
+ The file let's developers define their app manifest programmatically:
263
+
264
+ ```ts
265
+ import { app, backofficePage, extension } from '@wix/astro/builders';
266
+
267
+ export default app()
268
+ .use(
269
+ backofficePage({
270
+ component: './extensions/my-page/page.tsx',
271
+ id: '57512654-b94e-460b-91e4-88624b5afea3',
272
+ routePath: 'hello',
273
+ title: 'Trusted Index Page',
274
+ })
275
+ )
276
+ .use(
277
+ extension({
278
+ compData: {
279
+ webhook: {
280
+ callbackUrl: 'https://www.wix.com',
281
+ },
282
+ },
283
+ compId: 'f988e3bc-acaa-4aca-9cf8-2cd81cc39ee8',
284
+ compType: 'WEBHOOK',
285
+ })
286
+ );
287
+ ```
288
+
289
+ Some of the data is used to build each component correctly (and has a specific helper method to create it), along with a generic `extension()` method for purely-configuration extensions (or ones the developer built separately).
290
+
291
+ Note that this is a breaking change.
292
+
293
+ ### Patch Changes
294
+
295
+ - [#113](https://github.com/wix-incubator/headless-integrations/pull/113) [`920410e`](https://github.com/wix-incubator/headless-integrations/commit/920410eec124488a35601b8e7e99895c385e3e94) Thanks [@ronami](https://github.com/ronami)! - Stop bundling SDK related packages to avoid multiple copies of these dependencies.
296
+
297
+ - [#92](https://github.com/wix-incubator/headless-integrations/pull/92) [`2652759`](https://github.com/wix-incubator/headless-integrations/commit/2652759d29f0911d02b0f5b8be9a7d97a0208c65) Thanks [@ronami](https://github.com/ronami)! - Patch version bump to try and fix the release workflow
298
+
299
+ - [#26](https://github.com/wix-incubator/headless-integrations/pull/26) [`948a404`](https://github.com/wix-incubator/headless-integrations/commit/948a4041161ae35876e507d70efb03ae40f9a6cd) Thanks [@kfirstri](https://github.com/kfirstri)! - Added wix paylink support
300
+
301
+ - Updated dependencies [[`920410e`](https://github.com/wix-incubator/headless-integrations/commit/920410eec124488a35601b8e7e99895c385e3e94), [`2652759`](https://github.com/wix-incubator/headless-integrations/commit/2652759d29f0911d02b0f5b8be9a7d97a0208c65), [`4e0b6c2`](https://github.com/wix-incubator/headless-integrations/commit/4e0b6c23054bd2fb7230f437d59d45bb54b3bed0), [`83e191d`](https://github.com/wix-incubator/headless-integrations/commit/83e191d1d5e09dcf08ad82c2f8d973d2461add53)]:
302
+ - @wix/astro-payment-links@2.0.1
303
+ - @wix/astro-html-embeds@2.0.1
304
+ - @wix/astro-extensions@2.1.0
305
+ - @wix/astro-auth@2.0.1
306
+
307
+ ## 2.0.0
308
+
309
+ ### Major Changes
310
+
311
+ - [#23](https://github.com/wix-incubator/headless-integrations/pull/23) [`1a3450f`](https://github.com/wix-incubator/headless-integrations/commit/1a3450fe28cccf67de37e476710d1df90ed62fed) Thanks [@ronami](https://github.com/ronami)! - add initial support for releasing via `changesets`
312
+
313
+ ### Patch Changes
314
+
315
+ - Updated dependencies [[`1a3450f`](https://github.com/wix-incubator/headless-integrations/commit/1a3450fe28cccf67de37e476710d1df90ed62fed), [`4a957b4`](https://github.com/wix-incubator/headless-integrations/commit/4a957b452e595727aae622af478528581dda8a5c)]:
316
+ - @wix/astro-app-manifest@2.0.0
317
+ - @wix/astro-auth@2.0.0
318
+ - @wix/astro-extensions@2.0.0
319
+ - @wix/astro-html-embeds@2.0.0
@@ -11,7 +11,7 @@ function getSessionClient(options) {
11
11
  tokens: getCookieAsJson("wixSession")?.tokens,
12
12
  ...options
13
13
  }),
14
- host: headlessSite.host()
14
+ host: headlessSite.host({})
15
15
  });
16
16
  }
17
17
  function getCookieAsJson(name) {
@@ -0,0 +1,89 @@
1
+ import { WixIntegration } from '@wix/astro-core';
2
+
3
+ declare const createIntegration: () => WixIntegration;
4
+
5
+ interface EcomAdditionalFees {
6
+ type: 'EcomAdditionalFees';
7
+ options: Options$6;
8
+ }
9
+ interface Options$6 {
10
+ id: string;
11
+ name: string;
12
+ source: string;
13
+ }
14
+ declare function ecomAdditionalFees(options: Options$6): EcomAdditionalFees;
15
+
16
+ interface EcomDiscountsTrigger {
17
+ type: 'EcomDiscountsTrigger';
18
+ options: Options$5;
19
+ }
20
+ interface Options$5 {
21
+ id: string;
22
+ name: string;
23
+ source: string;
24
+ }
25
+ declare function ecomDiscountTriggers(options: Options$5): EcomDiscountsTrigger;
26
+
27
+ interface EcomGiftCardsProvider {
28
+ type: 'EcomGiftCardsProvider';
29
+ options: Options$4;
30
+ }
31
+ interface Options$4 {
32
+ id: string;
33
+ name: string;
34
+ source: string;
35
+ }
36
+ declare function ecomGiftCards(options: Options$4): EcomGiftCardsProvider;
37
+
38
+ interface EcomPaymentSettings {
39
+ type: 'EcomPaymentSettings';
40
+ options: Options$3;
41
+ }
42
+ interface Options$3 {
43
+ id: string;
44
+ name: string;
45
+ fallbackValueForRequires3dSecure?: boolean;
46
+ source: string;
47
+ }
48
+ declare function ecomPaymentSettings(options: Options$3): EcomPaymentSettings;
49
+
50
+ interface EcomShippingRates {
51
+ type: 'EcomShippingRates';
52
+ options: Options$2;
53
+ }
54
+ interface Options$2 {
55
+ id: string;
56
+ name: string;
57
+ dashboardUrl?: string;
58
+ description?: string;
59
+ fallbackDefinitionMandatory?: boolean;
60
+ learnMoreUrl?: string;
61
+ source: string;
62
+ thumbnailUrl?: string;
63
+ }
64
+ declare function ecomShippingRates(options: Options$2): EcomShippingRates;
65
+
66
+ interface EcomValidations {
67
+ type: 'EcomValidations';
68
+ options: Options$1;
69
+ }
70
+ interface Options$1 {
71
+ id: string;
72
+ name: string;
73
+ source: string;
74
+ validateInCart?: boolean;
75
+ }
76
+ declare function ecomValidations(options: Options$1): EcomValidations;
77
+
78
+ interface Webhook {
79
+ type: 'Webhook';
80
+ options: Options;
81
+ }
82
+ interface Options {
83
+ id: string;
84
+ slug: string;
85
+ source: string;
86
+ }
87
+ declare function webhook(options: Options): Webhook;
88
+
89
+ export { createIntegration as default, ecomAdditionalFees, ecomDiscountTriggers, ecomGiftCards, ecomPaymentSettings, ecomShippingRates, ecomValidations, webhook };
@@ -0,0 +1,68 @@
1
+ import { WixIntegration } from '@wix/astro-core';
2
+
3
+ declare const createIntegration: () => WixIntegration;
4
+
5
+ interface BackofficeExtensionMenuPlugin {
6
+ type: 'BackofficeExtensionMenuPlugin';
7
+ options: Options$3;
8
+ }
9
+ interface Options$3 {
10
+ id: string;
11
+ action: {
12
+ navigateToPage: {
13
+ pageId: string;
14
+ };
15
+ } | {
16
+ openModal: {
17
+ componentId: string;
18
+ };
19
+ };
20
+ description?: string;
21
+ extends: string;
22
+ iconKey: string;
23
+ subtitle?: string;
24
+ title: string;
25
+ }
26
+ declare function backofficeExtensionMenuPlugin(options: Options$3): BackofficeExtensionMenuPlugin;
27
+
28
+ interface BackofficeExtensionWidget {
29
+ type: 'BackofficeExtensionWidget';
30
+ options: Options$2;
31
+ }
32
+ interface Options$2 {
33
+ id: string;
34
+ component: string;
35
+ description?: string;
36
+ extends: string;
37
+ height?: number;
38
+ title: string;
39
+ }
40
+ declare function backofficeExtensionWidget(options: Options$2): BackofficeExtensionWidget;
41
+
42
+ interface BackofficeModal {
43
+ type: 'BackofficeModal';
44
+ options: Options$1;
45
+ }
46
+ interface Options$1 {
47
+ id: string;
48
+ component: string;
49
+ height?: number;
50
+ iconKey?: string;
51
+ title: string;
52
+ width?: number;
53
+ }
54
+ declare function backofficeModal(options: Options$1): BackofficeModal;
55
+
56
+ interface BackofficePage {
57
+ type: 'BackofficePage';
58
+ options: Options;
59
+ }
60
+ interface Options {
61
+ id: string;
62
+ component: string;
63
+ routePath: string;
64
+ title: string;
65
+ }
66
+ declare function backofficePage(options: Options): BackofficePage;
67
+
68
+ export { backofficeExtensionMenuPlugin, backofficeExtensionWidget, backofficeModal, backofficePage, createIntegration as default };
@@ -0,0 +1,106 @@
1
+ import { AstroIntegration } from 'astro';
2
+ import { DevCenterAppManifest, BaseDevCenterComponent } from '@wix/dev-center-schemas';
3
+ import { ViteDevServer, InlineConfig } from 'vite';
4
+ import EventEmitter from 'node:events';
5
+
6
+ interface EventMap {
7
+ change: [];
8
+ }
9
+ declare class Model extends EventEmitter<EventMap> {
10
+ appId: string;
11
+ env: Record<string, string>;
12
+ extensions: BaseExtension[];
13
+ srcDir: string;
14
+ private server;
15
+ constructor({ appId, env, extensions, server, srcDir, }: {
16
+ appId: string;
17
+ env: Record<string, string>;
18
+ extensions: BaseExtension[];
19
+ server: ViteDevServer;
20
+ srcDir: string;
21
+ });
22
+ }
23
+
24
+ interface BaseExtension {
25
+ type: string;
26
+ }
27
+ interface BuildMetadata {
28
+ appManifestPath: string;
29
+ clientDir: string;
30
+ outDir: string;
31
+ serverDir?: string;
32
+ serverUrlPlaceholder: string;
33
+ staticsUrlPlaceholder: string;
34
+ }
35
+ type CreateExtensionViteConfig = (opts: {
36
+ name: string;
37
+ config: InlineConfig;
38
+ }) => InlineConfig;
39
+ interface DevMetadata {
40
+ serverUrlPlaceholder: string;
41
+ staticsUrlPlaceholder: string;
42
+ }
43
+ interface IntegrationHooks {
44
+ /**
45
+ * Called before the app manifest is created.
46
+ *
47
+ * Let's integrations contribute or change the app manifest.
48
+ */
49
+ 'wix:app-manifest:setup': (options: {
50
+ model: Model;
51
+ serverUrlPlaceholder: string;
52
+ staticsUrlPlaceholder: string;
53
+ updateAppManifest: (newAppManifest: Partial<DevCenterAppManifest>) => void;
54
+ }) => Promise<void> | void;
55
+ /**
56
+ * Called after the wix model has been set up initially.
57
+ */
58
+ 'wix:model:setup': (options: {
59
+ model: Model;
60
+ }) => Promise<void> | void;
61
+ /**
62
+ * Called during `astro dev`, after a change has been made to files that affect the
63
+ * wix model.
64
+ */
65
+ 'wix:model:changed': (options: {
66
+ model: Model;
67
+ }) => Promise<void> | void;
68
+ /**
69
+ * Called after main astro dev server has been started.
70
+ */
71
+ 'wix:server:start': (options: {
72
+ createExtensionViteConfig: CreateExtensionViteConfig;
73
+ setupExtensionProxy: (server: ViteDevServer) => void;
74
+ }) => Promise<void> | void;
75
+ /**
76
+ * Wrapper around `astro:build:setup`, called during `astro build`.
77
+ *
78
+ * Note: Applied only for `target: 'client'`.
79
+ */
80
+ 'wix:build:setup': (options: {
81
+ createExtensionViteConfig: CreateExtensionViteConfig;
82
+ }) => Promise<void> | void;
83
+ }
84
+ type WixIntegration = AstroIntegration & {
85
+ hooks: {
86
+ [K in keyof IntegrationHooks]?: IntegrationHooks[K];
87
+ };
88
+ };
89
+
90
+ declare const createIntegration: ({ integrations, }: {
91
+ integrations: WixIntegration[];
92
+ }) => AstroIntegration;
93
+
94
+ declare class App {
95
+ private extensions;
96
+ use(extension: BaseExtension): this;
97
+ }
98
+ declare function app(): App;
99
+
100
+ interface GenericExtension {
101
+ type: 'GenericExtension';
102
+ options: BaseDevCenterComponent;
103
+ }
104
+ declare function genericExtension(options: BaseDevCenterComponent): GenericExtension;
105
+
106
+ export { type BaseExtension, type BuildMetadata, type CreateExtensionViteConfig, type DevMetadata, type IntegrationHooks, Model, type WixIntegration, app, createIntegration as default, genericExtension };
@@ -0,0 +1,6 @@
1
+ declare function customElementHmr({ customElement, tagName, }: {
2
+ customElement: CustomElementConstructor;
3
+ tagName: string;
4
+ }): void;
5
+
6
+ export { customElementHmr };
@@ -1,5 +1,5 @@
1
- // src/runtime/handleHmr.ts
2
- function handleHmr({
1
+ // src/runtime/customElementHmr.ts
2
+ function customElementHmr({
3
3
  customElement,
4
4
  tagName
5
5
  }) {
@@ -41,37 +41,6 @@ function visitPrototypeChain(rootClass, visitFn) {
41
41
  visitFn(classForVisiting);
42
42
  }
43
43
  }
44
-
45
- // src/runtime/wrapCustomElement.ts
46
- import { createClient } from "@wix/sdk";
47
- import { site } from "@wix/site";
48
- function wrapCustomElement({
49
- customElement,
50
- tagName
51
- }) {
52
- const { injectAccessTokenFunction } = createContext();
53
- Object.defineProperty(customElement.prototype, "accessTokenListener", {
54
- configurable: false,
55
- value: injectAccessTokenFunction,
56
- writable: false
57
- });
58
- customElements.define(tagName, customElement);
59
- }
60
- function createContext() {
61
- const host = site.host({
62
- applicationId: import.meta.env.WIX_CLIENT_ID
63
- });
64
- const auth = site.auth();
65
- const wixClient = createClient({
66
- auth,
67
- host
68
- });
69
- wixClient.enableContext("module");
70
- return {
71
- injectAccessTokenFunction: auth.getAccessTokenInjector()
72
- };
73
- }
74
44
  export {
75
- handleHmr,
76
- wrapCustomElement
45
+ customElementHmr
77
46
  };
@@ -0,0 +1 @@
1
+ export * from '@wix/astro-browser-runtime/hmr/react-component';
@@ -0,0 +1,26 @@
1
+ // ../astro-browser-runtime/src/hmr/react-component.tsx
2
+ import React, { useEffect, useRef, useState } from "react";
3
+ function createComponentHmrWrapper(OriginalComponent, hotData) {
4
+ return (props) => {
5
+ const [WrappedComponent, setComponent] = useState(
6
+ () => hotData.Component ?? OriginalComponent
7
+ );
8
+ const isMountedRef = useRef(false);
9
+ useEffect(() => {
10
+ isMountedRef.current = true;
11
+ hotData.setComponent = (NewComponent) => {
12
+ hotData.Component = NewComponent;
13
+ if (isMountedRef.current) {
14
+ setComponent(() => NewComponent);
15
+ }
16
+ };
17
+ return () => {
18
+ isMountedRef.current = false;
19
+ };
20
+ }, []);
21
+ return /* @__PURE__ */ React.createElement(WrappedComponent, { ...props });
22
+ };
23
+ }
24
+ export {
25
+ createComponentHmrWrapper
26
+ };