@zentto/studio 0.1.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/designer/zs-app-wizard.d.ts +33 -0
- package/dist/designer/zs-app-wizard.d.ts.map +1 -0
- package/dist/designer/zs-app-wizard.js +493 -0
- package/dist/designer/zs-app-wizard.js.map +1 -0
- package/dist/designer/zs-page-designer.d.ts +30 -0
- package/dist/designer/zs-page-designer.d.ts.map +1 -0
- package/dist/designer/zs-page-designer.js +466 -0
- package/dist/designer/zs-page-designer.js.map +1 -0
- package/dist/fields/zs-field-address.d.ts +28 -0
- package/dist/fields/zs-field-address.d.ts.map +1 -0
- package/dist/fields/zs-field-address.js +129 -0
- package/dist/fields/zs-field-address.js.map +1 -0
- package/dist/fields/zs-field-chart.d.ts +27 -0
- package/dist/fields/zs-field-chart.d.ts.map +1 -0
- package/dist/fields/zs-field-chart.js +192 -0
- package/dist/fields/zs-field-chart.js.map +1 -0
- package/dist/fields/zs-field-checkbox.d.ts +33 -0
- package/dist/fields/zs-field-checkbox.d.ts.map +1 -0
- package/dist/fields/zs-field-checkbox.js +172 -0
- package/dist/fields/zs-field-checkbox.js.map +1 -0
- package/dist/fields/zs-field-chips.d.ts +38 -0
- package/dist/fields/zs-field-chips.d.ts.map +1 -0
- package/dist/fields/zs-field-chips.js +257 -0
- package/dist/fields/zs-field-chips.js.map +1 -0
- package/dist/fields/zs-field-date.d.ts +23 -0
- package/dist/fields/zs-field-date.d.ts.map +1 -0
- package/dist/fields/zs-field-date.js +98 -0
- package/dist/fields/zs-field-date.js.map +1 -0
- package/dist/fields/zs-field-file.d.ts +26 -0
- package/dist/fields/zs-field-file.d.ts.map +1 -0
- package/dist/fields/zs-field-file.js +190 -0
- package/dist/fields/zs-field-file.js.map +1 -0
- package/dist/fields/zs-field-heading.d.ts +14 -0
- package/dist/fields/zs-field-heading.d.ts.map +1 -0
- package/dist/fields/zs-field-heading.js +54 -0
- package/dist/fields/zs-field-heading.js.map +1 -0
- package/dist/fields/zs-field-html.d.ts +12 -0
- package/dist/fields/zs-field-html.d.ts.map +1 -0
- package/dist/fields/zs-field-html.js +38 -0
- package/dist/fields/zs-field-html.js.map +1 -0
- package/dist/fields/zs-field-lookup.d.ts +37 -0
- package/dist/fields/zs-field-lookup.d.ts.map +1 -0
- package/dist/fields/zs-field-lookup.js +204 -0
- package/dist/fields/zs-field-lookup.js.map +1 -0
- package/dist/fields/zs-field-media.d.ts +15 -0
- package/dist/fields/zs-field-media.d.ts.map +1 -0
- package/dist/fields/zs-field-media.js +59 -0
- package/dist/fields/zs-field-media.js.map +1 -0
- package/dist/fields/zs-field-number.d.ts +35 -0
- package/dist/fields/zs-field-number.d.ts.map +1 -0
- package/dist/fields/zs-field-number.js +192 -0
- package/dist/fields/zs-field-number.js.map +1 -0
- package/dist/fields/zs-field-select.d.ts +34 -0
- package/dist/fields/zs-field-select.d.ts.map +1 -0
- package/dist/fields/zs-field-select.js +237 -0
- package/dist/fields/zs-field-select.js.map +1 -0
- package/dist/fields/zs-field-separator.d.ts +12 -0
- package/dist/fields/zs-field-separator.d.ts.map +1 -0
- package/dist/fields/zs-field-separator.js +37 -0
- package/dist/fields/zs-field-separator.js.map +1 -0
- package/dist/fields/zs-field-signature.d.ts +34 -0
- package/dist/fields/zs-field-signature.d.ts.map +1 -0
- package/dist/fields/zs-field-signature.js +191 -0
- package/dist/fields/zs-field-signature.js.map +1 -0
- package/dist/fields/zs-field-switch.d.ts +19 -0
- package/dist/fields/zs-field-switch.d.ts.map +1 -0
- package/dist/fields/zs-field-switch.js +100 -0
- package/dist/fields/zs-field-switch.js.map +1 -0
- package/dist/fields/zs-field-text.d.ts +24 -0
- package/dist/fields/zs-field-text.d.ts.map +1 -0
- package/dist/fields/zs-field-text.js +115 -0
- package/dist/fields/zs-field-text.js.map +1 -0
- package/dist/fields/zs-field-treeview.d.ts +37 -0
- package/dist/fields/zs-field-treeview.d.ts.map +1 -0
- package/dist/fields/zs-field-treeview.js +234 -0
- package/dist/fields/zs-field-treeview.js.map +1 -0
- package/dist/styles/tokens.d.ts +3 -0
- package/dist/styles/tokens.d.ts.map +1 -0
- package/dist/styles/tokens.js +159 -0
- package/dist/styles/tokens.js.map +1 -0
- package/dist/zentto-studio-app.d.ts +55 -0
- package/dist/zentto-studio-app.d.ts.map +1 -0
- package/dist/zentto-studio-app.js +748 -0
- package/dist/zentto-studio-app.js.map +1 -0
- package/dist/zentto-studio-designer.d.ts +13 -0
- package/dist/zentto-studio-designer.d.ts.map +1 -0
- package/dist/zentto-studio-designer.js +75 -0
- package/dist/zentto-studio-designer.js.map +1 -0
- package/dist/zentto-studio-renderer.d.ts +53 -0
- package/dist/zentto-studio-renderer.d.ts.map +1 -0
- package/dist/zentto-studio-renderer.js +636 -0
- package/dist/zentto-studio-renderer.js.map +1 -0
- package/package.json +56 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import type { AppConfig } from '@zentto/studio-core';
|
|
3
|
+
import '../zentto-studio-app.js';
|
|
4
|
+
export declare class ZsAppWizard extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
initialConfig: AppConfig | null;
|
|
7
|
+
private currentStep;
|
|
8
|
+
private selectedTemplate;
|
|
9
|
+
private config;
|
|
10
|
+
private editingNavIndex;
|
|
11
|
+
private showIconPicker;
|
|
12
|
+
private iconPickerTarget;
|
|
13
|
+
connectedCallback(): void;
|
|
14
|
+
private canNext;
|
|
15
|
+
private next;
|
|
16
|
+
private prev;
|
|
17
|
+
private finish;
|
|
18
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
19
|
+
private renderTemplateStep;
|
|
20
|
+
private renderBrandingStep;
|
|
21
|
+
private renderNavStep;
|
|
22
|
+
private addNavItem;
|
|
23
|
+
private moveNav;
|
|
24
|
+
private renderPagesStep;
|
|
25
|
+
private getContentIcon;
|
|
26
|
+
private renderPreviewStep;
|
|
27
|
+
}
|
|
28
|
+
declare global {
|
|
29
|
+
interface HTMLElementTagNameMap {
|
|
30
|
+
'zs-app-wizard': ZsAppWizard;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=zs-app-wizard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zs-app-wizard.d.ts","sourceRoot":"","sources":["../../src/designer/zs-app-wizard.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAGrD,OAAO,KAAK,EAAE,SAAS,EAAiD,MAAM,qBAAqB,CAAC;AAKpG,OAAO,yBAAyB,CAAC;AAqCjC,qBACa,WAAY,SAAQ,UAAU;IACzC,MAAM,CAAC,MAAM,4BAiJV;IAEyB,aAAa,EAAE,SAAS,GAAG,IAAI,CAAQ;IAE1D,OAAO,CAAC,WAAW,CAAK;IACxB,OAAO,CAAC,gBAAgB,CAA8B;IACtD,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,eAAe,CAAM;IAC7B,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,gBAAgB,CAA6B;IAE9D,iBAAiB;IAUjB,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,IAAI;IAOZ,OAAO,CAAC,IAAI;IAIZ,OAAO,CAAC,MAAM;IAUd,MAAM;IAqCN,OAAO,CAAC,kBAAkB;IAmB1B,OAAO,CAAC,kBAAkB;IAkD1B,OAAO,CAAC,aAAa;IA8CrB,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,OAAO;IAWf,OAAO,CAAC,eAAe;IAqCvB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,iBAAiB;CAqB1B;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,WAAW,CAAC;KAC9B;CACF"}
|
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
// @zentto/studio — App Creation Wizard
|
|
2
|
+
// Step-by-step wizard to create an AppConfig from a template
|
|
3
|
+
// Steps: 1) Template → 2) Branding → 3) Navigation → 4) Pages → 5) Preview
|
|
4
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
5
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
7
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
8
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9
|
+
};
|
|
10
|
+
import { LitElement, html, css, nothing } from 'lit';
|
|
11
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
12
|
+
import { studioTokens, fieldBaseStyles } from '../styles/tokens.js';
|
|
13
|
+
import { listAppTemplates, getAppTemplate } from '@zentto/studio-core';
|
|
14
|
+
// Import the app component for preview
|
|
15
|
+
import '../zentto-studio-app.js';
|
|
16
|
+
const STEPS = [
|
|
17
|
+
{ id: 'template', title: 'Plantilla', icon: '📋', description: 'Elige una plantilla base' },
|
|
18
|
+
{ id: 'branding', title: 'Marca', icon: '🎨', description: 'Personaliza tu aplicacion' },
|
|
19
|
+
{ id: 'navigation', title: 'Menu', icon: '📑', description: 'Configura el sidebar' },
|
|
20
|
+
{ id: 'pages', title: 'Paginas', icon: '📄', description: 'Agrega paginas y contenido' },
|
|
21
|
+
{ id: 'preview', title: 'Vista Previa', icon: '👁️', description: 'Revisa y finaliza' },
|
|
22
|
+
];
|
|
23
|
+
const SIDEBAR_STYLES = [
|
|
24
|
+
{ value: 'dark', label: 'Oscuro', preview: '#1e1e2d' },
|
|
25
|
+
{ value: 'light', label: 'Claro', preview: '#ffffff' },
|
|
26
|
+
{ value: 'branded', label: 'Marca', preview: '#e67e22' },
|
|
27
|
+
];
|
|
28
|
+
const ICON_PALETTE = [
|
|
29
|
+
'📊', '👥', '📦', '💰', '🛒', '📄', '📋', '➕', '⚙️', '📈',
|
|
30
|
+
'🏢', '🏦', '🌐', '🚚', '✅', '🤝', '📅', '🔍', '📝', '🏷️',
|
|
31
|
+
'⭐', '🎯', '💼', '📱', '🖥️', '🔔', '🔒', '📂', '🗂️', '💡',
|
|
32
|
+
'🏠', '🍽️', '🏖️', '🕐', '👷', '🛡️', '🎓', '🏭', '✈️', '🔧',
|
|
33
|
+
];
|
|
34
|
+
const COLOR_PALETTE = [
|
|
35
|
+
'#e67e22', '#3498db', '#27ae60', '#e74c3c', '#9b59b6',
|
|
36
|
+
'#f39c12', '#1abc9c', '#34495e', '#e91e63', '#00bcd4',
|
|
37
|
+
'#ff6b6b', '#6bcb77', '#4ecdc4', '#45b7d1', '#96ceb4',
|
|
38
|
+
'#ffd93d', '#ff69b4', '#a29bfe', '#fd79a8', '#2d3436',
|
|
39
|
+
];
|
|
40
|
+
let ZsAppWizard = class ZsAppWizard extends LitElement {
|
|
41
|
+
constructor() {
|
|
42
|
+
super(...arguments);
|
|
43
|
+
this.initialConfig = null;
|
|
44
|
+
this.currentStep = 0;
|
|
45
|
+
this.selectedTemplate = null;
|
|
46
|
+
this.config = null;
|
|
47
|
+
this.editingNavIndex = -1;
|
|
48
|
+
this.showIconPicker = false;
|
|
49
|
+
this.iconPickerTarget = 'nav';
|
|
50
|
+
}
|
|
51
|
+
static { this.styles = [studioTokens, fieldBaseStyles, css `
|
|
52
|
+
:host { display: block; font-family: var(--zs-font-family); }
|
|
53
|
+
|
|
54
|
+
.wizard {
|
|
55
|
+
max-width: 900px; margin: 0 auto;
|
|
56
|
+
background: var(--zs-bg); border-radius: 12px;
|
|
57
|
+
border: 1px solid var(--zs-border);
|
|
58
|
+
overflow: hidden;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Steps bar */
|
|
62
|
+
.wizard-steps {
|
|
63
|
+
display: flex; background: var(--zs-bg-secondary);
|
|
64
|
+
border-bottom: 1px solid var(--zs-border); padding: 0;
|
|
65
|
+
}
|
|
66
|
+
.wizard-step {
|
|
67
|
+
flex: 1; display: flex; align-items: center; gap: 8px;
|
|
68
|
+
padding: 16px 20px; cursor: pointer;
|
|
69
|
+
color: var(--zs-text-muted); font-size: 13px;
|
|
70
|
+
border-bottom: 3px solid transparent;
|
|
71
|
+
transition: all 150ms;
|
|
72
|
+
}
|
|
73
|
+
.wizard-step:hover { color: var(--zs-text-secondary); }
|
|
74
|
+
.wizard-step--active {
|
|
75
|
+
color: var(--zs-primary); border-bottom-color: var(--zs-primary);
|
|
76
|
+
font-weight: 500;
|
|
77
|
+
}
|
|
78
|
+
.wizard-step--done { color: var(--zs-success); }
|
|
79
|
+
.wizard-step-icon { font-size: 18px; }
|
|
80
|
+
.wizard-step-title { white-space: nowrap; }
|
|
81
|
+
|
|
82
|
+
/* Body */
|
|
83
|
+
.wizard-body { padding: 32px; min-height: 400px; }
|
|
84
|
+
.wizard-title { font-size: 22px; font-weight: 600; margin: 0 0 4px; color: var(--zs-text); }
|
|
85
|
+
.wizard-desc { font-size: 14px; color: var(--zs-text-secondary); margin: 0 0 24px; }
|
|
86
|
+
|
|
87
|
+
/* Footer */
|
|
88
|
+
.wizard-footer {
|
|
89
|
+
display: flex; justify-content: space-between;
|
|
90
|
+
padding: 16px 32px; border-top: 1px solid var(--zs-border);
|
|
91
|
+
background: var(--zs-bg-secondary);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/* Template cards */
|
|
95
|
+
.template-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
|
|
96
|
+
.template-card {
|
|
97
|
+
padding: 24px; border: 2px solid var(--zs-border);
|
|
98
|
+
border-radius: 12px; cursor: pointer;
|
|
99
|
+
transition: all 200ms; text-align: center;
|
|
100
|
+
}
|
|
101
|
+
.template-card:hover { border-color: var(--zs-primary); transform: translateY(-2px); box-shadow: 0 4px 12px var(--zs-shadow); }
|
|
102
|
+
.template-card--selected { border-color: var(--zs-primary); background: var(--zs-primary-light); }
|
|
103
|
+
.template-icon { font-size: 40px; margin-bottom: 12px; }
|
|
104
|
+
.template-title { font-size: 16px; font-weight: 600; color: var(--zs-text); }
|
|
105
|
+
.template-desc { font-size: 13px; color: var(--zs-text-secondary); margin-top: 4px; }
|
|
106
|
+
|
|
107
|
+
/* Form groups */
|
|
108
|
+
.form-group { margin-bottom: 20px; }
|
|
109
|
+
.form-label { font-size: 13px; font-weight: 500; color: var(--zs-text); margin-bottom: 6px; display: block; }
|
|
110
|
+
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
|
|
111
|
+
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
|
|
112
|
+
|
|
113
|
+
/* Color picker grid */
|
|
114
|
+
.color-grid { display: flex; flex-wrap: wrap; gap: 8px; }
|
|
115
|
+
.color-swatch {
|
|
116
|
+
width: 36px; height: 36px; border-radius: 8px;
|
|
117
|
+
cursor: pointer; border: 3px solid transparent;
|
|
118
|
+
transition: all 150ms;
|
|
119
|
+
}
|
|
120
|
+
.color-swatch:hover { transform: scale(1.15); }
|
|
121
|
+
.color-swatch--selected { border-color: var(--zs-text); box-shadow: 0 0 0 2px white, 0 0 0 4px var(--zs-text); }
|
|
122
|
+
|
|
123
|
+
/* Sidebar style picker */
|
|
124
|
+
.style-grid { display: flex; gap: 12px; }
|
|
125
|
+
.style-option {
|
|
126
|
+
flex: 1; padding: 16px; text-align: center;
|
|
127
|
+
border: 2px solid var(--zs-border); border-radius: 8px;
|
|
128
|
+
cursor: pointer; transition: all 150ms;
|
|
129
|
+
}
|
|
130
|
+
.style-option:hover { border-color: var(--zs-primary); }
|
|
131
|
+
.style-option--selected { border-color: var(--zs-primary); background: var(--zs-primary-light); }
|
|
132
|
+
.style-preview {
|
|
133
|
+
width: 60px; height: 40px; border-radius: 4px;
|
|
134
|
+
margin: 0 auto 8px; border: 1px solid var(--zs-border);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* Nav editor */
|
|
138
|
+
.nav-list { border: 1px solid var(--zs-border); border-radius: 8px; overflow: hidden; }
|
|
139
|
+
.nav-item-row {
|
|
140
|
+
display: flex; align-items: center; gap: 8px;
|
|
141
|
+
padding: 10px 12px; border-bottom: 1px solid var(--zs-border);
|
|
142
|
+
font-size: 14px;
|
|
143
|
+
}
|
|
144
|
+
.nav-item-row:last-child { border-bottom: none; }
|
|
145
|
+
.nav-item-icon { font-size: 18px; cursor: pointer; }
|
|
146
|
+
.nav-item-title { flex: 1; }
|
|
147
|
+
.nav-item-actions { display: flex; gap: 4px; }
|
|
148
|
+
.nav-item-btn {
|
|
149
|
+
border: none; background: none; cursor: pointer;
|
|
150
|
+
font-size: 14px; padding: 2px 6px; border-radius: 4px;
|
|
151
|
+
color: var(--zs-text-muted); transition: all 100ms;
|
|
152
|
+
}
|
|
153
|
+
.nav-item-btn:hover { background: var(--zs-bg-hover); color: var(--zs-text); }
|
|
154
|
+
.nav-item-btn--danger:hover { color: var(--zs-danger); }
|
|
155
|
+
.add-btn {
|
|
156
|
+
display: flex; align-items: center; gap: 6px;
|
|
157
|
+
padding: 8px 16px; margin-top: 12px;
|
|
158
|
+
border: 1px dashed var(--zs-border); border-radius: 8px;
|
|
159
|
+
background: none; cursor: pointer;
|
|
160
|
+
font-family: var(--zs-font-family); font-size: 13px;
|
|
161
|
+
color: var(--zs-text-secondary); transition: all 150ms;
|
|
162
|
+
}
|
|
163
|
+
.add-btn:hover { border-color: var(--zs-primary); color: var(--zs-primary); }
|
|
164
|
+
|
|
165
|
+
/* Icon picker */
|
|
166
|
+
.icon-grid { display: flex; flex-wrap: wrap; gap: 4px; }
|
|
167
|
+
.icon-btn {
|
|
168
|
+
width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
|
|
169
|
+
border: 1px solid transparent; border-radius: 6px;
|
|
170
|
+
cursor: pointer; font-size: 18px; background: none;
|
|
171
|
+
transition: all 100ms;
|
|
172
|
+
}
|
|
173
|
+
.icon-btn:hover { background: var(--zs-bg-hover); border-color: var(--zs-border); }
|
|
174
|
+
.icon-btn--selected { background: var(--zs-primary-light); border-color: var(--zs-primary); }
|
|
175
|
+
|
|
176
|
+
/* Preview */
|
|
177
|
+
.preview-container {
|
|
178
|
+
border: 1px solid var(--zs-border); border-radius: 8px;
|
|
179
|
+
height: 500px; overflow: hidden;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* Buttons */
|
|
183
|
+
.btn {
|
|
184
|
+
padding: 10px 24px; border-radius: var(--zs-radius);
|
|
185
|
+
font-family: var(--zs-font-family); font-size: 14px;
|
|
186
|
+
font-weight: 500; cursor: pointer; border: 1px solid transparent;
|
|
187
|
+
transition: all 150ms;
|
|
188
|
+
}
|
|
189
|
+
.btn--primary { background: var(--zs-primary); color: white; }
|
|
190
|
+
.btn--primary:hover { background: var(--zs-primary-hover); }
|
|
191
|
+
.btn--secondary { background: var(--zs-bg); color: var(--zs-text); border-color: var(--zs-border); }
|
|
192
|
+
.btn--secondary:hover { background: var(--zs-bg-hover); }
|
|
193
|
+
.btn--success { background: var(--zs-success); color: white; }
|
|
194
|
+
.btn--success:hover { opacity: 0.9; }
|
|
195
|
+
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
196
|
+
`]; }
|
|
197
|
+
connectedCallback() {
|
|
198
|
+
super.connectedCallback();
|
|
199
|
+
if (this.initialConfig) {
|
|
200
|
+
this.config = structuredClone(this.initialConfig);
|
|
201
|
+
this.currentStep = 1; // skip template selection
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
// ─── Navigation ───────────────────────────────────
|
|
205
|
+
canNext() {
|
|
206
|
+
if (this.currentStep === 0)
|
|
207
|
+
return this.selectedTemplate != null || this.config != null;
|
|
208
|
+
return this.config != null;
|
|
209
|
+
}
|
|
210
|
+
next() {
|
|
211
|
+
if (this.currentStep === 0 && !this.config && this.selectedTemplate) {
|
|
212
|
+
this.config = getAppTemplate(this.selectedTemplate);
|
|
213
|
+
}
|
|
214
|
+
if (this.currentStep < STEPS.length - 1)
|
|
215
|
+
this.currentStep++;
|
|
216
|
+
}
|
|
217
|
+
prev() {
|
|
218
|
+
if (this.currentStep > 0)
|
|
219
|
+
this.currentStep--;
|
|
220
|
+
}
|
|
221
|
+
finish() {
|
|
222
|
+
if (!this.config)
|
|
223
|
+
return;
|
|
224
|
+
this.dispatchEvent(new CustomEvent('wizard-complete', {
|
|
225
|
+
detail: { config: structuredClone(this.config) },
|
|
226
|
+
bubbles: true, composed: true,
|
|
227
|
+
}));
|
|
228
|
+
}
|
|
229
|
+
// ─── Render ───────────────────────────────────────
|
|
230
|
+
render() {
|
|
231
|
+
return html `
|
|
232
|
+
<div class="wizard">
|
|
233
|
+
<div class="wizard-steps">
|
|
234
|
+
${STEPS.map((step, i) => html `
|
|
235
|
+
<div class="wizard-step ${i === this.currentStep ? 'wizard-step--active' : i < this.currentStep ? 'wizard-step--done' : ''}"
|
|
236
|
+
@click="${() => { if (i <= this.currentStep || this.config)
|
|
237
|
+
this.currentStep = i; }}">
|
|
238
|
+
<span class="wizard-step-icon">${i < this.currentStep ? '✓' : step.icon}</span>
|
|
239
|
+
<span class="wizard-step-title">${step.title}</span>
|
|
240
|
+
</div>
|
|
241
|
+
`)}
|
|
242
|
+
</div>
|
|
243
|
+
|
|
244
|
+
<div class="wizard-body">
|
|
245
|
+
<h2 class="wizard-title">${STEPS[this.currentStep].title}</h2>
|
|
246
|
+
<p class="wizard-desc">${STEPS[this.currentStep].description}</p>
|
|
247
|
+
|
|
248
|
+
${this.currentStep === 0 ? this.renderTemplateStep() :
|
|
249
|
+
this.currentStep === 1 ? this.renderBrandingStep() :
|
|
250
|
+
this.currentStep === 2 ? this.renderNavStep() :
|
|
251
|
+
this.currentStep === 3 ? this.renderPagesStep() :
|
|
252
|
+
this.renderPreviewStep()}
|
|
253
|
+
</div>
|
|
254
|
+
|
|
255
|
+
<div class="wizard-footer">
|
|
256
|
+
<button class="btn btn--secondary" ?disabled="${this.currentStep === 0}" @click="${this.prev}">Anterior</button>
|
|
257
|
+
${this.currentStep < STEPS.length - 1
|
|
258
|
+
? html `<button class="btn btn--primary" ?disabled="${!this.canNext()}" @click="${this.next}">Siguiente</button>`
|
|
259
|
+
: html `<button class="btn btn--success" @click="${this.finish}">Crear Aplicacion</button>`}
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
`;
|
|
263
|
+
}
|
|
264
|
+
// ─── Step 1: Template Selection ──────────────────
|
|
265
|
+
renderTemplateStep() {
|
|
266
|
+
const templates = listAppTemplates();
|
|
267
|
+
return html `
|
|
268
|
+
<div class="template-grid">
|
|
269
|
+
${templates.map(t => html `
|
|
270
|
+
<div class="template-card ${this.selectedTemplate === t.id ? 'template-card--selected' : ''}"
|
|
271
|
+
@click="${() => { this.selectedTemplate = t.id; }}">
|
|
272
|
+
<div class="template-icon">${t.icon}</div>
|
|
273
|
+
<div class="template-title">${t.title}</div>
|
|
274
|
+
<div class="template-desc">${t.description}</div>
|
|
275
|
+
</div>
|
|
276
|
+
`)}
|
|
277
|
+
</div>
|
|
278
|
+
`;
|
|
279
|
+
}
|
|
280
|
+
// ─── Step 2: Branding ─────────────────────────────
|
|
281
|
+
renderBrandingStep() {
|
|
282
|
+
if (!this.config)
|
|
283
|
+
return nothing;
|
|
284
|
+
const b = this.config.branding;
|
|
285
|
+
return html `
|
|
286
|
+
<div class="form-row">
|
|
287
|
+
<div class="form-group">
|
|
288
|
+
<label class="form-label">Nombre de la App</label>
|
|
289
|
+
<input class="zs-input" .value="${b.title ?? ''}" @input="${(e) => { this.config.branding.title = e.target.value; this.requestUpdate(); }}" />
|
|
290
|
+
</div>
|
|
291
|
+
<div class="form-group">
|
|
292
|
+
<label class="form-label">Subtitulo</label>
|
|
293
|
+
<input class="zs-input" .value="${b.subtitle ?? ''}" @input="${(e) => { this.config.branding.subtitle = e.target.value; this.requestUpdate(); }}" />
|
|
294
|
+
</div>
|
|
295
|
+
</div>
|
|
296
|
+
|
|
297
|
+
<div class="form-group">
|
|
298
|
+
<label class="form-label">Color Principal</label>
|
|
299
|
+
<div class="color-grid">
|
|
300
|
+
${COLOR_PALETTE.map(color => html `
|
|
301
|
+
<div class="color-swatch ${b.primaryColor === color ? 'color-swatch--selected' : ''}"
|
|
302
|
+
style="background: ${color}"
|
|
303
|
+
@click="${() => { this.config.branding.primaryColor = color; this.requestUpdate(); }}"
|
|
304
|
+
></div>
|
|
305
|
+
`)}
|
|
306
|
+
</div>
|
|
307
|
+
</div>
|
|
308
|
+
|
|
309
|
+
<div class="form-group">
|
|
310
|
+
<label class="form-label">Estilo del Sidebar</label>
|
|
311
|
+
<div class="style-grid">
|
|
312
|
+
${SIDEBAR_STYLES.map(s => html `
|
|
313
|
+
<div class="style-option ${b.sidebarStyle === s.value ? 'style-option--selected' : ''}"
|
|
314
|
+
@click="${() => { this.config.branding.sidebarStyle = s.value; this.requestUpdate(); }}">
|
|
315
|
+
<div class="style-preview" style="background: ${s.preview}"></div>
|
|
316
|
+
<div style="font-size:13px;font-weight:500;">${s.label}</div>
|
|
317
|
+
</div>
|
|
318
|
+
`)}
|
|
319
|
+
</div>
|
|
320
|
+
</div>
|
|
321
|
+
|
|
322
|
+
<div class="form-group">
|
|
323
|
+
<label class="form-label">URL del Logo (opcional)</label>
|
|
324
|
+
<input class="zs-input" .value="${b.logo ?? ''}" placeholder="https://..." @input="${(e) => { this.config.branding.logo = e.target.value; this.requestUpdate(); }}" />
|
|
325
|
+
</div>
|
|
326
|
+
`;
|
|
327
|
+
}
|
|
328
|
+
// ─── Step 3: Navigation Editor ────────────────────
|
|
329
|
+
renderNavStep() {
|
|
330
|
+
if (!this.config)
|
|
331
|
+
return nothing;
|
|
332
|
+
return html `
|
|
333
|
+
<div class="nav-list">
|
|
334
|
+
${this.config.navigation.map((item, i) => html `
|
|
335
|
+
<div class="nav-item-row">
|
|
336
|
+
<span class="nav-item-icon" @click="${() => { this.editingNavIndex = i; this.showIconPicker = !this.showIconPicker; }}">${item.icon ?? (item.kind === 'header' ? '📌' : item.kind === 'divider' ? '—' : '📄')}</span>
|
|
337
|
+
${item.kind === 'divider'
|
|
338
|
+
? html `<span class="nav-item-title" style="color:var(--zs-text-muted);font-style:italic;">Separador</span>`
|
|
339
|
+
: html `<input class="zs-input" style="height:32px;font-size:13px;" .value="${item.title ?? ''}" @input="${(e) => { this.config.navigation[i].title = e.target.value; this.requestUpdate(); }}" />`}
|
|
340
|
+
<div class="nav-item-actions">
|
|
341
|
+
<button class="nav-item-btn" title="Subir" @click="${() => this.moveNav(i, -1)}">↑</button>
|
|
342
|
+
<button class="nav-item-btn" title="Bajar" @click="${() => this.moveNav(i, 1)}">↓</button>
|
|
343
|
+
<button class="nav-item-btn nav-item-btn--danger" title="Eliminar" @click="${() => { this.config.navigation.splice(i, 1); this.requestUpdate(); }}">✕</button>
|
|
344
|
+
</div>
|
|
345
|
+
</div>
|
|
346
|
+
`)}
|
|
347
|
+
</div>
|
|
348
|
+
|
|
349
|
+
${this.showIconPicker ? html `
|
|
350
|
+
<div style="margin-top:12px;padding:12px;border:1px solid var(--zs-border);border-radius:8px;">
|
|
351
|
+
<div style="font-size:12px;color:var(--zs-text-secondary);margin-bottom:8px;">Selecciona un icono:</div>
|
|
352
|
+
<div class="icon-grid">
|
|
353
|
+
${ICON_PALETTE.map(icon => html `
|
|
354
|
+
<button class="icon-btn" @click="${() => {
|
|
355
|
+
if (this.editingNavIndex >= 0) {
|
|
356
|
+
this.config.navigation[this.editingNavIndex].icon = icon;
|
|
357
|
+
this.showIconPicker = false;
|
|
358
|
+
this.requestUpdate();
|
|
359
|
+
}
|
|
360
|
+
}}">${icon}</button>
|
|
361
|
+
`)}
|
|
362
|
+
</div>
|
|
363
|
+
</div>
|
|
364
|
+
` : ''}
|
|
365
|
+
|
|
366
|
+
<div style="display:flex;gap:8px;">
|
|
367
|
+
<button class="add-btn" @click="${() => this.addNavItem('page')}">➕ Pagina</button>
|
|
368
|
+
<button class="add-btn" @click="${() => this.addNavItem('header')}">📌 Seccion</button>
|
|
369
|
+
<button class="add-btn" @click="${() => this.addNavItem('divider')}">— Separador</button>
|
|
370
|
+
</div>
|
|
371
|
+
`;
|
|
372
|
+
}
|
|
373
|
+
addNavItem(kind) {
|
|
374
|
+
if (!this.config)
|
|
375
|
+
return;
|
|
376
|
+
if (kind === 'divider') {
|
|
377
|
+
this.config.navigation.push({ kind: 'divider' });
|
|
378
|
+
}
|
|
379
|
+
else if (kind === 'header') {
|
|
380
|
+
this.config.navigation.push({ kind: 'header', title: 'Nueva Seccion' });
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
const id = `page-${Date.now()}`;
|
|
384
|
+
this.config.navigation.push({ segment: id, title: 'Nueva Pagina', icon: '📄' });
|
|
385
|
+
// Auto-create page
|
|
386
|
+
this.config.pages.push({ id, segment: id, title: 'Nueva Pagina', content: 'empty' });
|
|
387
|
+
}
|
|
388
|
+
this.requestUpdate();
|
|
389
|
+
}
|
|
390
|
+
moveNav(index, dir) {
|
|
391
|
+
if (!this.config)
|
|
392
|
+
return;
|
|
393
|
+
const newIndex = index + dir;
|
|
394
|
+
if (newIndex < 0 || newIndex >= this.config.navigation.length)
|
|
395
|
+
return;
|
|
396
|
+
const items = this.config.navigation;
|
|
397
|
+
[items[index], items[newIndex]] = [items[newIndex], items[index]];
|
|
398
|
+
this.requestUpdate();
|
|
399
|
+
}
|
|
400
|
+
// ─── Step 4: Pages ────────────────────────────────
|
|
401
|
+
renderPagesStep() {
|
|
402
|
+
if (!this.config)
|
|
403
|
+
return nothing;
|
|
404
|
+
return html `
|
|
405
|
+
<div class="nav-list">
|
|
406
|
+
${this.config.pages.map((page, i) => html `
|
|
407
|
+
<div class="nav-item-row">
|
|
408
|
+
<span class="nav-item-icon">${this.getContentIcon(page.content)}</span>
|
|
409
|
+
<div style="flex:1;">
|
|
410
|
+
<input class="zs-input" style="height:30px;font-size:13px;margin-bottom:4px;" .value="${page.title}" @input="${(e) => { this.config.pages[i].title = e.target.value; this.requestUpdate(); }}" />
|
|
411
|
+
<div style="display:flex;gap:8px;align-items:center;">
|
|
412
|
+
<span style="font-size:11px;color:var(--zs-text-muted);">/${page.segment}</span>
|
|
413
|
+
<select style="font-size:11px;padding:2px 6px;border:1px solid var(--zs-border);border-radius:4px;" .value="${page.content}" @change="${(e) => { this.config.pages[i].content = e.target.value; this.requestUpdate(); }}">
|
|
414
|
+
<option value="empty">Vacia</option>
|
|
415
|
+
<option value="cards">Cards/Dashboard</option>
|
|
416
|
+
<option value="datagrid">Grid de Datos</option>
|
|
417
|
+
<option value="schema">Formulario</option>
|
|
418
|
+
<option value="chart">Graficos</option>
|
|
419
|
+
<option value="html">HTML</option>
|
|
420
|
+
<option value="iframe">iFrame</option>
|
|
421
|
+
<option value="tabs">Tabs</option>
|
|
422
|
+
<option value="custom">Custom</option>
|
|
423
|
+
</select>
|
|
424
|
+
</div>
|
|
425
|
+
</div>
|
|
426
|
+
<button class="nav-item-btn nav-item-btn--danger" @click="${() => { this.config.pages.splice(i, 1); this.requestUpdate(); }}">✕</button>
|
|
427
|
+
</div>
|
|
428
|
+
`)}
|
|
429
|
+
</div>
|
|
430
|
+
<button class="add-btn" @click="${() => {
|
|
431
|
+
const id = `page-${Date.now()}`;
|
|
432
|
+
this.config.pages.push({ id, segment: id, title: 'Nueva Pagina', content: 'empty' });
|
|
433
|
+
this.requestUpdate();
|
|
434
|
+
}}">➕ Nueva Pagina</button>
|
|
435
|
+
`;
|
|
436
|
+
}
|
|
437
|
+
getContentIcon(type) {
|
|
438
|
+
const icons = {
|
|
439
|
+
cards: '🏠', datagrid: '📊', schema: '📝', chart: '📈',
|
|
440
|
+
html: '🌐', iframe: '🖼️', tabs: '📑', empty: '📄',
|
|
441
|
+
custom: '🧩', split: '📐', report: '📋',
|
|
442
|
+
};
|
|
443
|
+
return icons[type] ?? '📄';
|
|
444
|
+
}
|
|
445
|
+
// ─── Step 5: Preview ──────────────────────────────
|
|
446
|
+
renderPreviewStep() {
|
|
447
|
+
if (!this.config)
|
|
448
|
+
return nothing;
|
|
449
|
+
return html `
|
|
450
|
+
<div style="display:flex;gap:16px;margin-bottom:16px;">
|
|
451
|
+
<div style="flex:1;">
|
|
452
|
+
<div style="font-size:13px;color:var(--zs-text-secondary);margin-bottom:4px;">Resumen:</div>
|
|
453
|
+
<div style="font-size:14px;"><strong>${this.config.branding.title}</strong> — ${this.config.pages.length} paginas, ${this.config.navigation.filter(n => n.kind !== 'divider' && n.kind !== 'header').length} items en menu</div>
|
|
454
|
+
</div>
|
|
455
|
+
<button class="btn btn--secondary" @click="${() => {
|
|
456
|
+
const json = JSON.stringify(this.config, null, 2);
|
|
457
|
+
navigator.clipboard.writeText(json).then(() => {
|
|
458
|
+
alert('JSON copiado al portapapeles');
|
|
459
|
+
});
|
|
460
|
+
}}">📋 Copiar JSON</button>
|
|
461
|
+
</div>
|
|
462
|
+
<div class="preview-container">
|
|
463
|
+
<zentto-studio-app .config="${this.config}"></zentto-studio-app>
|
|
464
|
+
</div>
|
|
465
|
+
`;
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
__decorate([
|
|
469
|
+
property({ type: Object })
|
|
470
|
+
], ZsAppWizard.prototype, "initialConfig", void 0);
|
|
471
|
+
__decorate([
|
|
472
|
+
state()
|
|
473
|
+
], ZsAppWizard.prototype, "currentStep", void 0);
|
|
474
|
+
__decorate([
|
|
475
|
+
state()
|
|
476
|
+
], ZsAppWizard.prototype, "selectedTemplate", void 0);
|
|
477
|
+
__decorate([
|
|
478
|
+
state()
|
|
479
|
+
], ZsAppWizard.prototype, "config", void 0);
|
|
480
|
+
__decorate([
|
|
481
|
+
state()
|
|
482
|
+
], ZsAppWizard.prototype, "editingNavIndex", void 0);
|
|
483
|
+
__decorate([
|
|
484
|
+
state()
|
|
485
|
+
], ZsAppWizard.prototype, "showIconPicker", void 0);
|
|
486
|
+
__decorate([
|
|
487
|
+
state()
|
|
488
|
+
], ZsAppWizard.prototype, "iconPickerTarget", void 0);
|
|
489
|
+
ZsAppWizard = __decorate([
|
|
490
|
+
customElement('zs-app-wizard')
|
|
491
|
+
], ZsAppWizard);
|
|
492
|
+
export { ZsAppWizard };
|
|
493
|
+
//# sourceMappingURL=zs-app-wizard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zs-app-wizard.js","sourceRoot":"","sources":["../../src/designer/zs-app-wizard.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,6DAA6D;AAC7D,2EAA2E;;;;;;;AAE3E,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGvE,uCAAuC;AACvC,OAAO,yBAAyB,CAAC;AASjC,MAAM,KAAK,GAAiB;IAC1B,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,0BAA0B,EAAE;IAC3F,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,2BAA2B,EAAE;IACxF,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,sBAAsB,EAAE;IACpF,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,4BAA4B,EAAE;IACxF,EAAE,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE;CACxF,CAAC;AAEF,MA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zentto-studio-renderer.js';
|
|
4
|
+
export declare class ZsPageDesigner extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
schema: StudioSchema | null;
|
|
7
|
+
data: Record<string, unknown>;
|
|
8
|
+
private selectedFieldId;
|
|
9
|
+
private viewMode;
|
|
10
|
+
private dragType;
|
|
11
|
+
private renderKey;
|
|
12
|
+
private get selectedField();
|
|
13
|
+
private get selectedSectionIndex();
|
|
14
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
15
|
+
private renderToolbox;
|
|
16
|
+
private renderCanvas;
|
|
17
|
+
private renderDesignView;
|
|
18
|
+
private renderProperties;
|
|
19
|
+
private addField;
|
|
20
|
+
private addFieldToSection;
|
|
21
|
+
private removeField;
|
|
22
|
+
private moveField;
|
|
23
|
+
private emitChange;
|
|
24
|
+
}
|
|
25
|
+
declare global {
|
|
26
|
+
interface HTMLElementTagNameMap {
|
|
27
|
+
'zs-page-designer': ZsPageDesigner;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=zs-page-designer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zs-page-designer.d.ts","sourceRoot":"","sources":["../../src/designer/zs-page-designer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAGrD,OAAO,KAAK,EAAE,YAAY,EAAmC,MAAM,qBAAqB,CAAC;AAIzF,OAAO,8BAA8B,CAAC;AAEtC,qBACa,cAAe,SAAQ,UAAU;IAC5C,MAAM,CAAC,MAAM,4BAuJV;IAEyB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAQ;IACnC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAM;IAEtD,OAAO,CAAC,eAAe,CAAuB;IAC9C,OAAO,CAAC,QAAQ,CAA2C;IAC3D,OAAO,CAAC,QAAQ,CAA0B;IAC1C,OAAO,CAAC,SAAS,CAAK;IAE/B,OAAO,KAAK,aAAa,GAOxB;IAED,OAAO,KAAK,oBAAoB,GAG/B;IAID,MAAM;IAYN,OAAO,CAAC,aAAa;IAmCrB,OAAO,CAAC,YAAY;IAsBpB,OAAO,CAAC,gBAAgB;IA2CxB,OAAO,CAAC,gBAAgB;IA8FxB,OAAO,CAAC,QAAQ;IAWhB,OAAO,CAAC,iBAAiB;IAgBzB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,UAAU;CAQnB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
|