@tur-ng/std 0.0.1 → 0.0.3
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/package.json +1 -1
- package/src/index.d.ts +115 -1
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -284,7 +284,27 @@ declare module "tur:std" {
|
|
|
284
284
|
/** When `true`, the text can be drag-selected with the pointer. */
|
|
285
285
|
selectable?: boolean;
|
|
286
286
|
queryKey?: Val<string[]>;
|
|
287
|
-
|
|
287
|
+
/**
|
|
288
|
+
* Maximum number of lines to render. Ignored when `overflow` is
|
|
289
|
+
* `"visible"`. When omitted (or `0`), the text wraps without limit.
|
|
290
|
+
*/
|
|
291
|
+
maxLines?: Val<number>;
|
|
292
|
+
/**
|
|
293
|
+
* How content beyond `maxLines` is handled. Defaults to `"clip"`
|
|
294
|
+
* when `maxLines` is set.
|
|
295
|
+
* - `"clip"` — render at most `maxLines` lines, discard the rest.
|
|
296
|
+
* - `"ellipsis"` — render at most `maxLines` lines, appending `…`
|
|
297
|
+
* to the last visible line (trimmed to fit).
|
|
298
|
+
* - `"visible"` — render all lines; `maxLines` is ignored.
|
|
299
|
+
*/
|
|
300
|
+
overflow?: Val<TextOverflow>;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* How `Text` handles content beyond `maxLines`. Mirrors Flutter's
|
|
305
|
+
* `TextOverflow`.
|
|
306
|
+
*/
|
|
307
|
+
export type TextOverflow = "clip" | "ellipsis" | "visible";
|
|
288
308
|
|
|
289
309
|
export interface PointerInteractProps {
|
|
290
310
|
onClick?: Mutation<[PointerInteractEvent]>;
|
|
@@ -412,6 +432,11 @@ declare module "tur:std" {
|
|
|
412
432
|
width?: Val<number>;
|
|
413
433
|
height?: Val<number>;
|
|
414
434
|
multiline?: Val<boolean>;
|
|
435
|
+
/** When true, each character is rendered as `obscuringCharacter`
|
|
436
|
+
* (password mode). The controller's `text` keeps the real value. */
|
|
437
|
+
obscureText?: Val<boolean>;
|
|
438
|
+
/** Mask glyph used when `obscureText` is on (default `"•"`). */
|
|
439
|
+
obscuringCharacter?: Val<string>;
|
|
415
440
|
onContextMenu?: Mutation<[PointerInteractEvent]>;
|
|
416
441
|
queryKey?: Val<string[]>;
|
|
417
442
|
}
|
|
@@ -614,6 +639,95 @@ declare module "tur:std" {
|
|
|
614
639
|
export function lifecycleView(f: () => LifecycleDescriptor): Element;
|
|
615
640
|
export function ReadableSubscribe(props: ReadableSubscribeProps): Element;
|
|
616
641
|
|
|
642
|
+
// ---------------------------------------------------------------------------
|
|
643
|
+
// Visual-effect elements (Opacity / Transform)
|
|
644
|
+
// ---------------------------------------------------------------------------
|
|
645
|
+
|
|
646
|
+
export interface OpacityProps {
|
|
647
|
+
value: Val<number>;
|
|
648
|
+
child?: Element;
|
|
649
|
+
queryKey?: Val<string[]>;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
export interface TransformProps {
|
|
653
|
+
scale?: Val<number>;
|
|
654
|
+
scaleX?: Val<number>;
|
|
655
|
+
scaleY?: Val<number>;
|
|
656
|
+
rotate?: Val<number>;
|
|
657
|
+
translateX?: Val<number>;
|
|
658
|
+
translateY?: Val<number>;
|
|
659
|
+
/** Pivot for `rotate`/`scale`, within the child box. Defaults to
|
|
660
|
+
* `Alignment.Center` (matches Flutter's `Transform`). */
|
|
661
|
+
alignment?: Val<Alignment>;
|
|
662
|
+
child?: Element;
|
|
663
|
+
queryKey?: Val<string[]>;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
/** Alpha-mask its child subtree by `value` (0.0..=1.0). */
|
|
667
|
+
export function Opacity(props: OpacityProps): Element;
|
|
668
|
+
|
|
669
|
+
/** Apply a 2D affine rotate/scale/translate to its child subtree. */
|
|
670
|
+
export function Transform(props: TransformProps): Element;
|
|
671
|
+
|
|
672
|
+
// ---------------------------------------------------------------------------
|
|
673
|
+
// CompositedTransformTarget / Follower — Flutter-style anchor linking.
|
|
674
|
+
// A follower renders at a target's global position (tracked continuously
|
|
675
|
+
// through layout / scroll / reactive / transform changes). Create a shared
|
|
676
|
+
// link via `createLayerLink()` and pass it to one target + one follower.
|
|
677
|
+
// Place the follower in a root overlay slot so it isn't clipped and paints
|
|
678
|
+
// on top (the Flutter `Overlay` pattern).
|
|
679
|
+
// ---------------------------------------------------------------------------
|
|
680
|
+
|
|
681
|
+
/** Shared handle connecting one `CompositedTransformTarget` to one
|
|
682
|
+
* `CompositedTransformFollower`. Create via `createLayerLink()`. */
|
|
683
|
+
export interface LayerLink {
|
|
684
|
+
readonly _layerLinkBrand: unique symbol;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/** Create a shared `LayerLink` connecting a target and a follower. */
|
|
688
|
+
export function createLayerLink(): LayerLink;
|
|
689
|
+
|
|
690
|
+
export interface CompositedTransformTargetProps {
|
|
691
|
+
/** A link created via `createLayerLink()`, shared with the follower. */
|
|
692
|
+
link: LayerLink;
|
|
693
|
+
child?: Element;
|
|
694
|
+
queryKey?: Val<string[]>;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
export interface CompositedTransformFollowerProps {
|
|
698
|
+
/** A link created via `createLayerLink()`, shared with the target. */
|
|
699
|
+
link: LayerLink;
|
|
700
|
+
/** Anchor point on the target that the follower aligns to. The
|
|
701
|
+
* follower is translated so its `followerAnchor` lands here in global
|
|
702
|
+
* space. Defaults to `Alignment.TopLeft`. Reactive: pass a `derive`
|
|
703
|
+
* to change it at runtime. */
|
|
704
|
+
targetAnchor?: Val<Alignment>;
|
|
705
|
+
/** Anchor point on this follower that lines up with `targetAnchor`.
|
|
706
|
+
* Defaults to `Alignment.TopLeft`. Reactive. */
|
|
707
|
+
followerAnchor?: Val<Alignment>;
|
|
708
|
+
/** Additional offset (in the target's local coordinate space) applied
|
|
709
|
+
* to `targetAnchor`. Defaults to `{x: 0, y: 0}`. Reactive: pass a
|
|
710
|
+
* `derive` to change it at runtime (e.g. steppers). */
|
|
711
|
+
targetOffset?: Val<{ x: number; y: number }>;
|
|
712
|
+
/** Whether to keep rendering at the follower's layout position when no
|
|
713
|
+
* target is linked. Defaults to `true`. */
|
|
714
|
+
showWhenUnlinked?: boolean;
|
|
715
|
+
child?: Element;
|
|
716
|
+
queryKey?: Val<string[]>;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/** Marks a spot in the tree for a `CompositedTransformFollower` to track.
|
|
720
|
+
* A transparent passthrough. */
|
|
721
|
+
export function CompositedTransformTarget(
|
|
722
|
+
props: CompositedTransformTargetProps,
|
|
723
|
+
): Element;
|
|
724
|
+
|
|
725
|
+
/** Renders at a target's anchor (tracked continuously). Place in a root
|
|
726
|
+
* overlay slot. */
|
|
727
|
+
export function CompositedTransformFollower(
|
|
728
|
+
props: CompositedTransformFollowerProps,
|
|
729
|
+
): Element;
|
|
730
|
+
|
|
617
731
|
// ---------------------------------------------------------------------------
|
|
618
732
|
// Controllers / resources / colors / focus
|
|
619
733
|
// ---------------------------------------------------------------------------
|