@ng-native/components 0.4.0 → 0.5.0
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/dist/gradient-text.d.ts +57 -0
- package/dist/gradient-text.js +105 -0
- package/dist/gradient-text.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/text-input.d.ts +1 -1
- package/package.json +8 -4
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text filled with a gradient, or with any background: the background is drawn through the shapes
|
|
3
|
+
* of the letters.
|
|
4
|
+
*
|
|
5
|
+
* ```html
|
|
6
|
+
* <gradient-text class="brand">Week</gradient-text>
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* ```css
|
|
10
|
+
* .brand {
|
|
11
|
+
* background-image: linear-gradient(to bottom, #437dfc, #4ad0ef);
|
|
12
|
+
* background-clip: text;
|
|
13
|
+
* color: transparent;
|
|
14
|
+
* font-size: 34px;
|
|
15
|
+
* font-weight: 700;
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* The rule is the one a web page writes. `background-clip: text` is what this element does, so a
|
|
20
|
+
* rule that has it applies to `<gradient-text>` and to nothing else: on a `<text>` it would leave
|
|
21
|
+
* transparent letters on a block of colour. The `color` is not used, since the letters are the
|
|
22
|
+
* mask and are drawn in full.
|
|
23
|
+
*
|
|
24
|
+
* It is text like any other: it wraps, follows the device's text size, takes `<text>` spans
|
|
25
|
+
* inside it with their own weight or style, and is sized by its letters. What a span cannot have
|
|
26
|
+
* here is a colour of its own, because the fill is the one background behind all of it.
|
|
27
|
+
*
|
|
28
|
+
* The app must have `@react-native-masked-view/masked-view` installed, which is where the native
|
|
29
|
+
* view comes from (`npx expo install @react-native-masked-view/masked-view`); none of its
|
|
30
|
+
* JavaScript is imported. The view masks what is inside it by its first child, so the letters are
|
|
31
|
+
* that child and the background is painted on a view behind them.
|
|
32
|
+
*/
|
|
33
|
+
import { type AfterContentChecked, type AfterViewInit } from '@angular/core';
|
|
34
|
+
import { ViewBase } from './view-base.ts';
|
|
35
|
+
import * as i0 from "@angular/core";
|
|
36
|
+
export declare class GradientText extends ViewBase implements AfterViewInit, AfterContentChecked {
|
|
37
|
+
private readonly fill;
|
|
38
|
+
private readonly letters;
|
|
39
|
+
/** The label last written from the letters, to write it again only when they change. */
|
|
40
|
+
private spoken;
|
|
41
|
+
constructor();
|
|
42
|
+
ngAfterViewInit(): void;
|
|
43
|
+
ngAfterContentChecked(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Say the letters. iOS takes the mask out of the view hierarchy, so there is no text under the
|
|
46
|
+
* element for VoiceOver to read, and an element with nothing to say is not found at all. A
|
|
47
|
+
* label the app gave is left as it is.
|
|
48
|
+
*/
|
|
49
|
+
private labelFromLetters;
|
|
50
|
+
/**
|
|
51
|
+
* The host's background is the fill's to paint: the view masks its children and not itself.
|
|
52
|
+
* Before the first commit, so the background is never drawn unmasked.
|
|
53
|
+
*/
|
|
54
|
+
private paintOnFill;
|
|
55
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GradientText, never>;
|
|
56
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GradientText, "gradient-text", never, {}, {}, never, ["*"], true, never>;
|
|
57
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text filled with a gradient, or with any background: the background is drawn through the shapes
|
|
3
|
+
* of the letters.
|
|
4
|
+
*
|
|
5
|
+
* ```html
|
|
6
|
+
* <gradient-text class="brand">Week</gradient-text>
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* ```css
|
|
10
|
+
* .brand {
|
|
11
|
+
* background-image: linear-gradient(to bottom, #437dfc, #4ad0ef);
|
|
12
|
+
* background-clip: text;
|
|
13
|
+
* color: transparent;
|
|
14
|
+
* font-size: 34px;
|
|
15
|
+
* font-weight: 700;
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* The rule is the one a web page writes. `background-clip: text` is what this element does, so a
|
|
20
|
+
* rule that has it applies to `<gradient-text>` and to nothing else: on a `<text>` it would leave
|
|
21
|
+
* transparent letters on a block of colour. The `color` is not used, since the letters are the
|
|
22
|
+
* mask and are drawn in full.
|
|
23
|
+
*
|
|
24
|
+
* It is text like any other: it wraps, follows the device's text size, takes `<text>` spans
|
|
25
|
+
* inside it with their own weight or style, and is sized by its letters. What a span cannot have
|
|
26
|
+
* here is a colour of its own, because the fill is the one background behind all of it.
|
|
27
|
+
*
|
|
28
|
+
* The app must have `@react-native-masked-view/masked-view` installed, which is where the native
|
|
29
|
+
* view comes from (`npx expo install @react-native-masked-view/masked-view`); none of its
|
|
30
|
+
* JavaScript is imported. The view masks what is inside it by its first child, so the letters are
|
|
31
|
+
* that child and the background is painted on a view behind them.
|
|
32
|
+
*/
|
|
33
|
+
import { Component, ElementRef, viewChild, } from '@angular/core';
|
|
34
|
+
import { registerViewName } from '@ng-native/fabric';
|
|
35
|
+
import { Text } from "./text.js";
|
|
36
|
+
import { View } from "./view.js";
|
|
37
|
+
import { ViewBase } from "./view-base.js";
|
|
38
|
+
import * as i0 from "@angular/core";
|
|
39
|
+
/** The characters under a node, in order. */
|
|
40
|
+
const textOf = (node) => node.kind === 'text' ? node.text : node.children.map(textOf).join('');
|
|
41
|
+
let registered = false;
|
|
42
|
+
/** Teach the engine the element, once, before its first commit. */
|
|
43
|
+
function registerGradientText() {
|
|
44
|
+
if (registered)
|
|
45
|
+
return;
|
|
46
|
+
registered = true;
|
|
47
|
+
registerViewName('gradient-text', 'RNCMaskedView');
|
|
48
|
+
}
|
|
49
|
+
export class GradientText extends ViewBase {
|
|
50
|
+
fill = viewChild.required('fill', { ...(ngDevMode ? { debugName: "fill" } : /* istanbul ignore next */ {}), read: ElementRef });
|
|
51
|
+
letters = viewChild('letters', { ...(ngDevMode ? { debugName: "letters" } : /* istanbul ignore next */ {}), read: ElementRef });
|
|
52
|
+
/** The label last written from the letters, to write it again only when they change. */
|
|
53
|
+
spoken;
|
|
54
|
+
constructor() {
|
|
55
|
+
super();
|
|
56
|
+
registerGradientText();
|
|
57
|
+
// One element to a screen reader, as a text is. An input of the same name is written after.
|
|
58
|
+
this.engine.setProp(this.node, 'accessible', true);
|
|
59
|
+
this.engine.setProp(this.node, 'accessibilityRole', 'text');
|
|
60
|
+
}
|
|
61
|
+
ngAfterViewInit() {
|
|
62
|
+
this.paintOnFill();
|
|
63
|
+
this.labelFromLetters();
|
|
64
|
+
}
|
|
65
|
+
ngAfterContentChecked() {
|
|
66
|
+
this.labelFromLetters();
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Say the letters. iOS takes the mask out of the view hierarchy, so there is no text under the
|
|
70
|
+
* element for VoiceOver to read, and an element with nothing to say is not found at all. A
|
|
71
|
+
* label the app gave is left as it is.
|
|
72
|
+
*/
|
|
73
|
+
labelFromLetters() {
|
|
74
|
+
const letters = this.letters()?.nativeElement;
|
|
75
|
+
const given = this.accessibilityLabel() ?? this.ariaLabel();
|
|
76
|
+
if (!letters || given !== undefined)
|
|
77
|
+
return;
|
|
78
|
+
const label = textOf(letters).replace(/\s+/g, ' ').trim();
|
|
79
|
+
if (label === this.spoken)
|
|
80
|
+
return;
|
|
81
|
+
this.spoken = label;
|
|
82
|
+
this.engine.setProp(this.node, 'accessibilityLabel', label || null);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The host's background is the fill's to paint: the view masks its children and not itself.
|
|
86
|
+
* Before the first commit, so the background is never drawn unmasked.
|
|
87
|
+
*/
|
|
88
|
+
paintOnFill() {
|
|
89
|
+
const engine = this.engine;
|
|
90
|
+
engine.paintOn?.(this.node, this.fill().nativeElement);
|
|
91
|
+
}
|
|
92
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: GradientText, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
93
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.0", type: GradientText, isStandalone: true, selector: "gradient-text", viewQueries: [{ propertyName: "fill", first: true, predicate: ["fill"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "letters", first: true, predicate: ["letters"], descendants: true, read: ElementRef, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
94
|
+
<text #letters class="letters"><ng-content /></text>
|
|
95
|
+
<view #fill class="fill" pointerEvents="none"></view>
|
|
96
|
+
`, isInline: true, styles: ["\n .letters {\n color: black;\n }\n .fill {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n "], dependencies: [{ kind: "directive", type: Text, selector: "text", inputs: ["numberOfLines", "ellipsizeMode", "selectable", "selectionColor", "allowFontScaling", "maxFontSizeMultiplier", "dynamicTypeRamp", "adjustsFontSizeToFit", "minimumFontScale", "lineBreakStrategyIOS", "textBreakStrategy", "dataDetectorType", "android_hyphenationFrequency", "pressable", "suppressHighlighting"], exportAs: ["text"] }, { kind: "directive", type: View, selector: "view" }] });
|
|
97
|
+
}
|
|
98
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: GradientText, decorators: [{
|
|
99
|
+
type: Component,
|
|
100
|
+
args: [{ selector: 'gradient-text', imports: [Text, View], template: `
|
|
101
|
+
<text #letters class="letters"><ng-content /></text>
|
|
102
|
+
<view #fill class="fill" pointerEvents="none"></view>
|
|
103
|
+
`, styles: ["\n .letters {\n color: black;\n }\n .fill {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n "] }]
|
|
104
|
+
}], ctorParameters: () => [], propDecorators: { fill: [{ type: i0.ViewChild, args: ['fill', { ...{ read: ElementRef }, isSignal: true }] }], letters: [{ type: i0.ViewChild, args: ['letters', { ...{ read: ElementRef }, isSignal: true }] }] } });
|
|
105
|
+
//# sourceMappingURL=gradient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ChB,CAAC,IAAI,EAAE,IAAI,CAAC,YACX;;;GAGT;4FAe0C,MAAM,OAAE,EAAE,IAAI,EAAE,UAAU,EAAE,+DAClC,SAAS,OAAE,EAAE,IAAI,EAAE,UAAU,EAAE","sourcesContent":["/**\n * Text filled with a gradient, or with any background: the background is drawn through the shapes\n * of the letters.\n *\n * ```html\n * <gradient-text class=\"brand\">Week</gradient-text>\n * ```\n *\n * ```css\n * .brand {\n * background-image: linear-gradient(to bottom, #437dfc, #4ad0ef);\n * background-clip: text;\n * color: transparent;\n * font-size: 34px;\n * font-weight: 700;\n * }\n * ```\n *\n * The rule is the one a web page writes. `background-clip: text` is what this element does, so a\n * rule that has it applies to `<gradient-text>` and to nothing else: on a `<text>` it would leave\n * transparent letters on a block of colour. The `color` is not used, since the letters are the\n * mask and are drawn in full.\n *\n * It is text like any other: it wraps, follows the device's text size, takes `<text>` spans\n * inside it with their own weight or style, and is sized by its letters. What a span cannot have\n * here is a colour of its own, because the fill is the one background behind all of it.\n *\n * The app must have `@react-native-masked-view/masked-view` installed, which is where the native\n * view comes from (`npx expo install @react-native-masked-view/masked-view`); none of its\n * JavaScript is imported. The view masks what is inside it by its first child, so the letters are\n * that child and the background is painted on a view behind them.\n */\nimport {\n Component,\n ElementRef,\n viewChild,\n type AfterContentChecked,\n type AfterViewInit,\n} from '@angular/core';\nimport { registerViewName, type Engine, type EngineNode } from '@ng-native/fabric';\nimport { Text } from './text.ts';\nimport { View } from './view.ts';\nimport { ViewBase } from './view-base.ts';\n\n/** The characters under a node, in order. */\nconst textOf = (node: EngineNode): string =>\n node.kind === 'text' ? node.text : node.children.map(textOf).join('');\n\nlet registered = false;\n\n/** Teach the engine the element, once, before its first commit. */\nfunction registerGradientText(): void {\n if (registered) return;\n registered = true;\n registerViewName('gradient-text', 'RNCMaskedView');\n}\n\n@Component({\n selector: 'gradient-text',\n imports: [Text, View],\n template: `\n <text #letters class=\"letters\"><ng-content /></text>\n <view #fill class=\"fill\" pointerEvents=\"none\"></view>\n `,\n styles: `\n .letters {\n color: black;\n }\n .fill {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n `,\n})\nexport class GradientText extends ViewBase implements AfterViewInit, AfterContentChecked {\n private readonly fill = viewChild.required('fill', { read: ElementRef });\n private readonly letters = viewChild('letters', { read: ElementRef });\n /** The label last written from the letters, to write it again only when they change. */\n private spoken: string | undefined;\n\n constructor() {\n super();\n registerGradientText();\n // One element to a screen reader, as a text is. An input of the same name is written after.\n this.engine.setProp(this.node, 'accessible', true);\n this.engine.setProp(this.node, 'accessibilityRole', 'text');\n }\n\n ngAfterViewInit(): void {\n this.paintOnFill();\n this.labelFromLetters();\n }\n\n ngAfterContentChecked(): void {\n this.labelFromLetters();\n }\n\n /**\n * Say the letters. iOS takes the mask out of the view hierarchy, so there is no text under the\n * element for VoiceOver to read, and an element with nothing to say is not found at all. A\n * label the app gave is left as it is.\n */\n private labelFromLetters(): void {\n const letters = this.letters()?.nativeElement as EngineNode | undefined;\n const given = this.accessibilityLabel() ?? this.ariaLabel();\n if (!letters || given !== undefined) return;\n const label = textOf(letters).replace(/\\s+/g, ' ').trim();\n if (label === this.spoken) return;\n this.spoken = label;\n this.engine.setProp(this.node, 'accessibilityLabel', label || null);\n }\n\n /**\n * The host's background is the fill's to paint: the view masks its children and not itself.\n * Before the first commit, so the background is never drawn unmasked.\n */\n private paintOnFill(): void {\n const engine = this.engine as Partial<Pick<Engine, 'paintOn'>>;\n engine.paintOn?.(this.node as EngineNode, this.fill().nativeElement as EngineNode);\n }\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export { Modal, type ModalOrientation, type ModalPresentationStyle } from './mod
|
|
|
20
20
|
export { NativeRef } from './native-ref.ts';
|
|
21
21
|
export { ControlBase, PressBehavior, Pressable, TouchableBase, type AndroidRipple, type PressEvent, } from './pressable.ts';
|
|
22
22
|
export { RefreshControl } from './refresh-control.ts';
|
|
23
|
+
export { GradientText } from './gradient-text.ts';
|
|
23
24
|
export { type SafeAreaEdge, type SafeAreaEdges } from './safe-area.ts';
|
|
24
25
|
export { SafeAreaProvider } from './safe-area-provider.ts';
|
|
25
26
|
export { SafeAreaView, type SafeAreaEdgeMode } from './safe-area-view.ts';
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ export { Modal } from "./modal.js";
|
|
|
20
20
|
export { NativeRef } from "./native-ref.js";
|
|
21
21
|
export { ControlBase, PressBehavior, Pressable, TouchableBase, } from "./pressable.js";
|
|
22
22
|
export { RefreshControl } from "./refresh-control.js";
|
|
23
|
+
export { GradientText } from "./gradient-text.js";
|
|
23
24
|
export {} from "./safe-area.js";
|
|
24
25
|
export { SafeAreaProvider } from "./safe-area-provider.js";
|
|
25
26
|
export { SafeAreaView } from "./safe-area-view.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAmD,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAwCN,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,EAA+D,MAAM,YAAY,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAiC,MAAM,6BAA6B,CAAC;AAClG,OAAO,EAAE,KAAK,EAAsD,MAAM,YAAY,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,WAAW,EACX,aAAa,EACb,SAAS,EACT,aAAa,GAGd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAyC,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAyB,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAkC,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,WAAW,EACX,WAAW,EACX,gBAAgB,GAOjB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAA4C,MAAM,WAAW,CAAC;AAC3E,OAAO,EACL,SAAS,GAIV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,uBAAuB,GAWxB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,WAAW,EACX,cAAc,EACd,oBAAoB,GAMrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAA6D,MAAM,sBAAsB,CAAC;AACjG,OAAO,EACL,aAAa,EACb,YAAY,GAMb,MAAM,eAAe,CAAC","sourcesContent":["/**\n * The host primitives, and the platform-capability tokens they inject.\n *\n * Every element a template renders natively is a component here and must be imported by the\n * component whose template uses it, as any Angular component must. A template that uses one\n * without importing it compiles, renders a plain view, and is reported in dev builds.\n *\n * Importing this barrel evaluates decorators, so anything a Node test needs at runtime has to\n * be reached as a source file instead - see the note in `packages/integration-tests/compile.ts`.\n */\nexport { ActivityIndicator } from './activity-indicator.ts';\nexport { type AnimatedPropsHandle, type AnimationBackend } from './animation.ts';\nexport {\n type AccessibilityActionEvent,\n type AccessibilityActionPayload,\n type ContentSizeChangeEvent,\n type ImageErrorEvent,\n type ImageErrorPayload,\n type ImageLoadEvent,\n type ImageLoadPayload,\n type ImageProgressEvent,\n type ImageProgressPayload,\n type Insets,\n type KeyPressEvent,\n type KeyPressPayload,\n type LayoutEvent,\n type LayoutPayload,\n type OrientationChangeEvent,\n type OrientationChangePayload,\n type Point,\n type Rect,\n type ScrollEvent,\n type ScrollPayload,\n type SelectionChangeEvent,\n type SelectionChangePayload,\n type Size,\n type SwitchChangeEvent,\n type SwitchChangePayload,\n type TextInputChangeEvent,\n type TextInputChangePayload,\n type TextInputContentSizeEvent,\n type TextInputContentSizePayload,\n type TextInputEditingEvent,\n type TextInputFocusEvent,\n type TextInputFocusPayload,\n type TextInputScrollEvent,\n type TextInputScrollPayload,\n type TextLayoutEvent,\n type TextLayoutLine,\n type TextLayoutPayload,\n type TouchEvent,\n type TouchEventPayload,\n} from './events.ts';\nexport { Image, type ImageResizeMode, type ImageSource, type ImageURISource } from './image.ts';\nexport { ImageBackground } from './image-background.ts';\nexport { InputAccessoryView } from './input-accessory-view.ts';\nexport {\n KEYBOARD_CONTROLLER,\n KeyboardDock,\n KeyboardLift,\n provideKeyboardController,\n} from './keyboard-dock.ts';\nexport { KeyboardAvoidingView, type KeyboardAvoidingBehavior } from './keyboard-avoiding-view.ts';\nexport { Modal, type ModalOrientation, type ModalPresentationStyle } from './modal.ts';\nexport { NativeRef } from './native-ref.ts';\nexport {\n ControlBase,\n PressBehavior,\n Pressable,\n TouchableBase,\n type AndroidRipple,\n type PressEvent,\n} from './pressable.ts';\nexport { RefreshControl } from './refresh-control.ts';\nexport { type SafeAreaEdge, type SafeAreaEdges } from './safe-area.ts';\nexport { SafeAreaProvider } from './safe-area-provider.ts';\nexport { SafeAreaView, type SafeAreaEdgeMode } from './safe-area-view.ts';\nexport { type KeyboardShouldPersistTaps } from './keyboard-taps.ts';\nexport { ScrollView } from './scroll-view.ts';\nexport {\n SectionEdgeSeparator,\n SectionFooter,\n SectionHeader,\n SectionItem,\n SectionList,\n SectionSeparator,\n type SectionContext,\n type SectionEdgeSeparatorContext,\n type SectionItemContext,\n type SectionListSection,\n type SectionRow,\n type SectionSeparatorContext,\n} from './section-list.ts';\nexport { Switch } from './switch.ts';\nexport { Text, type DynamicTypeRamp, type EllipsizeMode } from './text.ts';\nexport {\n TextInput,\n type KeyboardType,\n type ReturnKeyType,\n type SubmitBehavior,\n} from './text-input.ts';\nexport { TouchableOpacity } from './touchable-opacity.ts';\nexport { optionalBoolean, optionalNumber } from './transforms.ts';\nexport { View } from './view.ts';\nexport {\n ViewBase,\n ViewBehavior,\n contributeAccessibility,\n type AccessibilityAction,\n type AccessibilityContribution,\n type AccessibilityLiveRegion,\n type AccessibilityRole,\n type Role,\n type AccessibilityState,\n type AccessibilityValue,\n type AndroidDrawable,\n type ImportantForAccessibility,\n type PointerEvents,\n} from './view-base.ts';\nexport {\n VirtualList,\n VirtualListRow,\n VirtualListSeparator,\n type VirtualItemHeight,\n type VirtualListSeparatorContext,\n type VirtualListPadding,\n type VirtualListVisiblePosition,\n type VirtualRow,\n} from './virtual-list.ts';\nexport { type GestureBackend, type GestureSpec, type GestureTarget } from './gesture-backend.ts';\nexport {\n workletScroll,\n workletStyle,\n type SharedValue,\n type WorkletBackend,\n type WorkletScrollSpec,\n type WorkletStyleSpec,\n type WorkletTarget,\n} from './worklets.ts';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAmD,MAAM,gBAAgB,CAAC;AACjF,OAAO,EAwCN,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,EAA+D,MAAM,YAAY,CAAC;AAChG,OAAO,EAAE,eAAe,EAA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,gBAAgB,CAAC;AACxB,OAAO,EACL,WAAW,EACX,cAAc,EACd,oBAAoB,GAMrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAA6D,MAAM,sBAAsB,CAAC;AACjG,OAAO,EACL,aAAa,EACb,YAAY,GAMb,MAAM,eAAe,CAAC","sourcesContent":["/**\n * The host primitives, and the platform-capability tokens they inject.\n *\n * Every element a template renders natively is a component here and must be imported by the\n * component whose template uses it, as any Angular component must. A template that uses one\n * without importing it compiles, renders a plain view, and is reported in dev builds.\n *\n * Importing this barrel evaluates decorators, so anything a Node test needs at runtime has to\n * be reached as a source file instead - see the note in `packages/integration-tests/compile.ts`.\n */\nexport { ActivityIndicator } from './activity-indicator.ts';\nexport { type AnimatedPropsHandle, type AnimationBackend } from './animation.ts';\nexport {\n type AccessibilityActionEvent,\n type AccessibilityActionPayload,\n type ContentSizeChangeEvent,\n type ImageErrorEvent,\n type ImageErrorPayload,\n type ImageLoadEvent,\n type ImageLoadPayload,\n type ImageProgressEvent,\n type ImageProgressPayload,\n type Insets,\n type KeyPressEvent,\n type KeyPressPayload,\n type LayoutEvent,\n type LayoutPayload,\n type OrientationChangeEvent,\n type OrientationChangePayload,\n type Point,\n type Rect,\n type ScrollEvent,\n type ScrollPayload,\n type SelectionChangeEvent,\n type SelectionChangePayload,\n type Size,\n type SwitchChangeEvent,\n type SwitchChangePayload,\n type TextInputChangeEvent,\n type TextInputChangePayload,\n type TextInputContentSizeEvent,\n type TextInputContentSizePayload,\n type TextInputEditingEvent,\n type TextInputFocusEvent,\n type TextInputFocusPayload,\n type TextInputScrollEvent,\n type TextInputScrollPayload,\n type TextLayoutEvent,\n type TextLayoutLine,\n type TextLayoutPayload,\n type TouchEvent,\n type TouchEventPayload,\n} from './events.ts';\nexport { Image, type ImageResizeMode, type ImageSource, type ImageURISource } from './image.ts';\nexport { ImageBackground } from './image-background.ts';\nexport { InputAccessoryView } from './input-accessory-view.ts';\nexport {\n KEYBOARD_CONTROLLER,\n KeyboardDock,\n KeyboardLift,\n provideKeyboardController,\n} from './keyboard-dock.ts';\nexport { KeyboardAvoidingView, type KeyboardAvoidingBehavior } from './keyboard-avoiding-view.ts';\nexport { Modal, type ModalOrientation, type ModalPresentationStyle } from './modal.ts';\nexport { NativeRef } from './native-ref.ts';\nexport {\n ControlBase,\n PressBehavior,\n Pressable,\n TouchableBase,\n type AndroidRipple,\n type PressEvent,\n} from './pressable.ts';\nexport { RefreshControl } from './refresh-control.ts';\nexport { GradientText } from './gradient-text.ts';\nexport { type SafeAreaEdge, type SafeAreaEdges } from './safe-area.ts';\nexport { SafeAreaProvider } from './safe-area-provider.ts';\nexport { SafeAreaView, type SafeAreaEdgeMode } from './safe-area-view.ts';\nexport { type KeyboardShouldPersistTaps } from './keyboard-taps.ts';\nexport { ScrollView } from './scroll-view.ts';\nexport {\n SectionEdgeSeparator,\n SectionFooter,\n SectionHeader,\n SectionItem,\n SectionList,\n SectionSeparator,\n type SectionContext,\n type SectionEdgeSeparatorContext,\n type SectionItemContext,\n type SectionListSection,\n type SectionRow,\n type SectionSeparatorContext,\n} from './section-list.ts';\nexport { Switch } from './switch.ts';\nexport { Text, type DynamicTypeRamp, type EllipsizeMode } from './text.ts';\nexport {\n TextInput,\n type KeyboardType,\n type ReturnKeyType,\n type SubmitBehavior,\n} from './text-input.ts';\nexport { TouchableOpacity } from './touchable-opacity.ts';\nexport { optionalBoolean, optionalNumber } from './transforms.ts';\nexport { View } from './view.ts';\nexport {\n ViewBase,\n ViewBehavior,\n contributeAccessibility,\n type AccessibilityAction,\n type AccessibilityContribution,\n type AccessibilityLiveRegion,\n type AccessibilityRole,\n type Role,\n type AccessibilityState,\n type AccessibilityValue,\n type AndroidDrawable,\n type ImportantForAccessibility,\n type PointerEvents,\n} from './view-base.ts';\nexport {\n VirtualList,\n VirtualListRow,\n VirtualListSeparator,\n type VirtualItemHeight,\n type VirtualListSeparatorContext,\n type VirtualListPadding,\n type VirtualListVisiblePosition,\n type VirtualRow,\n} from './virtual-list.ts';\nexport { type GestureBackend, type GestureSpec, type GestureTarget } from './gesture-backend.ts';\nexport {\n workletScroll,\n workletStyle,\n type SharedValue,\n type WorkletBackend,\n type WorkletScrollSpec,\n type WorkletStyleSpec,\n type WorkletTarget,\n} from './worklets.ts';\n"]}
|
package/dist/text-input.d.ts
CHANGED
|
@@ -125,7 +125,7 @@ export declare class TextInput extends ViewBase {
|
|
|
125
125
|
/** Android: the selection handle colour. */
|
|
126
126
|
readonly selectionHandleColor: import("@angular/core").InputSignal<string | undefined>;
|
|
127
127
|
/** Android: where text sits in a tall field. */
|
|
128
|
-
readonly textAlignVertical: import("@angular/core").InputSignal<"auto" | "
|
|
128
|
+
readonly textAlignVertical: import("@angular/core").InputSignal<"auto" | "top" | "bottom" | "center" | undefined>;
|
|
129
129
|
/** Android: whether autofill may fill this field. */
|
|
130
130
|
readonly importantForAutofill: import("@angular/core").InputSignal<"auto" | "yes" | "no" | "noExcludeDescendants" | "yesExcludeDescendants" | undefined>;
|
|
131
131
|
/** Android: set to false to focus without raising the keyboard. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-native/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Angular Native's core components: view, text, image, pressable, scroll-view, virtual-list, text-input and the rest of React Native's set.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@ng-native/device": "0.
|
|
57
|
-
"@ng-native/fabric": "0.
|
|
56
|
+
"@ng-native/device": "0.5.0",
|
|
57
|
+
"@ng-native/fabric": "0.5.0"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@angular/core": "^22.0.0",
|
|
@@ -62,7 +62,8 @@
|
|
|
62
62
|
"react-native-gesture-handler": "^2.32.0",
|
|
63
63
|
"react-native-reanimated": "^4.5.1",
|
|
64
64
|
"react-native-safe-area-context": "^5.7.0",
|
|
65
|
-
"react-native-keyboard-controller": "^1.21.9"
|
|
65
|
+
"react-native-keyboard-controller": "^1.21.9",
|
|
66
|
+
"@react-native-masked-view/masked-view": ">=0.3.0"
|
|
66
67
|
},
|
|
67
68
|
"nx": {
|
|
68
69
|
"tags": [
|
|
@@ -90,6 +91,9 @@
|
|
|
90
91
|
},
|
|
91
92
|
"react-native-keyboard-controller": {
|
|
92
93
|
"optional": true
|
|
94
|
+
},
|
|
95
|
+
"@react-native-masked-view/masked-view": {
|
|
96
|
+
"optional": true
|
|
93
97
|
}
|
|
94
98
|
},
|
|
95
99
|
"repository": {
|