@triniwiz/nativescript-masonkit 1.0.0-beta.89 → 1.0.0-beta.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/angular/fesm2022/triniwiz-nativescript-masonkit-angular.mjs +23 -66
- package/angular/fesm2022/triniwiz-nativescript-masonkit-angular.mjs.map +1 -1
- package/angular/types/triniwiz-nativescript-masonkit-angular.d.ts +9 -17
- package/common.d.ts +1 -0
- package/common.js +21 -1
- package/common.js.map +1 -1
- package/diagnostics.d.ts +51 -0
- package/diagnostics.js +53 -0
- package/diagnostics.js.map +1 -0
- package/elements.d.ts +55 -0
- package/elements.js +80 -0
- package/elements.js.map +1 -0
- package/fonts.d.ts +9 -0
- package/fonts.js +24 -0
- package/fonts.js.map +1 -0
- package/index.android.d.ts +3 -0
- package/index.android.js +5 -0
- package/index.android.js.map +1 -1
- package/index.d.ts +25 -2
- package/index.ios.d.ts +3 -0
- package/index.ios.js +3 -0
- package/index.ios.js.map +1 -1
- package/index.windows.d.ts +2 -0
- package/index.windows.js +2 -0
- package/index.windows.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/masonkit-release.aar +0 -0
- package/platforms/ios/Mason.xcframework/Info.plist +36 -2
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Headers/Mason-Swift.h +16 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.abi.json +11806 -2726
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.private.swiftinterface +7 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios.swiftinterface +7 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +8413 -8374
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Headers/Mason-Swift.h +32 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.abi.json +11806 -2726
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +7 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-ios-simulator.swiftinterface +7 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.abi.json +11806 -2726
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +7 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/Modules/Mason.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +7 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/Mason.framework/_CodeSignature/CodeResources +26 -26
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +8408 -8369
- package/platforms/ios/Mason.xcframework/ios-arm64_x86_64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/x86_64/Mason.yml +8049 -8008
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/Mason-Swift.h +2030 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/Mason.h +25 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Headers/mason_native.h +524 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Info.plist +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-xros.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.abi.json +110027 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.private.swiftinterface +3524 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros.swiftinterface +3524 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/Mason.framework/Modules/module.modulemap +10 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/dSYMs/Mason.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +8016 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/Mason-Swift.h +2030 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/Mason.h +25 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Headers/mason_native.h +524 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Info.plist +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Mason +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/Project/arm64-apple-xros-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.abi.json +110027 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.private.swiftinterface +3524 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.swiftdoc +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/Mason.swiftmodule/arm64-apple-xros-simulator.swiftinterface +3524 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/Modules/module.modulemap +10 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/Mason.framework/_CodeSignature/CodeResources +212 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/dSYMs/Mason.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/DWARF/Mason +0 -0
- package/platforms/ios/Mason.xcframework/xros-arm64-simulator/dSYMs/Mason.framework.dSYM/Contents/Resources/Relocations/aarch64/Mason.yml +8016 -0
- package/properties.d.ts +5 -0
- package/properties.js +341 -110
- package/properties.js.map +1 -1
- package/style.d.ts +38 -5
- package/style.js +434 -72
- package/style.js.map +1 -1
- package/symbols.d.ts +0 -1
- package/symbols.js +0 -1
- package/symbols.js.map +1 -1
- package/tree/index.android.js +3 -0
- package/tree/index.android.js.map +1 -1
- package/tree/index.ios.d.ts +5 -1
- package/tree/index.ios.js +18 -0
- package/tree/index.ios.js.map +1 -1
- package/tree/index.windows.d.ts +5 -1
- package/tree/index.windows.js +4 -0
- package/tree/index.windows.js.map +1 -1
- package/units.d.ts +22 -0
- package/units.js +17 -0
- package/units.js.map +1 -0
- package/utils/index.android.js +5 -5
- package/utils/index.android.js.map +1 -1
- package/utils/index.ios.js +5 -5
- package/utils/index.ios.js.map +1 -1
- package/web.d.ts +142 -10
- package/web.js +459 -12
- package/web.js.map +1 -1
package/properties.js
CHANGED
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
import { CssProperty, Style, ShorthandProperty, Length as CoreLength, fontSizeProperty, textAlignmentProperty, textTransformProperty, PercentLength as CorePercentLength, Trace, CoreTypes, unsetValue, verticalAlignmentProperty, textShadowProperty, Font, Property, makeParser, makeValidator, minWidthProperty, minHeightProperty } from '@nativescript/core';
|
|
2
|
-
import {
|
|
2
|
+
import { isMasonView_ } from './symbols';
|
|
3
3
|
import { alignItemsProperty, alignSelfProperty, flexDirectionProperty, flexGrowProperty, flexShrinkProperty, flexWrapProperty, justifyContentProperty } from '@nativescript/core/ui/layouts/flexbox-layout';
|
|
4
|
+
import { parseCSSShadow } from '@nativescript/core/ui/styling/css-shadow';
|
|
4
5
|
function getViewStyle(view) {
|
|
5
|
-
const ret = (__ANDROID__ ? view
|
|
6
|
-
|
|
6
|
+
const ret = (__ANDROID__ ? view?.get() : view?.deref());
|
|
7
|
+
// Undefined for a plain NativeScript view (and for a cleared ref): only mason's
|
|
8
|
+
// own view classes define `_styleHelper`.
|
|
9
|
+
return ret?._styleHelper;
|
|
7
10
|
}
|
|
8
|
-
|
|
11
|
+
// Mason parses CSS values itself, so for its own elements the raw declaration is
|
|
12
|
+
// passed straight through; anything else has to go through core's parser first.
|
|
13
|
+
//
|
|
14
|
+
// This asks specifically whether the view *is* a mason element, not whether it
|
|
15
|
+
// sits inside one. A plain NativeScript view parented into a mason tree has no
|
|
16
|
+
// mason style buffer — its value still has to be converted for core, or core's
|
|
17
|
+
// own setNative gets a string it can't use. See "Mixing with plain NativeScript
|
|
18
|
+
// views" in MASON_CONTEXT.md.
|
|
19
|
+
//
|
|
20
|
+
// `isMasonView_` is a plain marker set in the mason view constructors. Don't
|
|
21
|
+
// reach for `_styleHelper` here: its getter lazily builds the native view, and a
|
|
22
|
+
// valueConverter can run long before that should happen.
|
|
23
|
+
function isMasonView(style) {
|
|
9
24
|
if (style && style.viewRef) {
|
|
10
25
|
const view = __ANDROID__ ? style.viewRef.get() : style.viewRef.deref();
|
|
11
|
-
return view &&
|
|
26
|
+
return !!(view && view[isMasonView_]);
|
|
12
27
|
}
|
|
13
28
|
return false;
|
|
14
29
|
}
|
|
@@ -100,18 +115,42 @@ export const backgroundImageProperty = new CssProperty({
|
|
|
100
115
|
export const backgroundRepeatProperty = new CssProperty({
|
|
101
116
|
name: 'backgroundRepeat',
|
|
102
117
|
cssName: 'background-repeat',
|
|
118
|
+
valueChanged(target, oldValue, newValue) {
|
|
119
|
+
const view = getViewStyle(target.viewRef);
|
|
120
|
+
if (view) {
|
|
121
|
+
view.backgroundRepeat = newValue;
|
|
122
|
+
}
|
|
123
|
+
},
|
|
103
124
|
});
|
|
104
125
|
export const backgroundPositionProperty = new CssProperty({
|
|
105
126
|
name: 'backgroundPosition',
|
|
106
127
|
cssName: 'background-position',
|
|
128
|
+
valueChanged(target, oldValue, newValue) {
|
|
129
|
+
const view = getViewStyle(target.viewRef);
|
|
130
|
+
if (view) {
|
|
131
|
+
view.backgroundPosition = newValue;
|
|
132
|
+
}
|
|
133
|
+
},
|
|
107
134
|
});
|
|
108
135
|
export const backgroundSizeProperty = new CssProperty({
|
|
109
136
|
name: 'backgroundSize',
|
|
110
137
|
cssName: 'background-size',
|
|
138
|
+
valueChanged(target, oldValue, newValue) {
|
|
139
|
+
const view = getViewStyle(target.viewRef);
|
|
140
|
+
if (view) {
|
|
141
|
+
view.backgroundSize = newValue;
|
|
142
|
+
}
|
|
143
|
+
},
|
|
111
144
|
});
|
|
112
145
|
export const backgroundClipProperty = new CssProperty({
|
|
113
146
|
name: 'backgroundClip',
|
|
114
147
|
cssName: 'background-clip',
|
|
148
|
+
valueChanged(target, oldValue, newValue) {
|
|
149
|
+
const view = getViewStyle(target.viewRef);
|
|
150
|
+
if (view) {
|
|
151
|
+
view.backgroundClip = newValue;
|
|
152
|
+
}
|
|
153
|
+
},
|
|
115
154
|
});
|
|
116
155
|
function overflowConverter(value) {
|
|
117
156
|
if (typeof value === 'number') {
|
|
@@ -209,52 +248,170 @@ export const paddingProperty = new CssProperty({
|
|
|
209
248
|
name: 'padding',
|
|
210
249
|
cssName: 'padding',
|
|
211
250
|
});
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
251
|
+
// These four style-buffer fields were consumed by the natives all along but had
|
|
252
|
+
// no JS or CSS path to them: reserved StyleKeys nobody ever wrote. Same shape of
|
|
253
|
+
// gap as `list-style-type`. (`text-indent` and `font-variant-numeric` are
|
|
254
|
+
// deliberately left out — their offsets exist but nothing reads them yet, so
|
|
255
|
+
// exposing them would write bytes into the void.)
|
|
256
|
+
export const whiteSpaceProperty = new CssProperty({
|
|
257
|
+
name: 'whiteSpace',
|
|
258
|
+
cssName: 'white-space',
|
|
259
|
+
defaultValue: 'normal',
|
|
260
|
+
valueChanged(target, oldValue, newValue) {
|
|
261
|
+
const view = getViewStyle(target.viewRef);
|
|
262
|
+
if (view) {
|
|
263
|
+
view.whiteSpace = newValue;
|
|
264
|
+
}
|
|
265
|
+
},
|
|
216
266
|
});
|
|
217
|
-
export const
|
|
218
|
-
name: '
|
|
219
|
-
cssName: '
|
|
220
|
-
defaultValue:
|
|
221
|
-
|
|
267
|
+
export const objectFitProperty = new CssProperty({
|
|
268
|
+
name: 'objectFit',
|
|
269
|
+
cssName: 'object-fit',
|
|
270
|
+
defaultValue: 'contain',
|
|
271
|
+
valueChanged(target, oldValue, newValue) {
|
|
272
|
+
const view = getViewStyle(target.viewRef);
|
|
273
|
+
if (view) {
|
|
274
|
+
view.objectFit = newValue;
|
|
275
|
+
}
|
|
276
|
+
},
|
|
222
277
|
});
|
|
223
|
-
|
|
224
|
-
name: '
|
|
225
|
-
cssName: '
|
|
278
|
+
export const textJustifyProperty = new CssProperty({
|
|
279
|
+
name: 'textJustify',
|
|
280
|
+
cssName: 'text-justify',
|
|
281
|
+
defaultValue: 'auto',
|
|
226
282
|
valueChanged(target, oldValue, newValue) {
|
|
227
283
|
const view = getViewStyle(target.viewRef);
|
|
228
284
|
if (view) {
|
|
229
|
-
|
|
230
|
-
view.flexDirection = newValue;
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
// Revert to old value if newValue is invalid
|
|
234
|
-
// @ts-ignore
|
|
235
|
-
target.flexDirection = oldValue;
|
|
236
|
-
}
|
|
285
|
+
view.textJustify = newValue;
|
|
237
286
|
}
|
|
238
287
|
},
|
|
239
288
|
});
|
|
240
|
-
|
|
241
|
-
name: '
|
|
242
|
-
cssName: '
|
|
243
|
-
|
|
244
|
-
|
|
289
|
+
export const textDecorationThicknessProperty = new CssProperty({
|
|
290
|
+
name: 'textDecorationThickness',
|
|
291
|
+
cssName: 'text-decoration-thickness',
|
|
292
|
+
valueChanged(target, oldValue, newValue) {
|
|
293
|
+
const view = getViewStyle(target.viewRef);
|
|
294
|
+
if (view) {
|
|
295
|
+
view.textDecorationThickness = newValue;
|
|
296
|
+
}
|
|
245
297
|
},
|
|
298
|
+
});
|
|
299
|
+
// `font-family` had no path at all: FONT_FAMILY_STATE exists with no value slot
|
|
300
|
+
// (the natives keep the family on a FontFace, not in the buffer), and core's
|
|
301
|
+
// fontInternalProperty.setNative hook in common.ts is Windows-only. So on both
|
|
302
|
+
// mobile platforms this was unsettable from CSS *and* from TS.
|
|
303
|
+
export const fontFamilyProperty = new CssProperty({
|
|
304
|
+
name: 'fontFamily',
|
|
305
|
+
cssName: 'font-family',
|
|
246
306
|
valueChanged(target, oldValue, newValue) {
|
|
247
307
|
const view = getViewStyle(target.viewRef);
|
|
248
308
|
if (view) {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
309
|
+
view.fontFamily = newValue;
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
});
|
|
313
|
+
// ---------------------------------------------------------------------------
|
|
314
|
+
// Registering alongside @nativescript/core
|
|
315
|
+
// ---------------------------------------------------------------------------
|
|
316
|
+
//
|
|
317
|
+
// `CssProperty.register()` installs its accessors with Object.defineProperty, so
|
|
318
|
+
// for a CSS name core already owns the last registration wins outright — and
|
|
319
|
+
// masonkit registers after core. That silently shadowed core's handling of
|
|
320
|
+
// `margin`, `padding`, `background`, `background-*`, `border-color`,
|
|
321
|
+
// `border-radius`, `box-shadow`, `transform`, `vertical-align`, `text-overflow`,
|
|
322
|
+
// `align-content`, `flex` and `flex-flow` for **every view in the app**, mason's
|
|
323
|
+
// or not: a plain StackLayout with `margin: 10` in a stylesheet got nothing,
|
|
324
|
+
// because mason's property only implements setNative on mason's own ViewBase.
|
|
325
|
+
//
|
|
326
|
+
// So instead of replacing core's accessor, keep both and pick at assignment
|
|
327
|
+
// time: a mason view gets mason's, anything else keeps core's untouched.
|
|
328
|
+
function registerAlongsideCore(property) {
|
|
329
|
+
const proto = Style.prototype;
|
|
330
|
+
const keys = [property.name, property.cssName, property.cssLocalName].filter((key) => typeof key === 'string' && key.length > 0);
|
|
331
|
+
const core = new Map();
|
|
332
|
+
for (const key of keys) {
|
|
333
|
+
const descriptor = Object.getOwnPropertyDescriptor(proto, key);
|
|
334
|
+
if (descriptor)
|
|
335
|
+
core.set(key, descriptor);
|
|
336
|
+
}
|
|
337
|
+
property.register(Style);
|
|
338
|
+
for (const [key, coreDescriptor] of core) {
|
|
339
|
+
const masonDescriptor = Object.getOwnPropertyDescriptor(proto, key);
|
|
340
|
+
if (!masonDescriptor)
|
|
341
|
+
continue;
|
|
342
|
+
Object.defineProperty(proto, key, {
|
|
343
|
+
enumerable: masonDescriptor.enumerable ?? true,
|
|
344
|
+
configurable: true,
|
|
345
|
+
get() {
|
|
346
|
+
const descriptor = isMasonView(this) ? masonDescriptor : coreDescriptor;
|
|
347
|
+
return descriptor.get?.call(this);
|
|
348
|
+
},
|
|
349
|
+
set(value) {
|
|
350
|
+
const descriptor = isMasonView(this) ? masonDescriptor : coreDescriptor;
|
|
351
|
+
descriptor.set?.call(this, value);
|
|
352
|
+
},
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
registerAlongsideCore(paddingProperty);
|
|
357
|
+
export const marginProperty = new CssProperty({
|
|
358
|
+
name: 'margin',
|
|
359
|
+
cssName: 'margin',
|
|
360
|
+
});
|
|
361
|
+
export const scrollBarWidthProperty = new CssProperty({
|
|
362
|
+
name: 'scrollBarWidth',
|
|
363
|
+
cssName: 'scrollbar-width',
|
|
364
|
+
defaultValue: 0,
|
|
365
|
+
valueConverter: parseFloat,
|
|
366
|
+
});
|
|
367
|
+
// Core keeps these parsers private, so the fallbacks below have to restate them.
|
|
368
|
+
// The value lists mirror @nativescript/core exactly — flexbox-layout-common's
|
|
369
|
+
// FlexWrap and text-base-common's textAlignment/textTransform converters.
|
|
370
|
+
const FlexWrapParse = makeParser(makeValidator('nowrap', 'wrap', 'wrap-reverse'));
|
|
371
|
+
const FlexDirectionParse = makeParser(makeValidator('row', 'row-reverse', 'column', 'column-reverse'));
|
|
372
|
+
const TextAlignmentParse = makeParser(makeValidator('left', 'center', 'right', 'justify'));
|
|
373
|
+
const TextTransformParse = makeParser(makeValidator('none', 'capitalize', 'uppercase', 'lowercase'));
|
|
374
|
+
/**
|
|
375
|
+
* Narrow one of @nativescript/core's own properties so mason views get mason's
|
|
376
|
+
* handling and every other view keeps core's, untouched.
|
|
377
|
+
*
|
|
378
|
+
* `overrideHandlers` replaces core's handlers outright and core holds the
|
|
379
|
+
* originals in a closure, so a fallback has to be named explicitly. Without
|
|
380
|
+
* this, merely installing masonkit changed these properties for every view in
|
|
381
|
+
* the app: the converters handed core's setNative a raw CSS string, and the
|
|
382
|
+
* valueChanged bodies *reverted* the value (`target.x = oldValue`) whenever
|
|
383
|
+
* there was no mason style — which is every plain NativeScript view.
|
|
384
|
+
*/
|
|
385
|
+
function overrideForMasonViews(property, options) {
|
|
386
|
+
const handlers = {
|
|
387
|
+
valueChanged(target, _oldValue, newValue) {
|
|
388
|
+
const masonStyle = getViewStyle(target.viewRef);
|
|
389
|
+
// No mason style means a plain NativeScript view: core's setNative owns
|
|
390
|
+
// it, so leave the value exactly as core produced it.
|
|
391
|
+
if (!masonStyle) {
|
|
392
|
+
return;
|
|
256
393
|
}
|
|
257
|
-
|
|
394
|
+
options.apply(masonStyle, newValue);
|
|
395
|
+
},
|
|
396
|
+
};
|
|
397
|
+
if (options.coreConverter) {
|
|
398
|
+
handlers.valueConverter = function (value) {
|
|
399
|
+
// Mason parses CSS itself, so its own elements get the raw declaration.
|
|
400
|
+
return isMasonView(this) ? value : options.coreConverter(value);
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
property.overrideHandlers(handlers);
|
|
404
|
+
}
|
|
405
|
+
overrideForMasonViews(flexDirectionProperty, {
|
|
406
|
+
coreConverter: FlexDirectionParse,
|
|
407
|
+
apply: (style, value) => {
|
|
408
|
+
style.flexDirection = value;
|
|
409
|
+
},
|
|
410
|
+
});
|
|
411
|
+
overrideForMasonViews(flexWrapProperty, {
|
|
412
|
+
coreConverter: FlexWrapParse,
|
|
413
|
+
apply: (style, value) => {
|
|
414
|
+
style.flexWrap = value;
|
|
258
415
|
},
|
|
259
416
|
});
|
|
260
417
|
flexGrowProperty.overrideHandlers({
|
|
@@ -279,7 +436,7 @@ fontSizeProperty.overrideHandlers({
|
|
|
279
436
|
name: 'fontSize',
|
|
280
437
|
cssName: 'font-size',
|
|
281
438
|
valueConverter: function (value) {
|
|
282
|
-
if (
|
|
439
|
+
if (isMasonView(this)) {
|
|
283
440
|
return value;
|
|
284
441
|
}
|
|
285
442
|
return parseFloat(value);
|
|
@@ -480,38 +637,16 @@ export const gridColumnGapProperty = new ShorthandProperty({
|
|
|
480
637
|
return [[columnGapProperty, value]];
|
|
481
638
|
},
|
|
482
639
|
});
|
|
483
|
-
textAlignmentProperty
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
const view = getViewStyle(target.viewRef);
|
|
488
|
-
if (view) {
|
|
489
|
-
if (newValue) {
|
|
490
|
-
view.textAlignment = newValue;
|
|
491
|
-
}
|
|
492
|
-
else {
|
|
493
|
-
// Revert to old value if newValue is invalid
|
|
494
|
-
// @ts-ignore
|
|
495
|
-
target.textAlignment = oldValue;
|
|
496
|
-
}
|
|
497
|
-
}
|
|
640
|
+
overrideForMasonViews(textAlignmentProperty, {
|
|
641
|
+
coreConverter: TextAlignmentParse,
|
|
642
|
+
apply: (style, value) => {
|
|
643
|
+
style.textAlignment = value;
|
|
498
644
|
},
|
|
499
645
|
});
|
|
500
|
-
textTransformProperty
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
const view = getViewStyle(target.viewRef);
|
|
505
|
-
if (view) {
|
|
506
|
-
if (newValue) {
|
|
507
|
-
view.textTransform = newValue;
|
|
508
|
-
}
|
|
509
|
-
else {
|
|
510
|
-
// Revert to old value if newValue is invalid
|
|
511
|
-
// @ts-ignore
|
|
512
|
-
target.textTransform = oldValue;
|
|
513
|
-
}
|
|
514
|
-
}
|
|
646
|
+
overrideForMasonViews(textTransformProperty, {
|
|
647
|
+
coreConverter: TextTransformParse,
|
|
648
|
+
apply: (style, value) => {
|
|
649
|
+
style.textTransform = value;
|
|
515
650
|
},
|
|
516
651
|
});
|
|
517
652
|
function masonLengthParse(value) {
|
|
@@ -566,17 +701,29 @@ export const maxHeightProperty = new CssProperty({
|
|
|
566
701
|
});
|
|
567
702
|
// Core's minWidth/minHeight already route into this Style via setNative
|
|
568
703
|
// (common.ts), so no new CssProperty is needed — just fix the '%' handling.
|
|
704
|
+
// Core's min-width/min-height converter is Length.parse, which has no '%'
|
|
705
|
+
// handling; mason needs percentages. Core's own valueChanged (which sets
|
|
706
|
+
// effectiveMinWidth) is deliberately left in place for both kinds of view, so
|
|
707
|
+
// only the converter is narrowed — a plain view must still get a plain Length,
|
|
708
|
+
// or core's Length.toDevicePixels mis-reads a percentage.
|
|
709
|
+
function masonMinSizeConverter(value) {
|
|
710
|
+
return (isMasonView(this) ? masonLengthPercentParse(value) : CoreLength.parse(value));
|
|
711
|
+
}
|
|
569
712
|
minWidthProperty.overrideHandlers({
|
|
713
|
+
name: 'minWidth',
|
|
714
|
+
cssName: 'min-width',
|
|
570
715
|
// @ts-ignore
|
|
571
716
|
equalityComparer: CorePercentLength.equals,
|
|
572
717
|
// @ts-ignore
|
|
573
|
-
valueConverter:
|
|
718
|
+
valueConverter: masonMinSizeConverter,
|
|
574
719
|
});
|
|
575
720
|
minHeightProperty.overrideHandlers({
|
|
721
|
+
name: 'minHeight',
|
|
722
|
+
cssName: 'min-height',
|
|
576
723
|
// @ts-ignore
|
|
577
724
|
equalityComparer: CorePercentLength.equals,
|
|
578
725
|
// @ts-ignore
|
|
579
|
-
valueConverter:
|
|
726
|
+
valueConverter: masonMinSizeConverter,
|
|
580
727
|
});
|
|
581
728
|
export const insetProperty = new ShorthandProperty({
|
|
582
729
|
name: 'inset',
|
|
@@ -774,7 +921,7 @@ alignItemsProperty.overrideHandlers({
|
|
|
774
921
|
name: 'alignItems',
|
|
775
922
|
cssName: 'align-items',
|
|
776
923
|
valueConverter: function (value) {
|
|
777
|
-
if (
|
|
924
|
+
if (isMasonView(this)) {
|
|
778
925
|
return value;
|
|
779
926
|
}
|
|
780
927
|
return AlignItemsParse(value);
|
|
@@ -797,7 +944,7 @@ alignSelfProperty.overrideHandlers({
|
|
|
797
944
|
name: 'alignSelf',
|
|
798
945
|
cssName: 'align-self',
|
|
799
946
|
valueConverter: function (value) {
|
|
800
|
-
if (
|
|
947
|
+
if (isMasonView(this)) {
|
|
801
948
|
return value;
|
|
802
949
|
}
|
|
803
950
|
return AlignSelfParse(value);
|
|
@@ -823,7 +970,7 @@ export const alignContentProperty = new CssProperty({
|
|
|
823
970
|
cssName: 'align-content',
|
|
824
971
|
defaultValue: 'normal',
|
|
825
972
|
valueConverter: function (value) {
|
|
826
|
-
if (
|
|
973
|
+
if (isMasonView(this)) {
|
|
827
974
|
return value;
|
|
828
975
|
}
|
|
829
976
|
return AlignContentParse(value);
|
|
@@ -884,7 +1031,7 @@ justifyContentProperty.overrideHandlers({
|
|
|
884
1031
|
name: 'justifyContent',
|
|
885
1032
|
cssName: 'justify-content',
|
|
886
1033
|
valueConverter: function (value) {
|
|
887
|
-
if (
|
|
1034
|
+
if (isMasonView(this)) {
|
|
888
1035
|
return value;
|
|
889
1036
|
}
|
|
890
1037
|
return JustifyContentParse(value);
|
|
@@ -1137,7 +1284,7 @@ const flexProperty = new ShorthandProperty({
|
|
|
1137
1284
|
const values = trimmed.split(/\s+/);
|
|
1138
1285
|
if (values.length === 1) {
|
|
1139
1286
|
switch (values[0]) {
|
|
1140
|
-
case '
|
|
1287
|
+
case 'initial':
|
|
1141
1288
|
properties.push([flexGrowProperty, 0]);
|
|
1142
1289
|
properties.push([flexShrinkProperty, 1]);
|
|
1143
1290
|
properties.push([flexBasisProperty, 'auto']);
|
|
@@ -1164,8 +1311,12 @@ const flexProperty = new ShorthandProperty({
|
|
|
1164
1311
|
properties.push([flexGrowProperty, values[0]]);
|
|
1165
1312
|
properties.push([flexShrinkProperty, values[1]]);
|
|
1166
1313
|
}
|
|
1167
|
-
|
|
1168
|
-
|
|
1314
|
+
// `values.length`, not `value.length` — the latter is the string's
|
|
1315
|
+
// length, so this fired for any value of 3+ characters. And core's
|
|
1316
|
+
// setCssValue destructures each entry as `[property, value]`, so an
|
|
1317
|
+
// object here threw "not iterable" for every three-part flex.
|
|
1318
|
+
if (values.length >= 3) {
|
|
1319
|
+
properties.push([flexBasisProperty, values[2]]);
|
|
1169
1320
|
}
|
|
1170
1321
|
}
|
|
1171
1322
|
}
|
|
@@ -1204,7 +1355,7 @@ verticalAlignmentProperty.overrideHandlers({
|
|
|
1204
1355
|
name: 'verticalAlignment',
|
|
1205
1356
|
cssName: 'vertical-align',
|
|
1206
1357
|
valueConverter: function (value) {
|
|
1207
|
-
if (
|
|
1358
|
+
if (isMasonView(this)) {
|
|
1208
1359
|
return value;
|
|
1209
1360
|
}
|
|
1210
1361
|
return CoreTypes.VerticalAlignmentText.parse(value);
|
|
@@ -1224,22 +1375,10 @@ verticalAlignmentProperty.overrideHandlers({
|
|
|
1224
1375
|
}
|
|
1225
1376
|
},
|
|
1226
1377
|
});
|
|
1227
|
-
textShadowProperty
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
return value;
|
|
1232
|
-
},
|
|
1233
|
-
valueChanged(target, oldValue, newValue) {
|
|
1234
|
-
const view = getViewStyle(target.viewRef);
|
|
1235
|
-
if (view) {
|
|
1236
|
-
view.textShadow = newValue;
|
|
1237
|
-
}
|
|
1238
|
-
else {
|
|
1239
|
-
// Revert to old value if newValue is invalid
|
|
1240
|
-
// @ts-ignore
|
|
1241
|
-
target.textShadow = oldValue;
|
|
1242
|
-
}
|
|
1378
|
+
overrideForMasonViews(textShadowProperty, {
|
|
1379
|
+
coreConverter: parseCSSShadow,
|
|
1380
|
+
apply: (style, value) => {
|
|
1381
|
+
style.textShadow = value;
|
|
1243
1382
|
},
|
|
1244
1383
|
});
|
|
1245
1384
|
export const floatProperty = new CssProperty({
|
|
@@ -1267,36 +1406,60 @@ export const transformProperty = new CssProperty({
|
|
|
1267
1406
|
export const cornerShapeTopLeftProperty = new CssProperty({
|
|
1268
1407
|
name: 'cornerShapeTopLeft',
|
|
1269
1408
|
cssName: 'corner-shape-top-left',
|
|
1409
|
+
valueChanged(target, oldValue, newValue) {
|
|
1410
|
+
const view = getViewStyle(target.viewRef);
|
|
1411
|
+
if (view) {
|
|
1412
|
+
view.cornerShapeTopLeft = newValue;
|
|
1413
|
+
}
|
|
1414
|
+
},
|
|
1270
1415
|
});
|
|
1271
1416
|
export const cornerShapeTopRightProperty = new CssProperty({
|
|
1272
1417
|
name: 'cornerShapeTopRight',
|
|
1273
1418
|
cssName: 'corner-shape-top-right',
|
|
1419
|
+
valueChanged(target, oldValue, newValue) {
|
|
1420
|
+
const view = getViewStyle(target.viewRef);
|
|
1421
|
+
if (view) {
|
|
1422
|
+
view.cornerShapeTopRight = newValue;
|
|
1423
|
+
}
|
|
1424
|
+
},
|
|
1274
1425
|
});
|
|
1275
1426
|
export const cornerShapeBottomRightProperty = new CssProperty({
|
|
1276
1427
|
name: 'cornerShapeBottomRight',
|
|
1277
1428
|
cssName: 'corner-shape-bottom-right',
|
|
1429
|
+
valueChanged(target, oldValue, newValue) {
|
|
1430
|
+
const view = getViewStyle(target.viewRef);
|
|
1431
|
+
if (view) {
|
|
1432
|
+
view.cornerShapeBottomRight = newValue;
|
|
1433
|
+
}
|
|
1434
|
+
},
|
|
1278
1435
|
});
|
|
1279
1436
|
export const cornerShapeBottomLeftProperty = new CssProperty({
|
|
1280
1437
|
name: 'cornerShapeBottomLeft',
|
|
1281
1438
|
cssName: 'corner-shape-bottom-left',
|
|
1439
|
+
valueChanged(target, oldValue, newValue) {
|
|
1440
|
+
const view = getViewStyle(target.viewRef);
|
|
1441
|
+
if (view) {
|
|
1442
|
+
view.cornerShapeBottomLeft = newValue;
|
|
1443
|
+
}
|
|
1444
|
+
},
|
|
1282
1445
|
});
|
|
1283
1446
|
cornerShapeProperty.register(Style);
|
|
1284
|
-
boxShadowProperty
|
|
1285
|
-
transformProperty
|
|
1447
|
+
registerAlongsideCore(boxShadowProperty);
|
|
1448
|
+
registerAlongsideCore(transformProperty);
|
|
1286
1449
|
cornerShapeTopLeftProperty.register(Style);
|
|
1287
1450
|
cornerShapeTopRightProperty.register(Style);
|
|
1288
1451
|
cornerShapeBottomRightProperty.register(Style);
|
|
1289
1452
|
cornerShapeBottomLeftProperty.register(Style);
|
|
1290
1453
|
clearProperty.register(Style);
|
|
1291
1454
|
floatProperty.register(Style);
|
|
1292
|
-
verticalAlignProperty
|
|
1293
|
-
textOverFlowProperty
|
|
1294
|
-
flexProperty
|
|
1295
|
-
flexFlowProperty
|
|
1455
|
+
registerAlongsideCore(verticalAlignProperty);
|
|
1456
|
+
registerAlongsideCore(textOverFlowProperty);
|
|
1457
|
+
registerAlongsideCore(flexProperty);
|
|
1458
|
+
registerAlongsideCore(flexFlowProperty);
|
|
1296
1459
|
textWrapProperty.register(Style);
|
|
1297
1460
|
gridTemplateColumnsProperty.register(Style);
|
|
1298
1461
|
gridTemplateRowsProperty.register(Style);
|
|
1299
|
-
alignContentProperty
|
|
1462
|
+
registerAlongsideCore(alignContentProperty);
|
|
1300
1463
|
justifySelfProperty.register(Style);
|
|
1301
1464
|
justifyItemsProperty.register(Style);
|
|
1302
1465
|
gridTemplateAreasProperty.register(Style);
|
|
@@ -1312,7 +1475,7 @@ gridAutoRowsProperty.register(Style);
|
|
|
1312
1475
|
gridAutoColumnsProperty.register(Style);
|
|
1313
1476
|
aspectRatioProperty.register(Style);
|
|
1314
1477
|
flexBasisProperty.register(Style);
|
|
1315
|
-
borderRadiusProperty
|
|
1478
|
+
registerAlongsideCore(borderRadiusProperty);
|
|
1316
1479
|
boxSizingProperty.register(Style);
|
|
1317
1480
|
positionProperty.register(Style);
|
|
1318
1481
|
insetProperty.register(Style);
|
|
@@ -1329,14 +1492,14 @@ gapProperty.register(Style);
|
|
|
1329
1492
|
rowGapProperty.register(Style);
|
|
1330
1493
|
columnGapProperty.register(Style);
|
|
1331
1494
|
scrollBarWidthProperty.register(Style);
|
|
1332
|
-
marginProperty
|
|
1495
|
+
registerAlongsideCore(marginProperty);
|
|
1333
1496
|
overflowProperty.register(Style);
|
|
1334
1497
|
overflowXProperty.register(Style);
|
|
1335
1498
|
overflowYProperty.register(Style);
|
|
1336
|
-
backgroundProperty
|
|
1337
|
-
backgroundRepeatProperty
|
|
1338
|
-
backgroundPositionProperty
|
|
1339
|
-
backgroundSizeProperty
|
|
1499
|
+
registerAlongsideCore(backgroundProperty);
|
|
1500
|
+
registerAlongsideCore(backgroundRepeatProperty);
|
|
1501
|
+
registerAlongsideCore(backgroundPositionProperty);
|
|
1502
|
+
registerAlongsideCore(backgroundSizeProperty);
|
|
1340
1503
|
backgroundClipProperty.register(Style);
|
|
1341
1504
|
borderProperty.register(Style);
|
|
1342
1505
|
borderLeftProperty.register(Style);
|
|
@@ -1344,12 +1507,18 @@ borderTopProperty.register(Style);
|
|
|
1344
1507
|
borderRightProperty.register(Style);
|
|
1345
1508
|
borderBottomProperty.register(Style);
|
|
1346
1509
|
filterProperty.register(Style);
|
|
1347
|
-
borderColorProperty
|
|
1510
|
+
registerAlongsideCore(borderColorProperty);
|
|
1348
1511
|
// New CSS properties
|
|
1349
1512
|
export const objectPositionProperty = new CssProperty({
|
|
1350
1513
|
name: 'objectPosition',
|
|
1351
1514
|
cssName: 'object-position',
|
|
1352
1515
|
defaultValue: '50% 50%',
|
|
1516
|
+
valueChanged(target, oldValue, newValue) {
|
|
1517
|
+
const view = getViewStyle(target.viewRef);
|
|
1518
|
+
if (view) {
|
|
1519
|
+
view.objectPosition = newValue;
|
|
1520
|
+
}
|
|
1521
|
+
},
|
|
1353
1522
|
});
|
|
1354
1523
|
export const borderStyleProperty = new CssProperty({
|
|
1355
1524
|
name: 'borderStyle',
|
|
@@ -1359,45 +1528,99 @@ export const borderStyleProperty = new CssProperty({
|
|
|
1359
1528
|
export const borderImageProperty = new CssProperty({
|
|
1360
1529
|
name: 'borderImage',
|
|
1361
1530
|
cssName: 'border-image',
|
|
1531
|
+
valueChanged(target, oldValue, newValue) {
|
|
1532
|
+
const view = getViewStyle(target.viewRef);
|
|
1533
|
+
if (view) {
|
|
1534
|
+
view.borderImage = newValue;
|
|
1535
|
+
}
|
|
1536
|
+
},
|
|
1362
1537
|
});
|
|
1363
1538
|
export const fontStretchProperty = new CssProperty({
|
|
1364
1539
|
name: 'fontStretch',
|
|
1365
1540
|
cssName: 'font-stretch',
|
|
1366
1541
|
defaultValue: 'normal',
|
|
1542
|
+
valueChanged(target, oldValue, newValue) {
|
|
1543
|
+
const view = getViewStyle(target.viewRef);
|
|
1544
|
+
if (view) {
|
|
1545
|
+
view.fontStretch = newValue;
|
|
1546
|
+
}
|
|
1547
|
+
},
|
|
1367
1548
|
});
|
|
1368
1549
|
export const fontFeatureSettingsProperty = new CssProperty({
|
|
1369
1550
|
name: 'fontFeatureSettings',
|
|
1370
1551
|
cssName: 'font-feature-settings',
|
|
1371
1552
|
defaultValue: 'normal',
|
|
1553
|
+
valueChanged(target, oldValue, newValue) {
|
|
1554
|
+
const view = getViewStyle(target.viewRef);
|
|
1555
|
+
if (view) {
|
|
1556
|
+
view.fontFeatureSettings = newValue;
|
|
1557
|
+
}
|
|
1558
|
+
},
|
|
1372
1559
|
});
|
|
1373
1560
|
export const wordSpacingProperty = new CssProperty({
|
|
1374
1561
|
name: 'wordSpacing',
|
|
1375
1562
|
cssName: 'word-spacing',
|
|
1376
1563
|
defaultValue: 'normal',
|
|
1564
|
+
valueChanged(target, oldValue, newValue) {
|
|
1565
|
+
const view = getViewStyle(target.viewRef);
|
|
1566
|
+
if (view) {
|
|
1567
|
+
view.wordSpacing = newValue;
|
|
1568
|
+
}
|
|
1569
|
+
},
|
|
1377
1570
|
});
|
|
1378
1571
|
export const hyphensProperty = new CssProperty({
|
|
1379
1572
|
name: 'hyphens',
|
|
1380
1573
|
cssName: 'hyphens',
|
|
1381
1574
|
defaultValue: 'manual',
|
|
1575
|
+
valueChanged(target, oldValue, newValue) {
|
|
1576
|
+
const view = getViewStyle(target.viewRef);
|
|
1577
|
+
if (view) {
|
|
1578
|
+
view.hyphens = newValue;
|
|
1579
|
+
}
|
|
1580
|
+
},
|
|
1382
1581
|
});
|
|
1383
1582
|
export const backdropFilterProperty = new CssProperty({
|
|
1384
1583
|
name: 'backdropFilter',
|
|
1385
1584
|
cssName: 'backdrop-filter',
|
|
1585
|
+
valueChanged(target, oldValue, newValue) {
|
|
1586
|
+
const view = getViewStyle(target.viewRef);
|
|
1587
|
+
if (view) {
|
|
1588
|
+
view.backdropFilter = newValue;
|
|
1589
|
+
}
|
|
1590
|
+
},
|
|
1386
1591
|
});
|
|
1387
1592
|
export const writingModeProperty = new CssProperty({
|
|
1388
1593
|
name: 'writingMode',
|
|
1389
1594
|
cssName: 'writing-mode',
|
|
1390
1595
|
defaultValue: 'horizontal-tb',
|
|
1596
|
+
valueChanged(target, oldValue, newValue) {
|
|
1597
|
+
const view = getViewStyle(target.viewRef);
|
|
1598
|
+
if (view) {
|
|
1599
|
+
view.writingMode = newValue;
|
|
1600
|
+
}
|
|
1601
|
+
},
|
|
1391
1602
|
});
|
|
1392
1603
|
export const unicodeBidiProperty = new CssProperty({
|
|
1393
1604
|
name: 'unicodeBidi',
|
|
1394
1605
|
cssName: 'unicode-bidi',
|
|
1395
1606
|
defaultValue: 'normal',
|
|
1607
|
+
valueChanged(target, oldValue, newValue) {
|
|
1608
|
+
const view = getViewStyle(target.viewRef);
|
|
1609
|
+
if (view) {
|
|
1610
|
+
view.unicodeBidi = newValue;
|
|
1611
|
+
}
|
|
1612
|
+
},
|
|
1396
1613
|
});
|
|
1397
1614
|
export const caretColorProperty = new CssProperty({
|
|
1398
1615
|
name: 'caretColor',
|
|
1399
1616
|
cssName: 'caret-color',
|
|
1400
1617
|
defaultValue: 'auto',
|
|
1618
|
+
valueChanged(target, oldValue, newValue) {
|
|
1619
|
+
const view = getViewStyle(target.viewRef);
|
|
1620
|
+
if (view) {
|
|
1621
|
+
view.caretColor = newValue;
|
|
1622
|
+
}
|
|
1623
|
+
},
|
|
1401
1624
|
});
|
|
1402
1625
|
objectPositionProperty.register(Style);
|
|
1403
1626
|
borderStyleProperty.register(Style);
|
|
@@ -1410,7 +1633,7 @@ backdropFilterProperty.register(Style);
|
|
|
1410
1633
|
writingModeProperty.register(Style);
|
|
1411
1634
|
unicodeBidiProperty.register(Style);
|
|
1412
1635
|
caretColorProperty.register(Style);
|
|
1413
|
-
backgroundImageProperty
|
|
1636
|
+
registerAlongsideCore(backgroundImageProperty);
|
|
1414
1637
|
export const listStyleTypeProperty = new CssProperty({
|
|
1415
1638
|
name: 'listStyleType',
|
|
1416
1639
|
cssName: 'list-style-type',
|
|
@@ -1421,5 +1644,13 @@ export const listStylePositionProperty = new CssProperty({
|
|
|
1421
1644
|
});
|
|
1422
1645
|
listStyleTypeProperty.register(Style);
|
|
1423
1646
|
listStylePositionProperty.register(Style);
|
|
1647
|
+
// core owns `white-space` too (its Label honours nowrap), so dispatch.
|
|
1648
|
+
registerAlongsideCore(whiteSpaceProperty);
|
|
1649
|
+
objectFitProperty.register(Style);
|
|
1650
|
+
textJustifyProperty.register(Style);
|
|
1651
|
+
textDecorationThicknessProperty.register(Style);
|
|
1652
|
+
// core owns `font-family` (through its Font shorthand), so this has to dispatch
|
|
1653
|
+
// rather than shadow it.
|
|
1654
|
+
registerAlongsideCore(fontFamilyProperty);
|
|
1424
1655
|
displayProperty.register(Style);
|
|
1425
1656
|
//# sourceMappingURL=properties.js.map
|