x4js 1.4.21 → 1.4.26

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/src/x4.less CHANGED
@@ -70,7 +70,8 @@
70
70
  --x4-icon-xmark: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" fill="currentColor"><path d="M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25C304.4 412.9 296.2 416 288 416s-16.38-3.125-22.62-9.375L160 301.3L54.63 406.6C48.38 412.9 40.19 416 32 416S15.63 412.9 9.375 406.6c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z"/></svg>';
71
71
  --x4-icon-angle-down: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512" fill="currentColor"><path d="M192 384c-8.188 0-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L192 306.8l137.4-137.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-160 160C208.4 380.9 200.2 384 192 384z"/></svg>';
72
72
  --x4-icon-calendar-days: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor"><path d="M160 32V64H288V32C288 14.33 302.3 0 320 0C337.7 0 352 14.33 352 32V64H400C426.5 64 448 85.49 448 112V160H0V112C0 85.49 21.49 64 48 64H96V32C96 14.33 110.3 0 128 0C145.7 0 160 14.33 160 32zM0 192H448V464C448 490.5 426.5 512 400 512H48C21.49 512 0 490.5 0 464V192zM64 304C64 312.8 71.16 320 80 320H112C120.8 320 128 312.8 128 304V272C128 263.2 120.8 256 112 256H80C71.16 256 64 263.2 64 272V304zM192 304C192 312.8 199.2 320 208 320H240C248.8 320 256 312.8 256 304V272C256 263.2 248.8 256 240 256H208C199.2 256 192 263.2 192 272V304zM336 256C327.2 256 320 263.2 320 272V304C320 312.8 327.2 320 336 320H368C376.8 320 384 312.8 384 304V272C384 263.2 376.8 256 368 256H336zM64 432C64 440.8 71.16 448 80 448H112C120.8 448 128 440.8 128 432V400C128 391.2 120.8 384 112 384H80C71.16 384 64 391.2 64 400V432zM208 384C199.2 384 192 391.2 192 400V432C192 440.8 199.2 448 208 448H240C248.8 448 256 440.8 256 432V400C256 391.2 248.8 384 240 384H208zM320 432C320 440.8 327.2 448 336 448H368C376.8 448 384 440.8 384 432V400C384 391.2 376.8 384 368 384H336C327.2 384 320 391.2 320 400V432z"/></svg>';
73
- --x4-icon-tip: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><path d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464zM296 336h-16V248C280 234.8 269.3 224 256 224H224C210.8 224 200 234.8 200 248S210.8 272 224 272h8v64h-16C202.8 336 192 346.8 192 360S202.8 384 216 384h80c13.25 0 24-10.75 24-24S309.3 336 296 336zM256 192c17.67 0 32-14.33 32-32c0-17.67-14.33-32-32-32S224 142.3 224 160C224 177.7 238.3 192 256 192z"/></svg>';
73
+ --x4-icon-tip: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" fill="currentColor"><path d="M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256s256-114.6 256-256S397.4 0 256 0zM256 464c-114.7 0-208-93.31-208-208S141.3 48 256 48s208 93.31 208 208S370.7 464 256 464zM296 336h-16V248C280 234.8 269.3 224 256 224H224C210.8 224 200 234.8 200 248S210.8 272 224 272h8v64h-16C202.8 336 192 346.8 192 360S202.8 384 216 384h80c13.25 0 24-10.75 24-24S309.3 336 296 336zM256 192c17.67 0 32-14.33 32-32c0-17.67-14.33-32-32-32S224 142.3 224 160C224 177.7 238.3 192 256 192z"/></svg>';
74
+ --x4-check: 'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" fill="currentColor"><path d="M440.1 103C450.3 112.4 450.3 127.6 440.1 136.1L176.1 400.1C167.6 410.3 152.4 410.3 143 400.1L7.029 264.1C-2.343 255.6-2.343 240.4 7.029 231C16.4 221.7 31.6 221.7 40.97 231L160 350.1L407 103C416.4 93.66 431.6 93.66 440.1 103V103z"/></svg>';
74
75
  }
75
76
 
76
77
  @BLACK10: rgba(0,0,0,0.1);
@@ -862,6 +863,10 @@ textarea {
862
863
  width: 1em;
863
864
  margin-right: 8px;
864
865
  color: var( --gray-700 );
866
+
867
+ &.pop-mark {
868
+ height: 0.8em;
869
+ }
865
870
  }
866
871
 
