@triniwiz/nativescript-masonkit 1.0.0-beta.89 → 1.0.0-beta.90
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/angular/fesm2022/triniwiz-nativescript-masonkit-angular.mjs +23 -66
- package/angular/fesm2022/triniwiz-nativescript-masonkit-angular.mjs.map +1 -1
- package/angular/types/triniwiz-nativescript-masonkit-angular.d.ts +9 -17
- package/common.d.ts +1 -0
- package/common.js +21 -1
- package/common.js.map +1 -1
- package/diagnostics.d.ts +51 -0
- package/diagnostics.js +53 -0
- package/diagnostics.js.map +1 -0
- package/elements.d.ts +55 -0
- package/elements.js +80 -0
- package/elements.js.map +1 -0
- package/fonts.d.ts +9 -0
- package/fonts.js +24 -0
- package/fonts.js.map +1 -0
- package/index.android.d.ts +3 -0
- package/index.android.js +5 -0
- package/index.android.js.map +1 -1
- package/index.d.ts +25 -2
- package/index.ios.d.ts +3 -0
- package/index.ios.js +3 -0
- package/index.ios.js.map +1 -1
- package/index.windows.d.ts +2 -0
- package/index.windows.js +2 -0
- package/index.windows.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/masonkit-release.aar +0 -0
- package/platforms/ios/Mason.xcframework/Info.plist +36 -2
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +16 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +11806 -2726
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +7 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +7 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +8413 -8374
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +32 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +11806 -2726
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +7 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +7 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +11806 -2726
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +7 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +7 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +26 -26
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +8408 -8369
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +8049 -8008
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/Mason-Swift.h +2030 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/Mason.h +25 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/mason_native.h +524 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Info.plist +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-xros.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.abi.json +110027 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.private.swiftinterface +3524 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.swiftinterface +3524 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/module.modulemap +10 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/dSYMs/Mason.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +8016 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/Mason-Swift.h +2030 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/Mason.h +25 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/mason_native.h +524 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Info.plist +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-xros-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.abi.json +110027 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.private.swiftinterface +3524 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.swiftinterface +3524 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/module.modulemap +10 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/_CodeSignature/CodeResources +212 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/dSYMs/Mason.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +8016 -0
- package/properties.d.ts +5 -0
- package/properties.js +341 -110
- package/properties.js.map +1 -1
- package/style.d.ts +38 -5
- package/style.js +434 -72
- package/style.js.map +1 -1
- package/symbols.d.ts +0 -1
- package/symbols.js +0 -1
- package/symbols.js.map +1 -1
- package/tree/index.android.js +3 -0
- package/tree/index.android.js.map +1 -1
- package/tree/index.ios.d.ts +5 -1
- package/tree/index.ios.js +18 -0
- package/tree/index.ios.js.map +1 -1
- package/tree/index.windows.d.ts +5 -1
- package/tree/index.windows.js +4 -0
- package/tree/index.windows.js.map +1 -1
- package/units.d.ts +22 -0
- package/units.js +17 -0
- package/units.js.map +1 -0
- package/utils/index.android.js +5 -5
- package/utils/index.android.js.map +1 -1
- package/utils/index.ios.js +5 -5
- package/utils/index.ios.js.map +1 -1
- package/web.d.ts +142 -10
- package/web.js +459 -12
- package/web.js.map +1 -1
package/web.d.ts
CHANGED
|
@@ -1,19 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { Scroll, Text } from '.';
|
|
2
|
+
/**
|
|
3
|
+
* Block containers extend `Scroll`, not `View`, so any of them can scroll when
|
|
4
|
+
* `overflow` says so — as in a browser, where every block box is scrollable.
|
|
5
|
+
*
|
|
6
|
+
* This is affordable because neither platform uses the system scroll view:
|
|
7
|
+
* Android's `Scroll` is a custom `TwoDScrollView` (a FrameLayout with
|
|
8
|
+
* two-dimensional and nested-scroll support), and on iOS the scroll component
|
|
9
|
+
* hosts a `MasonUIView` with its own scroll handling, precisely because UIKit's
|
|
10
|
+
* `UIScrollView` breaks with nested scroll views. So nesting these behaves the
|
|
11
|
+
* way nested scrollable boxes do on the web.
|
|
12
|
+
*/
|
|
13
|
+
export declare class Div extends Scroll {
|
|
3
14
|
}
|
|
4
|
-
export declare class Section extends
|
|
15
|
+
export declare class Section extends Scroll {
|
|
5
16
|
}
|
|
6
|
-
export declare class Header extends
|
|
17
|
+
export declare class Header extends Scroll {
|
|
7
18
|
}
|
|
8
|
-
export declare class Footer extends
|
|
19
|
+
export declare class Footer extends Scroll {
|
|
9
20
|
}
|
|
10
|
-
export declare class Article extends
|
|
21
|
+
export declare class Article extends Scroll {
|
|
11
22
|
}
|
|
12
|
-
export declare class Main extends
|
|
23
|
+
export declare class Main extends Scroll {
|
|
13
24
|
}
|
|
14
|
-
export declare class Nav extends
|
|
25
|
+
export declare class Nav extends Scroll {
|
|
15
26
|
}
|
|
16
|
-
export declare class Aside extends
|
|
27
|
+
export declare class Aside extends Scroll {
|
|
17
28
|
}
|
|
18
29
|
export declare class Span extends Text {
|
|
19
30
|
constructor();
|
|
@@ -42,7 +53,11 @@ export declare class H6 extends Text {
|
|
|
42
53
|
export declare class P extends Text {
|
|
43
54
|
constructor();
|
|
44
55
|
}
|
|
45
|
-
export declare class Ul extends
|
|
56
|
+
export declare class Ul extends Scroll {
|
|
57
|
+
constructor();
|
|
58
|
+
}
|
|
59
|
+
export declare class Ol extends Scroll {
|
|
60
|
+
constructor();
|
|
46
61
|
}
|
|
47
62
|
export declare class Li extends Text {
|
|
48
63
|
constructor();
|
|
@@ -56,6 +71,123 @@ export declare class B extends Text {
|
|
|
56
71
|
export declare class Strong extends Text {
|
|
57
72
|
constructor();
|
|
58
73
|
}
|
|
74
|
+
export declare class Pre extends Text {
|
|
75
|
+
constructor();
|
|
76
|
+
}
|
|
77
|
+
export declare class Em extends Text {
|
|
78
|
+
constructor();
|
|
79
|
+
}
|
|
80
|
+
export declare class I extends Text {
|
|
81
|
+
constructor();
|
|
82
|
+
}
|
|
59
83
|
export declare class A extends Text {
|
|
84
|
+
private _href;
|
|
85
|
+
private _listening;
|
|
86
|
+
constructor();
|
|
87
|
+
/**
|
|
88
|
+
* `href` did not exist anywhere in this package or the natives — an `<a>` was a
|
|
89
|
+
* styled span that fired a `click` event and nothing more, so links in pasted
|
|
90
|
+
* markup went nowhere. The native side already makes the element clickable and
|
|
91
|
+
* focusable (TextView.kt's `TextType.A` case); this gives that click a
|
|
92
|
+
* destination.
|
|
93
|
+
*/
|
|
94
|
+
get href(): string;
|
|
95
|
+
set href(value: string);
|
|
96
|
+
private followHref;
|
|
97
|
+
}
|
|
98
|
+
/** A generic block container, same box as `<div>`. */
|
|
99
|
+
declare class BlockElement extends Scroll {
|
|
100
|
+
}
|
|
101
|
+
export declare class Figure extends BlockElement {
|
|
60
102
|
constructor();
|
|
61
103
|
}
|
|
104
|
+
export declare class Figcaption extends BlockElement {
|
|
105
|
+
}
|
|
106
|
+
export declare class Address extends BlockElement {
|
|
107
|
+
}
|
|
108
|
+
export declare class Details extends BlockElement {
|
|
109
|
+
}
|
|
110
|
+
export declare class Summary extends BlockElement {
|
|
111
|
+
}
|
|
112
|
+
export declare class Hgroup extends BlockElement {
|
|
113
|
+
}
|
|
114
|
+
export declare class Dl extends BlockElement {
|
|
115
|
+
constructor();
|
|
116
|
+
}
|
|
117
|
+
export declare class Dt extends BlockElement {
|
|
118
|
+
}
|
|
119
|
+
export declare class Dd extends BlockElement {
|
|
120
|
+
constructor();
|
|
121
|
+
}
|
|
122
|
+
export declare class Form extends BlockElement {
|
|
123
|
+
}
|
|
124
|
+
export declare class Fieldset extends BlockElement {
|
|
125
|
+
}
|
|
126
|
+
export declare class Legend extends BlockElement {
|
|
127
|
+
}
|
|
128
|
+
export declare class Picture extends BlockElement {
|
|
129
|
+
}
|
|
130
|
+
export declare class Hr extends BlockElement {
|
|
131
|
+
constructor();
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Phrasing elements. All of these previously resolved to a bare `Span` with no
|
|
135
|
+
* visual difference at all — `<del>` looked identical to its surrounding text.
|
|
136
|
+
*/
|
|
137
|
+
declare class PhrasingElement extends Text {
|
|
138
|
+
constructor();
|
|
139
|
+
}
|
|
140
|
+
export declare class Small extends PhrasingElement {
|
|
141
|
+
constructor();
|
|
142
|
+
}
|
|
143
|
+
export declare class Mark extends PhrasingElement {
|
|
144
|
+
constructor();
|
|
145
|
+
}
|
|
146
|
+
export declare class Sub extends PhrasingElement {
|
|
147
|
+
constructor();
|
|
148
|
+
}
|
|
149
|
+
export declare class Sup extends PhrasingElement {
|
|
150
|
+
constructor();
|
|
151
|
+
}
|
|
152
|
+
export declare class U extends PhrasingElement {
|
|
153
|
+
constructor();
|
|
154
|
+
}
|
|
155
|
+
export declare class Ins extends PhrasingElement {
|
|
156
|
+
constructor();
|
|
157
|
+
}
|
|
158
|
+
export declare class S extends PhrasingElement {
|
|
159
|
+
constructor();
|
|
160
|
+
}
|
|
161
|
+
export declare class Del extends PhrasingElement {
|
|
162
|
+
constructor();
|
|
163
|
+
}
|
|
164
|
+
export declare class Abbr extends PhrasingElement {
|
|
165
|
+
}
|
|
166
|
+
export declare class Cite extends PhrasingElement {
|
|
167
|
+
constructor();
|
|
168
|
+
}
|
|
169
|
+
export declare class Dfn extends PhrasingElement {
|
|
170
|
+
constructor();
|
|
171
|
+
}
|
|
172
|
+
export declare class Q extends PhrasingElement {
|
|
173
|
+
}
|
|
174
|
+
export declare class Kbd extends PhrasingElement {
|
|
175
|
+
constructor();
|
|
176
|
+
}
|
|
177
|
+
export declare class Samp extends PhrasingElement {
|
|
178
|
+
constructor();
|
|
179
|
+
}
|
|
180
|
+
export declare class Var extends PhrasingElement {
|
|
181
|
+
constructor();
|
|
182
|
+
}
|
|
183
|
+
export declare class Time extends PhrasingElement {
|
|
184
|
+
}
|
|
185
|
+
export declare class Label extends PhrasingElement {
|
|
186
|
+
}
|
|
187
|
+
export declare class Output extends PhrasingElement {
|
|
188
|
+
}
|
|
189
|
+
export declare class Bdi extends PhrasingElement {
|
|
190
|
+
}
|
|
191
|
+
export declare class Bdo extends PhrasingElement {
|
|
192
|
+
}
|
|
193
|
+
export {};
|
package/web.js
CHANGED
|
@@ -1,48 +1,74 @@
|
|
|
1
|
-
import { CSSType } from '@nativescript/core';
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { CSSType, Utils } from '@nativescript/core';
|
|
2
|
+
import { Scroll, Text } from '.';
|
|
3
|
+
/**
|
|
4
|
+
* Apply user-agent default styles.
|
|
5
|
+
*
|
|
6
|
+
* Written to the `css:` tier rather than as local style values: a local value
|
|
7
|
+
* outranks every stylesheet rule in NativeScript's cascade, so a UA default set
|
|
8
|
+
* as `view.style.x` is impossible for an app to override — `ul { margin: 0 }`
|
|
9
|
+
* and Tailwind's `list-none` both silently lost. On the `css:` tier an app rule
|
|
10
|
+
* for the same property replaces it, which is what a UA default should do.
|
|
11
|
+
*/
|
|
12
|
+
function applyUaCss(view, declarations) {
|
|
13
|
+
const style = view.style;
|
|
14
|
+
for (const property in declarations) {
|
|
15
|
+
style[`css:${property}`] = declarations[property];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Block containers extend `Scroll`, not `View`, so any of them can scroll when
|
|
20
|
+
* `overflow` says so — as in a browser, where every block box is scrollable.
|
|
21
|
+
*
|
|
22
|
+
* This is affordable because neither platform uses the system scroll view:
|
|
23
|
+
* Android's `Scroll` is a custom `TwoDScrollView` (a FrameLayout with
|
|
24
|
+
* two-dimensional and nested-scroll support), and on iOS the scroll component
|
|
25
|
+
* hosts a `MasonUIView` with its own scroll handling, precisely because UIKit's
|
|
26
|
+
* `UIScrollView` breaks with nested scroll views. So nesting these behaves the
|
|
27
|
+
* way nested scrollable boxes do on the web.
|
|
28
|
+
*/
|
|
29
|
+
let Div = class Div extends Scroll {
|
|
4
30
|
};
|
|
5
31
|
Div = __decorate([
|
|
6
32
|
CSSType('div')
|
|
7
33
|
], Div);
|
|
8
34
|
export { Div };
|
|
9
|
-
let Section = class Section extends
|
|
35
|
+
let Section = class Section extends Scroll {
|
|
10
36
|
};
|
|
11
37
|
Section = __decorate([
|
|
12
38
|
CSSType('section')
|
|
13
39
|
], Section);
|
|
14
40
|
export { Section };
|
|
15
|
-
let Header = class Header extends
|
|
41
|
+
let Header = class Header extends Scroll {
|
|
16
42
|
};
|
|
17
43
|
Header = __decorate([
|
|
18
44
|
CSSType('header')
|
|
19
45
|
], Header);
|
|
20
46
|
export { Header };
|
|
21
|
-
let Footer = class Footer extends
|
|
47
|
+
let Footer = class Footer extends Scroll {
|
|
22
48
|
};
|
|
23
49
|
Footer = __decorate([
|
|
24
50
|
CSSType('footer')
|
|
25
51
|
], Footer);
|
|
26
52
|
export { Footer };
|
|
27
|
-
let Article = class Article extends
|
|
53
|
+
let Article = class Article extends Scroll {
|
|
28
54
|
};
|
|
29
55
|
Article = __decorate([
|
|
30
56
|
CSSType('article')
|
|
31
57
|
], Article);
|
|
32
58
|
export { Article };
|
|
33
|
-
let Main = class Main extends
|
|
59
|
+
let Main = class Main extends Scroll {
|
|
34
60
|
};
|
|
35
61
|
Main = __decorate([
|
|
36
62
|
CSSType('main')
|
|
37
63
|
], Main);
|
|
38
64
|
export { Main };
|
|
39
|
-
let Nav = class Nav extends
|
|
65
|
+
let Nav = class Nav extends Scroll {
|
|
40
66
|
};
|
|
41
67
|
Nav = __decorate([
|
|
42
68
|
CSSType('nav')
|
|
43
69
|
], Nav);
|
|
44
70
|
export { Nav };
|
|
45
|
-
let Aside = class Aside extends
|
|
71
|
+
let Aside = class Aside extends Scroll {
|
|
46
72
|
};
|
|
47
73
|
Aside = __decorate([
|
|
48
74
|
CSSType('aside')
|
|
@@ -147,12 +173,39 @@ P = __decorate([
|
|
|
147
173
|
__metadata("design:paramtypes", [])
|
|
148
174
|
], P);
|
|
149
175
|
export { P };
|
|
150
|
-
|
|
176
|
+
// Browser UA default for <ul>/<ol>: `margin: 1em 0; padding-inline-start: 40px`
|
|
177
|
+
// (16px assumes the standard 16px root font-size, matching ua_defaults.rs's
|
|
178
|
+
// convention for the other block tags below). The padding is what reserves
|
|
179
|
+
// the marker gutter — `View.kt`'s/`MasonUIView.swift`'s `drawListItemMarkers`
|
|
180
|
+
// (see below) draws each marker relative to its `<li>` child's own resolved
|
|
181
|
+
// position, so it lands inside whatever space the container's own padding
|
|
182
|
+
// already pushed that child into; no separate per-item bookkeeping needed.
|
|
183
|
+
function applyListUaDefaults(view) {
|
|
184
|
+
applyUaCss(view, { 'margin-top': 16, 'margin-bottom': 16, 'padding-left': 40 });
|
|
185
|
+
}
|
|
186
|
+
let Ul = class Ul extends Scroll {
|
|
187
|
+
constructor() {
|
|
188
|
+
super();
|
|
189
|
+
applyListUaDefaults(this);
|
|
190
|
+
}
|
|
151
191
|
};
|
|
152
192
|
Ul = __decorate([
|
|
153
|
-
CSSType('ul')
|
|
193
|
+
CSSType('ul'),
|
|
194
|
+
__metadata("design:paramtypes", [])
|
|
154
195
|
], Ul);
|
|
155
196
|
export { Ul };
|
|
197
|
+
let Ol = class Ol extends Scroll {
|
|
198
|
+
constructor() {
|
|
199
|
+
super();
|
|
200
|
+
applyListUaDefaults(this);
|
|
201
|
+
applyUaCss(this, { 'list-style-type': 'decimal' });
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
Ol = __decorate([
|
|
205
|
+
CSSType('ol'),
|
|
206
|
+
__metadata("design:paramtypes", [])
|
|
207
|
+
], Ol);
|
|
208
|
+
export { Ol };
|
|
156
209
|
let Li = class Li extends Text {
|
|
157
210
|
constructor() {
|
|
158
211
|
// @ts-ignore
|
|
@@ -197,10 +250,81 @@ Strong = __decorate([
|
|
|
197
250
|
__metadata("design:paramtypes", [])
|
|
198
251
|
], Strong);
|
|
199
252
|
export { Strong };
|
|
253
|
+
let Pre = class Pre extends Text {
|
|
254
|
+
constructor() {
|
|
255
|
+
// @ts-ignore
|
|
256
|
+
super(13 /* TextType.Pre */);
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
Pre = __decorate([
|
|
260
|
+
CSSType('pre'),
|
|
261
|
+
__metadata("design:paramtypes", [])
|
|
262
|
+
], Pre);
|
|
263
|
+
export { Pre };
|
|
264
|
+
let Em = class Em extends Text {
|
|
265
|
+
constructor() {
|
|
266
|
+
// @ts-ignore
|
|
267
|
+
super(15 /* TextType.Em */);
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
Em = __decorate([
|
|
271
|
+
CSSType('em'),
|
|
272
|
+
__metadata("design:paramtypes", [])
|
|
273
|
+
], Em);
|
|
274
|
+
export { Em };
|
|
275
|
+
let I = class I extends Text {
|
|
276
|
+
constructor() {
|
|
277
|
+
// @ts-ignore
|
|
278
|
+
super(16 /* TextType.I */);
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
I = __decorate([
|
|
282
|
+
CSSType('i'),
|
|
283
|
+
__metadata("design:paramtypes", [])
|
|
284
|
+
], I);
|
|
285
|
+
export { I };
|
|
200
286
|
let A = class A extends Text {
|
|
201
287
|
constructor() {
|
|
202
288
|
// @ts-ignore
|
|
203
289
|
super(17 /* TextType.A */);
|
|
290
|
+
this._href = '';
|
|
291
|
+
this._listening = false;
|
|
292
|
+
this.followHref = () => {
|
|
293
|
+
const href = this._href;
|
|
294
|
+
// An in-page fragment has nothing to open; leave it to the app, which is the
|
|
295
|
+
// only thing that knows what its own anchors mean.
|
|
296
|
+
if (!href || href.startsWith('#')) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
try {
|
|
300
|
+
Utils.openUrl(href);
|
|
301
|
+
}
|
|
302
|
+
catch (error) {
|
|
303
|
+
// openUrl throws on a scheme the platform cannot handle; a dead link
|
|
304
|
+
// should not take the app down.
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* `href` did not exist anywhere in this package or the natives — an `<a>` was a
|
|
310
|
+
* styled span that fired a `click` event and nothing more, so links in pasted
|
|
311
|
+
* markup went nowhere. The native side already makes the element clickable and
|
|
312
|
+
* focusable (TextView.kt's `TextType.A` case); this gives that click a
|
|
313
|
+
* destination.
|
|
314
|
+
*/
|
|
315
|
+
get href() {
|
|
316
|
+
return this._href;
|
|
317
|
+
}
|
|
318
|
+
set href(value) {
|
|
319
|
+
this._href = value == null ? '' : String(value);
|
|
320
|
+
// The native side delivers a click only to registered listeners, so this has
|
|
321
|
+
// to hold one of its own. Registering before the native view exists is fine:
|
|
322
|
+
// ViewBase queues it and replays the queue on initNativeView.
|
|
323
|
+
if (this._href && !this._listening) {
|
|
324
|
+
this._listening = true;
|
|
325
|
+
// @ts-ignore — the renderers' event typing does not cover this.
|
|
326
|
+
this.addEventListener('click', this.followHref);
|
|
327
|
+
}
|
|
204
328
|
}
|
|
205
329
|
};
|
|
206
330
|
A = __decorate([
|
|
@@ -208,4 +332,327 @@ A = __decorate([
|
|
|
208
332
|
__metadata("design:paramtypes", [])
|
|
209
333
|
], A);
|
|
210
334
|
export { A };
|
|
335
|
+
// ---------------------------------------------------------------------------
|
|
336
|
+
// Remaining HTML elements
|
|
337
|
+
// ---------------------------------------------------------------------------
|
|
338
|
+
//
|
|
339
|
+
// The native HTML parser has always mapped roughly 60 tags, but `web.ts` only
|
|
340
|
+
// exported 26 classes — so `<hr>`, `<small>`, `<label>`, `<figure>` and the rest
|
|
341
|
+
// failed at element resolution in every framework, even though the native side
|
|
342
|
+
// knew what to do with them. These are TS-only additions: `TextType` is closed
|
|
343
|
+
// at 18 members, so each phrasing element reuses `Span` and gets its
|
|
344
|
+
// distinguishing style from properties that already work.
|
|
345
|
+
/** A generic block container, same box as `<div>`. */
|
|
346
|
+
class BlockElement extends Scroll {
|
|
347
|
+
}
|
|
348
|
+
let Figure = class Figure extends BlockElement {
|
|
349
|
+
constructor() {
|
|
350
|
+
super();
|
|
351
|
+
// Browser UA default: `margin: 1em 40px`.
|
|
352
|
+
applyUaCss(this, { 'margin-top': 16, 'margin-bottom': 16, 'margin-left': 40, 'margin-right': 40 });
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
Figure = __decorate([
|
|
356
|
+
CSSType('figure'),
|
|
357
|
+
__metadata("design:paramtypes", [])
|
|
358
|
+
], Figure);
|
|
359
|
+
export { Figure };
|
|
360
|
+
let Figcaption = class Figcaption extends BlockElement {
|
|
361
|
+
};
|
|
362
|
+
Figcaption = __decorate([
|
|
363
|
+
CSSType('figcaption')
|
|
364
|
+
], Figcaption);
|
|
365
|
+
export { Figcaption };
|
|
366
|
+
let Address = class Address extends BlockElement {
|
|
367
|
+
};
|
|
368
|
+
Address = __decorate([
|
|
369
|
+
CSSType('address')
|
|
370
|
+
], Address);
|
|
371
|
+
export { Address };
|
|
372
|
+
let Details = class Details extends BlockElement {
|
|
373
|
+
};
|
|
374
|
+
Details = __decorate([
|
|
375
|
+
CSSType('details')
|
|
376
|
+
], Details);
|
|
377
|
+
export { Details };
|
|
378
|
+
let Summary = class Summary extends BlockElement {
|
|
379
|
+
};
|
|
380
|
+
Summary = __decorate([
|
|
381
|
+
CSSType('summary')
|
|
382
|
+
], Summary);
|
|
383
|
+
export { Summary };
|
|
384
|
+
let Hgroup = class Hgroup extends BlockElement {
|
|
385
|
+
};
|
|
386
|
+
Hgroup = __decorate([
|
|
387
|
+
CSSType('hgroup')
|
|
388
|
+
], Hgroup);
|
|
389
|
+
export { Hgroup };
|
|
390
|
+
let Dl = class Dl extends BlockElement {
|
|
391
|
+
constructor() {
|
|
392
|
+
super();
|
|
393
|
+
applyUaCss(this, { 'margin-top': 16, 'margin-bottom': 16 });
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
Dl = __decorate([
|
|
397
|
+
CSSType('dl'),
|
|
398
|
+
__metadata("design:paramtypes", [])
|
|
399
|
+
], Dl);
|
|
400
|
+
export { Dl };
|
|
401
|
+
let Dt = class Dt extends BlockElement {
|
|
402
|
+
};
|
|
403
|
+
Dt = __decorate([
|
|
404
|
+
CSSType('dt')
|
|
405
|
+
], Dt);
|
|
406
|
+
export { Dt };
|
|
407
|
+
let Dd = class Dd extends BlockElement {
|
|
408
|
+
constructor() {
|
|
409
|
+
super();
|
|
410
|
+
// Browser UA default: `margin-inline-start: 40px`.
|
|
411
|
+
applyUaCss(this, { 'margin-left': 40 });
|
|
412
|
+
}
|
|
413
|
+
};
|
|
414
|
+
Dd = __decorate([
|
|
415
|
+
CSSType('dd'),
|
|
416
|
+
__metadata("design:paramtypes", [])
|
|
417
|
+
], Dd);
|
|
418
|
+
export { Dd };
|
|
419
|
+
let Form = class Form extends BlockElement {
|
|
420
|
+
};
|
|
421
|
+
Form = __decorate([
|
|
422
|
+
CSSType('form')
|
|
423
|
+
], Form);
|
|
424
|
+
export { Form };
|
|
425
|
+
let Fieldset = class Fieldset extends BlockElement {
|
|
426
|
+
};
|
|
427
|
+
Fieldset = __decorate([
|
|
428
|
+
CSSType('fieldset')
|
|
429
|
+
], Fieldset);
|
|
430
|
+
export { Fieldset };
|
|
431
|
+
let Legend = class Legend extends BlockElement {
|
|
432
|
+
};
|
|
433
|
+
Legend = __decorate([
|
|
434
|
+
CSSType('legend')
|
|
435
|
+
], Legend);
|
|
436
|
+
export { Legend };
|
|
437
|
+
let Picture = class Picture extends BlockElement {
|
|
438
|
+
};
|
|
439
|
+
Picture = __decorate([
|
|
440
|
+
CSSType('picture')
|
|
441
|
+
], Picture);
|
|
442
|
+
export { Picture };
|
|
443
|
+
let Hr = class Hr extends BlockElement {
|
|
444
|
+
constructor() {
|
|
445
|
+
super();
|
|
446
|
+
// A browser draws `<hr>` as an inset-bordered box: `margin: 0.5em auto`,
|
|
447
|
+
// 1px border. Mason has no `border-style: inset`, so a plain 1px top border
|
|
448
|
+
// is the closest honest approximation.
|
|
449
|
+
applyUaCss(this, {
|
|
450
|
+
'margin-top': 8,
|
|
451
|
+
'margin-bottom': 8,
|
|
452
|
+
'border-top-width': 1,
|
|
453
|
+
'border-top-style': 'solid',
|
|
454
|
+
height: 0,
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
Hr = __decorate([
|
|
459
|
+
CSSType('hr'),
|
|
460
|
+
__metadata("design:paramtypes", [])
|
|
461
|
+
], Hr);
|
|
462
|
+
export { Hr };
|
|
463
|
+
/**
|
|
464
|
+
* Phrasing elements. All of these previously resolved to a bare `Span` with no
|
|
465
|
+
* visual difference at all — `<del>` looked identical to its surrounding text.
|
|
466
|
+
*/
|
|
467
|
+
class PhrasingElement extends Text {
|
|
468
|
+
constructor() {
|
|
469
|
+
// @ts-ignore
|
|
470
|
+
super(2 /* TextType.Span */);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
let Small = class Small extends PhrasingElement {
|
|
474
|
+
constructor() {
|
|
475
|
+
super();
|
|
476
|
+
applyUaCss(this, { 'font-size': '0.8em' });
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
Small = __decorate([
|
|
480
|
+
CSSType('small'),
|
|
481
|
+
__metadata("design:paramtypes", [])
|
|
482
|
+
], Small);
|
|
483
|
+
export { Small };
|
|
484
|
+
let Mark = class Mark extends PhrasingElement {
|
|
485
|
+
constructor() {
|
|
486
|
+
super();
|
|
487
|
+
applyUaCss(this, { 'background-color': 'Mark', color: 'MarkText' });
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
Mark = __decorate([
|
|
491
|
+
CSSType('mark'),
|
|
492
|
+
__metadata("design:paramtypes", [])
|
|
493
|
+
], Mark);
|
|
494
|
+
export { Mark };
|
|
495
|
+
let Sub = class Sub extends PhrasingElement {
|
|
496
|
+
constructor() {
|
|
497
|
+
super();
|
|
498
|
+
applyUaCss(this, { 'font-size': '0.75em', 'vertical-align': 'sub' });
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
Sub = __decorate([
|
|
502
|
+
CSSType('sub'),
|
|
503
|
+
__metadata("design:paramtypes", [])
|
|
504
|
+
], Sub);
|
|
505
|
+
export { Sub };
|
|
506
|
+
let Sup = class Sup extends PhrasingElement {
|
|
507
|
+
constructor() {
|
|
508
|
+
super();
|
|
509
|
+
applyUaCss(this, { 'font-size': '0.75em', 'vertical-align': 'super' });
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
Sup = __decorate([
|
|
513
|
+
CSSType('sup'),
|
|
514
|
+
__metadata("design:paramtypes", [])
|
|
515
|
+
], Sup);
|
|
516
|
+
export { Sup };
|
|
517
|
+
let U = class U extends PhrasingElement {
|
|
518
|
+
constructor() {
|
|
519
|
+
super();
|
|
520
|
+
applyUaCss(this, { 'text-decoration': 'underline' });
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
U = __decorate([
|
|
524
|
+
CSSType('u'),
|
|
525
|
+
__metadata("design:paramtypes", [])
|
|
526
|
+
], U);
|
|
527
|
+
export { U };
|
|
528
|
+
let Ins = class Ins extends PhrasingElement {
|
|
529
|
+
constructor() {
|
|
530
|
+
super();
|
|
531
|
+
applyUaCss(this, { 'text-decoration': 'underline' });
|
|
532
|
+
}
|
|
533
|
+
};
|
|
534
|
+
Ins = __decorate([
|
|
535
|
+
CSSType('ins'),
|
|
536
|
+
__metadata("design:paramtypes", [])
|
|
537
|
+
], Ins);
|
|
538
|
+
export { Ins };
|
|
539
|
+
let S = class S extends PhrasingElement {
|
|
540
|
+
constructor() {
|
|
541
|
+
super();
|
|
542
|
+
applyUaCss(this, { 'text-decoration': 'line-through' });
|
|
543
|
+
}
|
|
544
|
+
};
|
|
545
|
+
S = __decorate([
|
|
546
|
+
CSSType('s'),
|
|
547
|
+
__metadata("design:paramtypes", [])
|
|
548
|
+
], S);
|
|
549
|
+
export { S };
|
|
550
|
+
let Del = class Del extends PhrasingElement {
|
|
551
|
+
constructor() {
|
|
552
|
+
super();
|
|
553
|
+
applyUaCss(this, { 'text-decoration': 'line-through' });
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
Del = __decorate([
|
|
557
|
+
CSSType('del'),
|
|
558
|
+
__metadata("design:paramtypes", [])
|
|
559
|
+
], Del);
|
|
560
|
+
export { Del };
|
|
561
|
+
let Abbr = class Abbr extends PhrasingElement {
|
|
562
|
+
};
|
|
563
|
+
Abbr = __decorate([
|
|
564
|
+
CSSType('abbr')
|
|
565
|
+
], Abbr);
|
|
566
|
+
export { Abbr };
|
|
567
|
+
let Cite = class Cite extends PhrasingElement {
|
|
568
|
+
constructor() {
|
|
569
|
+
super();
|
|
570
|
+
applyUaCss(this, { 'font-style': 'italic' });
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
Cite = __decorate([
|
|
574
|
+
CSSType('cite'),
|
|
575
|
+
__metadata("design:paramtypes", [])
|
|
576
|
+
], Cite);
|
|
577
|
+
export { Cite };
|
|
578
|
+
let Dfn = class Dfn extends PhrasingElement {
|
|
579
|
+
constructor() {
|
|
580
|
+
super();
|
|
581
|
+
applyUaCss(this, { 'font-style': 'italic' });
|
|
582
|
+
}
|
|
583
|
+
};
|
|
584
|
+
Dfn = __decorate([
|
|
585
|
+
CSSType('dfn'),
|
|
586
|
+
__metadata("design:paramtypes", [])
|
|
587
|
+
], Dfn);
|
|
588
|
+
export { Dfn };
|
|
589
|
+
let Q = class Q extends PhrasingElement {
|
|
590
|
+
};
|
|
591
|
+
Q = __decorate([
|
|
592
|
+
CSSType('q')
|
|
593
|
+
], Q);
|
|
594
|
+
export { Q };
|
|
595
|
+
let Kbd = class Kbd extends PhrasingElement {
|
|
596
|
+
constructor() {
|
|
597
|
+
super();
|
|
598
|
+
applyUaCss(this, { 'font-family': 'monospace', 'font-size': '0.9em' });
|
|
599
|
+
}
|
|
600
|
+
};
|
|
601
|
+
Kbd = __decorate([
|
|
602
|
+
CSSType('kbd'),
|
|
603
|
+
__metadata("design:paramtypes", [])
|
|
604
|
+
], Kbd);
|
|
605
|
+
export { Kbd };
|
|
606
|
+
let Samp = class Samp extends PhrasingElement {
|
|
607
|
+
constructor() {
|
|
608
|
+
super();
|
|
609
|
+
applyUaCss(this, { 'font-family': 'monospace' });
|
|
610
|
+
}
|
|
611
|
+
};
|
|
612
|
+
Samp = __decorate([
|
|
613
|
+
CSSType('samp'),
|
|
614
|
+
__metadata("design:paramtypes", [])
|
|
615
|
+
], Samp);
|
|
616
|
+
export { Samp };
|
|
617
|
+
let Var = class Var extends PhrasingElement {
|
|
618
|
+
constructor() {
|
|
619
|
+
super();
|
|
620
|
+
applyUaCss(this, { 'font-style': 'italic' });
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
Var = __decorate([
|
|
624
|
+
CSSType('var'),
|
|
625
|
+
__metadata("design:paramtypes", [])
|
|
626
|
+
], Var);
|
|
627
|
+
export { Var };
|
|
628
|
+
let Time = class Time extends PhrasingElement {
|
|
629
|
+
};
|
|
630
|
+
Time = __decorate([
|
|
631
|
+
CSSType('time')
|
|
632
|
+
], Time);
|
|
633
|
+
export { Time };
|
|
634
|
+
let Label = class Label extends PhrasingElement {
|
|
635
|
+
};
|
|
636
|
+
Label = __decorate([
|
|
637
|
+
CSSType('label')
|
|
638
|
+
], Label);
|
|
639
|
+
export { Label };
|
|
640
|
+
let Output = class Output extends PhrasingElement {
|
|
641
|
+
};
|
|
642
|
+
Output = __decorate([
|
|
643
|
+
CSSType('output')
|
|
644
|
+
], Output);
|
|
645
|
+
export { Output };
|
|
646
|
+
let Bdi = class Bdi extends PhrasingElement {
|
|
647
|
+
};
|
|
648
|
+
Bdi = __decorate([
|
|
649
|
+
CSSType('bdi')
|
|
650
|
+
], Bdi);
|
|
651
|
+
export { Bdi };
|
|
652
|
+
let Bdo = class Bdo extends PhrasingElement {
|
|
653
|
+
};
|
|
654
|
+
Bdo = __decorate([
|
|
655
|
+
CSSType('bdo')
|
|
656
|
+
], Bdo);
|
|
657
|
+
export { Bdo };
|
|
211
658
|
//# sourceMappingURL=web.js.map
|