@webqit/oohtml 1.9.10 → 1.9.13
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/main.js +1 -1
- package/dist/main.js.gz +0 -0
- package/dist/main.js.map +1 -1
- package/dist/main.js.map.gz +0 -0
- package/dist/subscript.js +1 -1
- package/dist/subscript.js.gz +0 -0
- package/dist/subscript.js.map +1 -1
- package/dist/subscript.js.map.gz +0 -0
- package/package.json +2 -2
- package/src/index.js +2 -5
- package/src/subscript/Element.js +12 -32
- package/src/subscript/index.js +4 -1
package/dist/subscript.js.map.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"wicg-proposal"
|
|
15
15
|
],
|
|
16
16
|
"homepage": "https://webqit.io/tooling/oohtml",
|
|
17
|
-
"version": "1.9.
|
|
17
|
+
"version": "1.9.13",
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@webqit/browser-pie": "^0.0.17",
|
|
42
42
|
"@webqit/observer": "^1.7.5",
|
|
43
|
-
"@webqit/subscript": "^2.0.
|
|
43
|
+
"@webqit/subscript": "^2.0.19",
|
|
44
44
|
"@webqit/util": "^0.8.7",
|
|
45
45
|
"acorn": "^8.7.0"
|
|
46
46
|
},
|
package/src/index.js
CHANGED
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
* @imports
|
|
4
4
|
*/
|
|
5
5
|
import Observer from '@webqit/observer';
|
|
6
|
-
import * as Subscript from '@webqit/subscript';
|
|
7
6
|
import domInit from '@webqit/browser-pie/src/dom/index.js';
|
|
8
7
|
import HTMLModules from './html-modules/index.js';
|
|
9
8
|
import HTMLImports from './html-imports/index.js';
|
|
10
9
|
import NamespacedHTML from './namespaced-html/index.js';
|
|
11
10
|
import StateAPI from './state-api/index.js';
|
|
12
|
-
import
|
|
11
|
+
import Subscript from './subscript/index.js';
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* @init
|
|
@@ -26,10 +25,9 @@ export default function init(config = null, onDomReady = false) {
|
|
|
26
25
|
HTMLImports.call(this, config, onDomReady);
|
|
27
26
|
NamespacedHTML.call(this, config, onDomReady);
|
|
28
27
|
StateAPI.call(this, config, onDomReady);
|
|
29
|
-
|
|
28
|
+
Subscript.call(this, config, onDomReady);
|
|
30
29
|
// --------------
|
|
31
30
|
WebQit.Observer = Observer;
|
|
32
|
-
WebQit.Subscript = Subscript;
|
|
33
31
|
|
|
34
32
|
}
|
|
35
33
|
|
|
@@ -38,5 +36,4 @@ export default function init(config = null, onDomReady = false) {
|
|
|
38
36
|
*/
|
|
39
37
|
export {
|
|
40
38
|
Observer,
|
|
41
|
-
Subscript,
|
|
42
39
|
}
|
package/src/subscript/Element.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @imports
|
|
4
4
|
*/
|
|
5
|
+
import { SubscriptFunction, SubscriptClass } from '@webqit/subscript';
|
|
5
6
|
import { _internals, _isNumeric, _isFunction } from '@webqit/util/js/index.js';
|
|
6
|
-
import Subscript from '@webqit/subscript';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* ---------------------------
|
|
@@ -11,7 +11,7 @@ import Subscript from '@webqit/subscript';
|
|
|
11
11
|
* ---------------------------
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
export const Element = BaseElement => class extends BaseElement {
|
|
14
|
+
export const Element = BaseElement => class extends SubscriptClass( BaseElement ) {
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* @subscript Element
|
|
@@ -22,10 +22,10 @@ export const Element = BaseElement => class extends BaseElement {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
static get subscriptMethods() {
|
|
25
|
-
return [
|
|
25
|
+
return [];
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
static
|
|
28
|
+
static expose( element, subscriptFunction ) {
|
|
29
29
|
let subscripts = _internals( element, 'oohtml', 'subscripts' );
|
|
30
30
|
let id = subscriptFunction.name;
|
|
31
31
|
if ( !id ) {
|
|
@@ -35,16 +35,15 @@ export const Element = BaseElement => class extends BaseElement {
|
|
|
35
35
|
return subscriptFunction;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
|
|
39
|
+
static implementMethod( method, element ) {
|
|
40
|
+
let subscriptFunction = super.implementMethod( method, element );
|
|
41
|
+
return this.expose( element, subscriptFunction );
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
-
static
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
return this.implement( element, Subscript.clone( method, element ) );
|
|
43
|
+
|
|
44
|
+
static implementScript( script, element ) {
|
|
45
|
+
let source = ( script.textContent || '' ).trim();
|
|
46
|
+
return this.expose( element, SubscriptFunction.call( element, source ) );
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
/**
|
|
@@ -81,19 +80,6 @@ export const Element = BaseElement => class extends BaseElement {
|
|
|
81
80
|
} );
|
|
82
81
|
}
|
|
83
82
|
|
|
84
|
-
/**
|
|
85
|
-
* @constructor()
|
|
86
|
-
*/
|
|
87
|
-
constructor() {
|
|
88
|
-
super();
|
|
89
|
-
const subscriptConstructor = this.constructor;
|
|
90
|
-
subscriptConstructor.subscriptMethods.forEach( methodName => {
|
|
91
|
-
if ( !this[ methodName ] ) return;
|
|
92
|
-
let proxy = subscriptConstructor.implementMethod( this, this[ methodName ] );
|
|
93
|
-
this[ methodName ] = proxy;
|
|
94
|
-
} );
|
|
95
|
-
}
|
|
96
|
-
|
|
97
83
|
/**
|
|
98
84
|
* @connectedCallback()
|
|
99
85
|
*/
|
|
@@ -118,10 +104,4 @@ export const Element = BaseElement => class extends BaseElement {
|
|
|
118
104
|
return _internals( this, 'oohtml', 'subscripts' );
|
|
119
105
|
}
|
|
120
106
|
|
|
121
|
-
/**
|
|
122
|
-
* @render()
|
|
123
|
-
*/
|
|
124
|
-
|
|
125
|
-
render() {}
|
|
126
|
-
|
|
127
107
|
}
|
package/src/subscript/index.js
CHANGED