@wix/ditto-codegen-public 1.0.243 → 1.0.245
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 +30 -14
- package/package.json +2 -2
- package/dist/examples-apps/coupon-popup/src/components/cart-popup-settings.tsx +0 -135
- package/dist/examples-apps/coupon-popup/src/dashboard/pages/cart-popup-manager/extensions.ts +0 -7
- package/dist/examples-apps/coupon-popup/src/dashboard/pages/cart-popup-manager/page.tsx +0 -133
- package/dist/examples-apps/coupon-popup/src/dashboard/withProviders.tsx +0 -16
package/dist/out.js
CHANGED
|
@@ -44773,12 +44773,14 @@ var require_config = __commonJS({
|
|
|
44773
44773
|
bash: "allow",
|
|
44774
44774
|
webfetch: "allow",
|
|
44775
44775
|
skill: "allow",
|
|
44776
|
+
task: "deny",
|
|
44776
44777
|
external_directory: {
|
|
44777
44778
|
"/root/.agents/**": "allow",
|
|
44778
44779
|
"/root/.claude/**": "allow",
|
|
44779
44780
|
"/root/.opencode/**": "allow"
|
|
44780
44781
|
}
|
|
44781
44782
|
},
|
|
44783
|
+
lsp: false,
|
|
44782
44784
|
mcp: {
|
|
44783
44785
|
"wix-mcp": {
|
|
44784
44786
|
type: "local",
|
|
@@ -44802,7 +44804,8 @@ var require_config = __commonJS({
|
|
|
44802
44804
|
...process.env,
|
|
44803
44805
|
ANTHROPIC_BASE_URL: anthropicBaseUrl,
|
|
44804
44806
|
OPENCODE_CONFIG_CONTENT: JSON.stringify(config2),
|
|
44805
|
-
OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS: exports2.DEFAULT_TIMEOUT_MS.toString()
|
|
44807
|
+
OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS: exports2.DEFAULT_TIMEOUT_MS.toString(),
|
|
44808
|
+
OPENCODE_DISABLE_LSP_DOWNLOAD: "true"
|
|
44806
44809
|
};
|
|
44807
44810
|
}
|
|
44808
44811
|
}
|
|
@@ -45136,10 +45139,23 @@ var require_process_manager = __commonJS({
|
|
|
45136
45139
|
function killProcess(child, resolved) {
|
|
45137
45140
|
if (!child)
|
|
45138
45141
|
return;
|
|
45139
|
-
|
|
45142
|
+
const killSignal = (signal) => {
|
|
45143
|
+
if (child.pid) {
|
|
45144
|
+
try {
|
|
45145
|
+
process.kill(-child.pid, signal);
|
|
45146
|
+
console.log(`[OpenCode] Sent ${signal} to process group (pid: -${child.pid})`);
|
|
45147
|
+
return;
|
|
45148
|
+
} catch (error48) {
|
|
45149
|
+
console.log(`[OpenCode] Process group kill failed, falling back to direct kill: ${error48}`);
|
|
45150
|
+
}
|
|
45151
|
+
}
|
|
45152
|
+
child.kill(signal);
|
|
45153
|
+
console.log(`[OpenCode] Sent ${signal} to child process directly`);
|
|
45154
|
+
};
|
|
45155
|
+
killSignal("SIGTERM");
|
|
45140
45156
|
setTimeout(() => {
|
|
45141
45157
|
if (child && !resolved) {
|
|
45142
|
-
|
|
45158
|
+
killSignal("SIGKILL");
|
|
45143
45159
|
}
|
|
45144
45160
|
}, exports2.KILL_GRACE_PERIOD_MS);
|
|
45145
45161
|
}
|
|
@@ -45306,7 +45322,7 @@ var require_executor = __commonJS({
|
|
|
45306
45322
|
var process_manager_1 = require_process_manager();
|
|
45307
45323
|
var result_builder_1 = require_result_builder();
|
|
45308
45324
|
var process_handlers_1 = require_process_handlers();
|
|
45309
|
-
var MAX_RETRIES =
|
|
45325
|
+
var MAX_RETRIES = 5;
|
|
45310
45326
|
async function executeOpenCode(options) {
|
|
45311
45327
|
let lastResult = null;
|
|
45312
45328
|
let accumulatedStdout = "";
|
|
@@ -45334,7 +45350,9 @@ var require_executor = __commonJS({
|
|
|
45334
45350
|
${(0, parser_1.formatUsageStats)(finalResult2.usage)}`);
|
|
45335
45351
|
return finalResult2;
|
|
45336
45352
|
}
|
|
45337
|
-
|
|
45353
|
+
const errorMsg = result.error?.message.toLowerCase() ?? "";
|
|
45354
|
+
const isRetryableFailure = !result.success && errorMsg.includes("idle timeout");
|
|
45355
|
+
if (result.success || !isRetryableFailure) {
|
|
45338
45356
|
const finalResult2 = {
|
|
45339
45357
|
...result,
|
|
45340
45358
|
filesChanged: (0, parser_1.parseFilesChanged)(accumulatedStdout),
|
|
@@ -45345,7 +45363,7 @@ ${(0, parser_1.formatUsageStats)(finalResult2.usage)}`);
|
|
|
45345
45363
|
return finalResult2;
|
|
45346
45364
|
}
|
|
45347
45365
|
lastResult = result;
|
|
45348
|
-
console.log(`[OpenCode] Attempt ${attempt}/${MAX_RETRIES} failed due to idle timeout`);
|
|
45366
|
+
console.log(`[OpenCode] Attempt ${attempt}/${MAX_RETRIES} failed due to idle timeout \u2014 will retry with --continue in a fresh process`);
|
|
45349
45367
|
}
|
|
45350
45368
|
console.log(`[OpenCode] All ${MAX_RETRIES} retry attempts exhausted`);
|
|
45351
45369
|
const finalResult = {
|
|
@@ -45381,7 +45399,10 @@ ${(0, parser_1.formatUsageStats)(finalResult.usage)}`);
|
|
|
45381
45399
|
lastOutputTime: Date.now(),
|
|
45382
45400
|
resolved: false
|
|
45383
45401
|
};
|
|
45384
|
-
const timers = {
|
|
45402
|
+
const timers = {
|
|
45403
|
+
timeoutId: null,
|
|
45404
|
+
idleCheckId: null
|
|
45405
|
+
};
|
|
45385
45406
|
const finalize2 = async (result) => {
|
|
45386
45407
|
if (state.resolved)
|
|
45387
45408
|
return;
|
|
@@ -45409,7 +45430,8 @@ ${(0, parser_1.formatUsageStats)(finalResult.usage)}`);
|
|
|
45409
45430
|
ctx.child = (0, child_process_1.spawn)("opencode", args, {
|
|
45410
45431
|
cwd: outputPath,
|
|
45411
45432
|
env: (0, config_1.getOpenCodeEnv)(projectId),
|
|
45412
|
-
stdio: ["ignore", "pipe", "pipe"]
|
|
45433
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
45434
|
+
detached: true
|
|
45413
45435
|
});
|
|
45414
45436
|
timers.timeoutId = (0, process_handlers_1.setupTotalTimeout)(ctx);
|
|
45415
45437
|
timers.idleCheckId = (0, process_handlers_1.setupIdleWatchdog)(ctx);
|
|
@@ -88988,11 +89010,6 @@ var require_load_examples = __commonJS({
|
|
|
88988
89010
|
path: "coupon-popup",
|
|
88989
89011
|
description: "A marketing app that displays a configurable coupon popup in the shopping cart, with a dashboard interface for managing popup settings and an embedded script to show the popup on the site",
|
|
88990
89012
|
files: {
|
|
88991
|
-
[types_1.ExtensionType.DASHBOARD_PAGE]: [
|
|
88992
|
-
"coupon-popup/src/dashboard/pages/cart-popup-manager/page.tsx",
|
|
88993
|
-
"coupon-popup/src/dashboard/withProviders.tsx",
|
|
88994
|
-
"coupon-popup/src/components/cart-popup-settings.tsx"
|
|
88995
|
-
],
|
|
88996
89013
|
[types_1.ExtensionType.EMBEDDED_SCRIPT]: [
|
|
88997
89014
|
"coupon-popup/src/site/embedded-scripts/cart-coupon-popup/embedded.html"
|
|
88998
89015
|
]
|
|
@@ -89002,7 +89019,6 @@ var require_load_examples = __commonJS({
|
|
|
89002
89019
|
var examples = {
|
|
89003
89020
|
[types_1.ExtensionType.DASHBOARD_PAGE]: [
|
|
89004
89021
|
appsExamples.SurveyManager,
|
|
89005
|
-
appsExamples.CouponPopup,
|
|
89006
89022
|
appsExamples.AIChatbot
|
|
89007
89023
|
],
|
|
89008
89024
|
[types_1.ExtensionType.EMBEDDED_SCRIPT]: [appsExamples.CouponPopup],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/ditto-codegen-public",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.245",
|
|
4
4
|
"description": "AI-powered Wix CLI app generator - standalone executable",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "node build.mjs",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"@wix/ditto-codegen": "1.0.0",
|
|
29
29
|
"esbuild": "^0.27.2"
|
|
30
30
|
},
|
|
31
|
-
"falconPackageHash": "
|
|
31
|
+
"falconPackageHash": "4aa908e1e82a22b42b4ad74b623391c687437c15ac95d8e99e79c889"
|
|
32
32
|
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { type FC } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Input,
|
|
4
|
-
InputArea,
|
|
5
|
-
Card,
|
|
6
|
-
FormField,
|
|
7
|
-
ToggleSwitch,
|
|
8
|
-
NumberInput,
|
|
9
|
-
Box,
|
|
10
|
-
type FormFieldProps,
|
|
11
|
-
} from '@wix/design-system';
|
|
12
|
-
import type { CartPopupOptions } from '../dashboard/pages/cart-popup-manager/page';
|
|
13
|
-
|
|
14
|
-
interface Props {
|
|
15
|
-
options: CartPopupOptions;
|
|
16
|
-
onChange: (options: CartPopupOptions) => void;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export const CartPopupSettings: FC<Props> = ({ options, onChange }) => {
|
|
20
|
-
const getFieldStatus = (
|
|
21
|
-
field: keyof CartPopupOptions,
|
|
22
|
-
required: boolean = false
|
|
23
|
-
): Partial<FormFieldProps> => {
|
|
24
|
-
return required && !options[field]
|
|
25
|
-
? {
|
|
26
|
-
status: 'error',
|
|
27
|
-
statusMessage: 'Required.',
|
|
28
|
-
}
|
|
29
|
-
: {};
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
return (
|
|
33
|
-
<Box direction="vertical" gap="24px">
|
|
34
|
-
<Card>
|
|
35
|
-
<Card.Header
|
|
36
|
-
title="Popup Content"
|
|
37
|
-
subtitle="Configure the text and coupon code displayed in the popup"
|
|
38
|
-
/>
|
|
39
|
-
<Card.Divider />
|
|
40
|
-
<Card.Content>
|
|
41
|
-
<Box gap="18px" direction="vertical">
|
|
42
|
-
<FormField
|
|
43
|
-
label="Coupon Code"
|
|
44
|
-
required
|
|
45
|
-
{...getFieldStatus('couponCode', true)}
|
|
46
|
-
>
|
|
47
|
-
<Input
|
|
48
|
-
placeholder="SAVE20"
|
|
49
|
-
value={options.couponCode}
|
|
50
|
-
onChange={(e) =>
|
|
51
|
-
onChange({
|
|
52
|
-
...options,
|
|
53
|
-
couponCode: e.currentTarget.value,
|
|
54
|
-
})
|
|
55
|
-
}
|
|
56
|
-
/>
|
|
57
|
-
</FormField>
|
|
58
|
-
|
|
59
|
-
<FormField
|
|
60
|
-
label="Popup Headline"
|
|
61
|
-
required
|
|
62
|
-
{...getFieldStatus('popupHeadline', true)}
|
|
63
|
-
>
|
|
64
|
-
<Input
|
|
65
|
-
placeholder="Special Offer!"
|
|
66
|
-
value={options.popupHeadline}
|
|
67
|
-
onChange={(e) =>
|
|
68
|
-
onChange({
|
|
69
|
-
...options,
|
|
70
|
-
popupHeadline: e.currentTarget.value,
|
|
71
|
-
})
|
|
72
|
-
}
|
|
73
|
-
/>
|
|
74
|
-
</FormField>
|
|
75
|
-
|
|
76
|
-
<FormField
|
|
77
|
-
label="Popup Description"
|
|
78
|
-
required
|
|
79
|
-
{...getFieldStatus('popupDescription', true)}
|
|
80
|
-
>
|
|
81
|
-
<InputArea
|
|
82
|
-
placeholder="Apply this coupon to get a discount on your cart!"
|
|
83
|
-
value={options.popupDescription}
|
|
84
|
-
onChange={(e) =>
|
|
85
|
-
onChange({
|
|
86
|
-
...options,
|
|
87
|
-
popupDescription: e.currentTarget.value,
|
|
88
|
-
})
|
|
89
|
-
}
|
|
90
|
-
rows={3}
|
|
91
|
-
/>
|
|
92
|
-
</FormField>
|
|
93
|
-
</Box>
|
|
94
|
-
</Card.Content>
|
|
95
|
-
</Card>
|
|
96
|
-
|
|
97
|
-
<Card>
|
|
98
|
-
<Card.Header
|
|
99
|
-
title="Display Settings"
|
|
100
|
-
subtitle="Configure when and how the popup appears"
|
|
101
|
-
/>
|
|
102
|
-
<Card.Divider />
|
|
103
|
-
<Card.Content>
|
|
104
|
-
<Box gap="18px" direction="vertical">
|
|
105
|
-
<FormField label="Enable Popup">
|
|
106
|
-
<ToggleSwitch
|
|
107
|
-
checked={options.enablePopup}
|
|
108
|
-
onChange={() =>
|
|
109
|
-
onChange({
|
|
110
|
-
...options,
|
|
111
|
-
enablePopup: !options.enablePopup,
|
|
112
|
-
})
|
|
113
|
-
}
|
|
114
|
-
/>
|
|
115
|
-
</FormField>
|
|
116
|
-
|
|
117
|
-
<FormField label="Minimum Cart Value">
|
|
118
|
-
<NumberInput
|
|
119
|
-
value={options.minimumCartValue}
|
|
120
|
-
onChange={(value) =>
|
|
121
|
-
onChange({
|
|
122
|
-
...options,
|
|
123
|
-
minimumCartValue: value || 0,
|
|
124
|
-
})
|
|
125
|
-
}
|
|
126
|
-
min={0}
|
|
127
|
-
prefix="$"
|
|
128
|
-
/>
|
|
129
|
-
</FormField>
|
|
130
|
-
</Box>
|
|
131
|
-
</Card.Content>
|
|
132
|
-
</Card>
|
|
133
|
-
</Box>
|
|
134
|
-
);
|
|
135
|
-
};
|
package/dist/examples-apps/coupon-popup/src/dashboard/pages/cart-popup-manager/extensions.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { extensions } from '@wix/astro/builders';
|
|
2
|
-
export const dashboardpagecartPopupManager = extensions.dashboardPage({
|
|
3
|
-
"id": "3304e8b7-4d5c-4719-86bb-68f6235a4bc5",
|
|
4
|
-
"title": "Cart Popup Manager",
|
|
5
|
-
"routePath": "cart-popup-manager",
|
|
6
|
-
"component": "./dashboard/pages/cart-popup-manager/page.tsx"
|
|
7
|
-
})
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState, type FC } from 'react';
|
|
2
|
-
import { dashboard } from '@wix/dashboard';
|
|
3
|
-
import { embeddedScripts } from '@wix/app-management';
|
|
4
|
-
import {
|
|
5
|
-
Button,
|
|
6
|
-
Page,
|
|
7
|
-
Layout,
|
|
8
|
-
Cell,
|
|
9
|
-
Loader,
|
|
10
|
-
Box,
|
|
11
|
-
} from '@wix/design-system';
|
|
12
|
-
import '@wix/design-system/styles.global.css';
|
|
13
|
-
import withProviders from '../../withProviders';
|
|
14
|
-
import { CartPopupSettings } from '../../../components/cart-popup-settings';
|
|
15
|
-
|
|
16
|
-
export type CartPopupOptions = {
|
|
17
|
-
couponCode: string;
|
|
18
|
-
popupHeadline: string;
|
|
19
|
-
popupDescription: string;
|
|
20
|
-
minimumCartValue: number;
|
|
21
|
-
enablePopup: boolean;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const cartPopupDefaultOptions: CartPopupOptions = {
|
|
25
|
-
couponCode: '',
|
|
26
|
-
popupHeadline: 'Special Offer!',
|
|
27
|
-
popupDescription: 'Apply this coupon to get a discount on your cart!',
|
|
28
|
-
minimumCartValue: 0,
|
|
29
|
-
enablePopup: true,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const CartPopupManagerPage: FC = () => {
|
|
33
|
-
const [options, setOptions] = useState<CartPopupOptions>(cartPopupDefaultOptions);
|
|
34
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
35
|
-
const [isSaving, setIsSaving] = useState(false);
|
|
36
|
-
|
|
37
|
-
useEffect(() => {
|
|
38
|
-
const loadSettings = async () => {
|
|
39
|
-
try {
|
|
40
|
-
const embeddedScript = await embeddedScripts.getEmbeddedScript();
|
|
41
|
-
const data = embeddedScript.parameters as Partial<Record<keyof CartPopupOptions, string>> || {};
|
|
42
|
-
|
|
43
|
-
setOptions((prev) => ({
|
|
44
|
-
...prev,
|
|
45
|
-
couponCode: data?.couponCode || prev.couponCode,
|
|
46
|
-
popupHeadline: data?.popupHeadline || prev.popupHeadline,
|
|
47
|
-
popupDescription: data?.popupDescription || prev.popupDescription,
|
|
48
|
-
minimumCartValue: Number(data?.minimumCartValue) || prev.minimumCartValue,
|
|
49
|
-
enablePopup: data?.enablePopup === 'true' ? true : data?.enablePopup === 'false' ? false : prev.enablePopup,
|
|
50
|
-
}));
|
|
51
|
-
} catch (error) {
|
|
52
|
-
console.error('Failed to load settings:', error);
|
|
53
|
-
} finally {
|
|
54
|
-
setIsLoading(false);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
loadSettings();
|
|
59
|
-
}, []);
|
|
60
|
-
|
|
61
|
-
const handleSave = async () => {
|
|
62
|
-
if (!options.couponCode || !options.popupHeadline || !options.popupDescription) {
|
|
63
|
-
dashboard.showToast({
|
|
64
|
-
message: 'Please fill in all required fields',
|
|
65
|
-
type: 'error',
|
|
66
|
-
});
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
setIsSaving(true);
|
|
71
|
-
try {
|
|
72
|
-
// Convert all values to strings for embedded script parameters
|
|
73
|
-
await embeddedScripts.embedScript({
|
|
74
|
-
parameters: {
|
|
75
|
-
couponCode: options.couponCode,
|
|
76
|
-
popupHeadline: options.popupHeadline,
|
|
77
|
-
popupDescription: options.popupDescription,
|
|
78
|
-
minimumCartValue: String(options.minimumCartValue),
|
|
79
|
-
enablePopup: String(options.enablePopup),
|
|
80
|
-
},
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
dashboard.showToast({
|
|
84
|
-
message: 'Cart popup settings saved successfully!',
|
|
85
|
-
type: 'success',
|
|
86
|
-
});
|
|
87
|
-
} catch (error) {
|
|
88
|
-
console.error('Failed to save settings:', error);
|
|
89
|
-
dashboard.showToast({
|
|
90
|
-
message: 'Failed to save settings. Please try again.',
|
|
91
|
-
type: 'error',
|
|
92
|
-
});
|
|
93
|
-
} finally {
|
|
94
|
-
setIsSaving(false);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
return (
|
|
99
|
-
<Page height="100vh">
|
|
100
|
-
<Page.Header
|
|
101
|
-
title="Cart Popup Manager"
|
|
102
|
-
subtitle="Configure your cart popup's content, coupon code, and display rules"
|
|
103
|
-
actionsBar={
|
|
104
|
-
<Button
|
|
105
|
-
skin="inverted"
|
|
106
|
-
disabled={!options.couponCode || !options.popupHeadline || !options.popupDescription || isSaving}
|
|
107
|
-
onClick={handleSave}
|
|
108
|
-
>
|
|
109
|
-
{isSaving ? 'Saving...' : 'Save'}
|
|
110
|
-
</Button>
|
|
111
|
-
}
|
|
112
|
-
/>
|
|
113
|
-
<Page.Content>
|
|
114
|
-
{isLoading ? (
|
|
115
|
-
<Box align="center" verticalAlign="middle" height="50vh">
|
|
116
|
-
<Loader text="Loading cart popup settings..." />
|
|
117
|
-
</Box>
|
|
118
|
-
) : (
|
|
119
|
-
<Layout gap="24px">
|
|
120
|
-
<Cell span={12}>
|
|
121
|
-
<CartPopupSettings
|
|
122
|
-
options={options}
|
|
123
|
-
onChange={setOptions}
|
|
124
|
-
/>
|
|
125
|
-
</Cell>
|
|
126
|
-
</Layout>
|
|
127
|
-
)}
|
|
128
|
-
</Page.Content>
|
|
129
|
-
</Page>
|
|
130
|
-
);
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
export default withProviders(CartPopupManagerPage);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { WixDesignSystemProvider } from '@wix/design-system';
|
|
3
|
-
import { i18n } from '@wix/essentials';
|
|
4
|
-
|
|
5
|
-
export default function withProviders<P extends {} = {}>(Component: React.FC<P>) {
|
|
6
|
-
return function DashboardProviders(props: P) {
|
|
7
|
-
const locale = i18n.getLocale();
|
|
8
|
-
return (
|
|
9
|
-
<WixDesignSystemProvider locale={locale} features={{ newColorsBranding: true }}>
|
|
10
|
-
<Component {...props} />
|
|
11
|
-
</WixDesignSystemProvider>
|
|
12
|
-
);
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export { withProviders };
|