@triniwiz/nativescript-masonkit 1.0.0-beta.121 → 1.0.0-beta.123
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/button/index.ios.js +5 -73
- package/button/index.ios.js.map +1 -1
- package/common.d.ts +3 -1
- package/common.js +55 -17
- package/common.js.map +1 -1
- package/css-shorthands.d.ts +0 -2
- package/css-shorthands.js +0 -4
- package/css-shorthands.js.map +1 -1
- package/foreign-layout.d.ts +3 -1
- package/foreign-layout.js +33 -1
- package/foreign-layout.js.map +1 -1
- package/img/index.android.js +1 -1
- package/img/index.android.js.map +1 -1
- package/img/index.ios.js +5 -43
- package/img/index.ios.js.map +1 -1
- package/img/index.windows.js +3 -8
- package/img/index.windows.js.map +1 -1
- package/index.d.ts +12 -0
- package/input/index.ios.js +4 -44
- package/input/index.ios.js.map +1 -1
- package/li/index.ios.js +6 -52
- package/li/index.ios.js.map +1 -1
- package/list/index.ios.js +3 -41
- package/list/index.ios.js.map +1 -1
- package/logical-boxes.d.ts +8 -0
- package/logical-boxes.js +131 -0
- package/logical-boxes.js.map +1 -0
- package/package.json +1 -1
- package/platforms/android/masonkit-release.aar +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +5 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/mason_native.h +9 -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 +33461 -30006
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +274 -221
- 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 +274 -221
- 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 +10099 -9730
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +10 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/mason_native.h +9 -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 +33461 -30006
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +274 -221
- 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 +274 -221
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +33461 -30006
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +274 -221
- 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 +274 -221
- 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 +2 -2
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +10093 -9724
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +9652 -9281
- package/platforms/windows/arm64/NativeScript.Mason.dll +0 -0
- package/platforms/windows/arm64/NativeScript.Mason.winmd +0 -0
- package/platforms/windows/x64/NativeScript.Mason.dll +0 -0
- package/platforms/windows/x64/NativeScript.Mason.winmd +0 -0
- package/properties.d.ts +37 -0
- package/properties.js +167 -41
- package/properties.js.map +1 -1
- package/scroll/index.ios.js +5 -62
- package/scroll/index.ios.js.map +1 -1
- package/style.d.ts +323 -0
- package/style.js +322 -6
- package/style.js.map +1 -1
- package/symbols.d.ts +3 -0
- package/symbols.js +4 -0
- package/symbols.js.map +1 -1
- package/text/index.ios.js +3 -79
- package/text/index.ios.js.map +1 -1
- package/text/index.windows.js +5 -4
- package/text/index.windows.js.map +1 -1
- package/textarea/index.ios.js +4 -62
- package/textarea/index.ios.js.map +1 -1
- package/typings/objc!Mason.d.ts +2 -0
- package/typings/objc!ObjectiveC.d.ts +2 -0
- package/view/index.ios.js +8 -56
- package/view/index.ios.js.map +1 -1
- package/vue/src/mason-meta.d.ts.map +1 -1
- package/vue/src/mason-meta.js +8 -7
- package/vue/src/mason-meta.js.map +1 -1
- package/web.js +6 -6
- package/web.js.map +1 -1
package/style.js
CHANGED
|
@@ -242,6 +242,58 @@ var StyleKeys;
|
|
|
242
242
|
StyleKeys[StyleKeys["TRANSFORM_ORIGIN_X_VALUE"] = 600] = "TRANSFORM_ORIGIN_X_VALUE";
|
|
243
243
|
StyleKeys[StyleKeys["TRANSFORM_ORIGIN_Y_VALUE"] = 604] = "TRANSFORM_ORIGIN_Y_VALUE";
|
|
244
244
|
StyleKeys[StyleKeys["TRANSFORM_ORIGIN_STATE"] = 608] = "TRANSFORM_ORIGIN_STATE";
|
|
245
|
+
StyleKeys[StyleKeys["TEXT_ORIENTATION"] = 609] = "TEXT_ORIENTATION";
|
|
246
|
+
StyleKeys[StyleKeys["TEXT_ORIENTATION_STATE"] = 610] = "TEXT_ORIENTATION_STATE";
|
|
247
|
+
// CSS logical properties, mapped onto physical sides by the box's writing mode and direction.
|
|
248
|
+
// A group's ORDER bytes are its physical slots (top, right, bottom, left; sizes: width, height,
|
|
249
|
+
// min-width, min-height, max-width, max-height) then its logical ones in the order below: 0
|
|
250
|
+
// never written, else the write's LOGICAL_SEQ stamp. A logical value applies to the side it
|
|
251
|
+
// maps to when it was written after that side's physical one. Types are the physical group's.
|
|
252
|
+
StyleKeys[StyleKeys["LOGICAL_SEQ"] = 611] = "LOGICAL_SEQ";
|
|
253
|
+
StyleKeys[StyleKeys["MARGIN_ORDER"] = 612] = "MARGIN_ORDER";
|
|
254
|
+
StyleKeys[StyleKeys["MARGIN_BLOCK_START_TYPE"] = 620] = "MARGIN_BLOCK_START_TYPE";
|
|
255
|
+
StyleKeys[StyleKeys["MARGIN_INLINE_END_TYPE"] = 621] = "MARGIN_INLINE_END_TYPE";
|
|
256
|
+
StyleKeys[StyleKeys["MARGIN_BLOCK_END_TYPE"] = 622] = "MARGIN_BLOCK_END_TYPE";
|
|
257
|
+
StyleKeys[StyleKeys["MARGIN_INLINE_START_TYPE"] = 623] = "MARGIN_INLINE_START_TYPE";
|
|
258
|
+
StyleKeys[StyleKeys["MARGIN_BLOCK_START_VALUE"] = 624] = "MARGIN_BLOCK_START_VALUE";
|
|
259
|
+
StyleKeys[StyleKeys["MARGIN_INLINE_END_VALUE"] = 628] = "MARGIN_INLINE_END_VALUE";
|
|
260
|
+
StyleKeys[StyleKeys["MARGIN_BLOCK_END_VALUE"] = 632] = "MARGIN_BLOCK_END_VALUE";
|
|
261
|
+
StyleKeys[StyleKeys["MARGIN_INLINE_START_VALUE"] = 636] = "MARGIN_INLINE_START_VALUE";
|
|
262
|
+
StyleKeys[StyleKeys["PADDING_ORDER"] = 640] = "PADDING_ORDER";
|
|
263
|
+
StyleKeys[StyleKeys["PADDING_BLOCK_START_TYPE"] = 648] = "PADDING_BLOCK_START_TYPE";
|
|
264
|
+
StyleKeys[StyleKeys["PADDING_INLINE_END_TYPE"] = 649] = "PADDING_INLINE_END_TYPE";
|
|
265
|
+
StyleKeys[StyleKeys["PADDING_BLOCK_END_TYPE"] = 650] = "PADDING_BLOCK_END_TYPE";
|
|
266
|
+
StyleKeys[StyleKeys["PADDING_INLINE_START_TYPE"] = 651] = "PADDING_INLINE_START_TYPE";
|
|
267
|
+
StyleKeys[StyleKeys["PADDING_BLOCK_START_VALUE"] = 652] = "PADDING_BLOCK_START_VALUE";
|
|
268
|
+
StyleKeys[StyleKeys["PADDING_INLINE_END_VALUE"] = 656] = "PADDING_INLINE_END_VALUE";
|
|
269
|
+
StyleKeys[StyleKeys["PADDING_BLOCK_END_VALUE"] = 660] = "PADDING_BLOCK_END_VALUE";
|
|
270
|
+
StyleKeys[StyleKeys["PADDING_INLINE_START_VALUE"] = 664] = "PADDING_INLINE_START_VALUE";
|
|
271
|
+
StyleKeys[StyleKeys["INSET_ORDER"] = 668] = "INSET_ORDER";
|
|
272
|
+
StyleKeys[StyleKeys["INSET_BLOCK_START_TYPE"] = 676] = "INSET_BLOCK_START_TYPE";
|
|
273
|
+
StyleKeys[StyleKeys["INSET_INLINE_END_TYPE"] = 677] = "INSET_INLINE_END_TYPE";
|
|
274
|
+
StyleKeys[StyleKeys["INSET_BLOCK_END_TYPE"] = 678] = "INSET_BLOCK_END_TYPE";
|
|
275
|
+
StyleKeys[StyleKeys["INSET_INLINE_START_TYPE"] = 679] = "INSET_INLINE_START_TYPE";
|
|
276
|
+
StyleKeys[StyleKeys["INSET_BLOCK_START_VALUE"] = 680] = "INSET_BLOCK_START_VALUE";
|
|
277
|
+
StyleKeys[StyleKeys["INSET_INLINE_END_VALUE"] = 684] = "INSET_INLINE_END_VALUE";
|
|
278
|
+
StyleKeys[StyleKeys["INSET_BLOCK_END_VALUE"] = 688] = "INSET_BLOCK_END_VALUE";
|
|
279
|
+
StyleKeys[StyleKeys["INSET_INLINE_START_VALUE"] = 692] = "INSET_INLINE_START_VALUE";
|
|
280
|
+
StyleKeys[StyleKeys["SIZE_ORDER"] = 696] = "SIZE_ORDER";
|
|
281
|
+
StyleKeys[StyleKeys["INLINE_SIZE_TYPE"] = 708] = "INLINE_SIZE_TYPE";
|
|
282
|
+
StyleKeys[StyleKeys["BLOCK_SIZE_TYPE"] = 709] = "BLOCK_SIZE_TYPE";
|
|
283
|
+
StyleKeys[StyleKeys["MIN_INLINE_SIZE_TYPE"] = 710] = "MIN_INLINE_SIZE_TYPE";
|
|
284
|
+
StyleKeys[StyleKeys["MIN_BLOCK_SIZE_TYPE"] = 711] = "MIN_BLOCK_SIZE_TYPE";
|
|
285
|
+
StyleKeys[StyleKeys["MAX_INLINE_SIZE_TYPE"] = 712] = "MAX_INLINE_SIZE_TYPE";
|
|
286
|
+
StyleKeys[StyleKeys["MAX_BLOCK_SIZE_TYPE"] = 713] = "MAX_BLOCK_SIZE_TYPE";
|
|
287
|
+
StyleKeys[StyleKeys["INLINE_SIZE_VALUE"] = 714] = "INLINE_SIZE_VALUE";
|
|
288
|
+
StyleKeys[StyleKeys["BLOCK_SIZE_VALUE"] = 718] = "BLOCK_SIZE_VALUE";
|
|
289
|
+
StyleKeys[StyleKeys["MIN_INLINE_SIZE_VALUE"] = 722] = "MIN_INLINE_SIZE_VALUE";
|
|
290
|
+
StyleKeys[StyleKeys["MIN_BLOCK_SIZE_VALUE"] = 726] = "MIN_BLOCK_SIZE_VALUE";
|
|
291
|
+
StyleKeys[StyleKeys["MAX_INLINE_SIZE_VALUE"] = 730] = "MAX_INLINE_SIZE_VALUE";
|
|
292
|
+
StyleKeys[StyleKeys["MAX_BLOCK_SIZE_VALUE"] = 734] = "MAX_BLOCK_SIZE_VALUE";
|
|
293
|
+
StyleKeys[StyleKeys["TEXT_COMBINE_UPRIGHT"] = 738] = "TEXT_COMBINE_UPRIGHT";
|
|
294
|
+
StyleKeys[StyleKeys["TEXT_COMBINE_UPRIGHT_STATE"] = 739] = "TEXT_COMBINE_UPRIGHT_STATE";
|
|
295
|
+
StyleKeys[StyleKeys["TEXT_SPACING_TRIM"] = 740] = "TEXT_SPACING_TRIM";
|
|
296
|
+
StyleKeys[StyleKeys["TEXT_SPACING_TRIM_STATE"] = 741] = "TEXT_SPACING_TRIM_STATE";
|
|
245
297
|
// </style-keys:offsets>
|
|
246
298
|
})(StyleKeys || (StyleKeys = {}));
|
|
247
299
|
// Windows: the native Style.UpdateGrid takes all grid strings at once. To set one while preserving
|
|
@@ -757,10 +809,13 @@ StateKeys.FONT_STRETCH = StateKeys.flag(78);
|
|
|
757
809
|
StateKeys.TEXT_INDENT = StateKeys.flag(79);
|
|
758
810
|
StateKeys.LINE_CLAMP = StateKeys.flag(80);
|
|
759
811
|
StateKeys.TRANSFORM_ORIGIN = StateKeys.flag(81);
|
|
812
|
+
StateKeys.TEXT_ORIENTATION = StateKeys.flag(82);
|
|
813
|
+
StateKeys.TEXT_COMBINE_UPRIGHT = StateKeys.flag(83);
|
|
814
|
+
StateKeys.TEXT_SPACING_TRIM = StateKeys.flag(84);
|
|
760
815
|
// </style-keys:state>
|
|
761
816
|
StateKeys.DISPLAY_AND_MODE = StateKeys.DISPLAY.or(StateKeys.DISPLAY_MODE);
|
|
762
817
|
StateKeys.FLOW_TYPE = StateKeys.DISPLAY.or(StateKeys.DISPLAY_MODE).or(StateKeys.POSITION).or(StateKeys.FLOAT);
|
|
763
|
-
StateKeys.WINDOWS_TEXT = [StateKeys.INVALIDATE_TEXT, StateKeys.FONT_COLOR, StateKeys.DECORATION_LINE, StateKeys.DECORATION_COLOR, StateKeys.TEXT_ALIGN, StateKeys.TEXT_JUSTIFY, StateKeys.FONT_SIZE, StateKeys.TEXT_TRANSFORM, StateKeys.FONT_STYLE, StateKeys.FONT_STYLE_SLANT, StateKeys.TEXT_WRAP, StateKeys.TEXT_OVERFLOW, StateKeys.DECORATION_STYLE, StateKeys.WHITE_SPACE, StateKeys.FONT_WEIGHT, StateKeys.LINE_HEIGHT, StateKeys.VERTICAL_ALIGN, StateKeys.DECORATION_THICKNESS, StateKeys.TEXT_SHADOWS, StateKeys.FONT_FAMILY, StateKeys.LETTER_SPACING, StateKeys.FONT_VARIANT_NUMERIC, StateKeys.WRITING_MODE, StateKeys.UNICODE_BIDI, StateKeys.HYPHENS, StateKeys.WORD_SPACING, StateKeys.FONT_STRETCH, StateKeys.TEXT_INDENT, StateKeys.LINE_CLAMP].reduce((mask, key) => mask.or(key), StateKeys.NONE);
|
|
818
|
+
StateKeys.WINDOWS_TEXT = [StateKeys.INVALIDATE_TEXT, StateKeys.FONT_COLOR, StateKeys.DECORATION_LINE, StateKeys.DECORATION_COLOR, StateKeys.TEXT_ALIGN, StateKeys.TEXT_JUSTIFY, StateKeys.FONT_SIZE, StateKeys.TEXT_TRANSFORM, StateKeys.FONT_STYLE, StateKeys.FONT_STYLE_SLANT, StateKeys.TEXT_WRAP, StateKeys.TEXT_OVERFLOW, StateKeys.DECORATION_STYLE, StateKeys.WHITE_SPACE, StateKeys.FONT_WEIGHT, StateKeys.LINE_HEIGHT, StateKeys.VERTICAL_ALIGN, StateKeys.DECORATION_THICKNESS, StateKeys.TEXT_SHADOWS, StateKeys.FONT_FAMILY, StateKeys.LETTER_SPACING, StateKeys.FONT_VARIANT_NUMERIC, StateKeys.WRITING_MODE, StateKeys.UNICODE_BIDI, StateKeys.HYPHENS, StateKeys.WORD_SPACING, StateKeys.FONT_STRETCH, StateKeys.TEXT_INDENT, StateKeys.LINE_CLAMP, StateKeys.TEXT_ORIENTATION].reduce((mask, key) => mask.or(key), StateKeys.NONE);
|
|
764
819
|
function wordsToBigInt(w0, w1, w2, w3) {
|
|
765
820
|
return BigInt(w0 >>> 0) | (BigInt(w1 >>> 0) << 32n) | (BigInt(w2 >>> 0) << 64n) | (BigInt(w3 >>> 0) << 96n);
|
|
766
821
|
}
|
|
@@ -800,6 +855,10 @@ const getFloat32 = (view, offset) => {
|
|
|
800
855
|
const setFloat32 = (view, offset, value) => {
|
|
801
856
|
view.setFloat32(offset, value, true);
|
|
802
857
|
};
|
|
858
|
+
// Core's Windows currentApp() is the package folder; the app's files are in its app\ folder.
|
|
859
|
+
export function windowsAppFile(url) {
|
|
860
|
+
return url.startsWith('~/') ? knownFolders.currentApp().path + '\\app\\' + url.slice(2).replace(/\//g, '\\') : url;
|
|
861
|
+
}
|
|
803
862
|
// Split a comma-separated list at top level only (commas inside parentheses, e.g. rgba(0,0,0,.5),
|
|
804
863
|
// are kept with their token).
|
|
805
864
|
function splitTopLevelCommas(s) {
|
|
@@ -866,7 +925,7 @@ function parseGradientCorner(token) {
|
|
|
866
925
|
return x && y ? [x, y] : undefined;
|
|
867
926
|
}
|
|
868
927
|
const LINEAR_GRADIENT = /linear-gradient/i;
|
|
869
|
-
const ANY_GRADIENT =
|
|
928
|
+
const ANY_GRADIENT = /-gradient\(/i;
|
|
870
929
|
const LINEAR_GRADIENT_ARGS = /linear-gradient\s*\(([\s\S]*)\)\s*$/i;
|
|
871
930
|
const INTERPOLATION_METHOD = /(?:^|\s)in\s+([a-z][a-z0-9-]*(?:\s+(?:shorter|longer|increasing|decreasing)\s+hue)?)(?=\s|$)/i;
|
|
872
931
|
// Parse `linear-gradient(<dir>? <in colorspace>?, <color> <stop>?, ...)` into a CSS angle, per-stop argb + offsets and the interpolation.
|
|
@@ -1319,6 +1378,53 @@ function parseSidesColorShorthand(value) {
|
|
|
1319
1378
|
return { t: cols[0], r: cols[1], b: cols[2], l: cols[3] };
|
|
1320
1379
|
}
|
|
1321
1380
|
}
|
|
1381
|
+
const LOGICAL_GROUPS = {
|
|
1382
|
+
margin: { order: StyleKeys.MARGIN_ORDER, half: 4, types: StyleKeys.MARGIN_BLOCK_START_TYPE, values: StyleKeys.MARGIN_BLOCK_START_VALUE, kind: () => 'auto', state: () => StateKeys.MARGIN },
|
|
1383
|
+
padding: { order: StyleKeys.PADDING_ORDER, half: 4, types: StyleKeys.PADDING_BLOCK_START_TYPE, values: StyleKeys.PADDING_BLOCK_START_VALUE, kind: () => 'length', state: () => StateKeys.PADDING },
|
|
1384
|
+
inset: { order: StyleKeys.INSET_ORDER, half: 4, types: StyleKeys.INSET_BLOCK_START_TYPE, values: StyleKeys.INSET_BLOCK_START_VALUE, kind: () => 'auto', state: () => StateKeys.INSET },
|
|
1385
|
+
size: {
|
|
1386
|
+
order: StyleKeys.SIZE_ORDER,
|
|
1387
|
+
half: 6,
|
|
1388
|
+
types: StyleKeys.INLINE_SIZE_TYPE,
|
|
1389
|
+
values: StyleKeys.INLINE_SIZE_VALUE,
|
|
1390
|
+
kind: (slot) => (slot < 2 ? 'dimension' : 'auto'),
|
|
1391
|
+
state: (slot) => (slot < 2 ? StateKeys.SIZE : slot < 4 ? StateKeys.MIN_SIZE : StateKeys.MAX_SIZE),
|
|
1392
|
+
},
|
|
1393
|
+
};
|
|
1394
|
+
const LOGICAL_STAMPS = [
|
|
1395
|
+
[StyleKeys.MARGIN_ORDER, 8],
|
|
1396
|
+
[StyleKeys.PADDING_ORDER, 8],
|
|
1397
|
+
[StyleKeys.INSET_ORDER, 8],
|
|
1398
|
+
[StyleKeys.SIZE_ORDER, 12],
|
|
1399
|
+
];
|
|
1400
|
+
const stampUsed = new Uint8Array(256);
|
|
1401
|
+
const stampRank = new Uint8Array(256);
|
|
1402
|
+
/** A length in the buffer's encoding for `kind` (auto: margins, insets, min/max; length: padding; dimension: sizes). */
|
|
1403
|
+
function logicalTypeValue(value, kind, emBasis) {
|
|
1404
|
+
switch (typeof value) {
|
|
1405
|
+
case 'string':
|
|
1406
|
+
return kind === 'length' ? lengthPercentageFromString(value, emBasis) : kind === 'dimension' ? dimensionFromString(value, emBasis) : lengthPercentageAutoFromString(value, emBasis);
|
|
1407
|
+
case 'number':
|
|
1408
|
+
return { type: kind === 'length' ? 0 : 1, value: layout.toDevicePixels(value) };
|
|
1409
|
+
case 'object': {
|
|
1410
|
+
const length = value;
|
|
1411
|
+
if (!length)
|
|
1412
|
+
return undefined;
|
|
1413
|
+
switch (length.unit) {
|
|
1414
|
+
case 'dip':
|
|
1415
|
+
case 'px':
|
|
1416
|
+
return { type: kind === 'length' ? 0 : 1, value: layout.toDevicePixels(length.value) };
|
|
1417
|
+
case '%':
|
|
1418
|
+
return { type: kind === 'length' ? 1 : 2, value: length.value };
|
|
1419
|
+
}
|
|
1420
|
+
const keyword = kind === 'dimension' ? sizingKeywordOf(length) : undefined;
|
|
1421
|
+
return keyword ? dimensionFromString(keyword) : undefined;
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
return undefined;
|
|
1425
|
+
}
|
|
1426
|
+
// text-spacing-trim keywords, in their buffer order.
|
|
1427
|
+
const TEXT_SPACING_TRIM_VALUES = ['normal', 'space-all', 'space-first', 'trim-start', 'trim-both', 'trim-all', 'auto'];
|
|
1322
1428
|
const i8Buffer = new Int8Array(4);
|
|
1323
1429
|
const f32Buffer = new Uint8Array(Float32Array.BYTES_PER_ELEMENT * 4);
|
|
1324
1430
|
const f32View = new Float32Array(f32Buffer.buffer);
|
|
@@ -1574,6 +1680,17 @@ export function refreshViewportUnits() {
|
|
|
1574
1680
|
style[keys[i]] = writes.get(keys[i]);
|
|
1575
1681
|
}
|
|
1576
1682
|
}
|
|
1683
|
+
// Inherited text properties a stylesheet can drop back to inheriting: their *_STATE byte.
|
|
1684
|
+
const INHERITED_TEXT_STATE = {
|
|
1685
|
+
writingMode: [StyleKeys.WRITING_MODE_STATE, StateKeys.WRITING_MODE],
|
|
1686
|
+
textOrientation: [StyleKeys.TEXT_ORIENTATION_STATE, StateKeys.TEXT_ORIENTATION],
|
|
1687
|
+
textCombineUpright: [StyleKeys.TEXT_COMBINE_UPRIGHT_STATE, StateKeys.TEXT_COMBINE_UPRIGHT],
|
|
1688
|
+
textSpacingTrim: [StyleKeys.TEXT_SPACING_TRIM_STATE, StateKeys.TEXT_SPACING_TRIM],
|
|
1689
|
+
hyphens: [StyleKeys.HYPHENS_STATE, StateKeys.HYPHENS],
|
|
1690
|
+
whiteSpace: [StyleKeys.WHITE_SPACE_STATE, StateKeys.WHITE_SPACE],
|
|
1691
|
+
wordSpacing: [StyleKeys.WORD_SPACING_STATE, StateKeys.WORD_SPACING],
|
|
1692
|
+
fontStretch: [StyleKeys.FONT_STRETCH_STATE, StateKeys.FONT_STRETCH],
|
|
1693
|
+
};
|
|
1577
1694
|
export class Style {
|
|
1578
1695
|
constructor() {
|
|
1579
1696
|
this._bufferRequested = false;
|
|
@@ -1862,9 +1979,7 @@ export class Style {
|
|
|
1862
1979
|
// Painted natively over background-color (CssMask.h), which an ImageBrush would replace.
|
|
1863
1980
|
if (setLayers(encodeWindowsBackground(url[2], size, position, repeat, this.windowsMaskContext(), boxes)))
|
|
1864
1981
|
return;
|
|
1865
|
-
|
|
1866
|
-
if (source.startsWith('~/'))
|
|
1867
|
-
source = source.replace('~/', knownFolders.currentApp().path + '/');
|
|
1982
|
+
const source = windowsAppFile(url[2]);
|
|
1868
1983
|
const box = parseBoxPosition(position || '0% 0%', 0);
|
|
1869
1984
|
const align = (f) => (f <= 0.25 ? 0 : f >= 0.75 ? 2 : 1);
|
|
1870
1985
|
NativeScript.Mason.Css.ApplyBackgroundImage(this.nativeView, source, backgroundFit(size), align(box.x), align(box.y));
|
|
@@ -1932,7 +2047,7 @@ export class Style {
|
|
|
1932
2047
|
color: (color) => normalizeColorValue(color),
|
|
1933
2048
|
linear: parseLinearGradientCss,
|
|
1934
2049
|
radial: parseRadialGradientCss,
|
|
1935
|
-
source:
|
|
2050
|
+
source: windowsAppFile,
|
|
1936
2051
|
};
|
|
1937
2052
|
}
|
|
1938
2053
|
// The mask longhands arrive one setter at a time (a shorthand sets eight, a keyframe two), so
|
|
@@ -2976,6 +3091,7 @@ export class Style {
|
|
|
2976
3091
|
default:
|
|
2977
3092
|
return;
|
|
2978
3093
|
}
|
|
3094
|
+
this.stampPhysical('size', 0b100);
|
|
2979
3095
|
this.commitState(StateKeys.MIN_SIZE);
|
|
2980
3096
|
}
|
|
2981
3097
|
get minHeight() {
|
|
@@ -3021,6 +3137,7 @@ export class Style {
|
|
|
3021
3137
|
default:
|
|
3022
3138
|
return;
|
|
3023
3139
|
}
|
|
3140
|
+
this.stampPhysical('size', 0b1000);
|
|
3024
3141
|
this.commitState(StateKeys.MIN_SIZE);
|
|
3025
3142
|
}
|
|
3026
3143
|
get width() {
|
|
@@ -3076,6 +3193,7 @@ export class Style {
|
|
|
3076
3193
|
default:
|
|
3077
3194
|
return;
|
|
3078
3195
|
}
|
|
3196
|
+
this.stampPhysical('size', 0b1);
|
|
3079
3197
|
this.commitState(StateKeys.SIZE);
|
|
3080
3198
|
}
|
|
3081
3199
|
get height() {
|
|
@@ -3131,6 +3249,7 @@ export class Style {
|
|
|
3131
3249
|
default:
|
|
3132
3250
|
return;
|
|
3133
3251
|
}
|
|
3252
|
+
this.stampPhysical('size', 0b10);
|
|
3134
3253
|
this.commitState(StateKeys.SIZE);
|
|
3135
3254
|
}
|
|
3136
3255
|
get maxWidth() {
|
|
@@ -3176,6 +3295,7 @@ export class Style {
|
|
|
3176
3295
|
default:
|
|
3177
3296
|
return;
|
|
3178
3297
|
}
|
|
3298
|
+
this.stampPhysical('size', 0b10000);
|
|
3179
3299
|
this.commitState(StateKeys.MAX_SIZE);
|
|
3180
3300
|
}
|
|
3181
3301
|
get maxHeight() {
|
|
@@ -3221,6 +3341,7 @@ export class Style {
|
|
|
3221
3341
|
default:
|
|
3222
3342
|
return;
|
|
3223
3343
|
}
|
|
3344
|
+
this.stampPhysical('size', 0b100000);
|
|
3224
3345
|
this.commitState(StateKeys.MAX_SIZE);
|
|
3225
3346
|
}
|
|
3226
3347
|
get borderLeftWidth() {
|
|
@@ -3398,6 +3519,7 @@ export class Style {
|
|
|
3398
3519
|
this.bottom = sides[2];
|
|
3399
3520
|
this.left = sides[3];
|
|
3400
3521
|
this.inBatch = wasInBatch;
|
|
3522
|
+
this.stampPhysical('inset', 0b1111);
|
|
3401
3523
|
this.commitState(StateKeys.INSET);
|
|
3402
3524
|
return;
|
|
3403
3525
|
}
|
|
@@ -3438,6 +3560,7 @@ export class Style {
|
|
|
3438
3560
|
this.u8View.set(i8Buffer, StyleKeys.INSET_LEFT_TYPE);
|
|
3439
3561
|
f32View.fill(insetValue);
|
|
3440
3562
|
this.u8View.set(f32Buffer, StyleKeys.INSET_LEFT_VALUE);
|
|
3563
|
+
this.stampPhysical('inset', 0b1111);
|
|
3441
3564
|
this.commitState(StateKeys.INSET);
|
|
3442
3565
|
}
|
|
3443
3566
|
}
|
|
@@ -3480,6 +3603,7 @@ export class Style {
|
|
|
3480
3603
|
}
|
|
3481
3604
|
break;
|
|
3482
3605
|
}
|
|
3606
|
+
this.stampPhysical('inset', 0b1000);
|
|
3483
3607
|
this.commitState(StateKeys.INSET);
|
|
3484
3608
|
}
|
|
3485
3609
|
get right() {
|
|
@@ -3521,6 +3645,7 @@ export class Style {
|
|
|
3521
3645
|
}
|
|
3522
3646
|
break;
|
|
3523
3647
|
}
|
|
3648
|
+
this.stampPhysical('inset', 0b10);
|
|
3524
3649
|
this.commitState(StateKeys.INSET);
|
|
3525
3650
|
}
|
|
3526
3651
|
get top() {
|
|
@@ -3562,6 +3687,7 @@ export class Style {
|
|
|
3562
3687
|
}
|
|
3563
3688
|
break;
|
|
3564
3689
|
}
|
|
3690
|
+
this.stampPhysical('inset', 0b1);
|
|
3565
3691
|
this.commitState(StateKeys.INSET);
|
|
3566
3692
|
}
|
|
3567
3693
|
get bottom() {
|
|
@@ -3603,6 +3729,7 @@ export class Style {
|
|
|
3603
3729
|
}
|
|
3604
3730
|
break;
|
|
3605
3731
|
}
|
|
3732
|
+
this.stampPhysical('inset', 0b100);
|
|
3606
3733
|
this.commitState(StateKeys.INSET);
|
|
3607
3734
|
}
|
|
3608
3735
|
set margin(value) {
|
|
@@ -3616,6 +3743,7 @@ export class Style {
|
|
|
3616
3743
|
this.marginBottom = sides[2];
|
|
3617
3744
|
this.marginLeft = sides[3];
|
|
3618
3745
|
this.inBatch = wasInBatch;
|
|
3746
|
+
this.stampPhysical('margin', 0b1111);
|
|
3619
3747
|
this.commitState(StateKeys.MARGIN);
|
|
3620
3748
|
return;
|
|
3621
3749
|
}
|
|
@@ -3656,6 +3784,7 @@ export class Style {
|
|
|
3656
3784
|
this.u8View.set(i8Buffer, StyleKeys.MARGIN_LEFT_TYPE);
|
|
3657
3785
|
f32View.fill(marginValue);
|
|
3658
3786
|
this.u8View.set(f32Buffer, StyleKeys.MARGIN_LEFT_VALUE);
|
|
3787
|
+
this.stampPhysical('margin', 0b1111);
|
|
3659
3788
|
this.commitState(StateKeys.MARGIN);
|
|
3660
3789
|
}
|
|
3661
3790
|
}
|
|
@@ -3698,6 +3827,7 @@ export class Style {
|
|
|
3698
3827
|
}
|
|
3699
3828
|
break;
|
|
3700
3829
|
}
|
|
3830
|
+
this.stampPhysical('margin', 0b1000);
|
|
3701
3831
|
this.commitState(StateKeys.MARGIN);
|
|
3702
3832
|
}
|
|
3703
3833
|
get marginRight() {
|
|
@@ -3739,6 +3869,7 @@ export class Style {
|
|
|
3739
3869
|
}
|
|
3740
3870
|
break;
|
|
3741
3871
|
}
|
|
3872
|
+
this.stampPhysical('margin', 0b10);
|
|
3742
3873
|
this.commitState(StateKeys.MARGIN);
|
|
3743
3874
|
}
|
|
3744
3875
|
get marginTop() {
|
|
@@ -3780,6 +3911,7 @@ export class Style {
|
|
|
3780
3911
|
}
|
|
3781
3912
|
break;
|
|
3782
3913
|
}
|
|
3914
|
+
this.stampPhysical('margin', 0b1);
|
|
3783
3915
|
this.commitState(StateKeys.MARGIN);
|
|
3784
3916
|
}
|
|
3785
3917
|
get marginBottom() {
|
|
@@ -3821,6 +3953,7 @@ export class Style {
|
|
|
3821
3953
|
}
|
|
3822
3954
|
break;
|
|
3823
3955
|
}
|
|
3956
|
+
this.stampPhysical('margin', 0b100);
|
|
3824
3957
|
this.commitState(StateKeys.MARGIN);
|
|
3825
3958
|
}
|
|
3826
3959
|
set padding(value) {
|
|
@@ -3834,6 +3967,7 @@ export class Style {
|
|
|
3834
3967
|
this.paddingBottom = sides[2];
|
|
3835
3968
|
this.paddingLeft = sides[3];
|
|
3836
3969
|
this.inBatch = wasInBatch;
|
|
3970
|
+
this.stampPhysical('padding', 0b1111);
|
|
3837
3971
|
this.commitState(StateKeys.PADDING);
|
|
3838
3972
|
return;
|
|
3839
3973
|
}
|
|
@@ -3842,6 +3976,7 @@ export class Style {
|
|
|
3842
3976
|
this.inBatch = true;
|
|
3843
3977
|
this.paddingBottom = this.paddingLeft = this.paddingRight = this.paddingTop = value;
|
|
3844
3978
|
this.inBatch = wasInBatch;
|
|
3979
|
+
this.stampPhysical('padding', 0b1111);
|
|
3845
3980
|
this.commitState(StateKeys.PADDING);
|
|
3846
3981
|
}
|
|
3847
3982
|
get paddingLeft() {
|
|
@@ -3883,6 +4018,7 @@ export class Style {
|
|
|
3883
4018
|
}
|
|
3884
4019
|
break;
|
|
3885
4020
|
}
|
|
4021
|
+
this.stampPhysical('padding', 0b1000);
|
|
3886
4022
|
this.commitState(StateKeys.PADDING);
|
|
3887
4023
|
}
|
|
3888
4024
|
get paddingRight() {
|
|
@@ -3924,6 +4060,7 @@ export class Style {
|
|
|
3924
4060
|
}
|
|
3925
4061
|
break;
|
|
3926
4062
|
}
|
|
4063
|
+
this.stampPhysical('padding', 0b10);
|
|
3927
4064
|
this.commitState(StateKeys.PADDING);
|
|
3928
4065
|
}
|
|
3929
4066
|
get paddingTop() {
|
|
@@ -3965,6 +4102,7 @@ export class Style {
|
|
|
3965
4102
|
}
|
|
3966
4103
|
break;
|
|
3967
4104
|
}
|
|
4105
|
+
this.stampPhysical('padding', 0b1);
|
|
3968
4106
|
this.commitState(StateKeys.PADDING);
|
|
3969
4107
|
}
|
|
3970
4108
|
get paddingBottom() {
|
|
@@ -4006,8 +4144,73 @@ export class Style {
|
|
|
4006
4144
|
}
|
|
4007
4145
|
break;
|
|
4008
4146
|
}
|
|
4147
|
+
this.stampPhysical('padding', 0b100);
|
|
4009
4148
|
this.commitState(StateKeys.PADDING);
|
|
4010
4149
|
}
|
|
4150
|
+
// CSS logical properties: see StyleKeys.LOGICAL_SEQ.
|
|
4151
|
+
/** The next write stamp; at the counter's end every stamp is renumbered by rank, keeping their order. */
|
|
4152
|
+
nextLogicalStamp() {
|
|
4153
|
+
const view = this.style_view;
|
|
4154
|
+
let seq = getUint8(view, StyleKeys.LOGICAL_SEQ);
|
|
4155
|
+
if (seq === 255) {
|
|
4156
|
+
stampUsed.fill(0);
|
|
4157
|
+
for (const [order, length] of LOGICAL_STAMPS) {
|
|
4158
|
+
for (let i = 0; i < length; i++)
|
|
4159
|
+
stampUsed[getUint8(view, order + i)] = 1;
|
|
4160
|
+
}
|
|
4161
|
+
let next = 0;
|
|
4162
|
+
for (let stamp = 1; stamp < 256; stamp++)
|
|
4163
|
+
stampRank[stamp] = stampUsed[stamp] ? ++next : 0;
|
|
4164
|
+
for (const [order, length] of LOGICAL_STAMPS) {
|
|
4165
|
+
for (let i = 0; i < length; i++)
|
|
4166
|
+
setUint8(view, order + i, stampRank[getUint8(view, order + i)]);
|
|
4167
|
+
}
|
|
4168
|
+
seq = next;
|
|
4169
|
+
}
|
|
4170
|
+
setUint8(view, StyleKeys.LOGICAL_SEQ, seq + 1);
|
|
4171
|
+
return seq + 1;
|
|
4172
|
+
}
|
|
4173
|
+
/** Stamps the physical slots in `mask` as written now, so they win over older logical values. Free while the group has none. */
|
|
4174
|
+
stampPhysical(group, mask) {
|
|
4175
|
+
const { order, half } = LOGICAL_GROUPS[group];
|
|
4176
|
+
const view = this.style_view;
|
|
4177
|
+
let logical = false;
|
|
4178
|
+
for (let i = 0; i < half; i++) {
|
|
4179
|
+
if (getUint8(view, order + half + i) !== 0) {
|
|
4180
|
+
logical = true;
|
|
4181
|
+
break;
|
|
4182
|
+
}
|
|
4183
|
+
}
|
|
4184
|
+
if (!logical)
|
|
4185
|
+
return;
|
|
4186
|
+
const stamp = this.nextLogicalStamp();
|
|
4187
|
+
for (let i = 0; i < half; i++) {
|
|
4188
|
+
if (mask & (1 << i))
|
|
4189
|
+
setUint8(view, order + i, stamp);
|
|
4190
|
+
}
|
|
4191
|
+
}
|
|
4192
|
+
/**
|
|
4193
|
+
* Sets a logical side (margin, padding, inset: 0 block-start, 1 inline-end, 2 block-end,
|
|
4194
|
+
* 3 inline-start; size: see LOGICAL_GROUPS). null or undefined removes it, so the physical
|
|
4195
|
+
* value applies again.
|
|
4196
|
+
*/
|
|
4197
|
+
setLogical(group, slot, value) {
|
|
4198
|
+
const entry = LOGICAL_GROUPS[group];
|
|
4199
|
+
const parsed = value == null || value === '' ? undefined : logicalTypeValue(value, entry.kind(slot), this.emBasisFor(value));
|
|
4200
|
+
if (value != null && value !== '' && !parsed)
|
|
4201
|
+
return;
|
|
4202
|
+
this.prepareMut();
|
|
4203
|
+
const view = this.style_view;
|
|
4204
|
+
if (parsed) {
|
|
4205
|
+
setUint8(view, entry.order + entry.half + slot, this.nextLogicalStamp());
|
|
4206
|
+
setInt8(view, entry.types + slot, parsed.type);
|
|
4207
|
+
setFloat32(view, entry.values + slot * 4, parsed.value);
|
|
4208
|
+
}
|
|
4209
|
+
else {
|
|
4210
|
+
setUint8(view, entry.order + entry.half + slot, 0);
|
|
4211
|
+
}
|
|
4212
|
+
this.commitState(entry.state(slot));
|
|
4213
|
+
}
|
|
4011
4214
|
get gridGap() {
|
|
4012
4215
|
return this.gap;
|
|
4013
4216
|
}
|
|
@@ -6908,6 +7111,12 @@ export class Style {
|
|
|
6908
7111
|
get 'mask-border-mode'() {
|
|
6909
7112
|
return this.maskBorderMode;
|
|
6910
7113
|
}
|
|
7114
|
+
/** This box's own writing-mode (0 horizontal-tb, 1 vertical-rl, 2 vertical-lr), or -1 when it inherits. */
|
|
7115
|
+
get ownWritingMode() {
|
|
7116
|
+
if (!this.style_view || !getUint8(this.style_view, StyleKeys.WRITING_MODE_STATE))
|
|
7117
|
+
return -1;
|
|
7118
|
+
return getUint8(this.style_view, StyleKeys.WRITING_MODE);
|
|
7119
|
+
}
|
|
6911
7120
|
get writingMode() {
|
|
6912
7121
|
if (!this.style_view)
|
|
6913
7122
|
return 'horizontal-tb';
|
|
@@ -6951,6 +7160,110 @@ export class Style {
|
|
|
6951
7160
|
get 'writing-mode'() {
|
|
6952
7161
|
return this.writingMode;
|
|
6953
7162
|
}
|
|
7163
|
+
get textOrientation() {
|
|
7164
|
+
if (!this.style_view)
|
|
7165
|
+
return 'mixed';
|
|
7166
|
+
const state = getUint8(this.style_view, StyleKeys.TEXT_ORIENTATION_STATE);
|
|
7167
|
+
if (!state)
|
|
7168
|
+
return 'mixed';
|
|
7169
|
+
switch (getUint8(this.style_view, StyleKeys.TEXT_ORIENTATION)) {
|
|
7170
|
+
case 1:
|
|
7171
|
+
return 'upright';
|
|
7172
|
+
case 2:
|
|
7173
|
+
return 'sideways';
|
|
7174
|
+
default:
|
|
7175
|
+
return 'mixed';
|
|
7176
|
+
}
|
|
7177
|
+
}
|
|
7178
|
+
set textOrientation(value) {
|
|
7179
|
+
let v = -1;
|
|
7180
|
+
switch (value) {
|
|
7181
|
+
case 'mixed':
|
|
7182
|
+
v = 0;
|
|
7183
|
+
break;
|
|
7184
|
+
case 'upright':
|
|
7185
|
+
v = 1;
|
|
7186
|
+
break;
|
|
7187
|
+
case 'sideways':
|
|
7188
|
+
case 'sideways-right':
|
|
7189
|
+
v = 2;
|
|
7190
|
+
break;
|
|
7191
|
+
}
|
|
7192
|
+
if (v === -1)
|
|
7193
|
+
return;
|
|
7194
|
+
this.prepareMut();
|
|
7195
|
+
setUint8(this.style_view, StyleKeys.TEXT_ORIENTATION, v);
|
|
7196
|
+
setUint8(this.style_view, StyleKeys.TEXT_ORIENTATION_STATE, 1);
|
|
7197
|
+
this.commitState(StateKeys.TEXT_ORIENTATION);
|
|
7198
|
+
}
|
|
7199
|
+
set 'text-orientation'(value) {
|
|
7200
|
+
this.textOrientation = value;
|
|
7201
|
+
}
|
|
7202
|
+
get 'text-orientation'() {
|
|
7203
|
+
return this.textOrientation;
|
|
7204
|
+
}
|
|
7205
|
+
/** text-combine-upright: `none`, `all`, or `digits` with an optional count of 2 to 4 (2 when omitted). */
|
|
7206
|
+
get textCombineUpright() {
|
|
7207
|
+
if (!this.style_view || !getUint8(this.style_view, StyleKeys.TEXT_COMBINE_UPRIGHT_STATE))
|
|
7208
|
+
return 'none';
|
|
7209
|
+
const value = getUint8(this.style_view, StyleKeys.TEXT_COMBINE_UPRIGHT);
|
|
7210
|
+
return value === 0 ? 'none' : value === 1 ? 'all' : `digits ${value}`;
|
|
7211
|
+
}
|
|
7212
|
+
set textCombineUpright(value) {
|
|
7213
|
+
const parts = String(value).trim().toLowerCase().split(/\s+/);
|
|
7214
|
+
let v = -1;
|
|
7215
|
+
if (parts.length === 1 && parts[0] === 'none')
|
|
7216
|
+
v = 0;
|
|
7217
|
+
else if (parts.length === 1 && parts[0] === 'all')
|
|
7218
|
+
v = 1;
|
|
7219
|
+
else if (parts[0] === 'digits' && parts.length <= 2) {
|
|
7220
|
+
const count = parts.length === 2 ? Number(parts[1]) : 2;
|
|
7221
|
+
if (Number.isInteger(count) && count >= 2 && count <= 4)
|
|
7222
|
+
v = count;
|
|
7223
|
+
}
|
|
7224
|
+
if (v === -1)
|
|
7225
|
+
return;
|
|
7226
|
+
this.prepareMut();
|
|
7227
|
+
setUint8(this.style_view, StyleKeys.TEXT_COMBINE_UPRIGHT, v);
|
|
7228
|
+
setUint8(this.style_view, StyleKeys.TEXT_COMBINE_UPRIGHT_STATE, 1);
|
|
7229
|
+
this.commitState(StateKeys.TEXT_COMBINE_UPRIGHT);
|
|
7230
|
+
}
|
|
7231
|
+
set 'text-combine-upright'(value) {
|
|
7232
|
+
this.textCombineUpright = value;
|
|
7233
|
+
}
|
|
7234
|
+
get 'text-combine-upright'() {
|
|
7235
|
+
return this.textCombineUpright;
|
|
7236
|
+
}
|
|
7237
|
+
/** text-spacing-trim: `normal`, `space-all`, `space-first`, `trim-start`, `trim-both`, `trim-all` or `auto`. */
|
|
7238
|
+
get textSpacingTrim() {
|
|
7239
|
+
if (!this.style_view || !getUint8(this.style_view, StyleKeys.TEXT_SPACING_TRIM_STATE))
|
|
7240
|
+
return 'normal';
|
|
7241
|
+
return TEXT_SPACING_TRIM_VALUES[getUint8(this.style_view, StyleKeys.TEXT_SPACING_TRIM)] ?? 'normal';
|
|
7242
|
+
}
|
|
7243
|
+
set textSpacingTrim(value) {
|
|
7244
|
+
const v = TEXT_SPACING_TRIM_VALUES.indexOf(String(value).trim().toLowerCase());
|
|
7245
|
+
if (v === -1)
|
|
7246
|
+
return;
|
|
7247
|
+
this.prepareMut();
|
|
7248
|
+
setUint8(this.style_view, StyleKeys.TEXT_SPACING_TRIM, v);
|
|
7249
|
+
setUint8(this.style_view, StyleKeys.TEXT_SPACING_TRIM_STATE, 1);
|
|
7250
|
+
this.commitState(StateKeys.TEXT_SPACING_TRIM);
|
|
7251
|
+
}
|
|
7252
|
+
set 'text-spacing-trim'(value) {
|
|
7253
|
+
this.textSpacingTrim = value;
|
|
7254
|
+
}
|
|
7255
|
+
get 'text-spacing-trim'() {
|
|
7256
|
+
return this.textSpacingTrim;
|
|
7257
|
+
}
|
|
7258
|
+
/** Lets an inherited text property inherit again, as when its declaration is removed. */
|
|
7259
|
+
unsetInheritedText(name) {
|
|
7260
|
+
const [state, key] = INHERITED_TEXT_STATE[name];
|
|
7261
|
+
if (!this.style_view || !getUint8(this.style_view, state))
|
|
7262
|
+
return;
|
|
7263
|
+
this.prepareMut();
|
|
7264
|
+
setUint8(this.style_view, state, 0);
|
|
7265
|
+
this.commitState(key);
|
|
7266
|
+
}
|
|
6954
7267
|
get unicodeBidi() {
|
|
6955
7268
|
if (!this.style_view)
|
|
6956
7269
|
return 'normal';
|
|
@@ -7103,6 +7416,9 @@ export class Style {
|
|
|
7103
7416
|
objectPosition: this.objectPosition,
|
|
7104
7417
|
borderStyle: this.borderStyle,
|
|
7105
7418
|
writingMode: this.writingMode,
|
|
7419
|
+
textOrientation: this.textOrientation,
|
|
7420
|
+
textCombineUpright: this.textCombineUpright,
|
|
7421
|
+
textSpacingTrim: this.textSpacingTrim,
|
|
7106
7422
|
unicodeBidi: this.unicodeBidi,
|
|
7107
7423
|
hyphens: this.hyphens,
|
|
7108
7424
|
caretColor: this.caretColor,
|