@wix/ditto-codegen-public 1.0.181 → 1.0.183
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/custom-element/countdown-widget/components/ColorPickerField.tsx +27 -0
- package/dist/examples-apps/custom-element/countdown-widget/components/FontPickerField.tsx +34 -0
- package/dist/examples-apps/custom-element/countdown-widget/components/Separator.tsx +10 -0
- package/dist/examples-apps/custom-element/countdown-widget/components/TimeBlock.tsx +23 -0
- package/dist/examples-apps/custom-element/countdown-widget/extensions.ts +18 -0
- package/dist/examples-apps/custom-element/countdown-widget/panel.tsx +146 -0
- package/dist/examples-apps/custom-element/countdown-widget/styles.ts +73 -0
- package/dist/examples-apps/custom-element/countdown-widget/utils.ts +46 -0
- package/dist/examples-apps/custom-element/countdown-widget/widget.tsx +97 -0
- package/dist/out.js +124 -19
- package/dist/wix-cli-templates/src/site/widgets/custom-elements/my-widget/panel.tsx +53 -0
- package/dist/wix-cli-templates/src/site/widgets/custom-elements/my-widget/widget.tsx +33 -4
- package/package.json +2 -2
- package/dist/examples-apps/custom-element/src/widgets/custom-elements/countdown-timer/widget.tsx +0 -493
package/dist/out.js
CHANGED
|
@@ -36825,6 +36825,7 @@ var require_SystemPromptBuilder = __commonJS({
|
|
|
36825
36825
|
var CommonSections;
|
|
36826
36826
|
(function(CommonSections2) {
|
|
36827
36827
|
CommonSections2["ROLE"] = "role";
|
|
36828
|
+
CommonSections2["OUTPUT_CONSTRAINTS"] = "output_constraints";
|
|
36828
36829
|
CommonSections2["CONTEXT_EXPLANATION"] = "context_explanation";
|
|
36829
36830
|
CommonSections2["CORE_PRINCIPLES"] = "core_principles";
|
|
36830
36831
|
CommonSections2["CORE_KNOWLEDGE"] = "core_knowledge";
|
|
@@ -36838,12 +36839,13 @@ var require_SystemPromptBuilder = __commonJS({
|
|
|
36838
36839
|
[CommonSections.ROLE]: 1,
|
|
36839
36840
|
[CommonSections.CONTEXT_EXPLANATION]: 2,
|
|
36840
36841
|
[CommonSections.CORE_PRINCIPLES]: 3,
|
|
36841
|
-
[CommonSections.
|
|
36842
|
-
[CommonSections.
|
|
36843
|
-
[CommonSections.
|
|
36844
|
-
[CommonSections.
|
|
36845
|
-
[CommonSections.
|
|
36846
|
-
[CommonSections.
|
|
36842
|
+
[CommonSections.OUTPUT_CONSTRAINTS]: 4,
|
|
36843
|
+
[CommonSections.CORE_KNOWLEDGE]: 5,
|
|
36844
|
+
[CommonSections.IMPLEMENTATION_PATTERNS]: 6,
|
|
36845
|
+
[CommonSections.IMPLEMENTATION_GUIDELINES]: 7,
|
|
36846
|
+
[CommonSections.AUTHENTICATION_ELEVATION_REQUIREMENT]: 8,
|
|
36847
|
+
[CommonSections.API_DOCS]: 9,
|
|
36848
|
+
[CommonSections.EXAMPLES]: 10
|
|
36847
36849
|
};
|
|
36848
36850
|
var GeneralAgentType;
|
|
36849
36851
|
(function(GeneralAgentType2) {
|
|
@@ -37455,7 +37457,23 @@ When the blueprint includes EMBEDDED_SCRIPT extensions:
|
|
|
37455
37457
|
* User-generated content (reviews, comments, submissions)
|
|
37456
37458
|
* Event logs (if explicitly requested for analytics/tracking purposes)
|
|
37457
37459
|
* Multi-record relational data that is NOT configuration
|
|
37458
|
-
- If in doubt whether something is "configuration" or "data": If it controls HOW the embedded script works or looks, it's configuration \u2192 use embedded script parameters
|
|
37460
|
+
- If in doubt whether something is "configuration" or "data": If it controls HOW the embedded script works or looks, it's configuration \u2192 use embedded script parameters
|
|
37461
|
+
|
|
37462
|
+
CRITICAL - SITE WIDGET SETTINGS vs CMS COLLECTIONS:
|
|
37463
|
+
When the blueprint includes SITE_WIDGET extensions:
|
|
37464
|
+
- SITE_WIDGET has a built-in settings panel (panel.tsx) that handles ALL widget configuration - dates, titles, colors, numbers, toggles, text, etc.
|
|
37465
|
+
- For SITE_WIDGET-ONLY blueprints (no DASHBOARD_PAGE or other extensions): return collections: [] - the widget panel handles everything
|
|
37466
|
+
- NEVER create collections to store widget configuration data - this is ALWAYS handled by the widget's settings panel
|
|
37467
|
+
- Only create collections for SITE_WIDGET when ALL of these conditions are met:
|
|
37468
|
+
* The blueprint ALSO includes a DASHBOARD_PAGE extension that needs to manage data the widget displays
|
|
37469
|
+
* OR the widget explicitly needs to display MULTIPLE records of user-generated/business data (not configuration)
|
|
37470
|
+
* AND the data is NOT configuration (dates, colors, settings, display options are ALWAYS configuration)
|
|
37471
|
+
- Examples of what is CONFIGURATION (use widget panel, NOT collections):
|
|
37472
|
+
* Target date/time for countdown \u2192 widget panel
|
|
37473
|
+
* Display colors, fonts, sizes \u2192 widget panel
|
|
37474
|
+
* Headlines, labels, messages \u2192 widget panel
|
|
37475
|
+
* Feature toggles, show/hide options \u2192 widget panel
|
|
37476
|
+
* Numeric settings (delays, intervals, thresholds) \u2192 widget panel`;
|
|
37459
37477
|
var cmsPlannerExample = `Blueprint indicates a handling fees system for products.
|
|
37460
37478
|
|
|
37461
37479
|
For the collections field, return:
|
|
@@ -37476,6 +37494,12 @@ For the collections field, return:
|
|
|
37476
37494
|
- Example (WRONG):
|
|
37477
37495
|
* Creating both embeddedScriptParameters AND a "popup-configurations" CMS collection - this is duplicate storage
|
|
37478
37496
|
- Only create CMS collections if there's genuinely new data needed beyond what's in embeddedScriptParameters (e.g., user-generated content, event logs if explicitly requested, business entities)
|
|
37497
|
+
|
|
37498
|
+
Avoid Duplicate Data Storage - SITE WIDGET CONFIGURATION:
|
|
37499
|
+
- Site widgets have a built-in settings panel (panel.tsx) - ALL widget configuration goes there
|
|
37500
|
+
- For SITE_WIDGET-ONLY blueprints: ALWAYS return collections: [] (empty array)
|
|
37501
|
+
- The widget panel handles: dates, times, colors, text, numbers, toggles, display settings, countdown targets, etc.
|
|
37502
|
+
- ONLY create collections for site widgets when there's a DASHBOARD_PAGE that manages multi-record data the widget displays
|
|
37479
37503
|
5) Initial Data Assessment:
|
|
37480
37504
|
- After defining the collection schema, evaluate if initial/seed data can be implied from the blueprint
|
|
37481
37505
|
- Consider if the blueprint describes example data, default configurations, sample content, or starter records that would help demonstrate the app's functionality
|
|
@@ -64455,6 +64479,7 @@ var require_dashboard_page_instructions = __commonJS({
|
|
|
64455
64479
|
"Page.Section",
|
|
64456
64480
|
"RichTextInputArea",
|
|
64457
64481
|
"SectionHeader",
|
|
64482
|
+
"SidePanel",
|
|
64458
64483
|
"Table",
|
|
64459
64484
|
"TableActionCell",
|
|
64460
64485
|
"TableListHeader",
|
|
@@ -64604,7 +64629,14 @@ var require_load_examples = __commonJS({
|
|
|
64604
64629
|
description: "A Custom Element that displays a countdown timer",
|
|
64605
64630
|
files: {
|
|
64606
64631
|
[types_1.ExtensionType.SITE_WIDGET]: [
|
|
64607
|
-
"custom-element/
|
|
64632
|
+
"custom-element/countdown-widget/components/ColorPickerField.tsx",
|
|
64633
|
+
"custom-element/countdown-widget/components/FontPickerField.tsx",
|
|
64634
|
+
"custom-element/countdown-widget/components/Separator.tsx",
|
|
64635
|
+
"custom-element/countdown-widget/components/TimeBlock.tsx",
|
|
64636
|
+
"custom-element/countdown-widget/panel.tsx",
|
|
64637
|
+
"custom-element/countdown-widget/styles.ts",
|
|
64638
|
+
"custom-element/countdown-widget/utils.ts",
|
|
64639
|
+
"custom-element/countdown-widget/widget.tsx"
|
|
64608
64640
|
]
|
|
64609
64641
|
}
|
|
64610
64642
|
},
|
|
@@ -65264,6 +65296,50 @@ var require_core_principles = __commonJS({
|
|
|
65264
65296
|
}
|
|
65265
65297
|
});
|
|
65266
65298
|
|
|
65299
|
+
// dist/system-prompts/system-prompt-builders/utils/output-constraints.js
|
|
65300
|
+
var require_output_constraints = __commonJS({
|
|
65301
|
+
"dist/system-prompts/system-prompt-builders/utils/output-constraints.js"(exports2) {
|
|
65302
|
+
"use strict";
|
|
65303
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
65304
|
+
exports2.outputConstraints = void 0;
|
|
65305
|
+
var outputConstraints = () => `<token_limits>
|
|
65306
|
+
CRITICAL: Your max output is ~10,000 tokens. You MUST plan your response to stay well under this limit.
|
|
65307
|
+
- If making a large file (>300 lines), split it into multiple smaller files with imports.
|
|
65308
|
+
- If editing a large section (>100 lines), break it into multiple smaller edit operations.
|
|
65309
|
+
- Count your output before responding - if it seems too long, reduce scope and prioritize.
|
|
65310
|
+
</token_limits>
|
|
65311
|
+
|
|
65312
|
+
<brevity_rules>
|
|
65313
|
+
IMPORTANT: Minimize output tokens while maintaining quality and correctness.
|
|
65314
|
+
- Do NOT add README.md, documentation files, or markdown files unless explicitly requested.
|
|
65315
|
+
- Do NOT add excessive comments in code - only add comments where truly necessary for clarity.
|
|
65316
|
+
- Do NOT re-output unchanged files or duplicate existing code.
|
|
65317
|
+
- Do NOT generate placeholder code like "// TODO: implement" - provide working implementations.
|
|
65318
|
+
- Only output files that are directly required for the task.
|
|
65319
|
+
</brevity_rules>
|
|
65320
|
+
|
|
65321
|
+
<modular_code_strategy>
|
|
65322
|
+
When generating substantial code, split into multiple smaller files with imports:
|
|
65323
|
+
- Extract utilities/helpers into separate files
|
|
65324
|
+
- Separate types/interfaces into dedicated type files
|
|
65325
|
+
- Keep each component/function focused (~50-100 lines max)
|
|
65326
|
+
|
|
65327
|
+
Example structure instead of one large file:
|
|
65328
|
+
components/MyFeature/MyFeature.tsx (main component)
|
|
65329
|
+
components/MyFeature/types.ts (interfaces/types)
|
|
65330
|
+
components/MyFeature/utils.ts (helper functions)
|
|
65331
|
+
</modular_code_strategy>
|
|
65332
|
+
|
|
65333
|
+
<iteration_efficiency>
|
|
65334
|
+
When iterating on existing code:
|
|
65335
|
+
- Only include files that actually need changes.
|
|
65336
|
+
- Prefer 'edit' operation with precise oldString/newString replacements.
|
|
65337
|
+
- If response would exceed limits, complete the most critical part first.
|
|
65338
|
+
</iteration_efficiency>`;
|
|
65339
|
+
exports2.outputConstraints = outputConstraints;
|
|
65340
|
+
}
|
|
65341
|
+
});
|
|
65342
|
+
|
|
65267
65343
|
// dist/system-prompts/system-prompt-builders/CodeGenerationSystemPromptBuilder.js
|
|
65268
65344
|
var require_CodeGenerationSystemPromptBuilder = __commonJS({
|
|
65269
65345
|
"dist/system-prompts/system-prompt-builders/CodeGenerationSystemPromptBuilder.js"(exports2) {
|
|
@@ -65277,6 +65353,7 @@ var require_CodeGenerationSystemPromptBuilder = __commonJS({
|
|
|
65277
65353
|
var apiDocLoader_1 = require_apiDocLoader();
|
|
65278
65354
|
var use_elevate_1 = require_use_elevate();
|
|
65279
65355
|
var core_principles_1 = require_core_principles();
|
|
65356
|
+
var output_constraints_1 = require_output_constraints();
|
|
65280
65357
|
var CodeGenerationSystemPromptBuilder = class extends SystemPromptBuilder_1.SystemPromptBuilder {
|
|
65281
65358
|
constructor(params) {
|
|
65282
65359
|
super(params);
|
|
@@ -65298,6 +65375,10 @@ ${(0, error_handling_1.errorHandling)()}`;
|
|
|
65298
65375
|
this.withSection(SystemPromptBuilder_1.CommonSections.CORE_PRINCIPLES, content);
|
|
65299
65376
|
return this;
|
|
65300
65377
|
}
|
|
65378
|
+
withOutputConstraints() {
|
|
65379
|
+
this.withSection(SystemPromptBuilder_1.CommonSections.OUTPUT_CONSTRAINTS, (0, output_constraints_1.outputConstraints)());
|
|
65380
|
+
return this;
|
|
65381
|
+
}
|
|
65301
65382
|
withApiDocs() {
|
|
65302
65383
|
if (this.apiNames.length === 0 && !this.useData && !this.useIteration) {
|
|
65303
65384
|
return this;
|
|
@@ -65334,7 +65415,7 @@ var require_dashboard_page_prompt = __commonJS({
|
|
|
65334
65415
|
apiNames,
|
|
65335
65416
|
useData,
|
|
65336
65417
|
useIteration
|
|
65337
|
-
}).withRole(dashboard_page_instructions_1.dashboardPageInstructions.role).withSection("dashboard_page_extension_files_and_code", dashboard_page_instructions_1.dashboardPageInstructions.filesAndCode).withSection("wds_provider_usage", dashboard_page_instructions_1.dashboardPageInstructions.wdsProviderUsage).withSection("hard_constraints", dashboard_page_instructions_1.dashboardPageInstructions.hardConstraints).withSection("api_references", dashboard_page_instructions_1.dashboardPageInstructions.apiReferences).withSection("wds_reference", dashboard_page_instructions_1.dashboardPageInstructions.wdsReference()).withContextExplanation().withApiDocs().withCorePrinciples().withImplementationGuidelines(dashboard_page_instructions_1.dashboardPageInstructions.typescriptQualityGuidelines).withExamples();
|
|
65418
|
+
}).withRole(dashboard_page_instructions_1.dashboardPageInstructions.role).withSection("dashboard_page_extension_files_and_code", dashboard_page_instructions_1.dashboardPageInstructions.filesAndCode).withSection("wds_provider_usage", dashboard_page_instructions_1.dashboardPageInstructions.wdsProviderUsage).withSection("hard_constraints", dashboard_page_instructions_1.dashboardPageInstructions.hardConstraints).withSection("api_references", dashboard_page_instructions_1.dashboardPageInstructions.apiReferences).withSection("wds_reference", dashboard_page_instructions_1.dashboardPageInstructions.wdsReference()).withContextExplanation().withApiDocs().withCorePrinciples().withOutputConstraints().withImplementationGuidelines(dashboard_page_instructions_1.dashboardPageInstructions.typescriptQualityGuidelines).withExamples();
|
|
65338
65419
|
if (useData) {
|
|
65339
65420
|
systemPrompt.withSection("data_prompt", dashboard_page_instructions_1.dashboardPageInstructions.dataPrompt);
|
|
65340
65421
|
}
|
|
@@ -65736,7 +65817,7 @@ var require_site_component_prompt = __commonJS({
|
|
|
65736
65817
|
apiNames,
|
|
65737
65818
|
useData,
|
|
65738
65819
|
useIteration
|
|
65739
|
-
}).withRole(site_component_instructions_1.siteComponentInstructions.role).withContextExplanation().withCorePrinciples().withImplementationGuidelines(site_component_instructions_1.siteComponentInstructions.implementationGuidelines).withApiDocs().withExamples();
|
|
65820
|
+
}).withRole(site_component_instructions_1.siteComponentInstructions.role).withContextExplanation().withCorePrinciples().withOutputConstraints().withImplementationGuidelines(site_component_instructions_1.siteComponentInstructions.implementationGuidelines).withApiDocs().withExamples();
|
|
65740
65821
|
return siteComponentPromptBuilder.compose();
|
|
65741
65822
|
};
|
|
65742
65823
|
exports2.siteComponentPrompt = siteComponentPrompt;
|
|
@@ -65797,18 +65878,39 @@ var require_custom_element_instructions = __commonJS({
|
|
|
65797
65878
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
65798
65879
|
exports2.customElementInstructions = void 0;
|
|
65799
65880
|
var typescript_quality_guidelines_1 = require_typescript_quality_guidelines();
|
|
65881
|
+
var wdsPackage_1 = require_wdsPackage();
|
|
65882
|
+
var dashboard_page_instructions_1 = require_dashboard_page_instructions();
|
|
65800
65883
|
var customElementRole = `You are a senior Wix CLI App Developer. Your job is to produce a beautiful, production\u2011quality site component quickly and correctly.`;
|
|
65801
65884
|
var customElementImplementationGuidelines = `<rules>
|
|
65802
65885
|
- Return ONLY a JSON object matching the schema { path, content, type } (no prose, no markdown)
|
|
65803
65886
|
- type must be "typescript"; content must be the COMPLETE file source
|
|
65804
|
-
- Do NOT add dependencies; do NOT use @wix/design-system or @wix/wix-ui-icons-common
|
|
65805
65887
|
- Do NOT invent types/modules/props; use only what exists in the scaffold and standard libs
|
|
65806
65888
|
</rules>
|
|
65807
65889
|
|
|
65890
|
+
<architecture>
|
|
65891
|
+
Site widgets consist of two files:
|
|
65892
|
+
|
|
65893
|
+
1. **widget.tsx** - React component converted to Web Component
|
|
65894
|
+
- Import React, ReactDOM, and react-to-webcomponent
|
|
65895
|
+
- Define a Props interface for configurable properties (camelCase)
|
|
65896
|
+
- Create a React FC that renders the widget UI
|
|
65897
|
+
- Convert to web component using reactToWebComponent with props mapping
|
|
65898
|
+
- Props in reactToWebComponent config use camelCase keys with 'string' type
|
|
65899
|
+
- Use inline styles for styling
|
|
65900
|
+
|
|
65901
|
+
2. **panel.tsx** - Settings panel shown in the Wix Editor
|
|
65902
|
+
- Import React hooks, @wix/editor widget API, and @wix/design-system components
|
|
65903
|
+
- Import '@wix/design-system/styles.global.css' for design system styles
|
|
65904
|
+
- Use useState for each configurable property
|
|
65905
|
+
- Use useEffect to load initial values via widget.getProp('kebab-case-name')
|
|
65906
|
+
- Create onChange handlers that update local state AND call widget.setProp('kebab-case-name', value)
|
|
65907
|
+
- Wrap content in WixDesignSystemProvider > SidePanel > SidePanel.Content
|
|
65908
|
+
- Use ONLY WDS components listed in the <wds_reference> section
|
|
65909
|
+
</architecture>
|
|
65910
|
+
|
|
65808
65911
|
<engineering_guidelines>
|
|
65809
65912
|
- Implement a TypeScript custom element with proper typing and clear interfaces
|
|
65810
|
-
-
|
|
65811
|
-
- Name things clearly; avoid magic numbers; extract tiny helpers if it improves clarity
|
|
65913
|
+
- Ensure prop names are consistent between widget.tsx (camelCase) and panel.tsx (kebab-case)
|
|
65812
65914
|
</engineering_guidelines>
|
|
65813
65915
|
|
|
65814
65916
|
${typescript_quality_guidelines_1.typescriptQualityGuidelines}
|
|
@@ -65843,7 +65945,8 @@ var require_custom_element_instructions = __commonJS({
|
|
|
65843
65945
|
exports2.customElementInstructions = {
|
|
65844
65946
|
role: customElementRole,
|
|
65845
65947
|
implementationGuidelines: customElementImplementationGuidelines,
|
|
65846
|
-
implementationRequirements: customElementImplementationRequirements
|
|
65948
|
+
implementationRequirements: customElementImplementationRequirements,
|
|
65949
|
+
wdsReference: () => (0, wdsPackage_1.buildWdsSystemPrompt)(dashboard_page_instructions_1.supportedWDSComponents)
|
|
65847
65950
|
};
|
|
65848
65951
|
}
|
|
65849
65952
|
});
|
|
@@ -65863,7 +65966,7 @@ var require_custom_element_prompt = __commonJS({
|
|
|
65863
65966
|
apiNames,
|
|
65864
65967
|
useData,
|
|
65865
65968
|
useIteration
|
|
65866
|
-
}).withRole(custom_element_instructions_1.customElementInstructions.role).withContextExplanation().withCorePrinciples().withImplementationGuidelines(custom_element_instructions_1.customElementInstructions.implementationGuidelines).withApiDocs().withExamples();
|
|
65969
|
+
}).withRole(custom_element_instructions_1.customElementInstructions.role).withContextExplanation().withCorePrinciples().withOutputConstraints().withImplementationGuidelines(custom_element_instructions_1.customElementInstructions.implementationGuidelines).withSection("wds_reference", custom_element_instructions_1.customElementInstructions.wdsReference()).withApiDocs().withExamples();
|
|
65867
65970
|
if (useData) {
|
|
65868
65971
|
systemPrompt.withSection("implementation_requirements", custom_element_instructions_1.customElementInstructions.implementationRequirements);
|
|
65869
65972
|
}
|
|
@@ -66097,7 +66200,7 @@ var require_service_plugin_prompt = __commonJS({
|
|
|
66097
66200
|
apiNames,
|
|
66098
66201
|
useData,
|
|
66099
66202
|
useIteration
|
|
66100
|
-
}).withRole(service_plugin_instructions_1.servicePluginInstructions.role).withContextExplanation().withImplementationPatterns(service_plugin_instructions_1.servicePluginInstructions.implementationPatterns).withImplementationGuidelines(service_plugin_instructions_1.servicePluginInstructions.implementationGuidelines).withCorePrinciples().withAuthenticationElevationRequirement().withApiDocs().withExamples().withSection("available_service_plugins", servicePluginDocs);
|
|
66203
|
+
}).withRole(service_plugin_instructions_1.servicePluginInstructions.role).withContextExplanation().withImplementationPatterns(service_plugin_instructions_1.servicePluginInstructions.implementationPatterns).withImplementationGuidelines(service_plugin_instructions_1.servicePluginInstructions.implementationGuidelines).withCorePrinciples().withOutputConstraints().withAuthenticationElevationRequirement().withApiDocs().withExamples().withSection("available_service_plugins", servicePluginDocs);
|
|
66101
66204
|
if (servicePluginDocs) {
|
|
66102
66205
|
servicePluginPromptBuilder.withSection("available_service_plugins", servicePluginDocs);
|
|
66103
66206
|
}
|
|
@@ -66216,7 +66319,7 @@ var require_backend_event_prompt = __commonJS({
|
|
|
66216
66319
|
apiNames,
|
|
66217
66320
|
useData,
|
|
66218
66321
|
useIteration
|
|
66219
|
-
}).withRole(backend_event_instructions_1.backendEventInstructions.role).withContextExplanation().withCorePrinciples().withImplementationPatterns(backend_event_instructions_1.backendEventInstructions.implementationPatterns).withImplementationGuidelines(backend_event_instructions_1.backendEventInstructions.implementationGuidelines).withAuthenticationElevationRequirement().withApiDocs().withExamples();
|
|
66322
|
+
}).withRole(backend_event_instructions_1.backendEventInstructions.role).withContextExplanation().withCorePrinciples().withOutputConstraints().withImplementationPatterns(backend_event_instructions_1.backendEventInstructions.implementationPatterns).withImplementationGuidelines(backend_event_instructions_1.backendEventInstructions.implementationGuidelines).withAuthenticationElevationRequirement().withApiDocs().withExamples();
|
|
66220
66323
|
return backendEventPromptBuilder.compose();
|
|
66221
66324
|
};
|
|
66222
66325
|
exports2.backendEventPrompt = backendEventPrompt;
|
|
@@ -66373,7 +66476,7 @@ var require_backend_api_prompt = __commonJS({
|
|
|
66373
66476
|
apiNames,
|
|
66374
66477
|
useData,
|
|
66375
66478
|
useIteration
|
|
66376
|
-
}).withRole(backend_api_instructions_1.backendApiInstructions.role).withContextExplanation().withCorePrinciples().withImplementationGuidelines(backend_api_instructions_1.backendApiInstructions.implementationGuidelines).withCoreKnowledge(backend_api_instructions_1.backendApiInstructions.coreKnowledge).withApiDocs().withExamples();
|
|
66479
|
+
}).withRole(backend_api_instructions_1.backendApiInstructions.role).withContextExplanation().withCorePrinciples().withOutputConstraints().withImplementationGuidelines(backend_api_instructions_1.backendApiInstructions.implementationGuidelines).withCoreKnowledge(backend_api_instructions_1.backendApiInstructions.coreKnowledge).withApiDocs().withExamples();
|
|
66377
66480
|
return systemPrompt.compose();
|
|
66378
66481
|
};
|
|
66379
66482
|
exports2.backendApiPrompt = backendApiPrompt;
|
|
@@ -66647,7 +66750,7 @@ ${(0, dynamicParameters_1.dynamicParametersPrompt)()}` : embedded_script_instruc
|
|
|
66647
66750
|
apiNames,
|
|
66648
66751
|
useData,
|
|
66649
66752
|
useIteration
|
|
66650
|
-
}).withRole(embedded_script_instructions_1.embeddedScriptInstructions.role).withContextExplanation().withSection("embedded_script_extension_files_and_code", embedded_script_instructions_1.embeddedScriptInstructions.embeddedScriptFilesAndCode).withImplementationGuidelines(embeddedScriptImplementationGuidelines).withImplementationPatterns(embedded_script_instructions_1.embeddedScriptInstructions.embeddedScriptImplementationPatterns).withCorePrinciples().withApiDocs().withExamples();
|
|
66753
|
+
}).withRole(embedded_script_instructions_1.embeddedScriptInstructions.role).withContextExplanation().withSection("embedded_script_extension_files_and_code", embedded_script_instructions_1.embeddedScriptInstructions.embeddedScriptFilesAndCode).withImplementationGuidelines(embeddedScriptImplementationGuidelines).withImplementationPatterns(embedded_script_instructions_1.embeddedScriptInstructions.embeddedScriptImplementationPatterns).withCorePrinciples().withOutputConstraints().withApiDocs().withExamples();
|
|
66651
66754
|
return systemPrompt.compose();
|
|
66652
66755
|
};
|
|
66653
66756
|
exports2.embeddedScriptPrompt = embeddedScriptPrompt;
|
|
@@ -78563,11 +78666,13 @@ var require_extensionGenerators = __commonJS({
|
|
|
78563
78666
|
static createCustomElementData(id, name, scaffoldDir) {
|
|
78564
78667
|
const kebabCaseComponentName = (0, ditto_scaffolding_2.toKebabCase)(name);
|
|
78565
78668
|
const componentPath = getScaffoldPath(scaffoldDir, "widget.tsx");
|
|
78669
|
+
const settingsPath = getScaffoldPath(scaffoldDir, "panel.tsx");
|
|
78566
78670
|
return {
|
|
78567
78671
|
id,
|
|
78568
78672
|
name,
|
|
78569
78673
|
tagName: kebabCaseComponentName,
|
|
78570
78674
|
element: componentPath,
|
|
78675
|
+
settings: settingsPath,
|
|
78571
78676
|
installation: { autoAdd: true },
|
|
78572
78677
|
width: { defaultWidth: 500, allowStretch: true },
|
|
78573
78678
|
height: { defaultHeight: 500 }
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
} from "@wix/design-system";
|
|
9
|
+
import "@wix/design-system/styles.global.css";
|
|
10
|
+
|
|
11
|
+
const Panel: FC = () => {
|
|
12
|
+
const [displayName, setDisplayName] = useState<string>("");
|
|
13
|
+
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
widget
|
|
16
|
+
.getProp("display-name")
|
|
17
|
+
.then((displayName) =>
|
|
18
|
+
setDisplayName(displayName || `Your Widget's Title`),
|
|
19
|
+
)
|
|
20
|
+
.catch((error) => console.error("Failed to fetch display-name:", error));
|
|
21
|
+
}, [setDisplayName]);
|
|
22
|
+
|
|
23
|
+
const handleDisplayNameChange = useCallback(
|
|
24
|
+
(event: React.ChangeEvent<HTMLInputElement>) => {
|
|
25
|
+
const newDisplayName = event.target.value;
|
|
26
|
+
setDisplayName(newDisplayName);
|
|
27
|
+
widget.setProp("display-name", newDisplayName);
|
|
28
|
+
},
|
|
29
|
+
[setDisplayName],
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<WixDesignSystemProvider>
|
|
34
|
+
<SidePanel width="300" height="100vh">
|
|
35
|
+
<SidePanel.Content noPadding stretchVertically>
|
|
36
|
+
<SidePanel.Field>
|
|
37
|
+
<FormField label="Display Name">
|
|
38
|
+
<Input
|
|
39
|
+
type="text"
|
|
40
|
+
value={displayName}
|
|
41
|
+
onChange={handleDisplayNameChange}
|
|
42
|
+
aria-label="Display Name"
|
|
43
|
+
/>
|
|
44
|
+
</FormField>
|
|
45
|
+
</SidePanel.Field>
|
|
46
|
+
</SidePanel.Content>
|
|
47
|
+
</SidePanel>
|
|
48
|
+
</WixDesignSystemProvider>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default Panel;
|
|
53
|
+
|
|
@@ -1,5 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import React, { type FC } from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
import reactToWebComponent from 'react-to-webcomponent';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
displayName?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const CustomElement: FC<Props> = ({
|
|
10
|
+
displayName = `Your Widget's Title`,
|
|
11
|
+
}) => {
|
|
12
|
+
return (
|
|
13
|
+
<div>
|
|
14
|
+
<h2>{displayName}</h2>
|
|
15
|
+
<hr />
|
|
16
|
+
<p>
|
|
17
|
+
This is a Site Widget generated by Wix CLI.<br />
|
|
18
|
+
</p>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const customElement = reactToWebComponent(
|
|
24
|
+
CustomElement,
|
|
25
|
+
React,
|
|
26
|
+
ReactDOM as any,
|
|
27
|
+
{
|
|
28
|
+
props: {
|
|
29
|
+
displayName: 'string',
|
|
30
|
+
},
|
|
4
31
|
}
|
|
5
|
-
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export default customElement;
|
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.183",
|
|
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": "
|
|
27
|
+
"falconPackageHash": "4dda91599e3e7aacc90417a2c99a0c0c293c409b3a4ac6293f97cae0"
|
|
28
28
|
}
|