@wix/ditto-codegen-public 1.0.36 → 1.0.37

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.
@@ -0,0 +1,5 @@
1
+ export default class extends HTMLElement {
2
+ public connectedCallback() {
3
+ this.innerHTML = `<div data-testid="custom-element">Hello from custom element!</div>`;
4
+ }
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "description": "AI-powered Wix CLI app generator - standalone executable",
5
5
  "scripts": {
6
6
  "build": "node build.mjs",
@@ -24,5 +24,5 @@
24
24
  "@wix/ditto-codegen": "1.0.0",
25
25
  "esbuild": "^0.25.9"
26
26
  },
27
- "falconPackageHash": "f78cfb6e7bdafb3a57f084c58b26c3a4b12662154bae77080decebba"
27
+ "falconPackageHash": "5414b39630c8c19b9c7a3604fedce44b192a1242f0cae2dbecdaf844"
28
28
  }
@@ -1,27 +0,0 @@
1
- {
2
- "$schema": "https://dev.wix.com/wix-cli/schemas/custom-element.json",
3
- "id": "6be9721d-6085-4bda-b50b-f4fe8e443263",
4
- "name": "My Widget",
5
- "width": {
6
- "defaultWidth": 450,
7
- "allowStretch": true
8
- },
9
- "height": {
10
- "defaultHeight": 250
11
- },
12
- "installation": {
13
- "autoAddToSite": true
14
- },
15
- "behaviors": {
16
- "dashboard": {
17
- "dashboardPageComponentId": "851162b4-65b1-47e5-9f4a-8a079204b368"
18
- }
19
- },
20
- "presets": [
21
- {
22
- "id": "3588cae1-09de-4a76-941d-66b81f921162",
23
- "thumbnailUrl": "../../../../assets/my-widget/thumbnail.png"
24
- }
25
- ]
26
- }
27
-
@@ -1,32 +0,0 @@
1
- :root {
2
- --background-color: #242A35;
3
- --text-color: #fcfdfd;
4
- --secondary-text-color: #c9c9c9;
5
- --code-color: #d7d7d7;
6
- }
7
-
8
- .root {
9
- width: 100%;
10
- height: 100%;
11
- background-color: var(--background-color);
12
- color: var(--text-color);
13
- box-sizing: border-box;
14
- padding: 3rem 1rem;
15
- font-size: 14px;
16
- }
17
-
18
- .root h2 {
19
- font-size: 1.5rem;
20
- margin-bottom: 5px;
21
- }
22
-
23
- .root p {
24
- color: var(--secondary-text-color);
25
- }
26
-
27
- .root code {
28
- color: var(--code-color);
29
- font-size: 0.8rem;
30
- font-weight: bolder;
31
- }
32
-
@@ -1,36 +0,0 @@
1
- import React, { type FC } from 'react';
2
- import ReactDOM from 'react-dom';
3
- import reactToWebComponent from 'react-to-webcomponent';
4
- import styles from './element.module.css';
5
-
6
- interface Props {
7
- displayName?: string;
8
- }
9
-
10
- const CustomElement: FC<Props> = ({
11
- displayName = `Your Widget's Title`,
12
- }) => {
13
- return (
14
- <div className={styles.root}>
15
- <h2>{displayName}</h2>
16
- <hr />
17
- <p>
18
- This is a Site Widget generated by Wix CLI.<br />
19
- Continue to develop this widget at <code>'src/site/widgets/custom-elements/my-widget'</code>.
20
- </p>
21
- </div>
22
- );
23
- };
24
-
25
- const customElement = reactToWebComponent(
26
- CustomElement,
27
- React,
28
- ReactDOM as any,
29
- {
30
- props: {
31
- displayName: 'string',
32
- },
33
- }
34
- );
35
-
36
- export default customElement;
@@ -1,54 +0,0 @@
1
- import React, { type FC, useState, useEffect, useCallback } from 'react';
2
- import { widget } from '@wix/editor';
3
- import {
4
- SidePanel,
5
- WixDesignSystemProvider,
6
- Input,
7
- FormField,
8
- SectionHelper,
9
- } from '@wix/design-system';
10
- import '@wix/design-system/styles.global.css';
11
-
12
- const SITE_WIDGETS_DOCS = 'https://dev.wix.com/docs/build-apps/develop-your-app/frameworks/wix-cli/supported-extensions/site-extensions/site-widgets/site-widget-extension-files-and-code';
13
-
14
- const Panel: FC = () => {
15
- const [displayName, setDisplayName] = useState<string>('');
16
-
17
- useEffect(() => {
18
- widget.getProp('display-name')
19
- .then(displayName => setDisplayName(displayName || `Your Widget's Title`))
20
- .catch(error => console.error('Failed to fetch display-name:', error));
21
- }, [setDisplayName]);
22
-
23
- const handleDisplayNameChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {
24
- const newDisplayName = event.target.value;
25
- setDisplayName(newDisplayName);
26
- widget.setProp('display-name', newDisplayName);
27
- }, [setDisplayName]);
28
-
29
- return (
30
- <WixDesignSystemProvider>
31
- <SidePanel width="300" height="100vh">
32
- <SidePanel.Content noPadding stretchVertically>
33
- <SidePanel.Field>
34
- <FormField label="Display Name">
35
- <Input
36
- type="text"
37
- value={displayName}
38
- onChange={handleDisplayNameChange}
39
- aria-label="Display Name"
40
- />
41
- </FormField>
42
- </SidePanel.Field>
43
- </SidePanel.Content>
44
- <SidePanel.Footer noPadding>
45
- <SectionHelper fullWidth appearance="success" border="topBottom">
46
- Learn more about <a href={SITE_WIDGETS_DOCS} target="_blank" rel="noopener noreferrer" title="Site Widget docs">Site Widgets</a>
47
- </SectionHelper>
48
- </SidePanel.Footer>
49
- </SidePanel>
50
- </WixDesignSystemProvider>
51
- );
52
- };
53
-
54
- export default Panel;