@triniwiz/nativescript-masonkit 1.0.0-alpha.27 → 1.0.0-alpha.28
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/common.d.ts +138 -0
- package/common.js +1546 -0
- package/common.js.map +1 -0
- package/img/index.android.d.ts +10 -0
- package/img/index.android.js +40 -0
- package/img/index.android.js.map +1 -0
- package/img/index.ios.d.ts +13 -0
- package/img/index.ios.js +102 -0
- package/img/index.ios.js.map +1 -0
- package/index.android.d.ts +5 -0
- package/index.android.js +6 -0
- package/index.android.js.map +1 -0
- package/index.ios.d.ts +5 -0
- package/index.ios.js +6 -0
- package/index.ios.js.map +1 -0
- package/package.json +1 -1
- package/scroll/index.android.d.ts +13 -0
- package/scroll/index.android.js +75 -0
- package/scroll/index.android.js.map +1 -0
- package/scroll/index.ios.d.ts +16 -0
- package/scroll/index.ios.js +150 -0
- package/scroll/index.ios.js.map +1 -0
- package/style.d.ts +201 -0
- package/style.js +2315 -0
- package/style.js.map +1 -0
- package/text/index.android.d.ts +30 -0
- package/text/index.android.js +142 -0
- package/text/index.android.js.map +1 -0
- package/text/index.ios.d.ts +39 -0
- package/text/index.ios.js +288 -0
- package/text/index.ios.js.map +1 -0
- package/tree/index.android.d.ts +27 -0
- package/tree/index.android.js +72 -0
- package/tree/index.android.js.map +1 -0
- package/tree/index.ios.d.ts +27 -0
- package/tree/index.ios.js +72 -0
- package/tree/index.ios.js.map +1 -0
- package/utils/index.android.d.ts +187 -0
- package/utils/index.android.js +595 -0
- package/utils/index.android.js.map +1 -0
- package/utils/index.ios.d.ts +198 -0
- package/utils/index.ios.js +710 -0
- package/utils/index.ios.js.map +1 -0
- package/view/index.android.d.ts +13 -0
- package/view/index.android.js +82 -0
- package/view/index.android.js.map +1 -0
- package/view/index.ios.d.ts +17 -0
- package/view/index.ios.js +155 -0
- package/view/index.ios.js.map +1 -0
- package/web.d.ts +55 -0
- package/web.js +189 -0
- package/web.js.map +1 -0
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import { Color, colorProperty, Utils, View } from '@nativescript/core';
|
|
2
|
+
import { isMasonView_, isText_, isTextChild_, style_, TextBase, textWrapProperty } from '../common';
|
|
3
|
+
import { Style } from '../style';
|
|
4
|
+
import { Tree } from '../tree';
|
|
5
|
+
import { parseLength } from '../utils';
|
|
6
|
+
export class Text extends TextBase {
|
|
7
|
+
constructor(type = 0) {
|
|
8
|
+
super();
|
|
9
|
+
this._inBatch = false;
|
|
10
|
+
this[isText_] = true;
|
|
11
|
+
switch (type) {
|
|
12
|
+
case 0 /* TextType.None */:
|
|
13
|
+
this._view = Tree.instance.createTextView(null, 0 /* MasonTextType.None */);
|
|
14
|
+
break;
|
|
15
|
+
case 1 /* TextType.P */:
|
|
16
|
+
this._view = Tree.instance.createTextView(null, 1 /* MasonTextType.P */);
|
|
17
|
+
break;
|
|
18
|
+
case 2 /* TextType.Span */:
|
|
19
|
+
this._view = Tree.instance.createTextView(null, 2 /* MasonTextType.Span */);
|
|
20
|
+
break;
|
|
21
|
+
case 3 /* TextType.Code */:
|
|
22
|
+
this._view = Tree.instance.createTextView(null, 3 /* MasonTextType.Code */);
|
|
23
|
+
break;
|
|
24
|
+
case 4 /* TextType.H1 */:
|
|
25
|
+
this._view = Tree.instance.createTextView(null, 4 /* MasonTextType.H1 */);
|
|
26
|
+
break;
|
|
27
|
+
case 5 /* TextType.H2 */:
|
|
28
|
+
this._view = Tree.instance.createTextView(null, 5 /* MasonTextType.H2 */);
|
|
29
|
+
break;
|
|
30
|
+
case 6 /* TextType.H3 */:
|
|
31
|
+
this._view = Tree.instance.createTextView(null, 6 /* MasonTextType.H3 */);
|
|
32
|
+
break;
|
|
33
|
+
case 7 /* TextType.H4 */:
|
|
34
|
+
this._view = Tree.instance.createTextView(null, 7 /* MasonTextType.H4 */);
|
|
35
|
+
break;
|
|
36
|
+
case 8 /* TextType.H5 */:
|
|
37
|
+
this._view = Tree.instance.createTextView(null, 8 /* MasonTextType.H5 */);
|
|
38
|
+
break;
|
|
39
|
+
case 9 /* TextType.H6 */:
|
|
40
|
+
this._view = Tree.instance.createTextView(null, 9 /* MasonTextType.H6 */);
|
|
41
|
+
break;
|
|
42
|
+
case 10 /* TextType.Li */:
|
|
43
|
+
this._view = Tree.instance.createTextView(null, 10 /* MasonTextType.Li */);
|
|
44
|
+
break;
|
|
45
|
+
case 11 /* TextType.Blockquote */:
|
|
46
|
+
this._view = Tree.instance.createTextView(null, 11 /* MasonTextType.Blockquote */);
|
|
47
|
+
break;
|
|
48
|
+
case 12 /* TextType.B */:
|
|
49
|
+
this._view = Tree.instance.createTextView(null, 12 /* MasonTextType.B */);
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
this[isMasonView_] = true;
|
|
53
|
+
this[style_] = Style.fromView(this, this._view, true);
|
|
54
|
+
}
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
get ios() {
|
|
58
|
+
return this._view;
|
|
59
|
+
}
|
|
60
|
+
get _styleHelper() {
|
|
61
|
+
if (this[style_] === undefined) {
|
|
62
|
+
this[style_] = Style.fromView(this, this._view);
|
|
63
|
+
}
|
|
64
|
+
return this[style_];
|
|
65
|
+
}
|
|
66
|
+
createNativeView() {
|
|
67
|
+
return this._view;
|
|
68
|
+
}
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
70
|
+
//@ts-ignore
|
|
71
|
+
get text() {
|
|
72
|
+
return this._view.text;
|
|
73
|
+
}
|
|
74
|
+
set text(value) {
|
|
75
|
+
const nativeView = this._view;
|
|
76
|
+
if (nativeView) {
|
|
77
|
+
// hacking vue3 to handle text nodes
|
|
78
|
+
if (global.VUE3_ELEMENT_REF) {
|
|
79
|
+
const view_ref = this[global.VUE3_ELEMENT_REF];
|
|
80
|
+
if (Array.isArray(view_ref.childNodes)) {
|
|
81
|
+
view_ref.childNodes.forEach((node, index) => {
|
|
82
|
+
if (node.nodeType === 'text') {
|
|
83
|
+
// using replace to avoid accumulating text nodes
|
|
84
|
+
// @ts-ignore
|
|
85
|
+
nativeView.mason_replaceChildAtText(node.text || '', index);
|
|
86
|
+
// nativeView.addChildAtText(node.text || '', index);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
// will replace all nodes with a new text node
|
|
93
|
+
nativeView.text = value;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// [textProperty.setNative](value) {
|
|
98
|
+
// const nativeView = this._view;
|
|
99
|
+
// console.log('text:setNative', value);
|
|
100
|
+
// if (nativeView) {
|
|
101
|
+
// nativeView.updateText(value);
|
|
102
|
+
// }
|
|
103
|
+
// }
|
|
104
|
+
[colorProperty.setNative](value) {
|
|
105
|
+
switch (typeof value) {
|
|
106
|
+
case 'number':
|
|
107
|
+
this._styleHelper.color = value;
|
|
108
|
+
break;
|
|
109
|
+
case 'string':
|
|
110
|
+
{
|
|
111
|
+
this._styleHelper.color = new Color(value).argb;
|
|
112
|
+
}
|
|
113
|
+
break;
|
|
114
|
+
case 'object':
|
|
115
|
+
{
|
|
116
|
+
this._styleHelper.color = value.argb;
|
|
117
|
+
}
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
122
|
+
// @ts-ignore
|
|
123
|
+
set backgroundColor(value) {
|
|
124
|
+
switch (typeof value) {
|
|
125
|
+
case 'number':
|
|
126
|
+
this._styleHelper.backgroundColor = value;
|
|
127
|
+
break;
|
|
128
|
+
case 'string':
|
|
129
|
+
this._styleHelper.backgroundColor = new Color(value).argb;
|
|
130
|
+
break;
|
|
131
|
+
case 'object':
|
|
132
|
+
this._styleHelper.backgroundColor = value.argb;
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
137
|
+
// @ts-ignore
|
|
138
|
+
get backgroundColor() {
|
|
139
|
+
return new Color(this[style_].backgroundColor);
|
|
140
|
+
}
|
|
141
|
+
// [backgroundColorProperty.setNative](value) {
|
|
142
|
+
// console.log('backgroundColorProperty.setNative', value);
|
|
143
|
+
// // if (typeof value === 'number') {
|
|
144
|
+
// // this[style_].backgroundColor = value;
|
|
145
|
+
// // this[style_].syncStyle(true);
|
|
146
|
+
// // } else if (value instanceof Color) {
|
|
147
|
+
// // this[style_].backgroundColor = value.argb;
|
|
148
|
+
// // this[style_].syncStyle(true);
|
|
149
|
+
// // }
|
|
150
|
+
// }
|
|
151
|
+
[textWrapProperty.setNative](value) {
|
|
152
|
+
switch (value) {
|
|
153
|
+
case 'false':
|
|
154
|
+
case false:
|
|
155
|
+
case 'nowrap':
|
|
156
|
+
this._styleHelper.textWrap = 1 /* MasonTextWrap.NoWrap */;
|
|
157
|
+
break;
|
|
158
|
+
case true:
|
|
159
|
+
case 'true':
|
|
160
|
+
case 'wrap':
|
|
161
|
+
this._styleHelper.textWrap = 0 /* MasonTextWrap.Wrap */;
|
|
162
|
+
break;
|
|
163
|
+
case 'balance':
|
|
164
|
+
this._styleHelper.textWrap = 2 /* MasonTextWrap.Balance */;
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
onLayout(left, top, right, bottom) {
|
|
169
|
+
super.onLayout(left, top, right, bottom);
|
|
170
|
+
// todo
|
|
171
|
+
// @ts-ignore
|
|
172
|
+
let layout = this._view.node.computedLayout;
|
|
173
|
+
const children = layout.children;
|
|
174
|
+
let i = 0;
|
|
175
|
+
if (children.count === 0) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
for (const child of this._children) {
|
|
179
|
+
layout = children.objectAtIndex(i);
|
|
180
|
+
const x = layout.x;
|
|
181
|
+
const y = layout.y;
|
|
182
|
+
const width = layout.width;
|
|
183
|
+
const height = layout.height;
|
|
184
|
+
View.layoutChild(this, child, x, y, width, height);
|
|
185
|
+
i++;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
onMeasure(widthMeasureSpec, heightMeasureSpec) {
|
|
189
|
+
const nativeView = this._view;
|
|
190
|
+
if (nativeView) {
|
|
191
|
+
const specWidth = Utils.layout.getMeasureSpecSize(widthMeasureSpec);
|
|
192
|
+
const widthMode = Utils.layout.getMeasureSpecMode(widthMeasureSpec);
|
|
193
|
+
const specHeight = Utils.layout.getMeasureSpecSize(heightMeasureSpec);
|
|
194
|
+
const heightMode = Utils.layout.getMeasureSpecMode(heightMeasureSpec);
|
|
195
|
+
if (!this[isMasonView_]) {
|
|
196
|
+
// only call compute on the parent
|
|
197
|
+
if (this.width === 'auto' && this.height === 'auto') {
|
|
198
|
+
// todo
|
|
199
|
+
// @ts-ignore
|
|
200
|
+
this.ios.mason_computeWithSize(specWidth, specHeight);
|
|
201
|
+
//this.ios.computeWithMaxContent();
|
|
202
|
+
// todo
|
|
203
|
+
// @ts-ignore
|
|
204
|
+
const layout = this.ios.node.computedLayout;
|
|
205
|
+
const w = Utils.layout.makeMeasureSpec(layout.width, Utils.layout.EXACTLY);
|
|
206
|
+
const h = Utils.layout.makeMeasureSpec(layout.height, Utils.layout.EXACTLY);
|
|
207
|
+
this.setMeasuredDimension(w, h);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
let width;
|
|
212
|
+
switch (typeof this.width) {
|
|
213
|
+
case 'object': {
|
|
214
|
+
const parent = this.parent;
|
|
215
|
+
const mw = parent?.getMeasuredWidth?.() || Utils.layout.toDevicePixels(parent?.nativeView?.frame?.size?.width ?? 0);
|
|
216
|
+
width = parseLength(this.width, mw);
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
case 'string':
|
|
220
|
+
width = -2;
|
|
221
|
+
break;
|
|
222
|
+
case 'number':
|
|
223
|
+
width = Utils.layout.toDevicePixels(this.width);
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
let height;
|
|
227
|
+
switch (typeof this.height) {
|
|
228
|
+
case 'object': {
|
|
229
|
+
const parent = this.parent;
|
|
230
|
+
const mh = parent?.getMeasuredHeight?.() || Utils.layout.toDevicePixels(parent?.nativeView?.frame?.size?.height ?? 0);
|
|
231
|
+
height = parseLength(this.height, mh);
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
case 'string':
|
|
235
|
+
height = -2;
|
|
236
|
+
break;
|
|
237
|
+
case 'number':
|
|
238
|
+
height = Utils.layout.toDevicePixels(this.height);
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
// todo
|
|
242
|
+
// @ts-ignore
|
|
243
|
+
this.ios.mason_computeWithSize(width, height);
|
|
244
|
+
const layout = this.ios.node.computedLayout;
|
|
245
|
+
const w = Utils.layout.makeMeasureSpec(layout.width, Utils.layout.EXACTLY);
|
|
246
|
+
const h = Utils.layout.makeMeasureSpec(layout.height, Utils.layout.EXACTLY);
|
|
247
|
+
this.setMeasuredDimension(w, h);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
// todo
|
|
252
|
+
// @ts-ignore
|
|
253
|
+
const layout = nativeView.node.computedLayout;
|
|
254
|
+
const w = Utils.layout.makeMeasureSpec(layout.width, Utils.layout.EXACTLY);
|
|
255
|
+
const h = Utils.layout.makeMeasureSpec(layout.height, Utils.layout.EXACTLY);
|
|
256
|
+
this.eachLayoutChild((child) => {
|
|
257
|
+
View.measureChild(this, child, child._currentWidthMeasureSpec, child._currentHeightMeasureSpec);
|
|
258
|
+
});
|
|
259
|
+
this.setMeasuredDimension(w, h);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
// @ts-ignore
|
|
264
|
+
_addViewToNativeVisualTree(child, atIndex = -1) {
|
|
265
|
+
const nativeView = this._view;
|
|
266
|
+
if (nativeView && child.nativeViewProtected) {
|
|
267
|
+
child._hasNativeView = true;
|
|
268
|
+
child._isMasonChild = true;
|
|
269
|
+
const index = atIndex ?? -1;
|
|
270
|
+
if (index >= 0) {
|
|
271
|
+
nativeView.addViewAt(child.nativeViewProtected, index);
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
nativeView.addView(child.nativeViewProtected);
|
|
275
|
+
}
|
|
276
|
+
return true;
|
|
277
|
+
}
|
|
278
|
+
return false;
|
|
279
|
+
}
|
|
280
|
+
_removeViewFromNativeVisualTree(view) {
|
|
281
|
+
view[isTextChild_] = false;
|
|
282
|
+
super._removeViewFromNativeVisualTree(view);
|
|
283
|
+
}
|
|
284
|
+
_setNativeViewFrame(nativeView, frame) {
|
|
285
|
+
nativeView.frame = frame;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
//# sourceMappingURL=index.ios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.ios.js","sourceRoot":"","sources":["../../../../packages/nativescript-masonkit/text/index.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,EAAY,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACpG,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AA8BvC,MAAM,OAAO,IAAK,SAAQ,QAAQ;IAIhC,YAAY,OAAiB,CAAC;QAC5B,KAAK,EAAE,CAAC;QAHV,aAAQ,GAAG,KAAK,CAAC;QAIf,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;QACrB,QAAQ,IAAI,EAAE,CAAC;YACb;gBACE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,C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IAED,mBAAmB,CAAC,UAAe,EAAE,KAAa;QAChD,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare enum TextType {
|
|
2
|
+
None = 0,
|
|
3
|
+
P = 1,
|
|
4
|
+
Span = 2,
|
|
5
|
+
Code = 3,
|
|
6
|
+
H1 = 4,
|
|
7
|
+
H2 = 5,
|
|
8
|
+
H3 = 6,
|
|
9
|
+
H4 = 7,
|
|
10
|
+
H5 = 8,
|
|
11
|
+
H6 = 9,
|
|
12
|
+
Li = 10,
|
|
13
|
+
Blockquote = 11,
|
|
14
|
+
B = 12
|
|
15
|
+
}
|
|
16
|
+
export declare class Tree {
|
|
17
|
+
private _base;
|
|
18
|
+
private static _tree;
|
|
19
|
+
constructor(base?: org.nativescript.mason.masonkit.Mason);
|
|
20
|
+
static get instance(): Tree;
|
|
21
|
+
get native(): org.nativescript.mason.masonkit.Mason;
|
|
22
|
+
createView(context: any): org.nativescript.mason.masonkit.View;
|
|
23
|
+
createTextView(context: any, type?: TextType): org.nativescript.mason.masonkit.TextView;
|
|
24
|
+
createImageView(context: any): org.nativescript.mason.masonkit.Img;
|
|
25
|
+
createScrollView(context: any): org.nativescript.mason.masonkit.Scroll;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
var TextType;
|
|
3
|
+
(function (TextType) {
|
|
4
|
+
TextType[TextType["None"] = 0] = "None";
|
|
5
|
+
TextType[TextType["P"] = 1] = "P";
|
|
6
|
+
TextType[TextType["Span"] = 2] = "Span";
|
|
7
|
+
TextType[TextType["Code"] = 3] = "Code";
|
|
8
|
+
TextType[TextType["H1"] = 4] = "H1";
|
|
9
|
+
TextType[TextType["H2"] = 5] = "H2";
|
|
10
|
+
TextType[TextType["H3"] = 6] = "H3";
|
|
11
|
+
TextType[TextType["H4"] = 7] = "H4";
|
|
12
|
+
TextType[TextType["H5"] = 8] = "H5";
|
|
13
|
+
TextType[TextType["H6"] = 9] = "H6";
|
|
14
|
+
TextType[TextType["Li"] = 10] = "Li";
|
|
15
|
+
TextType[TextType["Blockquote"] = 11] = "Blockquote";
|
|
16
|
+
TextType[TextType["B"] = 12] = "B";
|
|
17
|
+
})(TextType || (TextType = {}));
|
|
18
|
+
export class Tree {
|
|
19
|
+
constructor(base) {
|
|
20
|
+
this._base = base ?? new org.nativescript.mason.masonkit.Mason();
|
|
21
|
+
}
|
|
22
|
+
static get instance() {
|
|
23
|
+
return _a._tree;
|
|
24
|
+
}
|
|
25
|
+
get native() {
|
|
26
|
+
return this._base;
|
|
27
|
+
}
|
|
28
|
+
createView(context) {
|
|
29
|
+
return this.native.createView(context);
|
|
30
|
+
}
|
|
31
|
+
createTextView(context, type) {
|
|
32
|
+
switch (type) {
|
|
33
|
+
case TextType.P:
|
|
34
|
+
return this.native.createTextView(context, org.nativescript.mason.masonkit.TextType.P);
|
|
35
|
+
case TextType.Span:
|
|
36
|
+
return this.native.createTextView(context, org.nativescript.mason.masonkit.TextType.Span);
|
|
37
|
+
case TextType.Code:
|
|
38
|
+
return this.native.createTextView(context, org.nativescript.mason.masonkit.TextType.Code);
|
|
39
|
+
case TextType.H1:
|
|
40
|
+
return this.native.createTextView(context, org.nativescript.mason.masonkit.TextType.H1);
|
|
41
|
+
case TextType.H2:
|
|
42
|
+
return this.native.createTextView(context, org.nativescript.mason.masonkit.TextType.H2);
|
|
43
|
+
case TextType.H3:
|
|
44
|
+
return this.native.createTextView(context, org.nativescript.mason.masonkit.TextType.H3);
|
|
45
|
+
case TextType.H4:
|
|
46
|
+
return this.native.createTextView(context, org.nativescript.mason.masonkit.TextType.H4);
|
|
47
|
+
case TextType.H5:
|
|
48
|
+
return this.native.createTextView(context, org.nativescript.mason.masonkit.TextType.H5);
|
|
49
|
+
case TextType.H6:
|
|
50
|
+
return this.native.createTextView(context, org.nativescript.mason.masonkit.TextType.H6);
|
|
51
|
+
case TextType.Li:
|
|
52
|
+
return this.native.createTextView(context, org.nativescript.mason.masonkit.TextType.Li);
|
|
53
|
+
case TextType.Blockquote:
|
|
54
|
+
return this.native.createTextView(context, org.nativescript.mason.masonkit.TextType.Blockquote);
|
|
55
|
+
case TextType.B:
|
|
56
|
+
return this.native.createTextView(context, org.nativescript.mason.masonkit.TextType.B);
|
|
57
|
+
default:
|
|
58
|
+
return this.native.createTextView(context);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
createImageView(context) {
|
|
62
|
+
return this.native.createImageView(context);
|
|
63
|
+
}
|
|
64
|
+
createScrollView(context) {
|
|
65
|
+
return this.native.createScrollView(context);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
_a = Tree;
|
|
69
|
+
(() => {
|
|
70
|
+
_a._tree = new _a(org.nativescript.mason.masonkit.Mason.getShared());
|
|
71
|
+
})();
|
|
72
|
+
//# sourceMappingURL=index.android.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.android.js","sourceRoot":"","sources":["../../../../packages/nativescript-masonkit/tree/index.android.ts"],"names":[],"mappings":";AAAA,IAAK,QA0BJ;AA1BD,WAAK,QAAQ;IACX,uCAAQ,CAAA;IAER,iCAAK,CAAA;IAEL,uCAAQ,CAAA;IAER,uCAAQ,CAAA;IAER,mCAAM,CAAA;IAEN,mCAAM,CAAA;IAEN,mCAAM,CAAA;IAEN,mCAAM,CAAA;IAEN,mCAAM,CAAA;IAEN,mCAAM,CAAA;IAEN,oCAAO,CAAA;IAEP,oDAAe,CAAA;IAEf,kCAAM,CAAA;AACR,CAAC,EA1BI,QAAQ,KAAR,QAAQ,QA0BZ;AAED,MAAM,OAAO,IAAI;IAGf,YAAY,IAA4C;QACtD,IAAI,CAAC,KAAK,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACnE,CAAC;IAMD,MAAM,KAAK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ED,eAAe,CAAC,OAAO;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED,gBAAgB,CAAC,OAAO;QACtB,OAAO,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;CACF;;AAtDC;IACE,GAAK,KAAK,GAAG,IAAI,EAAI,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;AAC3E,CAAC,GAAA,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare enum TextType {
|
|
2
|
+
None = 0,
|
|
3
|
+
P = 1,
|
|
4
|
+
Span = 2,
|
|
5
|
+
Code = 3,
|
|
6
|
+
H1 = 4,
|
|
7
|
+
H2 = 5,
|
|
8
|
+
H3 = 6,
|
|
9
|
+
H4 = 7,
|
|
10
|
+
H5 = 8,
|
|
11
|
+
H6 = 9,
|
|
12
|
+
Li = 10,
|
|
13
|
+
Blockquote = 11,
|
|
14
|
+
B = 12
|
|
15
|
+
}
|
|
16
|
+
export declare class Tree {
|
|
17
|
+
private _base;
|
|
18
|
+
private static _tree;
|
|
19
|
+
constructor(base?: NSCMason);
|
|
20
|
+
static get instance(): Tree;
|
|
21
|
+
get native(): NSCMason;
|
|
22
|
+
createView(): MasonUIView;
|
|
23
|
+
createTextView(context?: any, type?: TextType): MasonText;
|
|
24
|
+
createImageView(): MasonImg;
|
|
25
|
+
createScrollView(): MasonScroll;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
var TextType;
|
|
3
|
+
(function (TextType) {
|
|
4
|
+
TextType[TextType["None"] = 0] = "None";
|
|
5
|
+
TextType[TextType["P"] = 1] = "P";
|
|
6
|
+
TextType[TextType["Span"] = 2] = "Span";
|
|
7
|
+
TextType[TextType["Code"] = 3] = "Code";
|
|
8
|
+
TextType[TextType["H1"] = 4] = "H1";
|
|
9
|
+
TextType[TextType["H2"] = 5] = "H2";
|
|
10
|
+
TextType[TextType["H3"] = 6] = "H3";
|
|
11
|
+
TextType[TextType["H4"] = 7] = "H4";
|
|
12
|
+
TextType[TextType["H5"] = 8] = "H5";
|
|
13
|
+
TextType[TextType["H6"] = 9] = "H6";
|
|
14
|
+
TextType[TextType["Li"] = 10] = "Li";
|
|
15
|
+
TextType[TextType["Blockquote"] = 11] = "Blockquote";
|
|
16
|
+
TextType[TextType["B"] = 12] = "B";
|
|
17
|
+
})(TextType || (TextType = {}));
|
|
18
|
+
export class Tree {
|
|
19
|
+
constructor(base) {
|
|
20
|
+
this._base = base ?? NSCMason.new();
|
|
21
|
+
}
|
|
22
|
+
static get instance() {
|
|
23
|
+
return _a._tree;
|
|
24
|
+
}
|
|
25
|
+
get native() {
|
|
26
|
+
return this._base;
|
|
27
|
+
}
|
|
28
|
+
createView() {
|
|
29
|
+
return this.native.createView();
|
|
30
|
+
}
|
|
31
|
+
createTextView(context, type) {
|
|
32
|
+
switch (type) {
|
|
33
|
+
case TextType.P:
|
|
34
|
+
return this.native.createTextViewWithType(1 /* MasonTextType.P */);
|
|
35
|
+
case TextType.Span:
|
|
36
|
+
return this.native.createTextViewWithType(2 /* MasonTextType.Span */);
|
|
37
|
+
case TextType.Code:
|
|
38
|
+
return this.native.createTextViewWithType(3 /* MasonTextType.Code */);
|
|
39
|
+
case TextType.H1:
|
|
40
|
+
return this.native.createTextViewWithType(4 /* MasonTextType.H1 */);
|
|
41
|
+
case TextType.H2:
|
|
42
|
+
return this.native.createTextViewWithType(5 /* MasonTextType.H2 */);
|
|
43
|
+
case TextType.H3:
|
|
44
|
+
return this.native.createTextViewWithType(6 /* MasonTextType.H3 */);
|
|
45
|
+
case TextType.H4:
|
|
46
|
+
return this.native.createTextViewWithType(7 /* MasonTextType.H4 */);
|
|
47
|
+
case TextType.H5:
|
|
48
|
+
return this.native.createTextViewWithType(8 /* MasonTextType.H5 */);
|
|
49
|
+
case TextType.H6:
|
|
50
|
+
return this.native.createTextViewWithType(9 /* MasonTextType.H6 */);
|
|
51
|
+
case TextType.Li:
|
|
52
|
+
return this.native.createTextViewWithType(10 /* MasonTextType.Li */);
|
|
53
|
+
case TextType.Blockquote:
|
|
54
|
+
return this.native.createTextViewWithType(11 /* MasonTextType.Blockquote */);
|
|
55
|
+
case TextType.B:
|
|
56
|
+
return this.native.createTextViewWithType(12 /* MasonTextType.B */);
|
|
57
|
+
default:
|
|
58
|
+
return this.native.createTextView();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
createImageView() {
|
|
62
|
+
return this.native.createImageView();
|
|
63
|
+
}
|
|
64
|
+
createScrollView() {
|
|
65
|
+
return this.native.createScrollView();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
_a = Tree;
|
|
69
|
+
(() => {
|
|
70
|
+
_a._tree = new _a(NSCMason.shared);
|
|
71
|
+
})();
|
|
72
|
+
//# sourceMappingURL=index.ios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.ios.js","sourceRoot":"","sources":["../../../../packages/nativescript-masonkit/tree/index.ios.ts"],"names":[],"mappings":";AAAA,IAAK,QA0BJ;AA1BD,WAAK,QAAQ;IACX,uCAAQ,CAAA;IAER,iCAAK,CAAA;IAEL,uCAAQ,CAAA;IAER,uCAAQ,CAAA;IAER,mCAAM,CAAA;IAEN,mCAAM,CAAA;IAEN,mCAAM,CAAA;IAEN,mCAAM,CAAA;IAEN,mCAAM,CAAA;IAEN,mCAAM,CAAA;IAEN,oCAAO,CAAA;IAEP,oDAAe,CAAA;IAEf,kCAAM,CAAA;AACR,CAAC,EA1BI,QAAQ,KAAR,QAAQ,QA0BZ;AAED,MAAM,OAAO,IAAI;IAGf,YAAY,IAAe;QACzB,IAAI,CAAC,KAAK,GAAG,IAAI,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAC;IACtC,C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