voirjs-native 1.0.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/.tabrisignore ADDED
@@ -0,0 +1,7 @@
1
+ .eslintrc
2
+ tsconfig.json
3
+ .gitignore
4
+ .vscode/
5
+ node_modules/**/*.d.ts
6
+ node_modules/tabris/ClientMock.js
7
+ README.md
package/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2023, hicode
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md ADDED
@@ -0,0 +1,450 @@
1
+
2
+ <p align="center" style="text-align:center">
3
+ <img src="https://raw.githubusercontent.com/everskyblue/voir-native/main/logo-voir.png" alt="voir native" title="voir native">
4
+ </p>
5
+ <h1 align="center">Voir Native</h1>
6
+
7
+ <br>
8
+ <p align="center">
9
+ Framework de arquitectura y componentes para Tabris.js.<br>
10
+ Voir Native proporciona una experiencia moderna inspirada en Android Jetpack y Material Design, incorporando navegación avanzada, gestión de pantallas, fragmentos, preferencias, diálogos y estado reactivo.
11
+ </p>
12
+
13
+ los puedes ver la documentacion de los temas [aquí](./theme.md)
14
+
15
+ ### Características
16
+
17
+ - Navegación declarativa.
18
+ - Pantallas (Screen).
19
+ - Fragmentos reutilizables.
20
+ - Drawer Navigation.
21
+ - Menús y acciones.
22
+ - Sistema de preferencias.
23
+ - Modales y notificaciones.
24
+ - Arquitectura modular.
25
+ - JSX nativo.
26
+ - Gestión automática del ciclo de vida.
27
+
28
+ ---
29
+
30
+ ### Instalación
31
+ ```
32
+ npm install voir-native
33
+ ```
34
+ ---
35
+
36
+ ### Importación
37
+ ```
38
+ import {
39
+ Screen,
40
+
41
+ NavigationView,
42
+ NavigationDrawer,
43
+ NavItem,
44
+ Action,
45
+
46
+ Fragment,
47
+ FragmentManager,
48
+ FragmentHost,
49
+ getFragmentManager,
50
+
51
+ PreferenceScreen,
52
+ ListPreference,
53
+ CheckBoxPreference,
54
+ SwitchPreference,
55
+ TextPreference,
56
+
57
+ Group,
58
+
59
+ Modal,
60
+ Toast,
61
+ Snackbar
62
+
63
+ } from 'voir-native';
64
+ ```
65
+ ---
66
+
67
+ ### Screen
68
+
69
+ Una Screen representa una pantalla completa de la aplicación.
70
+ ```jsx
71
+ class HomeScreen extends Screen {
72
+
73
+ title = 'Inicio';
74
+
75
+ render() {
76
+ return (
77
+ <TextView text='Bienvenido'/>
78
+ );
79
+ }
80
+
81
+ }
82
+ ```
83
+ ---
84
+
85
+ ### Título
86
+
87
+ El título se muestra automáticamente en la AppBar.
88
+
89
+ title = 'Configuración';
90
+
91
+ ---
92
+
93
+ NavigationView
94
+
95
+ Contenedor principal encargado de gestionar la navegación de la aplicación.
96
+ ```js
97
+ contentView.append(
98
+ <NavigationView drawer navDrawer={callback} menus={actions} />
99
+ );
100
+ ```
101
+ ---
102
+
103
+ ### NavigationDrawer
104
+
105
+ Permite mostrar navegación lateral dentro del drawer.
106
+ ```jsx
107
+ <NavigationDrawer>
108
+ <NavItem
109
+ icon={Icons.home}
110
+ label='Inicio'
111
+ />
112
+
113
+ <NavItem
114
+ icon={Icons.settings}
115
+ label='Configuración'
116
+ />
117
+ </NavigationDrawer>
118
+ ```
119
+ ---
120
+
121
+ ### NavItem
122
+
123
+ Elemento de navegación utilizado dentro de NavigationDrawer.
124
+ ```jsx
125
+ <NavItem
126
+ title='Perfil'
127
+ icon={Icons.person}
128
+ badge="2"
129
+ id="profile"
130
+ host={ProfileFragment}
131
+ />
132
+ ```
133
+ ---
134
+
135
+ Action
136
+
137
+ Acciones mostradas en la AppBar.
138
+ ```js
139
+ actions = [
140
+ new Action({
141
+ id: 'search',
142
+ icon: Icons.search
143
+ })
144
+ ];
145
+ ```
146
+ ---
147
+
148
+ ### Fragment
149
+
150
+ Los Fragment permiten reutilizar vistas dentro de una Screen.
151
+ ```jsx
152
+ class UserFragment extends Fragment {
153
+ title="Usuario"
154
+ render() {
155
+ return (
156
+ <TextView text='Usuario'/>
157
+ );
158
+ }
159
+
160
+ }
161
+ ```
162
+ ---
163
+
164
+ ### FragmentHost
165
+
166
+ Contenedor visual donde se renderizan los Fragment.
167
+ ```jsx
168
+ <FragmentHost defaultHost />
169
+ ```
170
+ ---
171
+
172
+ ### FragmentManager
173
+
174
+ Administrador encargado de las transiciones y pila de Fragment.
175
+ ```js
176
+ const manager = new FragmentManager();
177
+ ```
178
+ ---
179
+
180
+ Mostrar Fragment
181
+ ```js
182
+ manager.push(
183
+ new UserFragment()
184
+ );
185
+ ```
186
+ ---
187
+
188
+ Reemplazar
189
+ ```js
190
+ manager.replace(
191
+ new SettingsFragment()
192
+ );
193
+ ```
194
+ ---
195
+
196
+ Cerrar Fragment
197
+ ```js
198
+ manager.pop();
199
+ ```
200
+ ---
201
+
202
+ getFragmentManager
203
+
204
+ Obtiene el administrador asociado a una vista.
205
+ ```js
206
+ const manager = getFragmentManager(this);
207
+ ```
208
+ ---
209
+
210
+ ### PreferenceScreen
211
+
212
+ Pantalla especializada para configuración.
213
+ ```js
214
+ class SettingsScreen extends PreferenceScreen {
215
+ }
216
+ ```
217
+ ---
218
+
219
+ ### TextPreference
220
+
221
+ Preferencia básica.
222
+ ```jsx
223
+ <TextPreference
224
+ label='Perfil'
225
+ summary='Editar información personal'
226
+ />
227
+ ```
228
+ ---
229
+
230
+ ### SwitchPreference
231
+
232
+ Preferencia con interruptor.
233
+ ```jsx
234
+ <SwitchPreference
235
+ label='Notificaciones'
236
+ key='notify'
237
+ checked={true}
238
+ />
239
+ ```
240
+ ---
241
+
242
+ ### CheckBoxPreference
243
+
244
+ Preferencia con casilla de selección.
245
+ ```jsx
246
+ <CheckBoxPreference
247
+ label='Modo avanzado'
248
+ checked={false}
249
+ />
250
+ ```
251
+ ---
252
+
253
+ ### ListPreference
254
+
255
+ Permite seleccionar un valor de una lista.
256
+ ```jsx
257
+ <ListPreference
258
+ label='Idioma'
259
+ checked={1}
260
+ entries={[
261
+ 'Español',
262
+ 'English',
263
+ 'Português'
264
+ ]}
265
+ />
266
+ ```
267
+ ---
268
+
269
+ ### Group
270
+
271
+ Agrupa elementos visualmente.
272
+ ```jsx
273
+ <Group title='Cuenta'>
274
+
275
+ <TextPreference
276
+ label='Perfil'
277
+ />
278
+
279
+ <TextPreference
280
+ label='Seguridad'
281
+ />
282
+
283
+ </Group>
284
+ ```
285
+ ---
286
+
287
+ ### Modal
288
+
289
+ Los modales permiten mostrar diálogos, formularios o contenido personalizado.
290
+
291
+ Modal simple
292
+ ```js
293
+ Modal({
294
+ title: 'Confirmación',
295
+ message: '¿Desea continuar?'
296
+ }).show();
297
+ ```
298
+ Modal con botones
299
+ ```jsx
300
+ Modal({
301
+ title: 'Eliminar archivo',
302
+ message: 'Esta acción no se puede deshacer.'
303
+ })
304
+ .addButton('Cancelar')
305
+ .addButton('Eliminar', () => {
306
+ deleteFile();
307
+ })
308
+ .show();
309
+ ```
310
+ Modal personalizado
311
+ ```jsx
312
+ Modal({
313
+ title: 'Nuevo usuario',
314
+ content: (
315
+ <ScrollView>
316
+ <TextInput message='Nombre'/>
317
+ <TextInput message='Email'/>
318
+ </ScrollView>
319
+ )
320
+ })
321
+ .show();
322
+ ```
323
+ ---
324
+
325
+ ### Toast
326
+
327
+ Mensaje temporal no intrusivo.
328
+
329
+ Toast simple
330
+ ```js
331
+ Toast('Guardado correctamente')
332
+ .show();
333
+ ```
334
+ Toast con duración
335
+ ```js
336
+ Toast('Guardado correctamente', 500)
337
+ .show();
338
+ ```
339
+ ---
340
+
341
+ ### Snackbar
342
+
343
+ Notificación temporal mostrada en la parte inferior de la pantalla.
344
+
345
+ Snackbar simple
346
+ ```js
347
+ Snackbar(
348
+ 'Mi snackbar sin action.',
349
+ 2000
350
+ ).show();
351
+ ```
352
+ Snackbar con acción
353
+ ```js
354
+ const snack = Snackbar(
355
+ 'Snackbar con action'
356
+ );
357
+
358
+ snack
359
+ .setAction('Cerrar', () => {
360
+ snack.close();
361
+ })
362
+ .show();
363
+ ```
364
+ ---
365
+
366
+ ### Ciclo de Vida
367
+
368
+ Las Screen y Fragment comparten un ciclo de vida común.
369
+
370
+ onCreate()
371
+
372
+ onStart()
373
+
374
+ onResume()
375
+
376
+ onPause()
377
+
378
+ onStop()
379
+
380
+ onDestroy()
381
+
382
+ > aun en desarrollo
383
+
384
+ ---
385
+
386
+ Ejemplo Completo
387
+ ```jsx
388
+ class HomeScreen extends Screen {
389
+
390
+ render() {
391
+ return (
392
+ <FragmentHost/>
393
+ );
394
+ }
395
+
396
+ onCreate() {
397
+
398
+ const manager = getFragmentManager(this);
399
+
400
+ manager.push(
401
+ new HomeFragment()
402
+ );
403
+
404
+ }
405
+
406
+ }
407
+ ```
408
+ ---
409
+
410
+ ### Arquitectura
411
+
412
+ Application
413
+
414
+ ├── NavigationView
415
+
416
+ ├── NavigationDrawer
417
+ │ └── NavItem
418
+
419
+ ├── Screen
420
+
421
+ ├── FragmentHost
422
+ │ ├── FragmentManager
423
+ │ └── Fragment
424
+
425
+ ├── PreferenceScreen
426
+ │ ├── TextPreference
427
+ │ ├── SwitchPreference
428
+ │ ├── CheckBoxPreference
429
+ │ └── ListPreference
430
+
431
+ ├── Modal
432
+ ├── Toast
433
+ └── Snackbar
434
+
435
+ ---
436
+
437
+ ### Filosofía
438
+
439
+ Voir Native extiende Tabris.js con una arquitectura orientada a pantallas y componentes reutilizables.
440
+
441
+ Cada Screen administra:
442
+
443
+ - Navegación.
444
+ - Menús.
445
+ - Drawer.
446
+ - Fragmentos.
447
+ - Preferencias.
448
+ - Ciclo de vida.
449
+
450
+ Todo mediante una API simple basada en JSX y componentes nativos.
@@ -0,0 +1,11 @@
1
+ <?xml version='1.0' encoding='utf-8'?>
2
+ <widget id="com.everskyblue.voirnative" version="1.0.0">
3
+ <name>Voir Native</name>
4
+ <description>
5
+ It is a framework to develop applications in a more controlled way with tabrisjs
6
+ </description>
7
+ <author email="hicodx@gmail.com">
8
+ HiCode
9
+ </author>
10
+ <preference name="EnableDeveloperConsole" value="$IS_DEBUG" />
11
+ </widget>
package/dist/voir.js ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=(e,t)=>()=>(e&&(t=e(e=0)),t);require(`string-tocapitalize`);let t=require(`tabris`);function n(e){"@babel/helpers - typeof";return n=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},n(e)}var r=e((()=>{}));function i(e,t){if(n(e)!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t||`default`);if(n(i)!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var a=e((()=>{r()}));function o(e){var t=i(e,`string`);return n(t)==`symbol`?t:t+``}var s=e((()=>{r(),a()}));function c(e,t,n){return(t=o(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ee=e((()=>{s()}));function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?l(Object(n),!0).forEach(function(t){c(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var te=e((()=>{ee()}));function ne(){return _}function re(){return v}function ie(){return y}function ae(e){return h.get(e)||{}}function oe(e){if(!e)return e;let t=ne();return t&&t[e]?t[e]:e}function se(e){if(!e)return e;let t=ie();return t[e]?t[e]:e}function d(e){let t=re(),[n,r]=Array.isArray(e)?e:[e,`normal`],i=t[n];return i?`${r} ${i}px ${t.fontFamily}`:e}function f(e){let t=ae(e),n={};return Object.entries(t).forEach(([e,t])=>{if(e===`font`){n.font=d(t);return}if(e.includes(`Radius`)){n[e]=se(t);return}n[e]=oe(t)}),n}function ce(e){let t=g.get(e);if(!t)return{};let n={};return t.component&&(n=u({},f(t.component))),n=u(u({},n),de(t.styles)),n}function le(e){return g.get(e)}function ue(e,t=``){return t.split(` `).filter(Boolean).forEach(t=>{e.set(ce(t))}),e}function de(e){var t;let n=(t=le(e))==null?typeof e==`object`?e:{}:t,r=ne(),i=ie(),a={};return Object.entries(n).forEach(([e,t])=>{if(r[t]){a[e]=r[t];return}if(i[t]){a[e]=i[t];return}if(e===`font`){a.font=d(t);return}a[e]=t}),a}var p,m,h,g,_,v,y,fe=e((()=>{te(),p={fontFamily:`sans-serif`,displayLarge:57,displayMedium:45,displaySmall:36,headlineLarge:32,headlineMedium:28,headlineSmall:24,titleLarge:22,titleMedium:16,titleSmall:14,bodyLarge:16,bodyMedium:14,bodySmall:12,labelLarge:14,labelMedium:12,labelSmall:11},m={small:8,medium:12,large:16,extraLarge:28,full:999},h=new Map,g=new Map,_=null,v=u({},p),y=u({},m)})),b,x,S,pe=e((()=>{b={EsmeraldCore:{type:`dark`,primary:`#00D68F`,onPrimary:`#002114`,primaryContainer:`#004D36`,onPrimaryContainer:`#A6FFD8`,secondary:`#4FC3F7`,onSecondary:`#001F2D`,secondaryContainer:`#0B4A66`,onSecondaryContainer:`#CDEFFF`,background:`#0C1110`,onBackground:`#E4F1EE`,surface:`#151C1B`,onSurface:`#E4F1EE`,surfaceVariant:`#2F3A38`,onSurfaceVariant:`#A7B5B2`,error:`#FF7B7B`,onError:`#FFFFFF`,outline:`#5B6966`},CrimsonVoid:{type:`dark`,primary:`#FF5C8A`,onPrimary:`#2B0A16`,primaryContainer:`#5C1F34`,onPrimaryContainer:`#FFD3DF`,secondary:`#FFB86B`,onSecondary:`#2A1700`,secondaryContainer:`#5A3A12`,onSecondaryContainer:`#FFE1BE`,background:`#121014`,onBackground:`#F1EAF3`,surface:`#1B181E`,onSurface:`#F1EAF3`,surfaceVariant:`#3B3440`,onSurfaceVariant:`#B9AFC0`,error:`#FF6E6E`,onError:`#FFFFFF`,outline:`#6A6070`},DarkAurora:{type:`dark`,primary:`#7C4DFF`,onPrimary:`#FFFFFF`,primaryContainer:`#33206B`,onPrimaryContainer:`#D8CCFF`,secondary:`#03DAC6`,onSecondary:`#001F1B`,secondaryContainer:`#004D45`,onSecondaryContainer:`#A6FFF6`,background:`#0F1115`,onBackground:`#E6EAF2`,surface:`#181B22`,onSurface:`#E6EAF2`,surfaceVariant:`#313540`,onSurfaceVariant:`#B0B7C3`,error:`#FF6B81`,onError:`#FFFFFF`,outline:`#5E6472`},DarkOceanic:{type:`dark`,primary:`#8AB4F8`,onPrimary:`#202124`,primaryContainer:`#345070`,onPrimaryContainer:`#C7DFFF`,secondary:`#C5A9F0`,onSecondary:`#202124`,secondaryContainer:`#4E3E6F`,onSecondaryContainer:`#E2D0FF`,background:`#121212`,onBackground:`#E0E0E0`,surface:`#1E1E1E`,onSurface:`#E0E0E0`,surfaceVariant:`#424242`,onSurfaceVariant:`#A0A0A0`,error:`#CF6679`,onError:`#FFFFFF`,outline:`#606060`},DarkForest:{type:`dark`,primary:`#A5D6A7`,onPrimary:`#2C3E50`,primaryContainer:`#388E3C`,onPrimaryContainer:`#DCFFDC`,secondary:`#FFCC80`,onSecondary:`#2C3E50`,secondaryContainer:`#A1887F`,onSecondaryContainer:`#FFEEDD`,background:`#1C2833`,onBackground:`#EAEAEA`,surface:`#2E3C4F`,onSurface:`#EAEAEA`,surfaceVariant:`#5A6A7D`,onSurfaceVariant:`#BBBBBB`,error:`#EF5350`,onError:`#FFFFFF`,outline:`#788C9F`},DarkVolcanic:{type:`dark`,primary:`#FFB74D`,onPrimary:`#2A2A2A`,primaryContainer:`#E65100`,onPrimaryContainer:`#FFF9C4`,secondary:`#B0BEC5`,onSecondary:`#2A2A2A`,secondaryContainer:`#546E7A`,onSecondaryContainer:`#E0F2F7`,background:`#212121`,onBackground:`#F5F5F5`,surface:`#313131`,onSurface:`#F5F5F5`,surfaceVariant:`#616161`,onSurfaceVariant:`#AAAAAA`,error:`#EF9A9A`,onError:`#2A2A2A`,outline:`#757575`},LightSunrise:{type:`light`,primary:`#FF5722`,onPrimary:`#FFFFFF`,primaryContainer:`#FFCCBC`,onPrimaryContainer:`#2A1400`,secondary:`#4CAF50`,onSecondary:`#FFFFFF`,secondaryContainer:`#C8E6C9`,onSecondaryContainer:`#1B5E20`,background:`#F5F5F5`,onBackground:`#212121`,surface:`#FFFFFF`,onSurface:`#212121`,surfaceVariant:`#E0E0E0`,onSurfaceVariant:`#616161`,error:`#B00020`,onError:`#FFFFFF`,outline:`#BDBDBD`},LightSky:{type:`light`,primary:`#2196F3`,onPrimary:`#FFFFFF`,primaryContainer:`#BBDEFB`,onPrimaryContainer:`#0D47A1`,secondary:`#8BC34A`,onSecondary:`#FFFFFF`,secondaryContainer:`#DCEDC8`,onSecondaryContainer:`#33691E`,background:`#F0F4F8`,onBackground:`#263238`,surface:`#FFFFFF`,onSurface:`#263238`,surfaceVariant:`#E3F2FD`,onSurfaceVariant:`#607D8B`,error:`#D32F2F`,onError:`#FFFFFF`,outline:`#90CAF9`}},x=b.CrimsonVoid,S=()=>x}));function me(e,t){let n=S(),r={textColor:n.onPrimary},i={tintColor:n.outline,checkedTintColor:n.primary,textColor:n.onSurface},a={imageTintColor:n.onPrimary,textColor:n.onPrimary,background:n.primary},o={trackOnColor:n.primaryContainer,trackOffColor:n.surfaceVariant,thumbOffColor:n.onSurfaceVariant,thumbOnColor:n.primary},s={toolbarColor:n.surface,titleTextColor:n.onSurface,actionColor:n.onSurface,actionTextColor:n.onSurface},c={background:n.background};return e===`TextView`?(t.set(r),t):e===`CheckBox`||e===`RadioButton`?(t.set(i),t):e===`Button`?(t.set(a),t.style===`outline`&&t.set({strokeColor:n.outline}),t):e===`Switch`?(t.set(o),t):(e===`NavigationView`&&t.set(s),(e===`Screen`||e===`PreferenceScreen`)&&t.set(c),(e===`flight`||e===`Modal`||e===`Toast`||e===`Snackbar`)&&t.set({background:n.surfaceVariant}),typeof t.apply==`function`&&t.apply({TextView:r,CheckBox:i,RadioButton:i,Button:a,Switch:o,".bg-secondary":{background:n.secondary},".bg-surfaceVariant":{background:n.surfaceVariant},".bg-primary":{background:n.primary},".bg-surface":{background:n.surface},".modal-title":{textColor:n.onSurface},".modal-message":{textColor:n.onSurfaceVariant},".btn-action":{textColor:n.primary},".img-onSurfaceVariant":{tintColor:n.onSurfaceVariant},".img-onSecondaryContainer":{tintColor:n.onSecondaryContainer},".text-onSecondaryContainer":{textColor:n.onSecondaryContainer},".text-onSurfaceVariant":{textColor:n.onSurfaceVariant},".text-onSurface":{textColor:n.onSurface},".text-primary":{textColor:n.primary},".text-onSecondary":{textColor:n.onSecondary},".btn-outline":{strokeColor:n.outline},".border-top":{background:n.outline},".border-bottom":{background:n.outline},".border-right":{background:n.outline},".border-left":{background:n.outline},".bg-outline":{background:n.outline}}),t)}var he=e((()=>{pe()})),C,w,T,E,D,O,k,A,j,M,ge,N,P,F,I,L,R,z,B,V,H,U,W,G,K,q,J,_e,ve=e((()=>{fe(),he(),t.app.onForeground(()=>{t.drawer.set({background:oe(`background`)})}),C=(e,n)=>e?(0,t.asFactory)(class extends e{constructor(...e){var t;super(...e),this.set(f(n)),(t=this.class)!=null&&t.trim()&&ue(this,this.class)}}):{},w=C(t.Action,`Action`),T=C(t.ActivityIndicator,`ActivityIndicator`),E=C(t.Button,`Button`),D=C(t.Canvas,`Canvas`),O=C(t.CheckBox,`CheckBox`),k=C(t.CollectionView,`CollectionView`),A=C(t.Composite,`Composite`),j=C(t.ImageView,`ImageView`),M=C(t.ItemPicker,`ItemPicker`),ge=C(t.ListView,`ListView`),N=C(t.NavigationView,`NavigationView`),P=C(t.Page,`Page`),F=C(t.Picker,`Picker`),I=C(t.ProgressBar,`ProgressBar`),L=C(t.RadioButton,`RadioButton`),R=C(t.RefreshComposite,`RefreshComposite`),z=C(t.Row,`Row`),B=C(t.ScrollView,`ScrollView`),V=C(t.SearchAction,`SearchAction`),H=C(t.Slider,`Slider`),U=C(t.Stack,`Stack`),W=C(t.Switch,`Switch`),G=C(t.Tab,`Tab`),K=C(t.TabFolder,`TabFolder`),q=C(t.TextInput,`TextInput`),J=C(t.TextView,`TextView`),_e=C(t.ToggleButton,`ToggleButton`)}));function ye(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function Y(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){ye(a,r,i,o,s,`next`,e)}function s(e){ye(a,r,i,o,s,`throw`,e)}o(void 0)})}}function be(e,t,n){return X.apply(this,arguments)}function X(){return X=Y(function*(e,t,n){yield e.animate({opacity:1},{delay:t==null?0:t,duration:n,easing:`ease-in`})}),X.apply(this,arguments)}function xe(e,t,n){return Z.apply(this,arguments)}function Z(){return Z=Y(function*(e,t,n){yield e.animate({opacity:0},{delay:t,duration:n,easing:`ease-out`})}),Z.apply(this,arguments)}function Se(e,t,n){return Q.apply(this,arguments)}function Q(){return Q=Y(function*(e,t,n){yield Promise.resolve(be(e,t,200)),yield Promise.resolve(xe(e,n,200))}),Q.apply(this,arguments)}function Ce(e){var t,n,r,i=2;for(typeof Symbol<`u`&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&(t=e[n])!=null)return t.call(e);if(r&&(t=e[r])!=null)return new $(t.call(e));n=`@@asyncIterator`,r=`@@iterator`}throw TypeError(`Object is not async iterable`)}function $(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+` is not an object.`));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return $=function(e){this.s=e,this.n=e.next},$.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var n=this.s.return;return n===void 0?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(e){var n=this.s.return;return n===void 0?Promise.reject(e):t(n.apply(this.s,arguments))}},new $(e)}function we(){return we=Y(function*(e){var t=!1,n=!1,r;try{for(var i=Ce(this.stacks),a;t=!(a=yield i.next()).done;t=!1){let t=a.value;yield e(...t)}}catch(e){n=!0,r=e}finally{try{t&&i.return!=null&&(yield i.return())}finally{if(n)throw r}}}),we.apply(this,arguments)}function Te(){return Te=Y(function*(e){e.size>1||(yield e.asyncIterator(function(){var e=Y(function*(e,n){t.contentView.append(e),me(`flight`,e);try{yield Se(e,0,n),e.dispose()}catch(e){}});return function(t,n){return e.apply(this,arguments)}}()),e.clear())}),Te.apply(this,arguments)}ve(),Object.defineProperty(exports,`$`,{enumerable:!0,get:function(){return t.$}}),exports.Action=w,Object.defineProperty(exports,`ActionSheet`,{enumerable:!0,get:function(){return t.ActionSheet}}),Object.defineProperty(exports,`ActionSheetItem`,{enumerable:!0,get:function(){return t.ActionSheetItem}}),exports.ActivityIndicator=T,Object.defineProperty(exports,`AlertDialog`,{enumerable:!0,get:function(){return t.AlertDialog}}),Object.defineProperty(exports,`Blob`,{enumerable:!0,get:function(){return t.Blob}}),exports.Button=E,Object.defineProperty(exports,`CameraView`,{enumerable:!0,get:function(){return t.CameraView}}),exports.Canvas=D,Object.defineProperty(exports,`CanvasContext`,{enumerable:!0,get:function(){return t.CanvasContext}}),Object.defineProperty(exports,`Cell`,{enumerable:!0,get:function(){return t.Cell}}),exports.CheckBox=O,exports.CollectionView=k,Object.defineProperty(exports,`Color`,{enumerable:!0,get:function(){return t.Color}}),Object.defineProperty(exports,`ColorResources`,{enumerable:!0,get:function(){return t.ColorResources}}),exports.Composite=A,Object.defineProperty(exports,`Constraint`,{enumerable:!0,get:function(){return t.Constraint}}),Object.defineProperty(exports,`ConstraintLayout`,{enumerable:!0,get:function(){return t.ConstraintLayout}}),Object.defineProperty(exports,`DateDialog`,{enumerable:!0,get:function(){return t.DateDialog}}),Object.defineProperty(exports,`File`,{enumerable:!0,get:function(){return t.File}}),Object.defineProperty(exports,`Font`,{enumerable:!0,get:function(){return t.Font}}),Object.defineProperty(exports,`FontResources`,{enumerable:!0,get:function(){return t.FontResources}}),Object.defineProperty(exports,`FormData`,{enumerable:!0,get:function(){return t.FormData}}),Object.defineProperty(exports,`Headers`,{enumerable:!0,get:function(){return t.Headers}}),Object.defineProperty(exports,`Image`,{enumerable:!0,get:function(){return t.Image}}),Object.defineProperty(exports,`ImageBitmap`,{enumerable:!0,get:function(){return t.ImageBitmap}}),exports.ImageView=j,Object.defineProperty(exports,`InactivityTimer`,{enumerable:!0,get:function(){return t.InactivityTimer}}),exports.ItemPicker=M,Object.defineProperty(exports,`Layout`,{enumerable:!0,get:function(){return t.Layout}}),Object.defineProperty(exports,`LayoutData`,{enumerable:!0,get:function(){return t.LayoutData}}),Object.defineProperty(exports,`LinearGradient`,{enumerable:!0,get:function(){return t.LinearGradient}}),Object.defineProperty(exports,`List`,{enumerable:!0,get:function(){return t.List}}),exports.ListView=ge,exports.NavigationView=N,exports.Page=P,Object.defineProperty(exports,`PdfView`,{enumerable:!0,get:function(){return t.PdfView}}),Object.defineProperty(exports,`Percent`,{enumerable:!0,get:function(){return t.Percent}}),exports.Picker=F,Object.defineProperty(exports,`Popover`,{enumerable:!0,get:function(){return t.Popover}}),Object.defineProperty(exports,`Popup`,{enumerable:!0,get:function(){return t.Popup}}),exports.ProgressBar=I,exports.RadioButton=L,exports.RefreshComposite=R,Object.defineProperty(exports,`Request`,{enumerable:!0,get:function(){return t.Request}}),Object.defineProperty(exports,`ResourceBuilder`,{enumerable:!0,get:function(){return t.ResourceBuilder}}),Object.defineProperty(exports,`Resources`,{enumerable:!0,get:function(){return t.Resources}}),Object.defineProperty(exports,`Response`,{enumerable:!0,get:function(){return t.Response}}),exports.Row=z,Object.defineProperty(exports,`RowLayout`,{enumerable:!0,get:function(){return t.RowLayout}}),exports.ScrollView=B,exports.SearchAction=V,Object.defineProperty(exports,`Setter`,{enumerable:!0,get:function(){return t.Setter}}),exports.Slider=H,exports.Stack=U,Object.defineProperty(exports,`StackLayout`,{enumerable:!0,get:function(){return t.StackLayout}}),Object.defineProperty(exports,`SubtleCrypto`,{enumerable:!0,get:function(){return t.SubtleCrypto}}),exports.Switch=W,exports.Tab=G,exports.TabFolder=K,exports.TextInput=q,Object.defineProperty(exports,`TextResources`,{enumerable:!0,get:function(){return t.TextResources}}),exports.TextView=J,Object.defineProperty(exports,`TimeDialog`,{enumerable:!0,get:function(){return t.TimeDialog}}),exports.ToggleButton=_e,Object.defineProperty(exports,`Video`,{enumerable:!0,get:function(){return t.Video}}),Object.defineProperty(exports,`WebSocket`,{enumerable:!0,get:function(){return t.WebSocket}}),Object.defineProperty(exports,`WebView`,{enumerable:!0,get:function(){return t.WebView}}),Object.defineProperty(exports,`Widget`,{enumerable:!0,get:function(){return t.Widget}}),Object.defineProperty(exports,`WidgetCollection`,{enumerable:!0,get:function(){return t.WidgetCollection}}),Object.defineProperty(exports,`XMLHttpRequest`,{enumerable:!0,get:function(){return t.XMLHttpRequest}}),Object.defineProperty(exports,`app`,{enumerable:!0,get:function(){return t.app}}),Object.defineProperty(exports,`authentication`,{enumerable:!0,get:function(){return t.authentication}}),Object.defineProperty(exports,`console`,{enumerable:!0,get:function(){return t.console}}),Object.defineProperty(exports,`contentView`,{enumerable:!0,get:function(){return t.contentView}}),Object.defineProperty(exports,`crypto`,{enumerable:!0,get:function(){return t.crypto}}),Object.defineProperty(exports,`cryptoKey`,{enumerable:!0,get:function(){return t.cryptoKey}}),Object.defineProperty(exports,`devTools`,{enumerable:!0,get:function(){return t.devTools}}),Object.defineProperty(exports,`device`,{enumerable:!0,get:function(){return t.device}}),Object.defineProperty(exports,`drawer`,{enumerable:!0,get:function(){return t.drawer}}),Object.defineProperty(exports,`fetch`,{enumerable:!0,get:function(){return t.fetch}}),Object.defineProperty(exports,`fs`,{enumerable:!0,get:function(){return t.fs}}),Object.defineProperty(exports,`input`,{enumerable:!0,get:function(){return t.input}}),Object.defineProperty(exports,`localStorage`,{enumerable:!0,get:function(){return t.localStorage}}),Object.defineProperty(exports,`navigationBar`,{enumerable:!0,get:function(){return t.navigationBar}}),Object.defineProperty(exports,`permission`,{enumerable:!0,get:function(){return t.permission}}),Object.defineProperty(exports,`printer`,{enumerable:!0,get:function(){return t.printer}}),Object.defineProperty(exports,`secureStorage`,{enumerable:!0,get:function(){return t.secureStorage}}),Object.defineProperty(exports,`sizeMeasurement`,{enumerable:!0,get:function(){return t.sizeMeasurement}}),Object.defineProperty(exports,`statusBar`,{enumerable:!0,get:function(){return t.statusBar}}),Object.defineProperty(exports,`tabris`,{enumerable:!0,get:function(){return t.tabris}});
package/logo-voir.png ADDED
Binary file
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "voirjs-native",
3
+ "version": "1.0.0",
4
+ "description": "It is a framework to develop applications in a more controlled way with tabrisjs",
5
+ "main": "dist/voir.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "start": "tabris serve -a",
9
+ "build": "vite build",
10
+ "types": "tsc -p .",
11
+ "parallel": "npm-run-all --parallel build types"
12
+ },
13
+ "directories": {
14
+ "dist": "dist",
15
+ "types": "types"
16
+ },
17
+ "keywords": [
18
+ "voir",
19
+ "voir-native",
20
+ "tabrisjs",
21
+ "native",
22
+ "mobile",
23
+ "android",
24
+ "ios",
25
+ "window",
26
+ "cross-platform"
27
+ ],
28
+ "dependencies": {
29
+ "string-tocapitalize": "^1.0.0",
30
+ "tabris": "~3.9.0"
31
+ },
32
+ "devDependencies": {
33
+ "vite": "^8.0.10"
34
+ },
35
+ "homepage": "https://github.com/everskyblue/voir-native#readme",
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "https://github.com/everskyblue/voir-native"
39
+ },
40
+ "typings": "./types/index.d.ts",
41
+ "author": "hicodx",
42
+ "license": "BSD 3-Clause"
43
+ }