@owear/cli 0.1.3 → 0.1.5

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.
@@ -31,7 +31,6 @@
31
31
 
32
32
  <main class="page">
33
33
  <section class="hero">
34
- <span class="eyebrow">Owear</span>
35
34
  <h1>__APP_NAME__</h1>
36
35
  <p class="lead">
37
36
  Frontend web, sistema nativo. Estos botones llaman <strong>directo</strong> a los
@@ -39,6 +38,28 @@
39
38
  </p>
40
39
  <div class="actions">
41
40
  <button class="btn btn--primary" data-action="open">Abrir archivo…</button>
41
+ <button class="btn" data-action="multi">Abrir varios…</button>
42
+ <button class="btn" data-action="save">Guardar como…</button>
43
+ <button class="btn" data-action="capture">Capturar página</button>
44
+ <button class="btn" data-action="nimage">nativeImage</button>
45
+ <button class="btn" data-action="menu">Menú contextual</button>
46
+ <button class="btn" data-action="tray">Tray</button>
47
+ <button class="btn btn--ghost" data-action="theme-system">Tema: sistema</button>
48
+ <button class="btn btn--ghost" data-action="theme-light">Claro</button>
49
+ <button class="btn btn--ghost" data-action="theme-dark">Oscuro</button>
50
+ <button class="btn" data-action="pdf">Exportar PDF</button>
51
+ <button class="btn" data-action="print">Imprimir</button>
52
+ <button class="btn" data-action="child">Ventana 2</button>
53
+ <button class="btn" data-action="ontop">AlwaysOnTop</button>
54
+ <button class="btn" data-action="prog">Progreso</button>
55
+ <button class="btn" data-action="ignore">Ignorar ratón</button>
56
+ <button class="btn" data-action="wins">Ventanas</button>
57
+ <button class="btn" data-action="screens">Pantallas</button>
58
+ <button class="btn" data-action="nearest">Monitor del cursor</button>
59
+ <button class="btn btn--ghost" data-action="power-on">Escuchar energía</button>
60
+ <button class="btn btn--ghost" data-action="blocker">Bloqueador ON/OFF</button>
61
+ <button class="btn btn--ghost" data-action="idle">Idle</button>
62
+ <button class="btn" data-action="ask">Diálogo con botones</button>
42
63
  <button class="btn" data-action="notify">Notificar</button>
43
64
  <button class="btn" data-action="copy">Copiar ruta</button>
44
65
  <button class="btn" data-action="reveal">Mostrar en carpeta</button>
@@ -46,37 +67,105 @@
46
67
  </div>
47
68
  </section>
48
69
 
49
- <section class="grid">
50
- <article class="card">
51
- <header class="card__head">
52
- <h2>Entorno</h2>
53
- <span class="badge" id="env-window">—</span>
54
- </header>
55
- <dl class="kv">
56
- <div><dt>Plataforma</dt><dd id="env-platform">—</dd></div>
57
- <div><dt>Motor</dt><dd id="env-engine">—</dd></div>
58
- <div><dt>Escala</dt><dd id="env-dpr">—</dd></div>
59
- </dl>
60
- <p class="ua" id="env-ua">—</p>
61
- </article>
70
+ <!-- Contenedor con fondo propio que agrupa las cards -->
71
+ <section class="board">
72
+ <section class="grid">
73
+ <article class="card">
74
+ <header class="card__head">
75
+ <h2>Entorno</h2>
76
+ <span class="badge" id="env-window">—</span>
77
+ </header>
78
+ <dl class="kv">
79
+ <div><dt>Plataforma</dt><dd id="env-platform">—</dd></div>
80
+ <div><dt>Motor</dt><dd id="env-engine">—</dd></div>
81
+ <div><dt>Escala</dt><dd id="env-dpr">—</dd></div>
82
+ </dl>
83
+ <p class="ua" id="env-ua">—</p>
84
+ </article>
62
85
 
63
- <article class="card card--grow">
64
- <header class="card__head">
65
- <h2>Consola</h2>
66
- <button class="linkbtn" data-action="clear">Limpiar</button>
67
- </header>
68
- <pre id="console" class="console">Listo. Pulsa «Abrir archivo…» para invocar un módulo nativo.</pre>
69
- </article>
70
- </section>
86
+ <article class="card">
87
+ <header class="card__head">
88
+ <h2>App <span class="hint">C1</span></h2>
89
+ <span class="badge" id="app-version">—</span>
90
+ </header>
91
+ <dl class="kv">
92
+ <div><dt>Nombre</dt><dd id="app-name">—</dd></div>
93
+ <div><dt>Empaquetada</dt><dd id="app-packaged">—</dd></div>
94
+ <div><dt>userData</dt><dd id="app-path-userData" class="mono">—</dd></div>
95
+ <div><dt>exe</dt><dd id="app-path-exe" class="mono">—</dd></div>
96
+ <div><dt>appPath</dt><dd id="app-path-appPath" class="mono">—</dd></div>
97
+ </dl>
98
+ </article>
71
99
 
