@wix/ditto-codegen-public 1.0.177 → 1.0.178

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 (39) hide show
  1. package/dist/out.js +2 -49
  2. package/package.json +2 -2
  3. package/dist/examples-apps/event-countdown/README.md +0 -13
  4. package/dist/examples-apps/event-countdown/astro.config.mjs +0 -31
  5. package/dist/examples-apps/event-countdown/package.json +0 -51
  6. package/dist/examples-apps/event-countdown/src/components/countdown-preview.tsx +0 -164
  7. package/dist/examples-apps/event-countdown/src/components/countdown-timer-settings.tsx +0 -199
  8. package/dist/examples-apps/event-countdown/src/dashboard/pages/countdown-timer-settings/extensions.ts +0 -7
  9. package/dist/examples-apps/event-countdown/src/dashboard/pages/countdown-timer-settings/page.tsx +0 -142
  10. package/dist/examples-apps/event-countdown/src/dashboard/withProviders.tsx +0 -22
  11. package/dist/examples-apps/event-countdown/src/extensions.ts +0 -12
  12. package/dist/examples-apps/event-countdown/src/index.ts +0 -2
  13. package/dist/examples-apps/event-countdown/src/site/embedded-scripts/countdown-timer/embedded.html +0 -328
  14. package/dist/examples-apps/event-countdown/src/site/embedded-scripts/countdown-timer/extensions.ts +0 -8
  15. package/dist/examples-apps/event-countdown/src/types.ts +0 -11
  16. package/dist/examples-apps/event-countdown/tsconfig.json +0 -9
  17. package/dist/examples-apps/event-countdown/wix.config.json +0 -4
  18. package/dist/examples-apps/mixpanel-analytics/.nvmrc +0 -1
  19. package/dist/examples-apps/mixpanel-analytics/README.md +0 -21
  20. package/dist/examples-apps/mixpanel-analytics/package-lock.json +0 -6357
  21. package/dist/examples-apps/mixpanel-analytics/package.json +0 -31
  22. package/dist/examples-apps/mixpanel-analytics/src/dashboard/components/ProjectToken.tsx +0 -60
  23. package/dist/examples-apps/mixpanel-analytics/src/dashboard/hooks/wix-embeds.ts +0 -33
  24. package/dist/examples-apps/mixpanel-analytics/src/dashboard/pages/page.tsx +0 -39
  25. package/dist/examples-apps/mixpanel-analytics/src/dashboard/withProviders.tsx +0 -19
  26. package/dist/examples-apps/mixpanel-analytics/src/env.d.ts +0 -4
  27. package/dist/examples-apps/mixpanel-analytics/src/site/embedded-scripts/mixpanel-analytics/embedded.html +0 -13
  28. package/dist/examples-apps/mixpanel-analytics/tsconfig.json +0 -8
  29. package/dist/examples-apps/mixpanel-analytics/wix.config.json +0 -5
  30. package/dist/examples-apps/my-locations-app/.nvmrc +0 -1
  31. package/dist/examples-apps/my-locations-app/README.md +0 -21
  32. package/dist/examples-apps/my-locations-app/package-lock.json +0 -6351
  33. package/dist/examples-apps/my-locations-app/package.json +0 -31
  34. package/dist/examples-apps/my-locations-app/src/dashboard/pages/page.json +0 -5
  35. package/dist/examples-apps/my-locations-app/src/dashboard/pages/page.tsx +0 -89
  36. package/dist/examples-apps/my-locations-app/src/dashboard/pages/wix_logo.svg +0 -18
  37. package/dist/examples-apps/my-locations-app/src/env.d.ts +0 -4
  38. package/dist/examples-apps/my-locations-app/tsconfig.json +0 -8
  39. package/dist/examples-apps/my-locations-app/wix.config.json +0 -5
