@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.
- package/dist/out.js +2 -49
- package/package.json +2 -2
- package/dist/examples-apps/event-countdown/README.md +0 -13
- package/dist/examples-apps/event-countdown/astro.config.mjs +0 -31
- package/dist/examples-apps/event-countdown/package.json +0 -51
- package/dist/examples-apps/event-countdown/src/components/countdown-preview.tsx +0 -164
- package/dist/examples-apps/event-countdown/src/components/countdown-timer-settings.tsx +0 -199
- package/dist/examples-apps/event-countdown/src/dashboard/pages/countdown-timer-settings/extensions.ts +0 -7
- package/dist/examples-apps/event-countdown/src/dashboard/pages/countdown-timer-settings/page.tsx +0 -142
- package/dist/examples-apps/event-countdown/src/dashboard/withProviders.tsx +0 -22
- package/dist/examples-apps/event-countdown/src/extensions.ts +0 -12
- package/dist/examples-apps/event-countdown/src/index.ts +0 -2
- package/dist/examples-apps/event-countdown/src/site/embedded-scripts/countdown-timer/embedded.html +0 -328
- package/dist/examples-apps/event-countdown/src/site/embedded-scripts/countdown-timer/extensions.ts +0 -8
- package/dist/examples-apps/event-countdown/src/types.ts +0 -11
- package/dist/examples-apps/event-countdown/tsconfig.json +0 -9
- package/dist/examples-apps/event-countdown/wix.config.json +0 -4
- package/dist/examples-apps/mixpanel-analytics/.nvmrc +0 -1
- package/dist/examples-apps/mixpanel-analytics/README.md +0 -21
- package/dist/examples-apps/mixpanel-analytics/package-lock.json +0 -6357
- package/dist/examples-apps/mixpanel-analytics/package.json +0 -31
- package/dist/examples-apps/mixpanel-analytics/src/dashboard/components/ProjectToken.tsx +0 -60
- package/dist/examples-apps/mixpanel-analytics/src/dashboard/hooks/wix-embeds.ts +0 -33
- package/dist/examples-apps/mixpanel-analytics/src/dashboard/pages/page.tsx +0 -39
- package/dist/examples-apps/mixpanel-analytics/src/dashboard/withProviders.tsx +0 -19
- package/dist/examples-apps/mixpanel-analytics/src/env.d.ts +0 -4
- package/dist/examples-apps/mixpanel-analytics/src/site/embedded-scripts/mixpanel-analytics/embedded.html +0 -13
- package/dist/examples-apps/mixpanel-analytics/tsconfig.json +0 -8
- package/dist/examples-apps/mixpanel-analytics/wix.config.json +0 -5
- package/dist/examples-apps/my-locations-app/.nvmrc +0 -1
- package/dist/examples-apps/my-locations-app/README.md +0 -21
- package/dist/examples-apps/my-locations-app/package-lock.json +0 -6351
- package/dist/examples-apps/my-locations-app/package.json +0 -31
- package/dist/examples-apps/my-locations-app/src/dashboard/pages/page.json +0 -5
- package/dist/examples-apps/my-locations-app/src/dashboard/pages/page.tsx +0 -89
- package/dist/examples-apps/my-locations-app/src/dashboard/pages/wix_logo.svg +0 -18
- package/dist/examples-apps/my-locations-app/src/env.d.ts +0 -4
- package/dist/examples-apps/my-locations-app/tsconfig.json +0 -8
- package/dist/examples-apps/my-locations-app/wix.config.json +0 -5
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "mixpanel-analytics",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"dependencies": {
|
|
5
|
-
"@tanstack/react-query": "^4.36.1",
|
|
6
|
-
"@wix/app-management": "^1.0.0",
|
|
7
|
-
"@wix/design-system": "^1.111.0",
|
|
8
|
-
"@wix/essentials": "^0.1.4",
|
|
9
|
-
"@wix/wix-ui-icons-common": "^3.0.34",
|
|
10
|
-
"mixpanel-browser": "^2.49.0"
|
|
11
|
-
},
|
|
12
|
-
"devDependencies": {
|
|
13
|
-
"@types/react": "^16.0.0",
|
|
14
|
-
"@types/react-dom": "^16.0.0",
|
|
15
|
-
"@wix/cli": "^1.0.0",
|
|
16
|
-
"@wix/cli-app": "^1.0.0",
|
|
17
|
-
"@wix/sdk-types": "^1.0.0",
|
|
18
|
-
"react": "16.14.0",
|
|
19
|
-
"react-dom": "16.14.0",
|
|
20
|
-
"typescript": "^5.3.3"
|
|
21
|
-
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"build": "wix app build",
|
|
24
|
-
"release": "wix app release",
|
|
25
|
-
"dev": "wix app dev",
|
|
26
|
-
"preview": "wix app preview",
|
|
27
|
-
"logs": "wix app logs",
|
|
28
|
-
"generate": "wix app generate",
|
|
29
|
-
"typecheck": "tsc --noEmit"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { Input, Button, Box, Loader } from '@wix/design-system';
|
|
3
|
-
import * as Icons from '@wix/wix-ui-icons-common';
|
|
4
|
-
import { useEmbeds } from '../hooks/wix-embeds.js';
|
|
5
|
-
|
|
6
|
-
type MixpanelEmbeds = {
|
|
7
|
-
projectToken: string;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default function ProjectToken() {
|
|
11
|
-
const { embedScript, getEmbeddedScript } = useEmbeds<MixpanelEmbeds>();
|
|
12
|
-
const [projectToken, setProjectToken] = useState<string>('');
|
|
13
|
-
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
setProjectToken(getEmbeddedScript.data?.projectToken || '');
|
|
16
|
-
}, [getEmbeddedScript.data]);
|
|
17
|
-
|
|
18
|
-
const ButtonContent = () => {
|
|
19
|
-
if (embedScript.isLoading) {
|
|
20
|
-
return <Loader size="tiny" />;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (!getEmbeddedScript.data?.projectToken) {
|
|
24
|
-
return (
|
|
25
|
-
<Box gap={1}>
|
|
26
|
-
Activate
|
|
27
|
-
<Icons.GetStarted />
|
|
28
|
-
</Box>
|
|
29
|
-
);
|
|
30
|
-
} else {
|
|
31
|
-
return <>Update</>;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<Box gap={3} marginTop={3}>
|
|
37
|
-
{getEmbeddedScript.isLoading ? (
|
|
38
|
-
<Loader size="small" />
|
|
39
|
-
) : (
|
|
40
|
-
<>
|
|
41
|
-
<Input
|
|
42
|
-
disabled={embedScript.isLoading}
|
|
43
|
-
placeholder={'project-token'}
|
|
44
|
-
value={projectToken}
|
|
45
|
-
onChange={(e) => setProjectToken(e.currentTarget.value)}
|
|
46
|
-
/>
|
|
47
|
-
<Button
|
|
48
|
-
disabled={
|
|
49
|
-
getEmbeddedScript.data?.projectToken === projectToken ||
|
|
50
|
-
projectToken.length !== 32
|
|
51
|
-
}
|
|
52
|
-
onClick={() => embedScript.mutate({ projectToken })}
|
|
53
|
-
>
|
|
54
|
-
<ButtonContent />
|
|
55
|
-
</Button>
|
|
56
|
-
</>
|
|
57
|
-
)}
|
|
58
|
-
</Box>
|
|
59
|
-
);
|
|
60
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { embeddedScripts } from '@wix/app-management';
|
|
2
|
-
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
3
|
-
|
|
4
|
-
export const QUERY_EMBEDS = 'queryEmbeds';
|
|
5
|
-
export const MUTATE_EMBEDS = 'mutateEmbeds';
|
|
6
|
-
|
|
7
|
-
export const useEmbeds = <T extends Record<string, string>>() => {
|
|
8
|
-
const queryClient = useQueryClient();
|
|
9
|
-
|
|
10
|
-
const getEmbeddedScript = useQuery<unknown, unknown, T>({
|
|
11
|
-
queryKey: [QUERY_EMBEDS],
|
|
12
|
-
refetchOnWindowFocus: false,
|
|
13
|
-
queryFn: async () => {
|
|
14
|
-
// https://dev.wix.com/docs/sdk/backend-modules/app-market/embedded-scripts/get-embedded-script
|
|
15
|
-
const embeddedScript = await embeddedScripts.getEmbeddedScript();
|
|
16
|
-
return embeddedScript.parameters || {};
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
const embedScript = useMutation<unknown, unknown, T>({
|
|
21
|
-
mutationKey: [MUTATE_EMBEDS],
|
|
22
|
-
mutationFn: async (parameters) => {
|
|
23
|
-
// https://dev.wix.com/docs/sdk/backend-modules/app-market/embedded-scripts/embed-script
|
|
24
|
-
await embeddedScripts.embedScript({ parameters });
|
|
25
|
-
return parameters;
|
|
26
|
-
},
|
|
27
|
-
onSuccess: (data) => {
|
|
28
|
-
queryClient.setQueryData([QUERY_EMBEDS], data);
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
return { embedScript, getEmbeddedScript };
|
|
33
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Page, Card, Box, Text, TextButton } from '@wix/design-system';
|
|
3
|
-
import '@wix/design-system/styles.global.css';
|
|
4
|
-
import { withProviders } from '../withProviders';
|
|
5
|
-
import ProjectToken from '../components/ProjectToken.js';
|
|
6
|
-
|
|
7
|
-
function MixpanelAnalytics() {
|
|
8
|
-
return (
|
|
9
|
-
<Page height="100vh">
|
|
10
|
-
<Page.Header title="Mixpanel Analytics" />
|
|
11
|
-
<Page.Content>
|
|
12
|
-
<Card>
|
|
13
|
-
<Card.Header title="Setup" />
|
|
14
|
-
<Card.Divider />
|
|
15
|
-
<Card.Content>
|
|
16
|
-
<Box direction="vertical" gap={3}>
|
|
17
|
-
<Text>
|
|
18
|
-
To start collecting data please add your Mixpanel project token.
|
|
19
|
-
<br />
|
|
20
|
-
If you don't have one, you can create it in
|
|
21
|
-
<Box inline padding={1}>
|
|
22
|
-
<TextButton
|
|
23
|
-
underline="onHover"
|
|
24
|
-
onClick={() => open('https://mixpanel.com/analysis')}
|
|
25
|
-
>
|
|
26
|
-
Mixpanel Analytics
|
|
27
|
-
</TextButton>
|
|
28
|
-
</Box>
|
|
29
|
-
</Text>
|
|
30
|
-
<ProjectToken />
|
|
31
|
-
</Box>
|
|
32
|
-
</Card.Content>
|
|
33
|
-
</Card>
|
|
34
|
-
</Page.Content>
|
|
35
|
-
</Page>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export default withProviders(MixpanelAnalytics);
|
|
@@ -1,19 +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 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
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<div id="project-token" data-project-token="{{projectToken}}"></div>
|
|
2
|
-
<script type="module">
|
|
3
|
-
import mixpanel from 'mixpanel-browser';
|
|
4
|
-
|
|
5
|
-
const el = document.querySelector('#project-token');
|
|
6
|
-
|
|
7
|
-
mixpanel.init(el.dataset.projectToken, {
|
|
8
|
-
debug: true,
|
|
9
|
-
track_pageview: true,
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
mixpanel.track('An Event');
|
|
13
|
-
</script>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
22.10.0
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
# my-locations-app
|
|
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
|
-
```
|