@wix/ditto-codegen-public 1.0.48 → 1.0.50
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/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/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 +4716 -898
- 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
|
@@ -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 />);
|