From 97e53de44dfd24b956876a3e36d15360f08acd31 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 25 Jan 2026 12:17:59 +0000 Subject: [PATCH 1/5] Initial plan From 58c11e40a2d7c2cc7e92bf8122aa055ece245b88 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 25 Jan 2026 12:24:57 +0000 Subject: [PATCH 2/5] Add web-based WSL playground with embedded support Co-authored-by: anare <1291552+anare@users.noreply.github.com> --- README.md | 15 ++ playground/.gitignore | 29 +++ playground/README.md | 338 ++++++++++++++++++++++++ playground/css/playground.css | 478 ++++++++++++++++++++++++++++++++++ playground/demo.html | 427 ++++++++++++++++++++++++++++++ playground/embed.html | 135 ++++++++++ playground/index.html | 130 +++++++++ playground/js/examples.js | 252 ++++++++++++++++++ playground/js/playground.js | 339 ++++++++++++++++++++++++ playground/js/wsl-language.js | 248 ++++++++++++++++++ playground/package.json | 32 +++ 11 files changed, 2423 insertions(+) create mode 100644 playground/.gitignore create mode 100644 playground/README.md create mode 100644 playground/css/playground.css create mode 100644 playground/demo.html create mode 100644 playground/embed.html create mode 100644 playground/index.html create mode 100644 playground/js/examples.js create mode 100644 playground/js/playground.js create mode 100644 playground/js/wsl-language.js create mode 100644 playground/package.json diff --git a/README.md b/README.md index 22c1615..e0232d8 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,18 @@ This repository contains IDE plugins that provide language support for the Kueti ### Visual Studio Code * [VS Code WSL](/vs-code-wsl) - Extension for Visual Studio Code * [VS Code WSL README.md](/vs-code-wsl/README.md) + +## Web Playground + +### Interactive Browser-Based Editor +* [WSL Playground](/playground) - Web-based playground for trying WSL/SimplifiedWSL without installation +* [Playground README.md](/playground/README.md) - Documentation and embedding guide +* **Features:** + - 🎨 Real-time syntax highlighting + - 🌓 Light/dark theme support + - 🔗 Shareable code URLs + - 📱 Responsive design + - 🚀 Embeddable via iframe + - ⚡ Zero installation required + +Try it now: [Open Playground](/playground/index.html) | [Demo Page](/playground/demo.html) diff --git a/playground/.gitignore b/playground/.gitignore new file mode 100644 index 0000000..9582adb --- /dev/null +++ b/playground/.gitignore @@ -0,0 +1,29 @@ +# Dependencies +node_modules/ +package-lock.json + +# Build outputs +dist/ +build/ + +# IDE +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# OS +.DS_Store +Thumbs.db + +# Logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Temporary files +tmp/ +temp/ +*.tmp diff --git a/playground/README.md b/playground/README.md new file mode 100644 index 0000000..9f4bdc0 --- /dev/null +++ b/playground/README.md @@ -0,0 +1,338 @@ +# WSL Playground - Interactive Web Editor + +An embeddable, web-based playground for the Workflow Specific Language (WSL) and SimplifiedWSL (SWSL) with real-time syntax highlighting and validation. + +## Features + +- 🎨 **Syntax Highlighting** - Full syntax highlighting for both WSL and SimplifiedWSL +- 🌓 **Dark/Light Theme** - Toggle between light and dark themes +- 📝 **Multiple Examples** - Pre-built examples to get started quickly +- 🔗 **Shareable URLs** - Share your code via URL +- 📱 **Responsive Design** - Works on desktop, tablet, and mobile +- 🎯 **Embeddable** - Easy to embed in any website via iframe +- ⚡ **Real-time Validation** - Instant syntax validation as you type +- 🚀 **Zero Installation** - Works directly in the browser + +## Quick Start + +### Standalone Usage + +1. Open `index.html` in your web browser +2. Select an example or start writing your own WSL code +3. Use the toolbar to change themes, clear the editor, or share your code + +### Embedding in Your Website + +#### Basic Embed + +Add this iframe to your HTML: + +```html + +``` + +#### Embed with Initial Code + +Pass code via URL parameter: + +```html + +``` + +#### Responsive Embed + +```html +
+``` + +## JavaScript API (for iframe communication) + +### Send Code to Embedded Playground + +```javascript +const iframe = document.querySelector('iframe'); + +// Set code in the playground +iframe.contentWindow.postMessage({ + type: 'setCode', + data: { + code: 'module example\n\nworkflow demo\n\naction.Call() -> .', + language: 'swsl' + } +}, '*'); +``` + +### Get Code from Embedded Playground + +```javascript +// Request code from playground +iframe.contentWindow.postMessage({ + type: 'getCode' +}, '*'); + +// Listen for response +window.addEventListener('message', (event) => { + if (event.data.type === 'code') { + console.log('Code:', event.data.data.code); + console.log('Language:', event.data.data.language); + } +}); +``` + +### Change Theme + +```javascript +iframe.contentWindow.postMessage({ + type: 'setTheme', + data: { theme: 'dark' } // or 'light' +}, '*'); +``` + +### Listen for Ready Event + +```javascript +window.addEventListener('message', (event) => { + if (event.data.type === 'ready') { + console.log('Playground is ready!'); + // Now you can send messages to the iframe + } +}); +``` + +## File Structure + +``` +playground/ +├── index.html # Main playground page +├── embed.html # Embeddable version +├── css/ +│ └── playground.css # Styles for the playground +├── js/ +│ ├── playground.js # Main playground logic +│ ├── wsl-language.js # Monaco Editor language definitions +│ └── examples.js # Example code snippets +└── README.md # This file +``` + +## Examples Included + +### SimplifiedWSL Examples + +1. **Hello World** - Basic SimplifiedWSL syntax +2. **Payment Feature** - Feature-level workflow +3. **Solution Example** - Solution-level orchestration +4. **Validate Workflow** - Payment validation +5. **Action Chain** - Chained action execution +6. **Hierarchical Call** - Multi-level workflow calls +7. **Error Handling** - Error handling patterns + +### Traditional WSL Examples + +1. **Login Workflow** - Complete login workflow with state machine + +## Customization + +### Change Default Language + +Edit `playground.js`: + +```javascript +let currentLanguage = 'swsl'; // Change to 'wsl' for WSL +``` + +### Add Custom Examples + +Edit `examples.js`: + +```javascript +const examples = { + my_example: { + name: "My Example", + language: "swsl", + code: `// Your code here` + } +}; +``` + +### Customize Theme Colors + +Edit `playground.css` CSS variables: + +```css +:root { + --accent-color: #0969da; /* Change accent color */ + --bg-primary: #ffffff; /* Background color */ + /* ... other variables ... */ +} +``` + +## Browser Support + +- ✅ Chrome 90+ +- ✅ Firefox 88+ +- ✅ Safari 14+ +- ✅ Edge 90+ + +## Dependencies + +- **Monaco Editor** (v0.45.0) - Microsoft's code editor (powers VS Code) + - Loaded via CDN: `https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/` + +## Deployment + +### GitHub Pages + +1. Push the `playground` directory to your repository +2. Enable GitHub Pages in repository settings +3. Set source to `main` branch and `/playground` folder +4. Access at `https://yourusername.github.io/repository-name/` + +### Static Hosting (Netlify, Vercel, etc.) + +1. Deploy the `playground` directory +2. Configure build settings (none required - pure static) +3. Set publish directory to `playground` + +### Local Development + +Simply open `index.html` in your browser. For best results, use a local server: + +```bash +# Python 3 +python -m http.server 8000 + +# Node.js +npx serve + +# PHP +php -S localhost:8000 +``` + +Then open `http://localhost:8000/index.html` + +## Integration Examples + +### WordPress + +```php +Interactive web-based editor for Workflow Specific Language (WSL) and SimplifiedWSL
+ +Full syntax highlighting powered by Monaco Editor
+Share your code via URL with anyone
+Works on desktop, tablet, and mobile
+Easy to embed in any website
+Try the playground below. Select examples, edit code, and see real-time syntax highlighting!
+ + +Use the controls below to interact with the embedded playground via JavaScript:
+ +Copy and paste this code into your website:
+ +<iframe
+ src="https://your-domain.com/playground/embed.html"
+ width="100%"
+ height="600"
+ frameborder="0"
+ style="border: 1px solid #ddd; border-radius: 8px;"
+></iframe><div style="position: relative; padding-bottom: 56.25%; height: 0;">
+ <iframe
+ src="https://your-domain.com/playground/embed.html"
+ style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"
+ frameborder="0"
+ ></iframe>
+</div>// Send code to playground
+iframe.contentWindow.postMessage({
+ type: 'setCode',
+ data: {
+ code: 'module example\\n\\nworkflow demo\\n\\naction.Call() -> .',
+ language: 'swsl'
+ }
+}, '*');
+
+// Get code from playground
+iframe.contentWindow.postMessage({ type: 'getCode' }, '*');
+
+// Listen for code
+window.addEventListener('message', (event) => {
+ if (event.data.type === 'code') {
+ console.log('Code:', event.data.data.code);
+ }
+});Embed live examples in your documentation
+Create interactive tutorials and courses
+Show off your workflow language features
+Quick prototyping and testing workflows
+