@@ -1,142 +0,0 @@
1
- import { useEffect, useState, type FC } from 'react';
2
- import { dashboard } from '@wix/dashboard';
3
- import { embeddedScripts } from '@wix/app-management';
4
- import {
5
- Button,
6
- Page,
7
- Layout,
8
- Cell,
9
- Loader,
10
- Box,
11
- } from '@wix/design-system';
12
- import '@wix/design-system/styles.global.css';
13
- import withProviders from '../../withProviders';
14
- import { CountdownTimerSettings } from '../../../components/countdown-timer-settings';
15
- import { CountdownPreview } from '../../../components/countdown-preview';
16
- import type { CountdownTimerOptions } from '../../../types';
17
-
18
- const countdownTimerDefaultOptions: CountdownTimerOptions = {
19
- eventTitle: 'Upcoming Event',
20
- eventDescription: '',
21
- targetDateTime: new Date(Date.now() + 7 * 24 * 60 * 60 * 1000).toISOString().slice(0, 16), // 7 days from now
22
- completionMessage: 'Event has started!',
23
- backgroundColor: '#FFFFFF',
24
- textColor: '#000000',
25
- position: 'bottom-right',
26
- autoHide: true,
27
- timerSize: 'medium',
28
- };
29
-
30
- const CountdownTimerPage: FC = () => {
31
- const [options, setOptions] = useState<CountdownTimerOptions>(countdownTimerDefaultOptions);
32
- const [isLoading, setIsLoading] = useState(true);
33
- const [isSaving, setIsSaving] = useState(false);
34
-
35
- useEffect(() => {
36
- const loadSettings = async () => {
37
- try {
38
- const embeddedScript = await embeddedScripts.getEmbeddedScript();
39
- const data = embeddedScript.parameters as Partial<Record<keyof CountdownTimerOptions, string>> || {};
40
-
41
- setOptions((prev) => ({
42
- ...prev,
43
- eventTitle: data?.eventTitle || prev.eventTitle,
44
- eventDescription: data?.eventDescription || prev.eventDescription || '',
45
- targetDateTime: data?.targetDateTime || prev.targetDateTime,
46
- completionMessage: data?.completionMessage || prev.completionMessage,
47
- backgroundColor: data?.backgroundColor || prev.backgroundColor,
48
- textColor: data?.textColor || prev.textColor,
49
- position: (data?.position as CountdownTimerOptions['position']) || prev.position,
50
- autoHide: data?.autoHide === 'true' ? true : data?.autoHide === 'false' ? false : prev.autoHide,
51
- timerSize: (data?.timerSize as CountdownTimerOptions['timerSize']) || prev.timerSize,
52
- }));
53
- } catch (error) {
54
- console.error('Failed to load embedded script settings:', error);
55
- } finally {
56
- setIsLoading(false);
57
- }
58
- };
59
-
60
- loadSettings();
61
- }, []);
62
-
63
- const handleSave = async () => {
64
- if (!options.eventTitle || !options.targetDateTime) {
65
- dashboard.showToast({
66
- message: 'Please fill in all required fields',
67
- type: 'error',
68
- });
69
- return;
70
- }
71
-
72
- setIsSaving(true);
73
- try {
74
- // Convert all values to strings for embedded script parameters
75
- await embeddedScripts.embedScript({
76
- parameters: {
77
- eventTitle: options.eventTitle,
78
- eventDescription: options.eventDescription || '',
79
- targetDateTime: options.targetDateTime,
80
- completionMessage: options.completionMessage,
81
- backgroundColor: options.backgroundColor,
82
- textColor: options.textColor,
83
- position: options.position,
84
- autoHide: String(options.autoHide),
85
- timerSize: options.timerSize,
86
- },
87
- });
88
-
89
- dashboard.showToast({
90
- message: 'Countdown timer settings saved successfully!',
91
- type: 'success',
92
- });
93
- } catch (error) {
94
- console.error('Failed to save settings:', error);
95
- dashboard.showToast({
96
- message: 'Failed to save settings. Please try again.',
97
- type: 'error',
98
- });
99
- } finally {
100
- setIsSaving(false);
101
- }
102
- };
103
-
104
- return (
105
- <Page height="100vh">
106
- <Page.Header
107
- title="Countdown Timer Settings"
108
- subtitle="Configure your countdown timer with event details and visual customization options"
109
- actionsBar={
110
- <Button
111
- skin="inverted"
112
- disabled={!options.eventTitle || !options.targetDateTime || isSaving}
113
- onClick={handleSave}
114
- >
115
- {isSaving ? 'Saving...' : 'Save'}
116
- </Button>
117
- }
118
- />
119
- <Page.Content>
120
- {isLoading ? (
121
- <Box align="center" verticalAlign="middle" height="50vh">
122
- <Loader text="Loading countdown timer settings..." />
123
- </Box>
124
- ) : (
125
- <Layout gap="24px">
126
- <Cell span={6}>
127
- <CountdownTimerSettings
128
- options={options}
129
- onChange={setOptions}
130
- />
131
- </Cell>
132
- <Cell span={6}>
133
- <CountdownPreview {...options} />
134
- </Cell>
135
- </Layout>
136
- )}
137
- </Page.Content>
138
- </Page>
139
- );
140
- };
141
-
142
- export default withProviders(CountdownTimerPage);
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import { QueryClientProvider, QueryClient } from '@tanstack/react-query';
3
- import { WixDesignSystemProvider } from '@wix/design-system';
4
- import { i18n } from '@wix/essentials';
5
-
6
- const queryClient = new QueryClient();
7
-
8
- export default function withProviders<P extends {} = {}>(Component: React.FC<P>) {
9
- return function DashboardProviders(props: P) {
10
- const locale = i18n.getLocale();
11
- return (
12
- <WixDesignSystemProvider locale={locale} features={{ newColorsBranding: true }}>
13
- <QueryClientProvider client={queryClient}>
14
- <Component {...props} />
15
- </QueryClientProvider>
16
- </WixDesignSystemProvider>
17
- );
18
- };
19
- }
20
-
21
- // Also export as named export for backwards compatibility
22
- export { withProviders };
@@ -1,12 +0,0 @@
1
- import { app } from '@wix/astro/builders';
2
- import * as allExtensions from './index';
3
-
4
- // Get all exported extensions
5
- const extensionList = Object.values(allExtensions);
6
-
7
- const appBuilder = app();
8
- extensionList.forEach(extension => {
9
- appBuilder.use(extension);
10
- });
11
-
12
- export default appBuilder;
@@ -1,2 +0,0 @@
1
- export * from './dashboard/pages/countdown-timer-settings/extensions.ts';
2
- export * from './site/embedded-scripts/countdown-timer/extensions.ts';
@@ -1,328 +0,0 @@
1
- <div
2
- id="countdown-config"
3
- data-event-title="{{eventTitle}}"
4
- data-event-description="{{eventDescription}}"
5
- data-target-datetime="{{targetDateTime}}"
6
- data-completion-message="{{completionMessage}}"
7
- data-background-color="{{backgroundColor}}"
8
- data-text-color="{{textColor}}"
9
- data-position="{{position}}"
10
- data-auto-hide="{{autoHide}}"
11
- data-timer-size="{{timerSize}}"
12
- ></div>
13
- <div id="countdown-timer-container"></div>
14
-
15
- <style>
16
- .countdown-timer {
17
- position: fixed;
18
- z-index: 1000;
19
- border-radius: 8px;
20
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
21
- padding: 16px;
22
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
23
- backdrop-filter: blur(10px);
24
- border: 1px solid rgba(255, 255, 255, 0.2);
25
- transition: all 0.3s ease;
26
- }
27
-
28
- .countdown-timer.top-left {
29
- top: 20px;
30
- left: 20px;
31
- }
32
-
33
- .countdown-timer.top-right {
34
- top: 20px;
35
- right: 20px;
36
- }
37
-
38
- .countdown-timer.bottom-left {
39
- bottom: 20px;
40
- left: 20px;
41
- }
42
-
43
- .countdown-timer.bottom-right {
44
- bottom: 20px;
45
- right: 20px;
46
- }
47
-
48
- .countdown-timer.center {
49
- top: 50%;
50
- left: 50%;
51
- transform: translate(-50%, -50%);
52
- }
53
-
54
- .countdown-timer.small {
55
- padding: 12px;
56
- font-size: 14px;
57
- }
58
-
59
- .countdown-timer.medium {
60
- padding: 16px;
61
- font-size: 16px;
62
- }
63
-
64
- .countdown-timer.large {
65
- padding: 24px;
66
- font-size: 20px;
67
- }
68
-
69
- .countdown-title {
70
- margin: 0 0 8px 0;
71
- font-weight: 600;
72
- text-align: center;
73
- }
74
-
75
- .countdown-description {
76
- margin: 0 0 12px 0;
77
- font-size: 0.9em;
78
- opacity: 0.8;
79
- text-align: center;
80
- }
81
-
82
- .countdown-display {
83
- display: flex;
84
- gap: 12px;
85
- justify-content: center;
86
- align-items: center;
87
- }
88
-
89
- .countdown-unit {
90
- text-align: center;
91
- min-width: 40px;
92
- }
93
-
94
- .countdown-number {
95
- display: block;
96
- font-weight: 700;
97
- font-size: 1.5em;
98
- line-height: 1;
99
- }
100
-
101
- .countdown-label {
102
- display: block;
103
- font-size: 0.7em;
104
- opacity: 0.7;
105
- margin-top: 2px;
106
- }
107
-
108
- .countdown-separator {
109
- font-weight: 700;
110
- font-size: 1.2em;
111
- opacity: 0.6;
112
- }
113
-
114
- .countdown-completion {
115
- text-align: center;
116
- font-weight: 600;
117
- padding: 8px 0;
118
- }
119
-
120
- .countdown-timer.hidden {
121
- display: none;
122
- }
123
-
124
- @media (max-width: 480px) {
125
- .countdown-timer {
126
- max-width: calc(100vw - 40px);
127
- }
128
-
129
- .countdown-display {
130
- gap: 8px;
131
- }
132
-
133
- .countdown-unit {
134
- min-width: 35px;
135
- }
136
-
137
- .countdown-number {
138
- font-size: 1.3em;
139
- }
140
- }
141
- </style>
142
-
143
- <script>
144
- (function() {
145
- 'use strict';
146
-
147
- const config = document.getElementById('countdown-config');
148
- if (!config) return;
149
-
150
- const {
151
- eventTitle,
152
- eventDescription,
153
- targetDatetime,
154
- completionMessage,
155
- backgroundColor,
156
- textColor,
157
- position,
158
- autoHide,
159
- timerSize
160
- } = config.dataset;
161
-
162
- if (!targetDatetime) {
163
- console.warn('Countdown Timer: No target date specified');
164
- return;
165
- }
166
-
167
- const targetDate = new Date(targetDatetime);
168
- if (isNaN(targetDate.getTime())) {
169
- console.warn('Countdown Timer: Invalid target date format');
170
- return;
171
- }
172
-
173
- const container = document.getElementById('countdown-timer-container');
174
- if (!container) return;
175
-
176
- let countdownElement = null;
177
- let intervalId = null;
178
- let isCompleted = false;
179
-
180
- function createCountdownElement() {
181
- const timer = document.createElement('div');
182
- timer.className = `countdown-timer ${position || 'bottom-right'} ${timerSize || 'medium'}`;
183
- timer.style.backgroundColor = backgroundColor || '#FFFFFF';
184
- timer.style.color = textColor || '#000000';
185
-
186
- const titleElement = eventTitle ? `<div class="countdown-title">${escapeHtml(eventTitle)}</div>` : '';
187
- const descriptionElement = eventDescription ? `<div class="countdown-description">${escapeHtml(eventDescription)}</div>` : '';
188
-
189
- timer.innerHTML = `
190
- ${titleElement}
191
- ${descriptionElement}
192
- <div class="countdown-display" id="countdown-display">
193
- <div class="countdown-unit">
194
- <span class="countdown-number" id="days">00</span>
195
- <span class="countdown-label">Days</span>
196
- </div>
197
- <span class="countdown-separator">:</span>
198
- <div class="countdown-unit">
199
- <span class="countdown-number" id="hours">00</span>
200
- <span class="countdown-label">Hours</span>
201
- </div>
202
- <span class="countdown-separator">:</span>
203
- <div class="countdown-unit">
204
- <span class="countdown-number" id="minutes">00</span>
205
- <span class="countdown-label">Minutes</span>
206
- </div>
207
- <span class="countdown-separator">:</span>
208
- <div class="countdown-unit">
209
- <span class="countdown-number" id="seconds">00</span>
210
- <span class="countdown-label">Seconds</span>
211
- </div>
212
- </div>
213
- `;
214
-
215
- return timer;
216
- }
217
-
218
- function escapeHtml(text) {
219
- const div = document.createElement('div');
220
- div.textContent = text;
221
- return div.innerHTML;
222
- }
223
-
224
- function updateCountdown() {
225
- const now = new Date().getTime();
226
- const distance = targetDate.getTime() - now;
227
-
228
- if (distance < 0) {
229
- handleCountdownComplete();
230
- return;
231
- }
232
-
233
- const days = Math.floor(distance / (1000 * 60 * 60 * 24));
234
- const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
235
- const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
236
- const seconds = Math.floor((distance % (1000 * 60)) / 1000);
237
-
238
- if (countdownElement) {
239
- const daysEl = countdownElement.querySelector('#days');
240
- const hoursEl = countdownElement.querySelector('#hours');
241
- const minutesEl = countdownElement.querySelector('#minutes');
242
- const secondsEl = countdownElement.querySelector('#seconds');
243
-
244
- if (daysEl) daysEl.textContent = String(days).padStart(2, '0');
245
- if (hoursEl) hoursEl.textContent = String(hours).padStart(2, '0');
246
- if (minutesEl) minutesEl.textContent = String(minutes).padStart(2, '0');
247
- if (secondsEl) secondsEl.textContent = String(seconds).padStart(2, '0');
248
- }
249
- }
250
-
251
- function handleCountdownComplete() {
252
- if (isCompleted) return;
253
- isCompleted = true;
254
-
255
- if (intervalId) {
256
- clearInterval(intervalId);
257
- intervalId = null;
258
- }
259
-
260
- if (autoHide === 'true') {
261
- hideCountdown();
262
- } else {
263
- showCompletionMessage();
264
- }
265
- }
266
-
267
- function showCompletionMessage() {
268
- if (!countdownElement) return;
269
-
270
- const displayElement = countdownElement.querySelector('#countdown-display');
271
- if (displayElement) {
272
- displayElement.innerHTML = `
273
- <div class="countdown-completion">
274
- ${escapeHtml(completionMessage || 'Event has started!')}
275
- </div>
276
- `;
277
- }
278
- }
279
-
280
- function hideCountdown() {
281
- if (countdownElement) {
282
- countdownElement.classList.add('hidden');
283
- }
284
- }
285
-
286
- function showCountdown() {
287
- if (countdownElement) {
288
- countdownElement.classList.remove('hidden');
289
- }
290
- }
291
-
292
- function initializeCountdown() {
293
- // Check if countdown is already completed
294
- const now = new Date().getTime();
295
- if (targetDate.getTime() <= now) {
296
- isCompleted = true;
297
- if (autoHide === 'true') {
298
- return; // Don't show anything
299
- }
300
- }
301
-
302
- countdownElement = createCountdownElement();
303
- container.appendChild(countdownElement);
304
-
305
- if (isCompleted) {
306
- showCompletionMessage();
307
- } else {
308
- updateCountdown();
309
- intervalId = setInterval(updateCountdown, 1000);
310
- }
311
- }
312
-
313
- // Initialize when DOM is ready
314
- if (document.readyState === 'loading') {
315
- document.addEventListener('DOMContentLoaded', initializeCountdown);
316
- } else {
317
- initializeCountdown();
318
- }
319
-
320
- // Cleanup on page unload
321
- window.addEventListener('beforeunload', function() {
322
- if (intervalId) {
323
- clearInterval(intervalId);
324
- }
325
- });
326
-
327
- })();
328
- </script>
@@ -1,8 +0,0 @@
1
- import { extensions } from '@wix/astro/builders';
2
- export const embeddedscriptcountdowntimer = extensions.embeddedScript({
3
- "id": "f065e8bd-5906-49a5-91c6-fbd0d5d8b600",
4
- "scriptType": "FUNCTIONAL",
5
- "placement": "BODY_END",
6
- "source": "./site/embedded-scripts/countdown-timer/embedded.html",
7
- "name": "countdown-timer"
8
- })
@@ -1,11 +0,0 @@
1
- export type CountdownTimerOptions = {
2
- eventTitle: string;
3
- eventDescription?: string;
4
- targetDateTime: string;
5
- completionMessage: string;
6
- backgroundColor: string;
7
- textColor: string;
8
- position: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center';
9
- autoHide: boolean;
10
- timerSize: 'small' | 'medium' | 'large';
11
- };
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "astro/tsconfigs/strictest",
3
- "compilerOptions": {
4
- "jsx": "react-jsx",
5
- "jsxImportSource": "react"
6
- },
7
- "include": [".astro/types.d.ts", "**/*"],
8
- "exclude": ["dist"]
9
- }
@@ -1,4 +0,0 @@
1
- {
2
- "appId": "54230258-14c1-41f8-9e34-75ff8cc7e0a1",
3
- "siteId": "84465fce-8df2-4506-8cea-a6a1267cc3ee"
4
- }
@@ -1 +0,0 @@
1
- 22.10.0
@@ -1,21 +0,0 @@
1
- # mixpanel-analytics
2
-
3
- This project was bootstrapped with [Create Wix App](https://www.npmjs.com/package/@wix/create-app).
4
- Read more about it in the [Wix CLI for Apps
5
- documentation](https://dev.wix.com/docs/build-apps/developer-tools/cli/get-started/about-the-wix-cli-for-apps).
6
-
7
- ## Setup 🔧
8
-
9
- ##### Install dependencies:
10
-
11
- ```console
12
- npm install
13
- ```
14
-
15
- ## Available Scripts
16
-
17
- In the project directory, you can run:
18
-
19
- ```console
20
- npm run dev
21
- ```