@wix/ditto-codegen-public 1.0.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.
- package/dist/examples-apps/ai-chatbot/.nvmrc +1 -0
- package/dist/examples-apps/ai-chatbot/README.md +21 -0
- package/dist/examples-apps/ai-chatbot/package-lock.json +7266 -0
- package/dist/examples-apps/ai-chatbot/package.json +35 -0
- package/dist/examples-apps/ai-chatbot/src/backend/api/chat/api.ts +62 -0
- package/dist/examples-apps/ai-chatbot/src/backend/api/settings/api.ts +39 -0
- package/dist/examples-apps/ai-chatbot/src/backend/database.ts +86 -0
- package/dist/examples-apps/ai-chatbot/src/dashboard/pages/product/ProductChat.module.css +3 -0
- package/dist/examples-apps/ai-chatbot/src/dashboard/pages/product/ProductChat.tsx +99 -0
- package/dist/examples-apps/ai-chatbot/src/dashboard/pages/product/page.json +6 -0
- package/dist/examples-apps/ai-chatbot/src/dashboard/pages/product/page.tsx +99 -0
- package/dist/examples-apps/ai-chatbot/src/dashboard/pages/settings/page.json +6 -0
- package/dist/examples-apps/ai-chatbot/src/dashboard/pages/settings/page.tsx +105 -0
- package/dist/examples-apps/ai-chatbot/src/dashboard/pages/wix_logo.svg +18 -0
- package/dist/examples-apps/ai-chatbot/src/dashboard/utils.ts +27 -0
- package/dist/examples-apps/ai-chatbot/src/dashboard/withProviders.tsx +15 -0
- package/dist/examples-apps/ai-chatbot/src/env.d.ts +4 -0
- package/dist/examples-apps/ai-chatbot/src/types.ts +4 -0
- package/dist/examples-apps/ai-chatbot/tsconfig.json +8 -0
- package/dist/examples-apps/ai-chatbot/wix.config.json +5 -0
- package/dist/examples-apps/chart-widget/.nvmrc +1 -0
- package/dist/examples-apps/chart-widget/README.md +21 -0
- package/dist/examples-apps/chart-widget/assets/chart-widget/thumbnail.png +0 -0
- package/dist/examples-apps/chart-widget/package-lock.json +6329 -0
- package/dist/examples-apps/chart-widget/package.json +30 -0
- package/dist/examples-apps/chart-widget/src/env.d.ts +4 -0
- package/dist/examples-apps/chart-widget/src/site/widgets/custom-elements/chart-widget/common.ts +20 -0
- package/dist/examples-apps/chart-widget/src/site/widgets/custom-elements/chart-widget/element/bar-chart.tsx +53 -0
- package/dist/examples-apps/chart-widget/src/site/widgets/custom-elements/chart-widget/element/pie-chart.tsx +40 -0
- package/dist/examples-apps/chart-widget/src/site/widgets/custom-elements/chart-widget/element.json +20 -0
- package/dist/examples-apps/chart-widget/src/site/widgets/custom-elements/chart-widget/element.tsx +53 -0
- package/dist/examples-apps/chart-widget/src/site/widgets/custom-elements/chart-widget/panel/chart-type.tsx +47 -0
- package/dist/examples-apps/chart-widget/src/site/widgets/custom-elements/chart-widget/panel/slice.tsx +72 -0
- package/dist/examples-apps/chart-widget/src/site/widgets/custom-elements/chart-widget/panel.tsx +90 -0
- package/dist/examples-apps/chart-widget/tsconfig.json +8 -0
- package/dist/examples-apps/chart-widget/wix.config.json +5 -0
- package/dist/examples-apps/custom-products-catalog/.nvmrc +1 -0
- package/dist/examples-apps/custom-products-catalog/README.md +21 -0
- package/dist/examples-apps/custom-products-catalog/package-lock.json +8694 -0
- package/dist/examples-apps/custom-products-catalog/package.json +33 -0
- package/dist/examples-apps/custom-products-catalog/src/dashboard/components/create-product.tsx +54 -0
- package/dist/examples-apps/custom-products-catalog/src/dashboard/hooks/stores.ts +60 -0
- package/dist/examples-apps/custom-products-catalog/src/dashboard/pages/page.json +5 -0
- package/dist/examples-apps/custom-products-catalog/src/dashboard/pages/page.tsx +297 -0
- package/dist/examples-apps/custom-products-catalog/src/dashboard/pages/wix_logo.svg +18 -0
- package/dist/examples-apps/custom-products-catalog/src/dashboard/withProviders.tsx +16 -0
- package/dist/examples-apps/custom-products-catalog/src/env.d.ts +4 -0
- package/dist/examples-apps/custom-products-catalog/tsconfig.json +8 -0
- package/dist/examples-apps/custom-products-catalog/wix.config.json +5 -0
- package/dist/examples-apps/inventory-countdown/.nvmrc +1 -0
- package/dist/examples-apps/inventory-countdown/README.md +21 -0
- package/dist/examples-apps/inventory-countdown/package-lock.json +7457 -0
- package/dist/examples-apps/inventory-countdown/package.json +33 -0
- package/dist/examples-apps/inventory-countdown/src/assets/stock-counter/site-plugin-logo.svg +27 -0
- package/dist/examples-apps/inventory-countdown/src/env.d.ts +4 -0
- package/dist/examples-apps/inventory-countdown/src/site/plugins/custom-elements/stock-counter/consts.ts +1 -0
- package/dist/examples-apps/inventory-countdown/src/site/plugins/custom-elements/stock-counter/panel.tsx +81 -0
- package/dist/examples-apps/inventory-countdown/src/site/plugins/custom-elements/stock-counter/plugin.json +24 -0
- package/dist/examples-apps/inventory-countdown/src/site/plugins/custom-elements/stock-counter/plugin.module.css +4 -0
- package/dist/examples-apps/inventory-countdown/src/site/plugins/custom-elements/stock-counter/plugin.tsx +132 -0
- package/dist/examples-apps/inventory-countdown/tsconfig.json +8 -0
- package/dist/examples-apps/inventory-countdown/wix.config.json +5 -0
- package/dist/examples-apps/mixpanel-analytics/.nvmrc +1 -0
- package/dist/examples-apps/mixpanel-analytics/README.md +21 -0
- package/dist/examples-apps/mixpanel-analytics/package-lock.json +6357 -0
- package/dist/examples-apps/mixpanel-analytics/package.json +31 -0
- package/dist/examples-apps/mixpanel-analytics/src/dashboard/components/ProjectToken.tsx +60 -0
- package/dist/examples-apps/mixpanel-analytics/src/dashboard/hooks/wix-embeds.ts +33 -0
- package/dist/examples-apps/mixpanel-analytics/src/dashboard/pages/page.json +5 -0
- package/dist/examples-apps/mixpanel-analytics/src/dashboard/pages/page.tsx +39 -0
- package/dist/examples-apps/mixpanel-analytics/src/dashboard/withProviders.tsx +19 -0
- package/dist/examples-apps/mixpanel-analytics/src/env.d.ts +4 -0
- package/dist/examples-apps/mixpanel-analytics/src/site/embedded-scripts/mixpanel-analytics/embedded.html +13 -0
- package/dist/examples-apps/mixpanel-analytics/src/site/embedded-scripts/mixpanel-analytics/embedded.json +7 -0
- package/dist/examples-apps/mixpanel-analytics/tsconfig.json +8 -0
- package/dist/examples-apps/mixpanel-analytics/wix.config.json +5 -0
- package/dist/examples-apps/my-locations-app/.nvmrc +1 -0
- package/dist/examples-apps/my-locations-app/README.md +21 -0
- package/dist/examples-apps/my-locations-app/package-lock.json +6351 -0
- package/dist/examples-apps/my-locations-app/package.json +31 -0
- package/dist/examples-apps/my-locations-app/src/dashboard/pages/page.json +5 -0
- package/dist/examples-apps/my-locations-app/src/dashboard/pages/page.tsx +89 -0
- package/dist/examples-apps/my-locations-app/src/dashboard/pages/wix_logo.svg +18 -0
- package/dist/examples-apps/my-locations-app/src/env.d.ts +4 -0
- package/dist/examples-apps/my-locations-app/tsconfig.json +8 -0
- package/dist/examples-apps/my-locations-app/wix.config.json +5 -0
- package/dist/examples-apps/site-popup/.nvmrc +1 -0
- package/dist/examples-apps/site-popup/README.md +21 -0
- package/dist/examples-apps/site-popup/package-lock.json +8033 -0
- package/dist/examples-apps/site-popup/package.json +34 -0
- package/dist/examples-apps/site-popup/postcss.config.js +7 -0
- package/dist/examples-apps/site-popup/src/components/activation-configuration.tsx +49 -0
- package/dist/examples-apps/site-popup/src/components/close-button.tsx +30 -0
- package/dist/examples-apps/site-popup/src/components/date-range-picker.tsx +49 -0
- package/dist/examples-apps/site-popup/src/components/image-picker.tsx +33 -0
- package/dist/examples-apps/site-popup/src/components/popup/index.css +3 -0
- package/dist/examples-apps/site-popup/src/components/popup/index.tsx +71 -0
- package/dist/examples-apps/site-popup/src/components/site-popup-settings.tsx +120 -0
- package/dist/examples-apps/site-popup/src/dashboard/hooks/wix-embeds.ts +33 -0
- package/dist/examples-apps/site-popup/src/dashboard/pages/page.tsx +78 -0
- package/dist/examples-apps/site-popup/src/dashboard/withProviders.tsx +19 -0
- package/dist/examples-apps/site-popup/src/env.d.ts +4 -0
- package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/embedded.html +12 -0
- package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/embedded.json +7 -0
- package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/params.dev.json +7 -0
- package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/popup-overlay/index.css +3 -0
- package/dist/examples-apps/site-popup/src/site/embedded-scripts/site-popup/popup-overlay/index.tsx +58 -0
- package/dist/examples-apps/site-popup/src/types.ts +14 -0
- package/dist/examples-apps/site-popup/tailwind.config.js +8 -0
- package/dist/examples-apps/site-popup/tsconfig.json +9 -0
- package/dist/examples-apps/site-popup/wix.config.json +5 -0
- package/dist/examples-apps/spis-examples/.nvmrc +1 -0
- package/dist/examples-apps/spis-examples/README.md +21 -0
- package/dist/examples-apps/spis-examples/package-lock.json +6903 -0
- package/dist/examples-apps/spis-examples/package.json +31 -0
- package/dist/examples-apps/spis-examples/src/backend/service-plugins/ecom-additional-fees/additional-fees/plugin.json +5 -0
- package/dist/examples-apps/spis-examples/src/backend/service-plugins/ecom-additional-fees/additional-fees/plugin.ts +24 -0
- package/dist/examples-apps/spis-examples/src/backend/service-plugins/ecom-discounts-trigger/discount-triggers/plugin.json +5 -0
- package/dist/examples-apps/spis-examples/src/backend/service-plugins/ecom-discounts-trigger/discount-triggers/plugin.ts +42 -0
- package/dist/examples-apps/spis-examples/src/backend/service-plugins/ecom-shipping-rates/shipping-rates/plugin.json +7 -0
- package/dist/examples-apps/spis-examples/src/backend/service-plugins/ecom-shipping-rates/shipping-rates/plugin.ts +34 -0
- package/dist/examples-apps/spis-examples/src/backend/service-plugins/ecom-validations/validations/plugin.json +6 -0
- package/dist/examples-apps/spis-examples/src/backend/service-plugins/ecom-validations/validations/plugin.ts +24 -0
- package/dist/examples-apps/spis-examples/src/backend/service-plugins/gift-cards-provider/gift-cards/plugin.json +5 -0
- package/dist/examples-apps/spis-examples/src/backend/service-plugins/gift-cards-provider/gift-cards/plugin.ts +38 -0
- package/dist/examples-apps/spis-examples/src/dashboard/pages/page.tsx +59 -0
- package/dist/examples-apps/spis-examples/src/dashboard/pages/wix_logo.svg +18 -0
- package/dist/examples-apps/spis-examples/src/env.d.ts +4 -0
- package/dist/examples-apps/spis-examples/tsconfig.json +8 -0
- package/dist/examples-apps/spis-examples/wix.config.json +5 -0
- package/dist/examples-apps/top-blog-posts/.nvmrc +1 -0
- package/dist/examples-apps/top-blog-posts/README.md +21 -0
- package/dist/examples-apps/top-blog-posts/package-lock.json +6406 -0
- package/dist/examples-apps/top-blog-posts/package.json +31 -0
- package/dist/examples-apps/top-blog-posts/src/dashboard/pages/blog-utils.ts +44 -0
- package/dist/examples-apps/top-blog-posts/src/dashboard/pages/page.tsx +129 -0
- package/dist/examples-apps/top-blog-posts/src/dashboard/pages/wix_logo.svg +18 -0
- package/dist/examples-apps/top-blog-posts/src/env.d.ts +4 -0
- package/dist/examples-apps/top-blog-posts/tsconfig.json +8 -0
- package/dist/examples-apps/top-blog-posts/wix.config.json +5 -0
- package/dist/out.js +1365 -0
- package/dist/wix-cli-templates/.nvmrc +1 -0
- package/dist/wix-cli-templates/README.md +21 -0
- package/dist/wix-cli-templates/package-lock.json +7118 -0
- package/dist/wix-cli-templates/package.json +35 -0
- package/dist/wix-cli-templates/src/assets/my-widget/thumbnail.png +0 -0
- package/dist/wix-cli-templates/src/backend/api/my-api/api.ts +29 -0
- package/dist/wix-cli-templates/src/backend/events/my-event/event.ts +16 -0
- package/dist/wix-cli-templates/src/backend/my-web-method.web.ts +21 -0
- package/dist/wix-cli-templates/src/backend/service-plugins/ecom-additional-fees/my-service-plugin/plugin.ts +9 -0
- package/dist/wix-cli-templates/src/backend/service-plugins/ecom-discounts-trigger/my-service-plugin/plugin.ts +14 -0
- package/dist/wix-cli-templates/src/backend/service-plugins/ecom-payment-settings/my-service-plugin/plugin.ts +12 -0
- package/dist/wix-cli-templates/src/backend/service-plugins/ecom-shipping-rates/my-service-plugin/plugin.ts +9 -0
- package/dist/wix-cli-templates/src/backend/service-plugins/ecom-validations/my-service-plugin/plugin.ts +9 -0
- package/dist/wix-cli-templates/src/backend/service-plugins/gift-cards-provider/my-service-plugin/plugin.ts +23 -0
- package/dist/wix-cli-templates/src/dashboard/modals/my-modal/modal.tsx +40 -0
- package/dist/wix-cli-templates/src/dashboard/pages/page.tsx +59 -0
- package/dist/wix-cli-templates/src/dashboard/pages/wix_logo.svg +18 -0
- package/dist/wix-cli-templates/src/env.d.ts +4 -0
- package/dist/wix-cli-templates/src/site/embedded-scripts/my-script/embedded.html +2 -0
- package/dist/wix-cli-templates/src/site/embedded-scripts/my-script/embedded.json +7 -0
- package/dist/wix-cli-templates/src/site/embedded-scripts/my-script/logger.ts +1 -0
- package/dist/wix-cli-templates/src/site/embedded-scripts/my-script/params.dev.json +3 -0
- package/dist/wix-cli-templates/src/site/widgets/custom-elements/my-widget/element.json +27 -0
- package/dist/wix-cli-templates/src/site/widgets/custom-elements/my-widget/element.module.css +32 -0
- package/dist/wix-cli-templates/src/site/widgets/custom-elements/my-widget/element.tsx +36 -0
- package/dist/wix-cli-templates/src/site/widgets/custom-elements/my-widget/panel.tsx +54 -0
- package/dist/wix-cli-templates/tsconfig.json +8 -0
- package/dist/wix-cli-templates/wix.config.json +5 -0
- package/package.json +28 -0
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
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);
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
22.10.0
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
```
|