x4js 2.2.61 → 2.2.63

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x4js",
3
- "version": "2.2.61",
3
+ "version": "2.2.63",
4
4
  "type": "module",
5
5
  "main": "src/x4.ts",
6
6
  "module": "src/x4.ts",
@@ -33,7 +33,7 @@
33
33
  padding: 8px;
34
34
 
35
35
  #kb {
36
- width: 100vw;
36
+ width: 100%;
37
37
  max-width: 800px;
38
38
  zoom: var( --keyboard-zoom );
39
39
  }
@@ -4,11 +4,10 @@ import { Component, ComponentProps } from '../../core/component';
4
4
  import Monaco from './bin/monaco';
5
5
  import "./monaco.module.scss"
6
6
 
7
- export type IMonarchLanguage = monaco.languages.IMonarchLanguage;
8
- export type CompletionItem = monaco.languages.CompletionItem;
9
- export type CompletionItemProvider = monaco.languages.CompletionItemProvider;
10
-
11
- export { IRange, }
7
+ export type IMonarchLanguage = Monaco.languages.IMonarchLanguage;
8
+ export type CompletionItem = Monaco.languages.CompletionItem;
9
+ export type CompletionItemProvider = Monaco.languages.CompletionItemProvider;
10
+ export type IRange = Monaco.IRange;
12
11
 
13
12
 
14
13
  interface MonacoEditorProps extends ComponentProps {
@@ -145,10 +145,11 @@ export class Popup<P extends PopupProps = PopupProps, E extends PopupEvents = Po
145
145
  this._do_show( ); // to compute size
146
146
 
147
147
  const fixpos = ( ) => {
148
- const orc = this.getBoundingRect( );
148
+ const self = this.dom as HTMLElement;
149
+
149
150
  this.setStyle( {
150
- left: ((window.innerWidth - orc.width) / 2) +'px',
151
- top: ((window.innerHeight - orc.height) / 2) +'px',
151
+ left: ((document.body.offsetWidth - self.offsetWidth) / 2) +'px',
152
+ top: ((document.body.offsetHeight - self.offsetHeight) / 2) +'px',
152
153
  } );
153
154
  }
154
155
 
@@ -3,7 +3,7 @@ import { Color } from '../../core/core_colors';
3
3
  import { Component, ComponentProps } from '../../core/component';
4
4
 
5
5
  import "./tickline.module.scss"
6
- import { class_ns } from '../../core/core_tools.ts';
6
+ import { class_ns } from '../../core/core_tools';
7
7
 
8
8
  interface TickLineProps extends ComponentProps {
9
9
  values: number[];
@@ -114,10 +114,29 @@ export function unsafeHtml(x: string): UnsafeHtml {
114
114
  }
115
115
 
116
116
  export function unsafe(strings: TemplateStringsArray, ...values: any[]): UnsafeHtml {
117
+
118
+ const resolve = ( value: any ) : string | UnsafeHtml => {
119
+ let v: string;
120
+ if( !value ) {
121
+ return "";
122
+ }
123
+
124
+ if( isArray( value ) ) {
125
+ return value.map( resolve ).join( '' );
126
+ }
127
+
128
+ if ( value instanceof UnsafeHtml ) {
129
+ return value.toString();
130
+ }
131
+
132
+ return sanitizeHtml(value);
133
+ }
134
+
117
135
  const result = strings.reduce((acc, str, i) => {
118
- return acc + str + sanitizeHtml(values[i] ?? '');
136
+ return acc + str + resolve( values[i] );
119
137
  }, '');
120
- return unsafeHtml(result);
138
+
139
+ return new UnsafeHtml(result);
121
140
  }
122
141
 
123
142
  /**
package/src/x4.d.ts CHANGED
@@ -1,20 +1,33 @@
1
- /**
1
+ /**
2
2
  * ___ ___ __
3
3
  * \ \/ / / _
4
4
  * \ / /_| |_
5
- * / \____ _|
6
- * /__/\__\ |_|.2
7
- *
8
- * @file x4.d.ts
9
- * @author Etienne Cochard
10
- *
5
+ * / \____ _|
6
+ * /__/\__\ |_|
7
+ *
8
+ * @file x4.ts
9
+ * @author Etienne Cochard
10
+ *
11
11
  * @copyright (c) 2026 R-libre ingenierie
12
12
  *
13
- * Use of this source code is governed by an MIT-style license
13
+ * Use of this source code is governed by an MIT-style license
14
14
  * that can be found in the LICENSE file or at https://opensource.org/licenses/MIT.
15
15
  **/
16
-
17
- declare module "*.svg" {
18
- const content: string;
19
- export default content;
20
- }
16
+ export * from "./core/component";
17
+ export * from "./core/core_application";
18
+ export * from "./core/core_colors";
19
+ export * from "./core/core_data";
20
+ export * from "./core/core_dom";
21
+ export * from "./core/core_dragdrop";
22
+ export * from "./core/core_element";
23
+ export * from "./core/core_events";
24
+ export * from "./core/core_i18n";
25
+ export * from "./core/core_pdf";
26
+ export * from "./core/core_react";
27
+ export * from "./core/core_router";
28
+ export * from "./core/core_state";
29
+ export * from "./core/core_styles";
30
+ export * from "./core/core_svg";
31
+ export * from "./core/core_tools";
32
+ export * from "./components/components";
33
+ import "./x4.scss";