867
872
  .x-label {
@@ -1329,9 +1334,12 @@ textarea {
1329
1334
  overflow: hidden;
1330
1335
  padding: 4px;
1331
1336
  white-space: nowrap;
1332
- //min-width: 50px;
1333
1337
  color: var( --gray-900 );
1334
1338
  height: @def-height;
1339
+
1340
+ span {
1341
+ width: 100%;
1342
+ }
1335
1343
  }
1336
1344
 
1337
1345
  .x-footer,
@@ -1368,6 +1376,15 @@ textarea {
1368
1376
  .x-cell {
1369
1377
  display: flex;
1370
1378
  align-items: center;
1379
+ span {
1380
+ width: unset;
1381
+ }
1382
+
1383
+ .sort {
1384
+ width: 1em;
1385
+ height: 1em;
1386
+ padding-left: 4px;
1387
+ }
1371
1388
  }
1372
1389
  }
1373
1390
 
@@ -1441,6 +1458,8 @@ textarea {
1441
1458
  border-right: 1px solid rgba(0,0,0,0.1);
1442
1459
  border-bottom: 1px solid rgba(0,0,0,0.1);
1443
1460
  height: 2em;
1461
+ align-items: center;
1462
+ display: flex;
1444
1463
  }
1445
1464
 
1446
1465
  .x-cell.x-selected {
package/tsconfig.json CHANGED
@@ -12,12 +12,6 @@
12
12
  "include": [
13
13
  "./src/*",
14
14
  ],
15
- "exclude": [
16
- "src/hosts/nwjs_types.ts",
17
- "src/hosts/nwjs.ts",
18
- "src/texthiliter.ts",
19
- "src/smartedit.ts"
20
- ],
21
15
  "typedocOptions": {
22
16
  "entryPoints": ["src/index.ts"],
23
17
  "out": "../doc/api"
@@ -1,164 +0,0 @@
1
- /**
2
- * @file host/electron.ts
3
- * @author Etienne Cochard
4
- * @license
5
- * Copyright (c) 2019-2021 R-libre ingenierie
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 3 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
18
- **/
19
-
20
- import { x4document } from '../dom-gen'
21
- import { FileStat, PathType, PartType, Host } from './host'
22
-
23
- export * from './host';
24
-
25
- declare const require;
26
- declare const host_require;
27
-
28
- if( !globalThis.host_require ) {
29
- globalThis.host_require = require;
30
- }
31
-
32
- export const fs = host_require( 'fs' );
33
- export const process = host_require( 'process' );
34
- export const electron = host_require( 'electron' );
35
- export const path = host_require( 'path' );
36
-
37
- //import * as path from 'node:path';
38
-
39
- export class ElectronHost extends Host {
40
-
41
- makePath( ...els: string[] ) {
42
- return path.join( ...els );
43
- }
44
-
45
- readBinary( path: string ): Promise<Uint8Array> {
46
- return new Promise( ( resolve, reject ) => {
47
- fs.readFile( path, ( err, buff ) => {
48
- if( err ) { reject( err ); }
49
- else { resolve( buff ); }
50
- } );
51
- } );
52
- }
53
-
54
- writeBinary( path: string, data: Uint8Array ): Promise<boolean> {
55
- return new Promise( ( resolve, reject ) => {
56
- fs.writeFile( path, data, ( err ) => {
57
- if( err ) { reject(err); }
58
- else { resolve( true ); }
59
- } );
60
- } );
61
- }
62
-
63
- readUtf8( path: string ): Promise<string> {
64
- return new Promise( ( resolve, reject ) => {
65
- fs.readFile( path, { encoding: 'utf8' }, ( err, buff ) => {
66
- if( err ) { reject( err ); }
67
- else { resolve( buff.toString() ); }
68
- } );
69
- } );
70
- }
71
-
72
- writeUtf8( path: string, data: string ): Promise<boolean> {
73
- return new Promise( ( resolve, reject ) => {
74
- fs.writeFile( path, data, {encoding: 'utf8'}, ( err ) => {
75
- if( err ) { reject(err); }
76
- else { resolve( true ); }
77
- } );
78
- } );
79
- }
80
-
81
- compress( data: Uint8Array ): Promise<Uint8Array> {
82
- return new Promise( (resolve, reject ) => {
83
- let zlib = this.require('zlib');
84
- zlib.gzip( data, ( err, Uint8Array ) => {
85
- if( err ) { reject( err); }
86
- else { resolve( Uint8Array); }
87
- } );
88
- } );
89
- }
90
-
91
- decompress( data: Uint8Array ): Promise<Uint8Array> {
92
- return new Promise( (resolve, reject ) => {
93
- let zlib = this.require('zlib');
94
- zlib.gunzip( data, ( err, Uint8Array ) => {
95
- if( err ) { reject( err); }
96
- else { resolve( Uint8Array); }
97
- } );
98
- } );
99
- }
100
-
101
- readLocalStorage( name: string ): string {
102
- return localStorage.getItem( name );
103
- }
104
-
105
- writeLocalStorage( name: string, data: string ): void {
106
- localStorage.setItem( name, data );
107
- }
108
-
109
- stat( name: string ): FileStat {
110
- let stat = fs.statSync( name );
111
- if( !stat ) {
112
- return null;
113
- }
114
-
115
- return {
116
- atime: stat.atimeMs,
117
- isDir: stat.isDirectory()
118
- }
119
- }
120
-
121
- readDir( path: string ): Promise<string[]> {
122
- return new Promise( ( resolve, reject ) => {
123
- fs.readdir( path, ( err, files ) => {
124
- if( err ) { reject(err); }
125
- else { resolve(files); }
126
- });
127
- });
128
- }
129
-
130
- require( name: string ): any {
131
- return host_require( name );
132
- }
133
-
134
- cwd( ): string {
135
- return process.cwd( );
136
- }
137
-
138
- get ipc( ) {
139
- return electron.ipcRenderer;
140
- }
141
-
142
- getPath( type: PathType ) : string {
143
- return this.ipc.sendSync( 'getPath', type );
144
- }
145
-
146
- getPathPart( pth: string, type: PartType ) : string {
147
-
148
- let els = path.parse( pth );
149
- switch ( type ) {
150
- case 'dirname': return els.dir;
151
- case 'basename': return els.base;
152
- case 'filename': return els.name;
153
- case 'extname': return els.ext;
154
- }
155
-
156
- return '';
157
- }
158
-
159
- createCanvas = ( ) => {
160
- return x4document.createElement('canvas');
161
- }
162
- }
163
-
164
- new ElectronHost( );
package/src/hosts/host.ts DELETED
@@ -1,100 +0,0 @@
1
- /**
2
- * @file host.ts
3
- * @author Etienne Cochard
4
- * @license
5
- * Copyright (c) 2019-2021 R-libre ingenierie
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 3 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
18
- **/
19
-
20
- export interface FileStat {
21
- atime: number;
22
- isDir: boolean;
23
- }
24
-
25
- export type PathType = 'home' | 'appData' | 'userData' | 'cache' | 'temp' | 'exe' | 'desktop' | 'documents' | 'downloads' | 'music'
26
- | 'pictures'| 'videos' | 'recent' | 'logs' | 'crashDumps';
27
-
28
- export type PartType = 'filename' | 'extname' | 'basename' | 'dirname';
29
-
30
- export abstract class Host {
31
-
32
- constructor( ) {
33
- host = this;
34
- }
35
-
36
- makePath( ...els: string[] ) {
37
- return els.join( '/' );
38
- }
39
-
40
- readBinary( path: string ): Promise<Uint8Array> {
41
- return Promise.reject( 'not imp' );
42
- }
43
-
44
- writeBinary( path: string, data: Uint8Array ): Promise<boolean> {
45
- return Promise.reject( 'not imp' );
46
- }
47
-
48
- readUtf8( path: string ): Promise<string> {
49
- return Promise.reject( 'not imp' );
50
- }
51
-
52
- writeUtf8( path: string, data: string ): Promise<boolean> {
53
- return Promise.reject( 'not imp' );
54
- }
55
-
56
- compress( data: Uint8Array ): Promise<Uint8Array> {
57
- return Promise.reject( 'not imp' );
58
- }
59
-
60
- decompress( data: Uint8Array ): Promise<Uint8Array> {
61
- return Promise.reject( 'not imp' );
62
- }
63
-
64
- readLocalStorage( name: string ): string {
65
- return localStorage.getItem( name );
66
- }
67
-
68
- writeLocalStorage( name: string, data: string ): void {
69
- localStorage.setItem( name, data );
70
- }
71
-
72
- stat( name: string ): FileStat {
73
- throw 'not imp';
74
- }
75
-
76
- readDir( path: string ): Promise<string[]> {
77
- throw 'not imp';
78
- }
79
-
80
- require( name: string ): any {
81
- throw 'not imp';
82
- }
83
-
84
- cwd( ): string {
85
- throw 'not imp';
86
- }
87
-
88
- getPath( type: PathType ) : string {
89
- throw 'not imp';
90
- }
91
-
92
- getPathPart( path: string, type: PartType ) : string {
93
- throw 'not imp';
94
- }
95
-
96
- abstract createCanvas( );
97
- }
98
-
99
-
100
- export let host: Host = null;
package/src/hosts/nwjs.ts DELETED
@@ -1,141 +0,0 @@
1
- /**
2
- * @file host/nwjs.ts
3
- * @author Etienne Cochard
4
- * @license
5
- * Copyright (c) 2019-2021 R-libre ingenierie
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 3 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
18
- **/
19
-
20
- import { FileStat, PathType, Host } from './host'
21
-
22
- export * from './host';
23
-
24
- // to deal with amd modules (that are not comletely compatible with nodejs)
25
- // globalThis.node_require must be set to require BEFORE polyfill code of amd module.
26
- // ie. globalThis.node_require = require;
27
-
28
- declare const host_require;
29
- if( !globalThis.host_require ) {
30
- globalThis.host_require = require;
31
- }
32
-
33
- const fs = host_require( 'fs' );
34
- const process = host_require( 'process' );
35
- const path = host_require( 'path' );
36
-
37
-
38
-
39
- export class NWJSHost implements Host {
40
-
41
- makePath( ...els: string[] ) {
42
- return path.join( ...els );
43
- }
44
-
45
- readBinary( path: string ): Promise<Uint8Array> {
46
- return new Promise( ( resolve, reject ) => {
47
- fs.readFile( path, ( err, buff ) => {
48
- if( err ) { reject( err ); }
49
- else { resolve( buff ); }
50
- } );
51
- } );
52
- }
53
-
54
- writeBinary( path: string, data: Uint8Array ): Promise<boolean> {
55
- return new Promise( ( resolve, reject ) => {
56
- fs.writeFile( path, data, ( err ) => {
57
- if( err ) { reject(err); }
58
- else { resolve( true ); }
59
- } );
60
- } );
61
- }
62
-
63
- readUtf8( path: string ): Promise<string> {
64
- return new Promise( ( resolve, reject ) => {
65
- fs.readFile( path, { encoding: 'utf8' }, ( err, buff ) => {
66
- if( err ) { reject( err ); }
67
- else { resolve( buff.toString() ); }
68
- } );
69
- } );
70
- }
71
-
72
- writeUtf8( path: string, data: string ): Promise<boolean> {
73
- return new Promise( ( resolve, reject ) => {
74
- fs.writeFile( path, data, {encoding: 'utf8'}, ( err ) => {
75
- if( err ) { reject(err); }
76
- else { resolve( true ); }
77
- } );
78
- } );
79
- }
80
-
81
- compress( data: Uint8Array ): Promise<Uint8Array> {
82
- return new Promise( (resolve, reject ) => {
83
- let zlib = host_require('zlib');
84
- zlib.gzip( data, ( err, Uint8Array ) => {
85
- if( err ) { reject( err); }
86
- else { resolve( Uint8Array); }
87
- } );
88
- } );
89
- }
90
-
91
- decompress( data: Uint8Array ): Promise<Uint8Array> {
92
- return new Promise( (resolve, reject ) => {
93
- let zlib = host_require('zlib');
94
- zlib.gunzip( data, ( err, Uint8Array ) => {
95
- if( err ) { reject( err); }
96
- else { resolve( Uint8Array); }
97
- } );
98
- } );
99
- }
100
-
101
- readLocalStorage( name: string ): string {
102
- return localStorage.getItem( name );
103
- }
104
-
105
- writeLocalStorage( name: string, data: string ): void {
106
- localStorage.setItem( name, data );
107
- }
108
-
109
- stat( name: string ): FileStat {
110
- let stat = fs.statSync( name );
111
- if( !stat ) {
112
- return null;
113
- }
114
-
115
- return {
116
- atime: stat.atimeMs
117
- }
118
- }
119
-
120
- readDir( path: string ): Promise<string[]> {
121
- return new Promise( ( resolve, reject ) => {
122
- fs.readdir( path, ( err, files ) => {
123
- if( err ) { reject(err); }
124
- else { resolve(files); }
125
- });
126
- });
127
- }
128
-
129
- require( name: string ): any {
130
- // your amd module must define window.node_require = require;
131
- return host_require( name );
132
- }
133
-
134
- cwd( ): string {
135
- return process.cwd( );
136
- }
137
-
138
- getPath( type: PathType ) : string {
139
- throw 'not imp';
140
- }
141
- }