@triniwiz/nativescript-masonkit 1.0.0-beta.61 → 1.0.0-beta.62
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/DOCS.md +5 -5
- package/button/index.ios.js +2 -2
- package/button/index.ios.js.map +1 -1
- package/common.d.ts +4 -1
- package/common.js +35 -12
- package/common.js.map +1 -1
- package/img/index.ios.js +4 -2
- package/img/index.ios.js.map +1 -1
- package/index.android.d.ts +2 -0
- package/index.android.js +2 -0
- package/index.android.js.map +1 -1
- package/index.d.ts +10 -0
- package/index.ios.d.ts +2 -0
- package/index.ios.js +2 -0
- package/index.ios.js.map +1 -1
- package/input/index.ios.js +10 -2
- package/input/index.ios.js.map +1 -1
- package/li/index.android.d.ts +12 -0
- package/li/index.android.js +57 -0
- package/li/index.android.js.map +1 -0
- package/li/index.ios.d.ts +14 -0
- package/li/index.ios.js +125 -0
- package/li/index.ios.js.map +1 -0
- package/list/common.d.ts +33 -0
- package/list/common.js +157 -0
- package/list/common.js.map +1 -0
- package/list/index.android.d.ts +28 -0
- package/list/index.android.js +155 -0
- package/list/index.android.js.map +1 -0
- package/list/index.ios.d.ts +42 -0
- package/list/index.ios.js +321 -0
- package/list/index.ios.js.map +1 -0
- package/package.json +1 -1
- package/platforms/android/masonkit-release.aar +0 -0
- package/platforms/ios/Mason.xcframework/Info.plist +5 -5
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +106 -24
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/mason_native.h +57 -8
- 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 +55092 -39434
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +758 -223
- 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 +758 -223
- 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 +8189 -7413
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +212 -48
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/mason_native.h +57 -8
- 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 +55092 -39434
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +758 -223
- 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 +758 -223
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +55092 -39434
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +758 -223
- 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 +758 -223
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +28 -28
- 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 +8184 -7408
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +7848 -7103
- package/properties.d.ts +8 -1
- package/properties.js +37 -0
- package/properties.js.map +1 -1
- package/scroll/index.ios.js +6 -2
- package/scroll/index.ios.js.map +1 -1
- package/style.d.ts +14 -3
- package/style.js +428 -235
- package/style.js.map +1 -1
- package/text/index.ios.js +5 -2
- package/text/index.ios.js.map +1 -1
- package/tree/index.android.d.ts +2 -0
- package/tree/index.android.js +6 -0
- package/tree/index.android.js.map +1 -1
- package/tree/index.ios.d.ts +3 -1
- package/tree/index.ios.js +7 -1
- package/tree/index.ios.js.map +1 -1
- package/utils/index.android.d.ts +11 -0
- package/utils/index.ios.d.ts +11 -0
- package/view/index.ios.js +20 -4
- package/view/index.ios.js.map +1 -1
package/style.js
CHANGED
|
@@ -78,7 +78,7 @@ var StyleKeys;
|
|
|
78
78
|
StyleKeys[StyleKeys["GRID_ROW_END_TYPE"] = 166] = "GRID_ROW_END_TYPE";
|
|
79
79
|
StyleKeys[StyleKeys["GRID_ROW_END_VALUE"] = 167] = "GRID_ROW_END_VALUE";
|
|
80
80
|
StyleKeys[StyleKeys["SCROLLBAR_WIDTH"] = 171] = "SCROLLBAR_WIDTH";
|
|
81
|
-
StyleKeys[StyleKeys["
|
|
81
|
+
StyleKeys[StyleKeys["ALIGN"] = 175] = "ALIGN";
|
|
82
82
|
StyleKeys[StyleKeys["BOX_SIZING"] = 176] = "BOX_SIZING";
|
|
83
83
|
StyleKeys[StyleKeys["OVERFLOW"] = 177] = "OVERFLOW";
|
|
84
84
|
StyleKeys[StyleKeys["ITEM_IS_TABLE"] = 178] = "ITEM_IS_TABLE";
|
|
@@ -163,49 +163,59 @@ var StyleKeys;
|
|
|
163
163
|
StyleKeys[StyleKeys["LIST_STYLE_POSITION_STATE"] = 318] = "LIST_STYLE_POSITION_STATE";
|
|
164
164
|
StyleKeys[StyleKeys["LIST_STYLE_TYPE_STATE"] = 319] = "LIST_STYLE_TYPE_STATE";
|
|
165
165
|
StyleKeys[StyleKeys["REF_COUNT"] = 320] = "REF_COUNT";
|
|
166
|
+
StyleKeys[StyleKeys["FONT_COLOR"] = 324] = "FONT_COLOR";
|
|
167
|
+
StyleKeys[StyleKeys["FONT_COLOR_STATE"] = 328] = "FONT_COLOR_STATE";
|
|
168
|
+
StyleKeys[StyleKeys["FONT_SIZE"] = 329] = "FONT_SIZE";
|
|
169
|
+
StyleKeys[StyleKeys["FONT_SIZE_TYPE"] = 333] = "FONT_SIZE_TYPE";
|
|
170
|
+
StyleKeys[StyleKeys["FONT_SIZE_STATE"] = 334] = "FONT_SIZE_STATE";
|
|
171
|
+
StyleKeys[StyleKeys["FONT_WEIGHT"] = 335] = "FONT_WEIGHT";
|
|
172
|
+
StyleKeys[StyleKeys["FONT_WEIGHT_STATE"] = 339] = "FONT_WEIGHT_STATE";
|
|
173
|
+
StyleKeys[StyleKeys["FONT_STYLE_SLANT"] = 340] = "FONT_STYLE_SLANT";
|
|
174
|
+
StyleKeys[StyleKeys["FONT_STYLE_TYPE"] = 344] = "FONT_STYLE_TYPE";
|
|
175
|
+
StyleKeys[StyleKeys["FONT_STYLE_STATE"] = 345] = "FONT_STYLE_STATE";
|
|
176
|
+
StyleKeys[StyleKeys["FONT_FAMILY_STATE"] = 346] = "FONT_FAMILY_STATE";
|
|
177
|
+
StyleKeys[StyleKeys["FONT_RESOLVED_DIRTY"] = 347] = "FONT_RESOLVED_DIRTY";
|
|
178
|
+
StyleKeys[StyleKeys["BACKGROUND_COLOR"] = 348] = "BACKGROUND_COLOR";
|
|
179
|
+
StyleKeys[StyleKeys["BACKGROUND_COLOR_STATE"] = 352] = "BACKGROUND_COLOR_STATE";
|
|
180
|
+
StyleKeys[StyleKeys["BACKGROUND_COLOR_TYPE"] = 353] = "BACKGROUND_COLOR_TYPE";
|
|
181
|
+
StyleKeys[StyleKeys["DECORATION_LINE"] = 354] = "DECORATION_LINE";
|
|
182
|
+
StyleKeys[StyleKeys["DECORATION_LINE_STATE"] = 355] = "DECORATION_LINE_STATE";
|
|
183
|
+
StyleKeys[StyleKeys["DECORATION_COLOR"] = 356] = "DECORATION_COLOR";
|
|
184
|
+
StyleKeys[StyleKeys["DECORATION_COLOR_STATE"] = 360] = "DECORATION_COLOR_STATE";
|
|
185
|
+
StyleKeys[StyleKeys["DECORATION_STYLE"] = 361] = "DECORATION_STYLE";
|
|
186
|
+
StyleKeys[StyleKeys["DECORATION_STYLE_STATE"] = 362] = "DECORATION_STYLE_STATE";
|
|
187
|
+
StyleKeys[StyleKeys["LETTER_SPACING"] = 363] = "LETTER_SPACING";
|
|
188
|
+
StyleKeys[StyleKeys["LETTER_SPACING_STATE"] = 367] = "LETTER_SPACING_STATE";
|
|
189
|
+
StyleKeys[StyleKeys["TEXT_WRAP"] = 368] = "TEXT_WRAP";
|
|
190
|
+
StyleKeys[StyleKeys["TEXT_WRAP_STATE"] = 369] = "TEXT_WRAP_STATE";
|
|
191
|
+
StyleKeys[StyleKeys["WHITE_SPACE"] = 370] = "WHITE_SPACE";
|
|
192
|
+
StyleKeys[StyleKeys["WHITE_SPACE_STATE"] = 371] = "WHITE_SPACE_STATE";
|
|
193
|
+
StyleKeys[StyleKeys["TEXT_TRANSFORM"] = 372] = "TEXT_TRANSFORM";
|
|
194
|
+
StyleKeys[StyleKeys["TEXT_TRANSFORM_STATE"] = 373] = "TEXT_TRANSFORM_STATE";
|
|
195
|
+
StyleKeys[StyleKeys["TEXT_ALIGN"] = 374] = "TEXT_ALIGN";
|
|
196
|
+
StyleKeys[StyleKeys["TEXT_ALIGN_STATE"] = 375] = "TEXT_ALIGN_STATE";
|
|
197
|
+
StyleKeys[StyleKeys["TEXT_JUSTIFY"] = 376] = "TEXT_JUSTIFY";
|
|
198
|
+
StyleKeys[StyleKeys["TEXT_JUSTIFY_STATE"] = 377] = "TEXT_JUSTIFY_STATE";
|
|
199
|
+
StyleKeys[StyleKeys["TEXT_INDENT"] = 378] = "TEXT_INDENT";
|
|
200
|
+
StyleKeys[StyleKeys["TEXT_INDENT_TYPE"] = 382] = "TEXT_INDENT_TYPE";
|
|
201
|
+
StyleKeys[StyleKeys["TEXT_INDENT_STATE"] = 383] = "TEXT_INDENT_STATE";
|
|
202
|
+
StyleKeys[StyleKeys["LINE_HEIGHT"] = 384] = "LINE_HEIGHT";
|
|
203
|
+
StyleKeys[StyleKeys["LINE_HEIGHT_STATE"] = 388] = "LINE_HEIGHT_STATE";
|
|
204
|
+
StyleKeys[StyleKeys["LINE_HEIGHT_TYPE"] = 389] = "LINE_HEIGHT_TYPE";
|
|
205
|
+
StyleKeys[StyleKeys["DECORATION_THICKNESS"] = 390] = "DECORATION_THICKNESS";
|
|
206
|
+
StyleKeys[StyleKeys["DECORATION_THICKNESS_STATE"] = 394] = "DECORATION_THICKNESS_STATE";
|
|
207
|
+
StyleKeys[StyleKeys["TEXT_SHADOW_STATE"] = 395] = "TEXT_SHADOW_STATE";
|
|
208
|
+
StyleKeys[StyleKeys["TEXT_OVERFLOW"] = 396] = "TEXT_OVERFLOW";
|
|
209
|
+
StyleKeys[StyleKeys["TEXT_OVERFLOW_STATE"] = 397] = "TEXT_OVERFLOW_STATE";
|
|
210
|
+
// Pseudo set mask: 128-bit bitmask (two longs) tracking which properties
|
|
211
|
+
// were explicitly set on a pseudo style buffer. Uses the same bit layout
|
|
212
|
+
// as StateKeys. Zero-copy: lives in the style buffer itself.
|
|
213
|
+
StyleKeys[StyleKeys["PSEUDO_SET_MASK_LOW"] = 398] = "PSEUDO_SET_MASK_LOW";
|
|
214
|
+
StyleKeys[StyleKeys["PSEUDO_SET_MASK_HIGH"] = 406] = "PSEUDO_SET_MASK_HIGH";
|
|
215
|
+
// font-variant-numeric bitmask (byte) + state
|
|
216
|
+
StyleKeys[StyleKeys["FONT_VARIANT_NUMERIC"] = 419] = "FONT_VARIANT_NUMERIC";
|
|
217
|
+
StyleKeys[StyleKeys["FONT_VARIANT_NUMERIC_STATE"] = 420] = "FONT_VARIANT_NUMERIC_STATE";
|
|
166
218
|
})(StyleKeys || (StyleKeys = {}));
|
|
167
|
-
var TextStyleKeys;
|
|
168
|
-
(function (TextStyleKeys) {
|
|
169
|
-
TextStyleKeys[TextStyleKeys["COLOR"] = 0] = "COLOR";
|
|
170
|
-
TextStyleKeys[TextStyleKeys["COLOR_STATE"] = 4] = "COLOR_STATE";
|
|
171
|
-
TextStyleKeys[TextStyleKeys["SIZE"] = 8] = "SIZE";
|
|
172
|
-
TextStyleKeys[TextStyleKeys["SIZE_TYPE"] = 12] = "SIZE_TYPE";
|
|
173
|
-
TextStyleKeys[TextStyleKeys["SIZE_STATE"] = 13] = "SIZE_STATE";
|
|
174
|
-
TextStyleKeys[TextStyleKeys["FONT_WEIGHT"] = 16] = "FONT_WEIGHT";
|
|
175
|
-
TextStyleKeys[TextStyleKeys["FONT_WEIGHT_STATE"] = 20] = "FONT_WEIGHT_STATE";
|
|
176
|
-
TextStyleKeys[TextStyleKeys["FONT_STYLE_SLANT"] = 24] = "FONT_STYLE_SLANT";
|
|
177
|
-
TextStyleKeys[TextStyleKeys["FONT_STYLE_TYPE"] = 28] = "FONT_STYLE_TYPE";
|
|
178
|
-
TextStyleKeys[TextStyleKeys["FONT_STYLE_STATE"] = 29] = "FONT_STYLE_STATE";
|
|
179
|
-
TextStyleKeys[TextStyleKeys["FONT_FAMILY_STATE"] = 30] = "FONT_FAMILY_STATE";
|
|
180
|
-
TextStyleKeys[TextStyleKeys["FONT_RESOLVED_DIRTY"] = 31] = "FONT_RESOLVED_DIRTY";
|
|
181
|
-
TextStyleKeys[TextStyleKeys["BACKGROUND_COLOR"] = 32] = "BACKGROUND_COLOR";
|
|
182
|
-
TextStyleKeys[TextStyleKeys["BACKGROUND_COLOR_STATE"] = 36] = "BACKGROUND_COLOR_STATE";
|
|
183
|
-
TextStyleKeys[TextStyleKeys["DECORATION_LINE"] = 40] = "DECORATION_LINE";
|
|
184
|
-
TextStyleKeys[TextStyleKeys["DECORATION_LINE_STATE"] = 44] = "DECORATION_LINE_STATE";
|
|
185
|
-
TextStyleKeys[TextStyleKeys["DECORATION_COLOR"] = 48] = "DECORATION_COLOR";
|
|
186
|
-
TextStyleKeys[TextStyleKeys["DECORATION_COLOR_STATE"] = 52] = "DECORATION_COLOR_STATE";
|
|
187
|
-
TextStyleKeys[TextStyleKeys["DECORATION_STYLE"] = 56] = "DECORATION_STYLE";
|
|
188
|
-
TextStyleKeys[TextStyleKeys["DECORATION_STYLE_STATE"] = 60] = "DECORATION_STYLE_STATE";
|
|
189
|
-
TextStyleKeys[TextStyleKeys["LETTER_SPACING"] = 64] = "LETTER_SPACING";
|
|
190
|
-
TextStyleKeys[TextStyleKeys["LETTER_SPACING_STATE"] = 68] = "LETTER_SPACING_STATE";
|
|
191
|
-
TextStyleKeys[TextStyleKeys["TEXT_WRAP"] = 72] = "TEXT_WRAP";
|
|
192
|
-
TextStyleKeys[TextStyleKeys["TEXT_WRAP_STATE"] = 76] = "TEXT_WRAP_STATE";
|
|
193
|
-
TextStyleKeys[TextStyleKeys["WHITE_SPACE"] = 80] = "WHITE_SPACE";
|
|
194
|
-
TextStyleKeys[TextStyleKeys["WHITE_SPACE_STATE"] = 84] = "WHITE_SPACE_STATE";
|
|
195
|
-
TextStyleKeys[TextStyleKeys["TRANSFORM"] = 88] = "TRANSFORM";
|
|
196
|
-
TextStyleKeys[TextStyleKeys["TRANSFORM_STATE"] = 92] = "TRANSFORM_STATE";
|
|
197
|
-
TextStyleKeys[TextStyleKeys["TEXT_ALIGN"] = 96] = "TEXT_ALIGN";
|
|
198
|
-
TextStyleKeys[TextStyleKeys["TEXT_ALIGN_STATE"] = 100] = "TEXT_ALIGN_STATE";
|
|
199
|
-
TextStyleKeys[TextStyleKeys["TEXT_JUSTIFY"] = 104] = "TEXT_JUSTIFY";
|
|
200
|
-
TextStyleKeys[TextStyleKeys["TEXT_JUSTIFY_STATE"] = 108] = "TEXT_JUSTIFY_STATE";
|
|
201
|
-
TextStyleKeys[TextStyleKeys["TEXT_INDENT"] = 112] = "TEXT_INDENT";
|
|
202
|
-
TextStyleKeys[TextStyleKeys["TEXT_INDENT_STATE"] = 116] = "TEXT_INDENT_STATE";
|
|
203
|
-
TextStyleKeys[TextStyleKeys["TEXT_OVERFLOW"] = 120] = "TEXT_OVERFLOW";
|
|
204
|
-
TextStyleKeys[TextStyleKeys["TEXT_OVERFLOW_STATE"] = 124] = "TEXT_OVERFLOW_STATE";
|
|
205
|
-
TextStyleKeys[TextStyleKeys["LINE_HEIGHT"] = 128] = "LINE_HEIGHT";
|
|
206
|
-
TextStyleKeys[TextStyleKeys["LINE_HEIGHT_TYPE"] = 132] = "LINE_HEIGHT_TYPE";
|
|
207
|
-
TextStyleKeys[TextStyleKeys["LINE_HEIGHT_STATE"] = 133] = "LINE_HEIGHT_STATE";
|
|
208
|
-
})(TextStyleKeys || (TextStyleKeys = {}));
|
|
209
219
|
function parseLengthPercentageAuto(type, value) {
|
|
210
220
|
switch (type) {
|
|
211
221
|
case 0:
|
|
@@ -228,100 +238,96 @@ class StateKeys {
|
|
|
228
238
|
constructor(bits) {
|
|
229
239
|
this.bits = bits;
|
|
230
240
|
}
|
|
231
|
-
|
|
232
|
-
return new StateKeys(
|
|
233
|
-
}
|
|
234
|
-
and(other) {
|
|
235
|
-
return new StateKeys(this.bits & other.bits);
|
|
241
|
+
static flag(n) {
|
|
242
|
+
return new StateKeys(1n << BigInt(n));
|
|
236
243
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
241
|
-
StateKeys.DISPLAY = new StateKeys(1n << 0n);
|
|
242
|
-
StateKeys.POSITION = new StateKeys(1n << 1n);
|
|
243
|
-
StateKeys.DIRECTION = new StateKeys(1n << 2n);
|
|
244
|
-
StateKeys.FLEX_DIRECTION = new StateKeys(1n << 3n);
|
|
245
|
-
StateKeys.FLEX_WRAP = new StateKeys(1n << 4n);
|
|
246
|
-
StateKeys.OVERFLOW_X = new StateKeys(1n << 5n);
|
|
247
|
-
StateKeys.OVERFLOW_Y = new StateKeys(1n << 6n);
|
|
248
|
-
StateKeys.ALIGN_ITEMS = new StateKeys(1n << 7n);
|
|
249
|
-
StateKeys.ALIGN_SELF = new StateKeys(1n << 8n);
|
|
250
|
-
StateKeys.ALIGN_CONTENT = new StateKeys(1n << 9n);
|
|
251
|
-
StateKeys.JUSTIFY_ITEMS = new StateKeys(1n << 10n);
|
|
252
|
-
StateKeys.JUSTIFY_SELF = new StateKeys(1n << 11n);
|
|
253
|
-
StateKeys.JUSTIFY_CONTENT = new StateKeys(1n << 12n);
|
|
254
|
-
StateKeys.INSET = new StateKeys(1n << 13n);
|
|
255
|
-
StateKeys.MARGIN = new StateKeys(1n << 14n);
|
|
256
|
-
StateKeys.PADDING = new StateKeys(1n << 15n);
|
|
257
|
-
StateKeys.BORDER = new StateKeys(1n << 16n);
|
|
258
|
-
StateKeys.FLEX_GROW = new StateKeys(1n << 17n);
|
|
259
|
-
StateKeys.FLEX_SHRINK = new StateKeys(1n << 18n);
|
|
260
|
-
StateKeys.FLEX_BASIS = new StateKeys(1n << 19n);
|
|
261
|
-
StateKeys.SIZE = new StateKeys(1n << 20n);
|
|
262
|
-
StateKeys.MIN_SIZE = new StateKeys(1n << 21n);
|
|
263
|
-
StateKeys.MAX_SIZE = new StateKeys(1n << 22n);
|
|
264
|
-
StateKeys.GAP = new StateKeys(1n << 23n);
|
|
265
|
-
StateKeys.ASPECT_RATIO = new StateKeys(1n << 24n);
|
|
266
|
-
StateKeys.GRID_AUTO_FLOW = new StateKeys(1n << 25n);
|
|
267
|
-
StateKeys.GRID_COLUMN = new StateKeys(1n << 26n);
|
|
268
|
-
StateKeys.GRID_ROW = new StateKeys(1n << 27n);
|
|
269
|
-
StateKeys.SCROLLBAR_WIDTH = new StateKeys(1n << 28n);
|
|
270
|
-
StateKeys.TEXT_ALIGN = new StateKeys(1n << 29n);
|
|
271
|
-
StateKeys.BOX_SIZING = new StateKeys(1n << 30n);
|
|
272
|
-
StateKeys.OVERFLOW = new StateKeys(1n << 31n);
|
|
273
|
-
StateKeys.ITEM_IS_TABLE = new StateKeys(1n << 32n);
|
|
274
|
-
StateKeys.ITEM_IS_REPLACED = new StateKeys(1n << 33n);
|
|
275
|
-
StateKeys.DISPLAY_MODE = new StateKeys(1n << 34n);
|
|
276
|
-
StateKeys.FORCE_INLINE = new StateKeys(1n << 35n);
|
|
277
|
-
StateKeys.MIN_CONTENT_WIDTH = new StateKeys(1n << 36n);
|
|
278
|
-
StateKeys.MIN_CONTENT_HEIGHT = new StateKeys(1n << 37n);
|
|
279
|
-
StateKeys.MAX_CONTENT_WIDTH = new StateKeys(1n << 38n);
|
|
280
|
-
StateKeys.MAX_CONTENT_HEIGHT = new StateKeys(1n << 39n);
|
|
281
|
-
StateKeys.BORDER_STYLE = new StateKeys(1n << 40n);
|
|
282
|
-
StateKeys.BORDER_RADIUS = new StateKeys(1n << 41n);
|
|
283
|
-
StateKeys.BORDER_COLOR = new StateKeys(1n << 42n);
|
|
284
|
-
StateKeys.FLOAT = new StateKeys(1n << 43n);
|
|
285
|
-
StateKeys.CLEAR = new StateKeys(1n << 44n);
|
|
286
|
-
StateKeys.OBJECT_FIT = new StateKeys(1n << 45n);
|
|
287
|
-
StateKeys.Z_INDEX = new StateKeys(1n << 46n);
|
|
288
|
-
class TextStateKeys {
|
|
289
|
-
constructor(bits) {
|
|
290
|
-
this.bits = bits;
|
|
244
|
+
// compatibility: return low bits when code expects single 64-bit value
|
|
245
|
+
get bitsLow() {
|
|
246
|
+
return this.bits;
|
|
291
247
|
}
|
|
292
248
|
or(other) {
|
|
293
|
-
return new
|
|
249
|
+
return new StateKeys(this.bits | other.bits);
|
|
294
250
|
}
|
|
295
251
|
and(other) {
|
|
296
|
-
return new
|
|
252
|
+
return new StateKeys(this.bits & other.bits);
|
|
297
253
|
}
|
|
298
254
|
hasFlag(flag) {
|
|
299
255
|
return (this.bits & flag.bits) !== 0n;
|
|
300
256
|
}
|
|
301
257
|
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
258
|
+
StateKeys.NONE = new StateKeys(0n);
|
|
259
|
+
StateKeys.DISPLAY = StateKeys.flag(0);
|
|
260
|
+
StateKeys.POSITION = StateKeys.flag(1);
|
|
261
|
+
StateKeys.DIRECTION = StateKeys.flag(2);
|
|
262
|
+
StateKeys.FLEX_DIRECTION = StateKeys.flag(3);
|
|
263
|
+
StateKeys.FLEX_WRAP = StateKeys.flag(4);
|
|
264
|
+
StateKeys.OVERFLOW_X = StateKeys.flag(5);
|
|
265
|
+
StateKeys.OVERFLOW_Y = StateKeys.flag(6);
|
|
266
|
+
StateKeys.ALIGN_ITEMS = StateKeys.flag(7);
|
|
267
|
+
StateKeys.ALIGN_SELF = StateKeys.flag(8);
|
|
268
|
+
StateKeys.ALIGN_CONTENT = StateKeys.flag(9);
|
|
269
|
+
StateKeys.JUSTIFY_ITEMS = StateKeys.flag(10);
|
|
270
|
+
StateKeys.JUSTIFY_SELF = StateKeys.flag(11);
|
|
271
|
+
StateKeys.JUSTIFY_CONTENT = StateKeys.flag(12);
|
|
272
|
+
StateKeys.INSET = StateKeys.flag(13);
|
|
273
|
+
StateKeys.MARGIN = StateKeys.flag(14);
|
|
274
|
+
StateKeys.PADDING = StateKeys.flag(15);
|
|
275
|
+
StateKeys.BORDER = StateKeys.flag(16);
|
|
276
|
+
StateKeys.FLEX_GROW = StateKeys.flag(17);
|
|
277
|
+
StateKeys.FLEX_SHRINK = StateKeys.flag(18);
|
|
278
|
+
StateKeys.FLEX_BASIS = StateKeys.flag(19);
|
|
279
|
+
StateKeys.SIZE = StateKeys.flag(20);
|
|
280
|
+
StateKeys.MIN_SIZE = StateKeys.flag(21);
|
|
281
|
+
StateKeys.MAX_SIZE = StateKeys.flag(22);
|
|
282
|
+
StateKeys.GAP = StateKeys.flag(23);
|
|
283
|
+
StateKeys.ASPECT_RATIO = StateKeys.flag(24);
|
|
284
|
+
StateKeys.GRID_AUTO_FLOW = StateKeys.flag(25);
|
|
285
|
+
StateKeys.GRID_COLUMN = StateKeys.flag(26);
|
|
286
|
+
StateKeys.GRID_ROW = StateKeys.flag(27);
|
|
287
|
+
StateKeys.SCROLLBAR_WIDTH = StateKeys.flag(28);
|
|
288
|
+
StateKeys.ALIGN = StateKeys.flag(29);
|
|
289
|
+
StateKeys.BOX_SIZING = StateKeys.flag(30);
|
|
290
|
+
StateKeys.OVERFLOW = StateKeys.flag(31);
|
|
291
|
+
StateKeys.ITEM_IS_TABLE = StateKeys.flag(32);
|
|
292
|
+
StateKeys.ITEM_IS_REPLACED = StateKeys.flag(33);
|
|
293
|
+
StateKeys.DISPLAY_MODE = StateKeys.flag(34);
|
|
294
|
+
StateKeys.FORCE_INLINE = StateKeys.flag(35);
|
|
295
|
+
StateKeys.MIN_CONTENT_WIDTH = StateKeys.flag(36);
|
|
296
|
+
StateKeys.MIN_CONTENT_HEIGHT = StateKeys.flag(37);
|
|
297
|
+
StateKeys.MAX_CONTENT_WIDTH = StateKeys.flag(38);
|
|
298
|
+
StateKeys.MAX_CONTENT_HEIGHT = StateKeys.flag(39);
|
|
299
|
+
StateKeys.BORDER_STYLE = StateKeys.flag(40);
|
|
300
|
+
StateKeys.BORDER_RADIUS = StateKeys.flag(41);
|
|
301
|
+
StateKeys.BORDER_COLOR = StateKeys.flag(42);
|
|
302
|
+
StateKeys.FLOAT = StateKeys.flag(43);
|
|
303
|
+
StateKeys.CLEAR = StateKeys.flag(44);
|
|
304
|
+
StateKeys.OBJECT_FIT = StateKeys.flag(45);
|
|
305
|
+
StateKeys.Z_INDEX = StateKeys.flag(46);
|
|
306
|
+
StateKeys.LIST_STYLE_POSITION = StateKeys.flag(47);
|
|
307
|
+
StateKeys.LIST_STYLE_TYPE = StateKeys.flag(48);
|
|
308
|
+
StateKeys.INVALIDATE_TEXT = StateKeys.flag(49);
|
|
309
|
+
StateKeys.FONT_COLOR = StateKeys.flag(50);
|
|
310
|
+
StateKeys.DECORATION_LINE = StateKeys.flag(51);
|
|
311
|
+
StateKeys.DECORATION_COLOR = StateKeys.flag(52);
|
|
312
|
+
StateKeys.TEXT_ALIGN = StateKeys.flag(53);
|
|
313
|
+
StateKeys.TEXT_JUSTIFY = StateKeys.flag(54);
|
|
314
|
+
StateKeys.BACKGROUND_COLOR = StateKeys.flag(55);
|
|
315
|
+
StateKeys.FONT_SIZE = StateKeys.flag(56);
|
|
316
|
+
StateKeys.TEXT_TRANSFORM = StateKeys.flag(57);
|
|
317
|
+
StateKeys.FONT_STYLE = StateKeys.flag(58);
|
|
318
|
+
StateKeys.FONT_STYLE_SLANT = StateKeys.flag(59);
|
|
319
|
+
StateKeys.TEXT_WRAP = StateKeys.flag(60);
|
|
320
|
+
StateKeys.TEXT_OVERFLOW = StateKeys.flag(61);
|
|
321
|
+
StateKeys.DECORATION_STYLE = StateKeys.flag(62);
|
|
322
|
+
StateKeys.WHITE_SPACE = StateKeys.flag(63);
|
|
323
|
+
StateKeys.FONT_WEIGHT = StateKeys.flag(64);
|
|
324
|
+
StateKeys.LINE_HEIGHT = StateKeys.flag(65);
|
|
325
|
+
StateKeys.VERTICAL_ALIGN = StateKeys.flag(66);
|
|
326
|
+
StateKeys.DECORATION_THICKNESS = StateKeys.flag(67);
|
|
327
|
+
StateKeys.TEXT_SHADOWS = StateKeys.flag(68);
|
|
328
|
+
StateKeys.FONT_FAMILY = StateKeys.flag(69);
|
|
329
|
+
StateKeys.LETTER_SPACING = StateKeys.flag(70);
|
|
330
|
+
StateKeys.FONT_VARIANT_NUMERIC = StateKeys.flag(71);
|
|
325
331
|
const getInt8 = (view, offset) => {
|
|
326
332
|
return view.getInt8(offset);
|
|
327
333
|
};
|
|
@@ -334,6 +340,22 @@ const getUint8 = (view, offset) => {
|
|
|
334
340
|
const setUint8 = (view, offset, value) => {
|
|
335
341
|
view.setUint8(offset, value);
|
|
336
342
|
};
|
|
343
|
+
const splitBigIntToInt64Parts = (value) => {
|
|
344
|
+
const MASK64 = (1n << 64n) - 1n;
|
|
345
|
+
const LOW = value & MASK64;
|
|
346
|
+
let HIGH = value >> 64n;
|
|
347
|
+
// Ensure HIGH fits into signed 64-bit range
|
|
348
|
+
const SIGN_BIT = 1n << 63n;
|
|
349
|
+
if ((HIGH & SIGN_BIT) !== 0n) {
|
|
350
|
+
// convert to signed representation
|
|
351
|
+
HIGH = HIGH - (1n << 64n);
|
|
352
|
+
}
|
|
353
|
+
let lowSigned = LOW;
|
|
354
|
+
if ((LOW & SIGN_BIT) !== 0n) {
|
|
355
|
+
lowSigned = LOW - (1n << 64n);
|
|
356
|
+
}
|
|
357
|
+
return [lowSigned.toString(), HIGH.toString()];
|
|
358
|
+
};
|
|
337
359
|
const getInt16 = (view, offset) => {
|
|
338
360
|
return view.getInt16(offset, true);
|
|
339
361
|
};
|
|
@@ -361,7 +383,6 @@ const setFloat32 = (view, offset, value) => {
|
|
|
361
383
|
export class Style {
|
|
362
384
|
constructor() {
|
|
363
385
|
this.isDirty = -1n;
|
|
364
|
-
this.isTextDirty = -1n;
|
|
365
386
|
this.inBatch = false;
|
|
366
387
|
}
|
|
367
388
|
static fromView(view, nativeView) {
|
|
@@ -378,9 +399,6 @@ export class Style {
|
|
|
378
399
|
const styleBuffer = style.getValues();
|
|
379
400
|
const buffer = ArrayBuffer.from(styleBuffer);
|
|
380
401
|
ret.style_view = new DataView(buffer);
|
|
381
|
-
const textStyleBuffer = style.getTextValues();
|
|
382
|
-
const textBuffer = ArrayBuffer.from(textStyleBuffer);
|
|
383
|
-
ret.text_style_view = new DataView(textBuffer);
|
|
384
402
|
}
|
|
385
403
|
else if (__APPLE__) {
|
|
386
404
|
let style = nativeView?.style;
|
|
@@ -390,27 +408,23 @@ export class Style {
|
|
|
390
408
|
const styleBuffer = style.values;
|
|
391
409
|
const buffer = interop.bufferFromData(styleBuffer);
|
|
392
410
|
ret.style_view = new DataView(buffer);
|
|
393
|
-
//@ts-ignore
|
|
394
|
-
const textStyleBuffer = style.textValues;
|
|
395
|
-
const textBuffer = interop.bufferFromData(textStyleBuffer);
|
|
396
|
-
ret.text_style_view = new DataView(textBuffer);
|
|
397
411
|
}
|
|
398
412
|
//console.timeEnd('fromView');
|
|
399
413
|
return ret;
|
|
400
414
|
}
|
|
401
415
|
resetState() {
|
|
402
416
|
this.isDirty = -1n;
|
|
403
|
-
this.isTextDirty = -1n;
|
|
404
417
|
}
|
|
405
418
|
syncStyle() {
|
|
419
|
+
const [low, high] = splitBigIntToInt64Parts(this.isDirty);
|
|
406
420
|
if (__ANDROID__) {
|
|
407
421
|
const view = this.view.android;
|
|
408
|
-
view.syncStyle(
|
|
422
|
+
view.syncStyle(low, high);
|
|
409
423
|
}
|
|
410
424
|
else if (__APPLE__) {
|
|
411
425
|
const view = this.view.ios;
|
|
412
426
|
// @ts-ignore
|
|
413
|
-
view.mason_syncStyle(
|
|
427
|
+
view.mason_syncStyle(low, high);
|
|
414
428
|
}
|
|
415
429
|
this.resetState();
|
|
416
430
|
}
|
|
@@ -425,17 +439,6 @@ export class Style {
|
|
|
425
439
|
this.syncStyle();
|
|
426
440
|
}
|
|
427
441
|
}
|
|
428
|
-
setOrAppendTextState(value) {
|
|
429
|
-
if (this.isTextDirty == -1n) {
|
|
430
|
-
this.isTextDirty = value.bits;
|
|
431
|
-
}
|
|
432
|
-
else {
|
|
433
|
-
this.isTextDirty = this.isTextDirty | value.bits;
|
|
434
|
-
}
|
|
435
|
-
if (!this.inBatch) {
|
|
436
|
-
this.syncStyle();
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
442
|
batch(fn) {
|
|
440
443
|
this.inBatch = true;
|
|
441
444
|
fn(this);
|
|
@@ -496,47 +499,47 @@ export class Style {
|
|
|
496
499
|
}
|
|
497
500
|
}
|
|
498
501
|
get fontSize() {
|
|
499
|
-
if (!this.
|
|
502
|
+
if (!this.style_view) {
|
|
500
503
|
// BLACK ?
|
|
501
504
|
return 16;
|
|
502
505
|
}
|
|
503
|
-
const type = getUint8(this.
|
|
504
|
-
const value = getInt32(this.
|
|
506
|
+
const type = getUint8(this.style_view, StyleKeys.FONT_SIZE_TYPE);
|
|
507
|
+
const value = getInt32(this.style_view, StyleKeys.FONT_SIZE);
|
|
505
508
|
if (type === 1) {
|
|
506
509
|
return `${value / 100}%`;
|
|
507
510
|
}
|
|
508
511
|
return value;
|
|
509
512
|
}
|
|
510
513
|
set fontSize(value) {
|
|
511
|
-
if (!this.
|
|
514
|
+
if (!this.style_view) {
|
|
512
515
|
return;
|
|
513
516
|
}
|
|
514
517
|
switch (typeof value) {
|
|
515
518
|
case 'number':
|
|
516
|
-
setInt32(this.
|
|
517
|
-
setInt8(this.
|
|
518
|
-
setInt8(this.
|
|
519
|
-
this.
|
|
519
|
+
setInt32(this.style_view, StyleKeys.FONT_SIZE, value);
|
|
520
|
+
setInt8(this.style_view, StyleKeys.FONT_SIZE_STATE, 1);
|
|
521
|
+
setInt8(this.style_view, StyleKeys.FONT_SIZE_TYPE, 0);
|
|
522
|
+
this.setOrAppendState(StateKeys.SIZE);
|
|
520
523
|
break;
|
|
521
524
|
case 'object':
|
|
522
525
|
switch (value.unit) {
|
|
523
526
|
case 'dip':
|
|
524
|
-
setInt32(this.
|
|
525
|
-
setInt8(this.
|
|
526
|
-
setInt8(this.
|
|
527
|
-
this.
|
|
527
|
+
setInt32(this.style_view, StyleKeys.FONT_SIZE, layout.toDeviceIndependentPixels(value.value));
|
|
528
|
+
setInt8(this.style_view, StyleKeys.FONT_SIZE_STATE, 1);
|
|
529
|
+
setInt8(this.style_view, StyleKeys.FONT_SIZE_TYPE, 0);
|
|
530
|
+
this.setOrAppendState(StateKeys.FONT_SIZE);
|
|
528
531
|
break;
|
|
529
532
|
case 'px':
|
|
530
|
-
setInt32(this.
|
|
531
|
-
setInt8(this.
|
|
532
|
-
setInt8(this.
|
|
533
|
-
this.
|
|
533
|
+
setInt32(this.style_view, StyleKeys.FONT_SIZE, value.value);
|
|
534
|
+
setInt8(this.style_view, StyleKeys.FONT_SIZE_STATE, 1);
|
|
535
|
+
setInt8(this.style_view, StyleKeys.FONT_SIZE_TYPE, 0);
|
|
536
|
+
this.setOrAppendState(StateKeys.FONT_SIZE);
|
|
534
537
|
break;
|
|
535
538
|
case '%':
|
|
536
|
-
setInt32(this.
|
|
537
|
-
setInt8(this.
|
|
538
|
-
setInt8(this.
|
|
539
|
-
this.
|
|
539
|
+
setInt32(this.style_view, StyleKeys.FONT_SIZE, value.value * 100);
|
|
540
|
+
setInt8(this.style_view, StyleKeys.FONT_SIZE_STATE, 1);
|
|
541
|
+
setInt8(this.style_view, StyleKeys.FONT_SIZE_TYPE, 1);
|
|
542
|
+
this.setOrAppendState(StateKeys.FONT_SIZE);
|
|
540
543
|
break;
|
|
541
544
|
}
|
|
542
545
|
break;
|
|
@@ -547,11 +550,11 @@ export class Style {
|
|
|
547
550
|
}
|
|
548
551
|
}
|
|
549
552
|
get fontStyle() {
|
|
550
|
-
if (!this.
|
|
553
|
+
if (!this.style_view) {
|
|
551
554
|
// normal ?
|
|
552
555
|
return 'normal';
|
|
553
556
|
}
|
|
554
|
-
switch (getInt32(this.
|
|
557
|
+
switch (getInt32(this.style_view, StyleKeys.FONT_STYLE_TYPE)) {
|
|
555
558
|
case 0:
|
|
556
559
|
return 'normal';
|
|
557
560
|
case 1:
|
|
@@ -563,7 +566,7 @@ export class Style {
|
|
|
563
566
|
}
|
|
564
567
|
}
|
|
565
568
|
set fontStyle(value) {
|
|
566
|
-
if (!this.
|
|
569
|
+
if (!this.style_view) {
|
|
567
570
|
return;
|
|
568
571
|
}
|
|
569
572
|
let style = -1;
|
|
@@ -579,20 +582,20 @@ export class Style {
|
|
|
579
582
|
break;
|
|
580
583
|
}
|
|
581
584
|
if (style !== -1) {
|
|
582
|
-
setInt32(this.
|
|
583
|
-
setInt8(this.
|
|
584
|
-
this.
|
|
585
|
+
setInt32(this.style_view, StyleKeys.FONT_STYLE_TYPE, style);
|
|
586
|
+
setInt8(this.style_view, StyleKeys.FONT_STYLE_STATE, 1);
|
|
587
|
+
this.setOrAppendState(StateKeys.FONT_STYLE);
|
|
585
588
|
}
|
|
586
589
|
}
|
|
587
590
|
get fontWeight() {
|
|
588
|
-
if (!this.
|
|
591
|
+
if (!this.style_view) {
|
|
589
592
|
// BLACK ?
|
|
590
593
|
return 400;
|
|
591
594
|
}
|
|
592
|
-
return getInt32(this.
|
|
595
|
+
return getInt32(this.style_view, StyleKeys.FONT_WEIGHT);
|
|
593
596
|
}
|
|
594
597
|
set fontWeight(value) {
|
|
595
|
-
if (!this.
|
|
598
|
+
if (!this.style_view) {
|
|
596
599
|
return;
|
|
597
600
|
}
|
|
598
601
|
let weight = -1;
|
|
@@ -633,50 +636,51 @@ export class Style {
|
|
|
633
636
|
break;
|
|
634
637
|
}
|
|
635
638
|
if (weight !== -1) {
|
|
636
|
-
setInt32(this.
|
|
637
|
-
setInt8(this.
|
|
638
|
-
this.
|
|
639
|
+
setInt32(this.style_view, StyleKeys.FONT_WEIGHT, weight);
|
|
640
|
+
setInt8(this.style_view, StyleKeys.FONT_WEIGHT_STATE, 1);
|
|
641
|
+
this.setOrAppendState(StateKeys.FONT_WEIGHT);
|
|
639
642
|
}
|
|
640
643
|
}
|
|
641
644
|
get color() {
|
|
642
|
-
if (!this.
|
|
645
|
+
if (!this.style_view) {
|
|
643
646
|
// BLACK ?
|
|
644
647
|
return 0;
|
|
645
648
|
}
|
|
646
|
-
return getUint32(this.
|
|
649
|
+
return getUint32(this.style_view, StyleKeys.FONT_COLOR);
|
|
647
650
|
}
|
|
648
651
|
set color(value) {
|
|
649
|
-
if (!this.
|
|
652
|
+
if (!this.style_view) {
|
|
650
653
|
return;
|
|
651
654
|
}
|
|
652
|
-
setUint32(this.
|
|
653
|
-
setInt8(this.
|
|
654
|
-
this.
|
|
655
|
+
setUint32(this.style_view, StyleKeys.FONT_COLOR, value);
|
|
656
|
+
setInt8(this.style_view, StyleKeys.FONT_COLOR_STATE, 1);
|
|
657
|
+
this.setOrAppendState(StateKeys.FONT_COLOR);
|
|
655
658
|
}
|
|
656
659
|
get backgroundColor() {
|
|
657
|
-
if (!this.
|
|
660
|
+
if (!this.style_view) {
|
|
658
661
|
// BLACK ?
|
|
659
662
|
return 0;
|
|
660
663
|
}
|
|
661
|
-
return getUint32(this.
|
|
664
|
+
return getUint32(this.style_view, StyleKeys.BACKGROUND_COLOR);
|
|
662
665
|
}
|
|
663
666
|
set backgroundColor(value) {
|
|
664
|
-
if (!this.
|
|
667
|
+
if (!this.style_view) {
|
|
665
668
|
return;
|
|
666
669
|
}
|
|
667
|
-
setUint32(this.
|
|
668
|
-
setInt8(this.
|
|
669
|
-
this.
|
|
670
|
+
setUint32(this.style_view, StyleKeys.BACKGROUND_COLOR, value);
|
|
671
|
+
setInt8(this.style_view, StyleKeys.BACKGROUND_COLOR_STATE, 1);
|
|
672
|
+
setInt8(this.style_view, StyleKeys.BACKGROUND_COLOR_TYPE, 0);
|
|
673
|
+
this.setOrAppendState(StateKeys.BACKGROUND_COLOR);
|
|
670
674
|
}
|
|
671
675
|
get textWrap() {
|
|
672
|
-
if (!this.
|
|
676
|
+
if (!this.style_view) {
|
|
673
677
|
// BLACK ?
|
|
674
678
|
return 0;
|
|
675
679
|
}
|
|
676
|
-
return getInt32(this.
|
|
680
|
+
return getInt32(this.style_view, StyleKeys.TEXT_WRAP);
|
|
677
681
|
}
|
|
678
682
|
set textWrap(value) {
|
|
679
|
-
if (!this.
|
|
683
|
+
if (!this.style_view) {
|
|
680
684
|
return;
|
|
681
685
|
}
|
|
682
686
|
let wrap = -1;
|
|
@@ -695,9 +699,9 @@ export class Style {
|
|
|
695
699
|
wrap = value;
|
|
696
700
|
}
|
|
697
701
|
if (wrap !== -1) {
|
|
698
|
-
setInt32(this.
|
|
699
|
-
setInt8(this.
|
|
700
|
-
this.
|
|
702
|
+
setInt32(this.style_view, StyleKeys.TEXT_WRAP, wrap);
|
|
703
|
+
setInt8(this.style_view, StyleKeys.TEXT_WRAP_STATE, 1);
|
|
704
|
+
this.setOrAppendState(StateKeys.TEXT_WRAP);
|
|
701
705
|
}
|
|
702
706
|
}
|
|
703
707
|
get styleView() {
|
|
@@ -769,6 +773,12 @@ export class Style {
|
|
|
769
773
|
this.prepareMut();
|
|
770
774
|
setInt8(this.style_view, StyleKeys.DISPLAY, display);
|
|
771
775
|
setInt8(this.style_view, StyleKeys.DISPLAY_MODE, displayMode);
|
|
776
|
+
if (this.isDirty == -1n) {
|
|
777
|
+
this.isDirty = StateKeys.DISPLAY_MODE.bits;
|
|
778
|
+
}
|
|
779
|
+
else {
|
|
780
|
+
this.isDirty = this.isDirty | StateKeys.DISPLAY_MODE.bits;
|
|
781
|
+
}
|
|
772
782
|
this.setOrAppendState(StateKeys.DISPLAY);
|
|
773
783
|
}
|
|
774
784
|
}
|
|
@@ -2703,62 +2713,62 @@ export class Style {
|
|
|
2703
2713
|
}
|
|
2704
2714
|
}
|
|
2705
2715
|
get letterSpacing() {
|
|
2706
|
-
return getFloat32(this.
|
|
2716
|
+
return getFloat32(this.style_view, StyleKeys.LETTER_SPACING);
|
|
2707
2717
|
}
|
|
2708
2718
|
set letterSpacing(value) {
|
|
2709
2719
|
if (typeof value === 'number') {
|
|
2710
|
-
setFloat32(this.
|
|
2711
|
-
setUint8(this.
|
|
2712
|
-
this.
|
|
2720
|
+
setFloat32(this.style_view, StyleKeys.LETTER_SPACING, value);
|
|
2721
|
+
setUint8(this.style_view, StyleKeys.LETTER_SPACING_STATE, 1);
|
|
2722
|
+
this.setOrAppendState(StateKeys.LETTER_SPACING);
|
|
2713
2723
|
}
|
|
2714
2724
|
else if (typeof value === 'object') {
|
|
2715
2725
|
switch (value.unit) {
|
|
2716
2726
|
case 'dip':
|
|
2717
|
-
setFloat32(this.
|
|
2718
|
-
setUint8(this.
|
|
2719
|
-
this.
|
|
2727
|
+
setFloat32(this.style_view, StyleKeys.LETTER_SPACING, layout.toDevicePixels(value.value));
|
|
2728
|
+
setUint8(this.style_view, StyleKeys.LETTER_SPACING_STATE, 1);
|
|
2729
|
+
this.setOrAppendState(StateKeys.LETTER_SPACING);
|
|
2720
2730
|
break;
|
|
2721
2731
|
case 'px':
|
|
2722
|
-
setFloat32(this.
|
|
2723
|
-
setUint8(this.
|
|
2724
|
-
this.
|
|
2732
|
+
setFloat32(this.style_view, StyleKeys.LETTER_SPACING, value.value);
|
|
2733
|
+
setUint8(this.style_view, StyleKeys.LETTER_SPACING_STATE, 1);
|
|
2734
|
+
this.setOrAppendState(StateKeys.LETTER_SPACING);
|
|
2725
2735
|
break;
|
|
2726
2736
|
}
|
|
2727
2737
|
}
|
|
2728
2738
|
}
|
|
2729
2739
|
get lineHeight() {
|
|
2730
|
-
return getFloat32(this.
|
|
2740
|
+
return getFloat32(this.style_view, StyleKeys.LINE_HEIGHT);
|
|
2731
2741
|
}
|
|
2732
2742
|
set lineHeight(value) {
|
|
2733
2743
|
if (typeof value === 'number') {
|
|
2734
|
-
setFloat32(this.
|
|
2735
|
-
setUint8(this.
|
|
2736
|
-
setUint8(this.
|
|
2737
|
-
this.
|
|
2744
|
+
setFloat32(this.style_view, StyleKeys.LINE_HEIGHT, value);
|
|
2745
|
+
setUint8(this.style_view, StyleKeys.LINE_HEIGHT_STATE, 1);
|
|
2746
|
+
setUint8(this.style_view, StyleKeys.LINE_HEIGHT_TYPE, 0);
|
|
2747
|
+
this.setOrAppendState(StateKeys.LINE_HEIGHT);
|
|
2738
2748
|
}
|
|
2739
2749
|
else if (typeof value === 'object') {
|
|
2740
2750
|
switch (value.unit) {
|
|
2741
2751
|
case 'dip':
|
|
2742
|
-
setFloat32(this.
|
|
2743
|
-
setUint8(this.
|
|
2744
|
-
setUint8(this.
|
|
2745
|
-
this.
|
|
2752
|
+
setFloat32(this.style_view, StyleKeys.LETTER_SPACING, layout.toDevicePixels(value.value));
|
|
2753
|
+
setUint8(this.style_view, StyleKeys.LINE_HEIGHT_STATE, 1);
|
|
2754
|
+
setUint8(this.style_view, StyleKeys.LINE_HEIGHT_TYPE, 1);
|
|
2755
|
+
this.setOrAppendState(StateKeys.LETTER_SPACING);
|
|
2746
2756
|
break;
|
|
2747
2757
|
case 'px':
|
|
2748
|
-
setFloat32(this.
|
|
2749
|
-
setUint8(this.
|
|
2750
|
-
setUint8(this.
|
|
2751
|
-
this.
|
|
2758
|
+
setFloat32(this.style_view, StyleKeys.LETTER_SPACING, value.value);
|
|
2759
|
+
setUint8(this.style_view, StyleKeys.LINE_HEIGHT_STATE, 1);
|
|
2760
|
+
setUint8(this.style_view, StyleKeys.LINE_HEIGHT_TYPE, 1);
|
|
2761
|
+
this.setOrAppendState(StateKeys.LETTER_SPACING);
|
|
2752
2762
|
break;
|
|
2753
2763
|
}
|
|
2754
2764
|
}
|
|
2755
2765
|
}
|
|
2756
2766
|
get textOverflow() {
|
|
2757
|
-
if (!this.
|
|
2767
|
+
if (!this.style_view) {
|
|
2758
2768
|
// clip ?
|
|
2759
2769
|
return 'clip';
|
|
2760
2770
|
}
|
|
2761
|
-
const type = getInt32(this.
|
|
2771
|
+
const type = getInt32(this.style_view, StyleKeys.TEXT_OVERFLOW);
|
|
2762
2772
|
switch (type) {
|
|
2763
2773
|
case 0:
|
|
2764
2774
|
return 'clip';
|
|
@@ -2777,7 +2787,7 @@ export class Style {
|
|
|
2777
2787
|
return 'clip';
|
|
2778
2788
|
}
|
|
2779
2789
|
set textOverflow(value) {
|
|
2780
|
-
if (!this.
|
|
2790
|
+
if (!this.style_view) {
|
|
2781
2791
|
return;
|
|
2782
2792
|
}
|
|
2783
2793
|
let flow = -1;
|
|
@@ -2802,17 +2812,17 @@ export class Style {
|
|
|
2802
2812
|
break;
|
|
2803
2813
|
}
|
|
2804
2814
|
if (flow !== -1) {
|
|
2805
|
-
setInt32(this.
|
|
2806
|
-
setInt8(this.
|
|
2807
|
-
this.
|
|
2815
|
+
setInt32(this.style_view, StyleKeys.TEXT_OVERFLOW, flow);
|
|
2816
|
+
setInt8(this.style_view, StyleKeys.TEXT_OVERFLOW_STATE, 1);
|
|
2817
|
+
this.setOrAppendState(StateKeys.TEXT_OVERFLOW);
|
|
2808
2818
|
}
|
|
2809
2819
|
}
|
|
2810
2820
|
get textAlignment() {
|
|
2811
|
-
if (!this.
|
|
2821
|
+
if (!this.style_view) {
|
|
2812
2822
|
// clip ?
|
|
2813
2823
|
return 'start';
|
|
2814
2824
|
}
|
|
2815
|
-
const type = getInt32(this.
|
|
2825
|
+
const type = getInt32(this.style_view, StyleKeys.TEXT_ALIGN);
|
|
2816
2826
|
switch (type) {
|
|
2817
2827
|
case 0:
|
|
2818
2828
|
// auto
|
|
@@ -2834,7 +2844,7 @@ export class Style {
|
|
|
2834
2844
|
}
|
|
2835
2845
|
}
|
|
2836
2846
|
set textAlignment(value) {
|
|
2837
|
-
if (!this.
|
|
2847
|
+
if (!this.style_view) {
|
|
2838
2848
|
return;
|
|
2839
2849
|
}
|
|
2840
2850
|
let align = -1;
|
|
@@ -2861,9 +2871,9 @@ export class Style {
|
|
|
2861
2871
|
break;
|
|
2862
2872
|
}
|
|
2863
2873
|
if (align !== -1) {
|
|
2864
|
-
setInt32(this.
|
|
2865
|
-
setInt8(this.
|
|
2866
|
-
this.
|
|
2874
|
+
setInt32(this.style_view, StyleKeys.TEXT_ALIGN, align);
|
|
2875
|
+
setInt8(this.style_view, StyleKeys.TEXT_ALIGN_STATE, 1);
|
|
2876
|
+
this.setOrAppendState(StateKeys.TEXT_ALIGN);
|
|
2867
2877
|
}
|
|
2868
2878
|
}
|
|
2869
2879
|
get background() {
|
|
@@ -2912,6 +2922,98 @@ export class Style {
|
|
|
2912
2922
|
this.nativeView.style.backgroundImage = value;
|
|
2913
2923
|
}
|
|
2914
2924
|
}
|
|
2925
|
+
get backgroundRepeat() {
|
|
2926
|
+
if (!this.nativeView) {
|
|
2927
|
+
return '';
|
|
2928
|
+
}
|
|
2929
|
+
if (__ANDROID__) {
|
|
2930
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getBackgroundRepeat(this.nativeView);
|
|
2931
|
+
}
|
|
2932
|
+
if (__APPLE__) {
|
|
2933
|
+
return this.nativeView.style.backgroundRepeat;
|
|
2934
|
+
}
|
|
2935
|
+
return '';
|
|
2936
|
+
}
|
|
2937
|
+
set backgroundRepeat(value) {
|
|
2938
|
+
if (!this.nativeView) {
|
|
2939
|
+
return;
|
|
2940
|
+
}
|
|
2941
|
+
if (__ANDROID__) {
|
|
2942
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setBackgroundRepeat(this.nativeView, value);
|
|
2943
|
+
}
|
|
2944
|
+
if (__APPLE__) {
|
|
2945
|
+
this.nativeView.style.backgroundRepeat = value;
|
|
2946
|
+
}
|
|
2947
|
+
}
|
|
2948
|
+
get backgroundPosition() {
|
|
2949
|
+
if (!this.nativeView) {
|
|
2950
|
+
return '';
|
|
2951
|
+
}
|
|
2952
|
+
if (__ANDROID__) {
|
|
2953
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getBackgroundPosition(this.nativeView);
|
|
2954
|
+
}
|
|
2955
|
+
if (__APPLE__) {
|
|
2956
|
+
return this.nativeView.style.backgroundPosition;
|
|
2957
|
+
}
|
|
2958
|
+
return '';
|
|
2959
|
+
}
|
|
2960
|
+
set backgroundPosition(value) {
|
|
2961
|
+
if (!this.nativeView) {
|
|
2962
|
+
return;
|
|
2963
|
+
}
|
|
2964
|
+
if (__ANDROID__) {
|
|
2965
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setBackgroundPosition(this.nativeView, value);
|
|
2966
|
+
}
|
|
2967
|
+
if (__APPLE__) {
|
|
2968
|
+
this.nativeView.style.backgroundPosition = value;
|
|
2969
|
+
}
|
|
2970
|
+
}
|
|
2971
|
+
get backgroundSize() {
|
|
2972
|
+
if (!this.nativeView) {
|
|
2973
|
+
return '';
|
|
2974
|
+
}
|
|
2975
|
+
if (__ANDROID__) {
|
|
2976
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getBackgroundSize(this.nativeView);
|
|
2977
|
+
}
|
|
2978
|
+
if (__APPLE__) {
|
|
2979
|
+
return this.nativeView.style.backgroundSize;
|
|
2980
|
+
}
|
|
2981
|
+
return '';
|
|
2982
|
+
}
|
|
2983
|
+
set backgroundSize(value) {
|
|
2984
|
+
if (!this.nativeView) {
|
|
2985
|
+
return;
|
|
2986
|
+
}
|
|
2987
|
+
if (__ANDROID__) {
|
|
2988
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setBackgroundSize(this.nativeView, value);
|
|
2989
|
+
}
|
|
2990
|
+
if (__APPLE__) {
|
|
2991
|
+
this.nativeView.style.backgroundSize = value;
|
|
2992
|
+
}
|
|
2993
|
+
}
|
|
2994
|
+
get backgroundClip() {
|
|
2995
|
+
if (!this.nativeView) {
|
|
2996
|
+
return '';
|
|
2997
|
+
}
|
|
2998
|
+
if (__ANDROID__) {
|
|
2999
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getBackgroundClip(this.nativeView);
|
|
3000
|
+
}
|
|
3001
|
+
if (__APPLE__) {
|
|
3002
|
+
return this.nativeView.style.backgroundClip;
|
|
3003
|
+
}
|
|
3004
|
+
return '';
|
|
3005
|
+
}
|
|
3006
|
+
set backgroundClip(value) {
|
|
3007
|
+
if (!this.nativeView) {
|
|
3008
|
+
return;
|
|
3009
|
+
}
|
|
3010
|
+
if (__ANDROID__) {
|
|
3011
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setBackgroundClip(this.nativeView, value);
|
|
3012
|
+
}
|
|
3013
|
+
if (__APPLE__) {
|
|
3014
|
+
this.nativeView.style.backgroundClip = value;
|
|
3015
|
+
}
|
|
3016
|
+
}
|
|
2915
3017
|
get borderRadius() {
|
|
2916
3018
|
if (!this.nativeView) {
|
|
2917
3019
|
return '';
|
|
@@ -3130,7 +3232,7 @@ export class Style {
|
|
|
3130
3232
|
}
|
|
3131
3233
|
}
|
|
3132
3234
|
}
|
|
3133
|
-
this.
|
|
3235
|
+
this.setOrAppendState(StateKeys.VERTICAL_ALIGN);
|
|
3134
3236
|
}
|
|
3135
3237
|
get textShadow() {
|
|
3136
3238
|
if (!this.nativeView) {
|
|
@@ -3162,6 +3264,97 @@ export class Style {
|
|
|
3162
3264
|
setInt32(this.style_view, StyleKeys.Z_INDEX, value);
|
|
3163
3265
|
this.setOrAppendState(StateKeys.Z_INDEX);
|
|
3164
3266
|
}
|
|
3267
|
+
get float() {
|
|
3268
|
+
switch (getInt8(this.style_view, StyleKeys.FLOAT)) {
|
|
3269
|
+
case 0 /* Float.None */:
|
|
3270
|
+
return 'none';
|
|
3271
|
+
case 1 /* Float.Left */:
|
|
3272
|
+
return 'left';
|
|
3273
|
+
case 2 /* Float.Right */:
|
|
3274
|
+
return 'right';
|
|
3275
|
+
}
|
|
3276
|
+
return 'none';
|
|
3277
|
+
}
|
|
3278
|
+
set float(value) {
|
|
3279
|
+
const current = getInt8(this.style_view, StyleKeys.FLOAT);
|
|
3280
|
+
let enumVal;
|
|
3281
|
+
switch (value) {
|
|
3282
|
+
case 'none':
|
|
3283
|
+
enumVal = 0 /* Float.None */;
|
|
3284
|
+
break;
|
|
3285
|
+
case 'left':
|
|
3286
|
+
enumVal = 1 /* Float.Left */;
|
|
3287
|
+
break;
|
|
3288
|
+
case 'right':
|
|
3289
|
+
enumVal = 2 /* Float.Right */;
|
|
3290
|
+
break;
|
|
3291
|
+
default:
|
|
3292
|
+
enumVal = 0 /* Float.None */;
|
|
3293
|
+
}
|
|
3294
|
+
if (current === enumVal) {
|
|
3295
|
+
return;
|
|
3296
|
+
}
|
|
3297
|
+
this.prepareMut();
|
|
3298
|
+
setInt8(this.style_view, StyleKeys.FLOAT, enumVal);
|
|
3299
|
+
this.setOrAppendState(StateKeys.FLOAT);
|
|
3300
|
+
}
|
|
3301
|
+
get clear() {
|
|
3302
|
+
switch (getInt8(this.style_view, StyleKeys.CLEAR)) {
|
|
3303
|
+
case 0 /* Clear.None */:
|
|
3304
|
+
return 'none';
|
|
3305
|
+
case 1 /* Clear.Left */:
|
|
3306
|
+
return 'left';
|
|
3307
|
+
case 2 /* Clear.Right */:
|
|
3308
|
+
return 'right';
|
|
3309
|
+
case 3 /* Clear.Both */:
|
|
3310
|
+
return 'both';
|
|
3311
|
+
}
|
|
3312
|
+
return 'none';
|
|
3313
|
+
}
|
|
3314
|
+
set clear(value) {
|
|
3315
|
+
switch (value) {
|
|
3316
|
+
case 'none':
|
|
3317
|
+
this.prepareMut();
|
|
3318
|
+
setInt8(this.style_view, StyleKeys.CLEAR, 0 /* Clear.None */);
|
|
3319
|
+
break;
|
|
3320
|
+
case 'left':
|
|
3321
|
+
this.prepareMut();
|
|
3322
|
+
setInt8(this.style_view, StyleKeys.CLEAR, 1 /* Clear.Left */);
|
|
3323
|
+
break;
|
|
3324
|
+
case 'right':
|
|
3325
|
+
this.prepareMut();
|
|
3326
|
+
setInt8(this.style_view, StyleKeys.CLEAR, 2 /* Clear.Right */);
|
|
3327
|
+
break;
|
|
3328
|
+
case 'none':
|
|
3329
|
+
this.prepareMut();
|
|
3330
|
+
setInt8(this.style_view, StyleKeys.CLEAR, 0 /* Clear.None */);
|
|
3331
|
+
break;
|
|
3332
|
+
}
|
|
3333
|
+
this.setOrAppendState(StateKeys.CLEAR);
|
|
3334
|
+
}
|
|
3335
|
+
set cornerShape(value) {
|
|
3336
|
+
if (!this.nativeView) {
|
|
3337
|
+
return;
|
|
3338
|
+
}
|
|
3339
|
+
if (__ANDROID__) {
|
|
3340
|
+
org.nativescript.mason.masonkit.NodeHelper.getShared().setCornerShape(this.nativeView, value);
|
|
3341
|
+
}
|
|
3342
|
+
if (__APPLE__) {
|
|
3343
|
+
this.nativeView.style.cornerShape = value;
|
|
3344
|
+
}
|
|
3345
|
+
}
|
|
3346
|
+
get cornerShape() {
|
|
3347
|
+
if (!this.nativeView) {
|
|
3348
|
+
return '';
|
|
3349
|
+
}
|
|
3350
|
+
if (__ANDROID__) {
|
|
3351
|
+
return org.nativescript.mason.masonkit.NodeHelper.getShared().getCornerShape(this.nativeView);
|
|
3352
|
+
}
|
|
3353
|
+
if (__APPLE__) {
|
|
3354
|
+
return this.nativeView.style.cornerShape;
|
|
3355
|
+
}
|
|
3356
|
+
return '';
|
|
3357
|
+
}
|
|
3165
3358
|
toJSON() {
|
|
3166
3359
|
return {
|
|
3167
3360
|
display: this.display,
|