72
- <section class="card">
73
- <header class="card__head"><h2>Cómo funciona</h2></header>
74
- <p class="hint">
75
- Cada botón invoca un módulo nativo con <code>ow.invoke()</code>.
76
- </p>
77
- <pre class="code"><code>const path = await ow.invoke('dialog', 'open', 'open', 'Abrir archivo')
100
+ <article class="card card--grow">
101
+ <header class="card__head">
102
+ <h2>Consola</h2>
103
+ <button class="linkbtn" data-action="clear">Limpiar</button>
104
+ </header>
105
+ <pre id="console" class="console">Listo. Pulsa «Abrir archivo…» para invocar un módulo nativo.</pre>
106
+ </article>
107
+ </section>
108
+
109
+ <section class="card">
110
+ <header class="card__head"><h2>Cómo funciona</h2></header>
111
+ <p class="hint">
112
+ Cada botón invoca un módulo nativo con <code>ow.invoke()</code>.
113
+ </p>
114
+ <pre class="code"><code>const path = await ow.invoke('dialog', 'open', 'open', 'Abrir archivo')
78
115
  const text = await ow.invoke('fs', 'readText', path)
79
116
  await ow.invoke('notification', 'show', 'Listo', 'Leídos ' + text.length + ' bytes')</code></pre>
117
+ </section>
118
+ </section>
119
+
120
+ <!-- C10: pantallas (multi-monitor) y energía -->
121
+ <section class="board">
122
+ <header class="card__head">
123
+ <h2>Pantallas y energía <span class="hint">C10</span></h2>
124
+ <span class="badge" id="mon-count">—</span>
125
+ </header>
126
+ <section class="grid">
127
+ <article class="card">
128
+ <header class="card__head">
129
+ <h2>Monitores</h2>
130
+ <span class="badge" id="mon-primary">—</span>
131
+ </header>
132
+ <div id="mon-map" class="monmap">
133
+ <span class="monmap__hint">Pulsa «Pantallas» para mapear los monitores.</span>
134
+ </div>
135
+ <div id="mon-list" class="monlist"></div>
136
+ </article>
137
+ <article class="card card--grow">
138
+ <header class="card__head">
139
+ <h2>Energía</h2>
140
+ <span class="badge" id="power-status">—</span>
141
+ </header>
142
+ <p class="hint">
143
+ Escucha suspend/resume, AC/batería y bloqueo de sesión. El bloqueador
144
+ impide que se apague la pantalla.
145
+ </p>
146
+ <pre id="power-log" class="console console--short">Sin eventos todavía.</pre>
147
+ </article>
148
+ </section>
149
+ </section>
150
+
151
+ <!-- Webview embebida: un navegador nativo hijo de la ventana (proceso
152
+ propio), controlado por la API webview.* y colocado sobre #wv-slot. -->
153
+ <section class="board">
154
+ <header class="card__head">
155
+ <h2>Navegador embebido</h2>
156
+ <span class="badge" id="wv-status">—</span>
157
+ </header>
158
+ <div class="browser">
159
+ <div class="browser__bar">
160
+ <button class="iconbtn" id="wv-back" title="Atrás" aria-label="Atrás">‹</button>
161
+ <button class="iconbtn" id="wv-fwd" title="Adelante" aria-label="Adelante">›</button>
162
+ <button class="iconbtn" id="wv-reload" title="Recargar" aria-label="Recargar">⟳</button>
163
+ <input id="wv-url" class="browser__url" type="text"
164
+ value="https://scrakk.art" spellcheck="false" />
165
+ <button class="btn btn--primary" id="wv-go">Ir</button>
166
+ </div>
167
+ <div id="wv-slot" class="browser__slot"></div>
168
+ </div>
80
169
  </section>
81
170
  </main>
82
171
 
@@ -3,7 +3,7 @@
3
3
  "version": "0.1.0",
4
4
  "private": true,
5
5
  "type": "module",
6
- "description": "App de escritorio construida con Owear.",
6
+ "description": "App de escritorio construida con Owear (Starter: titlebar propia, módulos nativos y UI real).",
7
7
  "scripts": {
8
8
  "dev": "ow dev",
9
9
  "build": "ow build",
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">
2
+ <rect width="64" height="64" rx="14" fill="#282c34"/>
3
+ <rect x="18" y="18" width="28" height="28" rx="7" fill="#d3869b"/>
4
+ </svg>
@@ -2,13 +2,21 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  //
4
4
  // Tipos de la API que el kernel inyecta en cada documento (`window.ow`).
5
- // Mantenidos a mano contra docs/API.md §1.
5
+ // Types maintained by hand against docs/api/renderer.md.
6
6
 
7
7
  export {}
8
8
 
9
9
  declare global {
10
10
  interface Window {
11
11
  __owWindowId: number
12
+ /** Presente cuando la ventana usa `titleBarOverlay` (botones nativos). */
13
+ __owTitlebarOverlay?: {
14
+ enabled: boolean
15
+ height: number
16
+ width: number
17
+ top?: number
18
+ right?: number
19
+ }
12
20
  ow: {
13
21
  invoke(module: string, fn: string, ...args: unknown[]): Promise<unknown>
14
22
  invokeSync(module: string, fn: string, ...args: unknown[]): unknown