@wix/ditto-codegen-public 1.0.49 → 1.0.51
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/dist/docs-output/api-docs/crm-contacts-onContactCreated-doc.txt +183 -0
- package/dist/docs-output/api-docs/data-items-onDataItemCreated.txt +103 -0
- package/dist/docs-output/api-docs/stores-product-onProductCreated-doc.txt +118 -0
- package/dist/docs-output/api-docs/stores-productV3-onProductCreated-doc.txt +184 -0
- package/dist/docs-output/api-docs/stores-productsV3-updateProduct-doc.txt +130 -0
- package/dist/examples-apps/contact-created-logger/package-lock.json +15102 -0
- package/dist/examples-apps/contact-created-logger/package.json +37 -0
- package/dist/examples-apps/contact-created-logger/src/backend/events/contact-created-logger/event.ts +51 -0
- package/dist/examples-apps/contact-created-logger/tsconfig.json +5 -0
- package/dist/examples-apps/contact-created-logger/wix.config.json +4 -0
- package/dist/examples-apps/event-countdown/README.md +13 -0
- package/dist/examples-apps/event-countdown/astro.config.mjs +31 -0
- package/dist/examples-apps/event-countdown/package.json +51 -0
- package/dist/examples-apps/event-countdown/src/components/countdown-preview.tsx +164 -0
- package/dist/examples-apps/event-countdown/src/components/countdown-timer-settings.tsx +199 -0
- package/dist/examples-apps/event-countdown/src/dashboard/pages/countdown-timer-settings/extensions.ts +7 -0
- package/dist/examples-apps/event-countdown/src/dashboard/pages/countdown-timer-settings/page.tsx +142 -0
- package/dist/examples-apps/event-countdown/src/dashboard/withProviders.tsx +22 -0
- package/dist/examples-apps/event-countdown/src/extensions.ts +12 -0
- package/dist/examples-apps/event-countdown/src/index.ts +2 -0
- package/dist/examples-apps/event-countdown/src/site/embedded-scripts/countdown-timer/embedded.html +328 -0
- package/dist/examples-apps/event-countdown/src/site/embedded-scripts/countdown-timer/extensions.ts +8 -0
- package/dist/examples-apps/event-countdown/src/types.ts +11 -0
- package/dist/examples-apps/event-countdown/tsconfig.json +9 -0
- package/dist/examples-apps/event-countdown/wix.config.json +4 -0
- package/dist/examples-apps/product-created-logger/package-lock.json +15102 -0
- package/dist/examples-apps/product-created-logger/package.json +37 -0
- package/dist/examples-apps/product-created-logger/src/backend/events/product-created-logger/event.ts +67 -0
- package/dist/examples-apps/product-created-logger/tsconfig.json +5 -0
- package/dist/examples-apps/product-created-logger/wix.config.json +4 -0
- package/dist/examples-apps/site-popup/package.json +43 -26
- package/dist/examples-apps/site-popup/src/components/activation-configuration.tsx +1 -1
- package/dist/examples-apps/site-popup/src/components/close-button.css +33 -0
- package/dist/examples-apps/site-popup/src/components/close-button.tsx +4 -3
- package/dist/examples-apps/site-popup/src/components/popup/index.css +133 -3
- package/dist/examples-apps/site-popup/src/components/popup/index.tsx +10 -10
- package/dist/examples-apps/site-popup/src/components/site-popup-settings.tsx +4 -4
- package/dist/examples-apps/site-popup/src/dashboard/pages/page.tsx +2 -2
- package/dist/examples-apps/site-popup/src/dashboard/withProviders.tsx +4 -1
- package/dist/examples-apps/site-popup/src/extensions.ts +21 -0
- package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/embedded.html +1 -0
- package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/popup-overlay/index.css +21 -3
- package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/popup-overlay/index.tsx +8 -9
- package/dist/examples-apps/site-popup/src/types.ts +1 -1
- package/dist/out.js +1294 -98
- package/dist/wix-cli-templates/src/dashboard/pages/page.tsx +0 -4
- package/dist/wix-cli-templates/src/site/embedded-scripts/my-script/embedded.html +1 -2
- package/package.json +2 -2
- package/dist/examples-apps/mixpanel-analytics/src/dashboard/pages/page.json +0 -5
- package/dist/examples-apps/mixpanel-analytics/src/site/embedded-scripts/mixpanel-analytics/embedded.json +0 -7
- package/dist/examples-apps/site-popup/package-lock.json +0 -8033
- package/dist/examples-apps/site-popup/postcss.config.js +0 -7
- package/dist/examples-apps/site-popup/src/env.d.ts +0 -4
- package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/embedded.json +0 -7
- package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/params.dev.json +0 -7
- package/dist/examples-apps/site-popup/tailwind.config.js +0 -8
- package/dist/wix-cli-templates/src/dashboard/pages/wix_logo.svg +0 -18
- package/dist/wix-cli-templates/src/site/embedded-scripts/my-script/embedded.json +0 -7
- package/dist/wix-cli-templates/src/site/embedded-scripts/my-script/logger.ts +0 -1
- package/dist/wix-cli-templates/src/site/embedded-scripts/my-script/params.dev.json +0 -3
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "my-custom-app",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"astro": "astro",
|
|
7
|
+
"dev": "wix dev",
|
|
8
|
+
"build": "wix build",
|
|
9
|
+
"wix": "wix",
|
|
10
|
+
"preview": "wix preview",
|
|
11
|
+
"release": "wix release",
|
|
12
|
+
"generate": "wix generate",
|
|
13
|
+
"env": "wix env"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@wix/astro": "0.0.4-experimental-react-component",
|
|
17
|
+
"@wix/crm": "^1.0.1071",
|
|
18
|
+
"@wix/dashboard": "^1.3.36",
|
|
19
|
+
"@wix/data": "^1.0.290",
|
|
20
|
+
"@wix/design-system": "^1.111.0",
|
|
21
|
+
"@wix/ecom": "^1.0.1354",
|
|
22
|
+
"@wix/essentials": "^0.1.23",
|
|
23
|
+
"@wix/sdk": "^1.15.23",
|
|
24
|
+
"@wix/stores": "^1.0.533",
|
|
25
|
+
"astro": "^5.8.0",
|
|
26
|
+
"typescript": "^5.8.3"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@astrojs/cloudflare": "^12.5.3",
|
|
30
|
+
"@astrojs/react": "^4.3.0",
|
|
31
|
+
"@types/react": "^18.3.1",
|
|
32
|
+
"@types/react-dom": "^18.3.1",
|
|
33
|
+
"@wix/cli": "^1.1.92",
|
|
34
|
+
"react": "18.3.1",
|
|
35
|
+
"react-dom": "18.3.1"
|
|
36
|
+
}
|
|
37
|
+
}
|
package/dist/examples-apps/product-created-logger/src/backend/events/product-created-logger/event.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { productsV3 } from '@wix/stores';
|
|
2
|
+
import { items } from '@wix/data';
|
|
3
|
+
|
|
4
|
+
productsV3.onProductCreated(async (event) => {
|
|
5
|
+
const productIdFromEvent = event.entity?._id;
|
|
6
|
+
try {
|
|
7
|
+
console.log('Product created event triggered:', event);
|
|
8
|
+
|
|
9
|
+
// Extract product information from the event
|
|
10
|
+
const productId = productIdFromEvent;
|
|
11
|
+
|
|
12
|
+
if (!productId) {
|
|
13
|
+
console.error('No product ID found in event');
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const product = event.entity;
|
|
18
|
+
|
|
19
|
+
// Create detailed creation information
|
|
20
|
+
const creationDetails = {
|
|
21
|
+
productName: product.name || 'Unknown Product',
|
|
22
|
+
productSlug: product.slug,
|
|
23
|
+
visible: product.visible,
|
|
24
|
+
inventory: product.inventory,
|
|
25
|
+
brand: product.brand
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// Create log entry in the product-creation-logs collection
|
|
29
|
+
const logEntry = {
|
|
30
|
+
productId: productId,
|
|
31
|
+
changeType: 'PRODUCT_CREATED',
|
|
32
|
+
changedFields: ['CREATED'],
|
|
33
|
+
timestamp: new Date(),
|
|
34
|
+
changeDetails: JSON.stringify(creationDetails, null, 2)
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// Insert the log entry into the collection
|
|
38
|
+
await items.insert('product-creation-logs', logEntry);
|
|
39
|
+
|
|
40
|
+
console.log('Product creation logged successfully:', {
|
|
41
|
+
productId,
|
|
42
|
+
productName: product.name,
|
|
43
|
+
changedFields: logEntry.changedFields,
|
|
44
|
+
timestamp: logEntry.timestamp
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error('Error processing product creation event:', {
|
|
49
|
+
productId: productIdFromEvent || 'unknown',
|
|
50
|
+
error: error instanceof Error ? error.message : String(error),
|
|
51
|
+
timestamp: new Date()
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Try to log the error to the collection as well
|
|
55
|
+
try {
|
|
56
|
+
await items.insert('product-creation-logs', {
|
|
57
|
+
productId: productIdFromEvent || 'unknown',
|
|
58
|
+
changeType: 'ERROR',
|
|
59
|
+
changedFields: [],
|
|
60
|
+
timestamp: new Date(),
|
|
61
|
+
changeDetails: `Error processing product creation: ${error instanceof Error ? error.message : String(error)}`
|
|
62
|
+
});
|
|
63
|
+
} catch (logError) {
|
|
64
|
+
console.error('Failed to log error to collection:', logError);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
});
|
|
@@ -1,34 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "site-popup",
|
|
3
3
|
"version": "1.0.0",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
4
|
+
"scripts": {
|
|
5
|
+
"astro": "astro",
|
|
6
|
+
"dev": "wix dev",
|
|
7
|
+
"build": "wix build",
|
|
8
|
+
"wix": "wix",
|
|
9
|
+
"preview": "wix preview",
|
|
10
|
+
"release": "wix release",
|
|
11
|
+
"generate": "wix generate",
|
|
12
|
+
"env": "wix env"
|
|
12
13
|
},
|
|
13
|
-
"
|
|
14
|
-
"@
|
|
15
|
-
"@
|
|
16
|
-
"@
|
|
17
|
-
"@
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@astrojs/cloudflare": "^12.5.3",
|
|
16
|
+
"@astrojs/react": "^4.3.0",
|
|
17
|
+
"@tanstack/react-query": "^5.90.5",
|
|
18
|
+
"@types/react": "^18.3.1",
|
|
19
|
+
"@types/react-dom": "^18.3.1",
|
|
20
|
+
"@wix/app-management": "^1.0.122",
|
|
21
|
+
"@wix/astro": "^2.8.0",
|
|
22
|
+
"@wix/auto-patterns": "^1.40.0",
|
|
23
|
+
"@wix/cli": "^1.1.92",
|
|
24
|
+
"@wix/crm": "^1.0.1071",
|
|
25
|
+
"@wix/dashboard": "^1.3.40",
|
|
26
|
+
"@wix/data": "^1.0.290",
|
|
27
|
+
"@wix/design-system": "^1.217.0",
|
|
28
|
+
"@wix/ecom": "^1.0.1354",
|
|
29
|
+
"@wix/essentials": "^0.1.23",
|
|
30
|
+
"@wix/patterns": "^1.290.0",
|
|
31
|
+
"@wix/sdk": "^1.15.23",
|
|
18
32
|
"@wix/sdk-types": "^1.0.0",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
33
|
+
"@wix/site-site": "^1.26.0",
|
|
34
|
+
"@wix/stores": "^1.0.533",
|
|
35
|
+
"@wix/wix-ui-icons-common": "^3.90.0",
|
|
36
|
+
"astro": "^5.8.0",
|
|
37
|
+
"react": "18.3.1",
|
|
38
|
+
"react-dom": "18.3.1",
|
|
39
|
+
"react-router-dom": "^6.0.0",
|
|
40
|
+
"typescript": "^5.8.3"
|
|
24
41
|
},
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@astrojs/cloudflare": "^12.5.3",
|
|
44
|
+
"@astrojs/react": "^4.3.0",
|
|
45
|
+
"@types/react": "^18.3.1",
|
|
46
|
+
"@types/react-dom": "^18.3.1",
|
|
47
|
+
"@wix/cli": "^1.1.92",
|
|
48
|
+
"react": "18.3.1",
|
|
49
|
+
"react-dom": "18.3.1"
|
|
33
50
|
}
|
|
34
51
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { type FC } from 'react';
|
|
2
2
|
import { Box, RadioGroup } from '@wix/design-system';
|
|
3
|
-
import { ActivationMode, ActivationOptions } from '../types.js';
|
|
4
3
|
import { DataRangePicker } from './date-range-picker.js';
|
|
4
|
+
import type { ActivationMode, ActivationOptions } from '../types.js';
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
7
|
activationOptions: ActivationOptions;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.close-button-wrapper {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: flex-end;
|
|
4
|
+
padding: 0.5rem;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.close-button {
|
|
8
|
+
background-color: rgba(255, 255, 255, 0.9);
|
|
9
|
+
color: #374151;
|
|
10
|
+
border-radius: 50%;
|
|
11
|
+
font-size: 0.875rem;
|
|
12
|
+
padding: 0.5rem;
|
|
13
|
+
margin-left: auto;
|
|
14
|
+
display: inline-flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
border: none;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
transition: all 0.2s ease;
|
|
20
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.close-button:hover {
|
|
24
|
+
background-color: rgba(255, 255, 255, 1);
|
|
25
|
+
transform: scale(1.1);
|
|
26
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.close-icon {
|
|
30
|
+
width: 1.25rem;
|
|
31
|
+
height: 1.25rem;
|
|
32
|
+
}
|
|
33
|
+
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { type FC } from 'react';
|
|
2
|
+
import './close-button.css';
|
|
2
3
|
|
|
3
4
|
interface Props {
|
|
4
5
|
onClick?: () => void;
|
|
@@ -6,14 +7,14 @@ interface Props {
|
|
|
6
7
|
|
|
7
8
|
export const CloseButton: FC<Props> = ({ onClick }) => {
|
|
8
9
|
return (
|
|
9
|
-
<div className="
|
|
10
|
+
<div className="close-button-wrapper">
|
|
10
11
|
<button
|
|
11
12
|
onClick={onClick}
|
|
12
13
|
type="button"
|
|
13
|
-
className="
|
|
14
|
+
className="close-button"
|
|
14
15
|
>
|
|
15
16
|
<svg
|
|
16
|
-
className="
|
|
17
|
+
className="close-icon"
|
|
17
18
|
fill="currentColor"
|
|
18
19
|
viewBox="0 0 20 20"
|
|
19
20
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1,3 +1,133 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
.popup-card {
|
|
2
|
+
border-radius: 0.5rem;
|
|
3
|
+
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
|
|
4
|
+
display: grid;
|
|
5
|
+
position: relative;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@media (min-width: 768px) {
|
|
9
|
+
.popup-card {
|
|
10
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.close-btn-container {
|
|
15
|
+
position: absolute;
|
|
16
|
+
z-index: 1000;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.popup-content {
|
|
20
|
+
padding: 1rem;
|
|
21
|
+
text-align: center;
|
|
22
|
+
background-color: #1f2937;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
border-top-left-radius: 0.5rem;
|
|
27
|
+
border-bottom-left-radius: 0.5rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media (min-width: 640px) {
|
|
31
|
+
.popup-content {
|
|
32
|
+
padding: 1.5rem;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media (min-width: 768px) {
|
|
37
|
+
.popup-content {
|
|
38
|
+
grid-column: span 1;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@media (min-width: 1024px) {
|
|
43
|
+
.popup-content {
|
|
44
|
+
padding: 2rem;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.popup-text-container {
|
|
49
|
+
position: relative;
|
|
50
|
+
bottom: 0;
|
|
51
|
+
isolation: isolate;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
padding: 6rem 1rem;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@media (min-width: 640px) {
|
|
57
|
+
.popup-text-container {
|
|
58
|
+
padding-left: 3rem;
|
|
59
|
+
padding-right: 3rem;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media (min-width: 1280px) {
|
|
64
|
+
.popup-text-container {
|
|
65
|
+
padding-top: 8rem;
|
|
66
|
+
padding-bottom: 8rem;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.popup-headline {
|
|
71
|
+
margin-left: auto;
|
|
72
|
+
margin-right: auto;
|
|
73
|
+
max-width: 42rem;
|
|
74
|
+
text-align: center;
|
|
75
|
+
font-size: 1.875rem;
|
|
76
|
+
font-weight: 700;
|
|
77
|
+
letter-spacing: -0.025em;
|
|
78
|
+
color: white;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@media (min-width: 640px) {
|
|
82
|
+
.popup-headline {
|
|
83
|
+
font-size: 2.25rem;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.popup-text {
|
|
88
|
+
margin-left: auto;
|
|
89
|
+
margin-right: auto;
|
|
90
|
+
margin-top: 0.5rem;
|
|
91
|
+
max-width: 36rem;
|
|
92
|
+
text-align: center;
|
|
93
|
+
font-size: 1.125rem;
|
|
94
|
+
line-height: 2rem;
|
|
95
|
+
color: #d1d5db;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.popup-button-container {
|
|
99
|
+
display: flex;
|
|
100
|
+
justify-content: center;
|
|
101
|
+
align-items: center;
|
|
102
|
+
padding: 1rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.popup-dont-show-button {
|
|
106
|
+
font-size: 0.875rem;
|
|
107
|
+
color: white;
|
|
108
|
+
background: transparent;
|
|
109
|
+
border: none;
|
|
110
|
+
cursor: pointer;
|
|
111
|
+
padding: 0.5rem 1rem;
|
|
112
|
+
transition: opacity 0.2s ease;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.popup-dont-show-button:hover {
|
|
116
|
+
opacity: 0.8;
|
|
117
|
+
text-decoration: underline;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.popup-image {
|
|
121
|
+
height: 16rem;
|
|
122
|
+
object-fit: cover;
|
|
123
|
+
width: 100%;
|
|
124
|
+
border-top-right-radius: 0.5rem;
|
|
125
|
+
border-bottom-right-radius: 0.5rem;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@media (min-width: 768px) {
|
|
129
|
+
.popup-image {
|
|
130
|
+
height: 100%;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { type FC } from 'react';
|
|
2
2
|
import { CloseButton } from '../close-button.js';
|
|
3
|
-
import { SitePopupOptions } from '../../types.js';
|
|
3
|
+
import type { SitePopupOptions } from '../../types.js';
|
|
4
4
|
import './index.css';
|
|
5
5
|
|
|
6
6
|
function formatDateWithLocale(dateInMillis: string, locale: string) {
|
|
@@ -36,23 +36,23 @@ export const Popup: FC<
|
|
|
36
36
|
formattedText = formattedText.replace(/{endDate}/g, formatDateWithLocale(endDate, locale));
|
|
37
37
|
}
|
|
38
38
|
return (
|
|
39
|
-
<div className="
|
|
40
|
-
<div id="close-btn" className="
|
|
39
|
+
<div className="popup-card">
|
|
40
|
+
<div id="close-btn" className="close-btn-container">
|
|
41
41
|
<CloseButton onClick={() => onClose?.()} />
|
|
42
42
|
</div>
|
|
43
|
-
<div className="
|
|
44
|
-
<div className="
|
|
45
|
-
<h4 className="
|
|
43
|
+
<div className="popup-content">
|
|
44
|
+
<div className="popup-text-container">
|
|
45
|
+
<h4 className="popup-headline">
|
|
46
46
|
<span style={{font: 'var(--wst-font-style-h4)'}}>{headline}</span>
|
|
47
47
|
</h4>
|
|
48
|
-
<p className="
|
|
48
|
+
<p className="popup-text">
|
|
49
49
|
<span style={{font: 'var(--wst-font-style-body-medium)'}}>{formattedText}</span>
|
|
50
50
|
</p>
|
|
51
51
|
</div>
|
|
52
|
-
<div className="
|
|
52
|
+
<div className="popup-button-container">
|
|
53
53
|
<button
|
|
54
54
|
type="button"
|
|
55
|
-
className="
|
|
55
|
+
className="popup-dont-show-button"
|
|
56
56
|
onClick={() => onClose?.(true)}
|
|
57
57
|
>
|
|
58
58
|
<span style={{font: 'var(--wst-font-style-body-small)'}}>Don't show this again</span>
|
|
@@ -64,7 +64,7 @@ export const Popup: FC<
|
|
|
64
64
|
height="50vh"
|
|
65
65
|
src={imageUrl}
|
|
66
66
|
alt={imageTitle}
|
|
67
|
-
className="
|
|
67
|
+
className="popup-image"
|
|
68
68
|
/>
|
|
69
69
|
</div>
|
|
70
70
|
);
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
InputArea,
|
|
7
7
|
Card,
|
|
8
8
|
FormField,
|
|
9
|
-
FormFieldProps,
|
|
9
|
+
type FormFieldProps,
|
|
10
10
|
} from '@wix/design-system';
|
|
11
|
-
import { SitePopupOptions } from '../types.js';
|
|
12
11
|
import { ActivationConfiguration } from './activation-configuration.js';
|
|
13
12
|
import { ImagePicker } from './image-picker.js';
|
|
13
|
+
import type { SitePopupOptions } from '../types.js';
|
|
14
14
|
|
|
15
15
|
interface Props {
|
|
16
16
|
options: SitePopupOptions;
|
|
@@ -86,8 +86,8 @@ export const SitePopupSettings: FC<Props> = ({ options, onChange }) => {
|
|
|
86
86
|
<ActivationConfiguration
|
|
87
87
|
activationOptions={{
|
|
88
88
|
activationMode: options.activationMode,
|
|
89
|
-
startDate: options.startDate,
|
|
90
|
-
endDate: options.endDate,
|
|
89
|
+
...(options.startDate != null && { startDate: options.startDate }),
|
|
90
|
+
...(options.endDate != null && { endDate: options.endDate }),
|
|
91
91
|
}}
|
|
92
92
|
onChange={(activationOptions) =>
|
|
93
93
|
onChange({
|
|
@@ -4,8 +4,8 @@ import { Box, Button, Cell, Layout, Loader, Page } from '@wix/design-system';
|
|
|
4
4
|
import '@wix/design-system/styles.global.css';
|
|
5
5
|
import { withProviders } from '../withProviders';
|
|
6
6
|
import { SitePopupSettings } from '../../components/site-popup-settings.js';
|
|
7
|
-
import { SitePopupOptions } from '../../types.js';
|
|
8
7
|
import { useEmbeds } from '../hooks/wix-embeds.js';
|
|
8
|
+
import type { SitePopupOptions } from '../../types.js';
|
|
9
9
|
import { Popup } from '../../components/popup/index.js';
|
|
10
10
|
|
|
11
11
|
const sitePopupDefaultOptions: SitePopupOptions = {
|
|
@@ -48,7 +48,7 @@ function SitePopup() {
|
|
|
48
48
|
disabled={!sitePopupOptions.headline || !sitePopupOptions.text}
|
|
49
49
|
onClick={() => embedScript.mutate({ ...sitePopupOptions })}
|
|
50
50
|
>
|
|
51
|
-
|
|
51
|
+
Save
|
|
52
52
|
</Button>
|
|
53
53
|
}
|
|
54
54
|
/>
|
|
@@ -5,7 +5,7 @@ import { i18n } from '@wix/essentials';
|
|
|
5
5
|
|
|
6
6
|
const queryClient = new QueryClient();
|
|
7
7
|
|
|
8
|
-
export function withProviders<P extends {} = {}>(Component: React.FC<P>) {
|
|
8
|
+
export default function withProviders<P extends {} = {}>(Component: React.FC<P>) {
|
|
9
9
|
return function DashboardProviders(props: P) {
|
|
10
10
|
const locale = i18n.getLocale();
|
|
11
11
|
return (
|
|
@@ -17,3 +17,6 @@ export function withProviders<P extends {} = {}>(Component: React.FC<P>) {
|
|
|
17
17
|
);
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
// Also export as named export for backwards compatibility
|
|
22
|
+
export { withProviders };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { app } from '@wix/astro/builders';
|
|
2
|
+
import * as extensions from '@wix/astro/builders';
|
|
3
|
+
|
|
4
|
+
export default app()
|
|
5
|
+
.use(
|
|
6
|
+
extensions.embeddedScript({
|
|
7
|
+
id: '2c43c310-939b-451d-b488-805f7ebba6ab',
|
|
8
|
+
name: 'Site Popup',
|
|
9
|
+
scriptType: "FUNCTIONAL",
|
|
10
|
+
placement: "BODY_START",
|
|
11
|
+
source: './site/embedded-scripts/site-popup/embedded.html',
|
|
12
|
+
})
|
|
13
|
+
)
|
|
14
|
+
.use(
|
|
15
|
+
extensions.backofficePage({
|
|
16
|
+
id: '57512654-b94e-460b-91e4-88624b5afea3',
|
|
17
|
+
component: './dashboard/pages/page.tsx',
|
|
18
|
+
routePath: 'hello',
|
|
19
|
+
title: 'Site popup',
|
|
20
|
+
})
|
|
21
|
+
);
|
package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/popup-overlay/index.css
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
.popup-overlay {
|
|
2
|
+
position: fixed;
|
|
3
|
+
display: flex;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
align-items: center;
|
|
6
|
+
top: 0;
|
|
7
|
+
left: 0;
|
|
8
|
+
right: 0;
|
|
9
|
+
bottom: 0;
|
|
10
|
+
z-index: 1000;
|
|
11
|
+
background-color: rgba(209, 213, 219, 0.75);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.popup-overlay.hidden {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.popup-container {
|
|
19
|
+
width: 75%;
|
|
20
|
+
}
|
|
21
|
+
|
package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/popup-overlay/index.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { createRoot } from 'react-dom/client';
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
|
-
import { Popup } from '../../../../components/popup/index.js';
|
|
4
|
-
import { SitePopupOptions } from '../../../../types.js';
|
|
5
|
-
import './index.css';
|
|
6
3
|
import { site } from '@wix/site-site';
|
|
4
|
+
import './index.css';
|
|
5
|
+
import type { SitePopupOptions } from '../../../../types';
|
|
6
|
+
import { Popup } from '../../../../components/popup';
|
|
7
7
|
|
|
8
8
|
const PopupOverlay = () => {
|
|
9
9
|
const [shown, setShown] = useState<boolean>(false);
|
|
@@ -43,16 +43,15 @@ const PopupOverlay = () => {
|
|
|
43
43
|
return (
|
|
44
44
|
<div
|
|
45
45
|
className={
|
|
46
|
-
shown && shouldShowPopup()
|
|
47
|
-
? 'fixed flex justify-center items-center inset-0 z-[1000] bg-gray-300 bg-opacity-75'
|
|
48
|
-
: 'hidden'
|
|
46
|
+
shown && shouldShowPopup() ? 'popup-overlay' : 'popup-overlay hidden'
|
|
49
47
|
}
|
|
50
48
|
>
|
|
51
|
-
<div className="
|
|
49
|
+
<div className="popup-container">
|
|
52
50
|
<Popup {...popupParams} locale={regionalSettings} onClose={closePopup} />
|
|
53
51
|
</div>
|
|
54
52
|
</div>
|
|
55
53
|
);
|
|
56
54
|
};
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
const root = createRoot(document.getElementById('site-popup')!);
|
|
57
|
+
root.render(<PopupOverlay />);
|