@swiftbrowser/react 0.0.0-stage → 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.
Files changed (94) hide show
  1. package/README.md +490 -2
  2. package/dist/binding.d.ts +9 -0
  3. package/dist/binding.d.ts.map +1 -0
  4. package/dist/bridge.d.ts +17 -0
  5. package/dist/bridge.d.ts.map +1 -0
  6. package/dist/components/animators.d.ts +40 -0
  7. package/dist/components/animators.d.ts.map +1 -0
  8. package/dist/components/canvas.d.ts +138 -0
  9. package/dist/components/canvas.d.ts.map +1 -0
  10. package/dist/components/charts.d.ts +100 -0
  11. package/dist/components/charts.d.ts.map +1 -0
  12. package/dist/components/containers.d.ts +78 -0
  13. package/dist/components/containers.d.ts.map +1 -0
  14. package/dist/components/controls.d.ts +106 -0
  15. package/dist/components/controls.d.ts.map +1 -0
  16. package/dist/components/geometry.d.ts +161 -0
  17. package/dist/components/geometry.d.ts.map +1 -0
  18. package/dist/components/host.d.ts +24 -0
  19. package/dist/components/host.d.ts.map +1 -0
  20. package/dist/components/images.d.ts +18 -0
  21. package/dist/components/images.d.ts.map +1 -0
  22. package/dist/components/lists.d.ts +26 -0
  23. package/dist/components/lists.d.ts.map +1 -0
  24. package/dist/components/media.d.ts +105 -0
  25. package/dist/components/media.d.ts.map +1 -0
  26. package/dist/components/menus.d.ts +20 -0
  27. package/dist/components/menus.d.ts.map +1 -0
  28. package/dist/components/navigation.d.ts +22 -0
  29. package/dist/components/navigation.d.ts.map +1 -0
  30. package/dist/components/row.d.ts +34 -0
  31. package/dist/components/row.d.ts.map +1 -0
  32. package/dist/components/shapes.d.ts +107 -0
  33. package/dist/components/shapes.d.ts.map +1 -0
  34. package/dist/components/split.d.ts +25 -0
  35. package/dist/components/split.d.ts.map +1 -0
  36. package/dist/components/stacks.d.ts +159 -0
  37. package/dist/components/stacks.d.ts.map +1 -0
  38. package/dist/components/system.d.ts +25 -0
  39. package/dist/components/system.d.ts.map +1 -0
  40. package/dist/components/table.d.ts +36 -0
  41. package/dist/components/table.d.ts.map +1 -0
  42. package/dist/components/tabs.d.ts +20 -0
  43. package/dist/components/tabs.d.ts.map +1 -0
  44. package/dist/components/text.d.ts +63 -0
  45. package/dist/components/text.d.ts.map +1 -0
  46. package/dist/coordinateSpace.d.ts +20 -0
  47. package/dist/coordinateSpace.d.ts.map +1 -0
  48. package/dist/dragDrop.d.ts +16 -0
  49. package/dist/dragDrop.d.ts.map +1 -0
  50. package/dist/environment.d.ts +54 -0
  51. package/dist/environment.d.ts.map +1 -0
  52. package/dist/host/instance.d.ts +67 -0
  53. package/dist/host/instance.d.ts.map +1 -0
  54. package/dist/host/reconciler.d.ts +9 -0
  55. package/dist/host/reconciler.d.ts.map +1 -0
  56. package/dist/host/root.d.ts +29 -0
  57. package/dist/host/root.d.ts.map +1 -0
  58. package/dist/host/sb.d.ts +5 -0
  59. package/dist/host/sb.d.ts.map +1 -0
  60. package/dist/host/tree.d.ts +35 -0
  61. package/dist/host/tree.d.ts.map +1 -0
  62. package/dist/index.d.ts +43 -0
  63. package/dist/index.d.ts.map +1 -0
  64. package/dist/index.js +4379 -0
  65. package/dist/index.js.map +1 -0
  66. package/dist/inspector.d.ts +11 -0
  67. package/dist/inspector.d.ts.map +1 -0
  68. package/dist/island.d.ts +25 -0
  69. package/dist/island.d.ts.map +1 -0
  70. package/dist/lazy.d.ts +19 -0
  71. package/dist/lazy.d.ts.map +1 -0
  72. package/dist/lifecycle.d.ts +11 -0
  73. package/dist/lifecycle.d.ts.map +1 -0
  74. package/dist/modifiers.d.ts +379 -0
  75. package/dist/modifiers.d.ts.map +1 -0
  76. package/dist/mount.d.ts +41 -0
  77. package/dist/mount.d.ts.map +1 -0
  78. package/dist/navigation-context.d.ts +15 -0
  79. package/dist/navigation-context.d.ts.map +1 -0
  80. package/dist/path.d.ts +48 -0
  81. package/dist/path.d.ts.map +1 -0
  82. package/dist/pointer.d.ts +65 -0
  83. package/dist/pointer.d.ts.map +1 -0
  84. package/dist/presentation.d.ts +38 -0
  85. package/dist/presentation.d.ts.map +1 -0
  86. package/dist/scrollEnvironment.d.ts +50 -0
  87. package/dist/scrollEnvironment.d.ts.map +1 -0
  88. package/dist/scrollReader.d.ts +27 -0
  89. package/dist/scrollReader.d.ts.map +1 -0
  90. package/dist/values.d.ts +118 -0
  91. package/dist/values.d.ts.map +1 -0
  92. package/dist/visualEffect.d.ts +120 -0
  93. package/dist/visualEffect.d.ts.map +1 -0
  94. package/package.json +48 -4
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Modifiers for a page with a mouse and a keyboard, and the effects the
3
+ * renderer draws for them: hover, tooltips, cursors, keyboard shortcuts,
4
+ * key presses, symbol effects, matched geometry, haptics.
5
+ */
6
+ import type { SymbolEffectStyle } from '@swiftbrowser/web/src/protocol';
7
+ import { type ReactNode } from 'react';
8
+ export declare function Hover({ action, children }: {
9
+ action: (hovering: boolean) => void;
10
+ children?: ReactNode;
11
+ }): ReactNode;
12
+ export declare function cursorFor(style: string): string;
13
+ export interface SymbolEffectModifier {
14
+ effect: SymbolEffectStyle['effect'];
15
+ direction?: 'up' | 'down';
16
+ speed?: number;
17
+ repeat?: number | 'forever';
18
+ /** `.symbolEffect(_:isActive:)`: the effect runs while true (true by default). */
19
+ isActive?: boolean;
20
+ /** `.symbolEffect(_:value:)`: the effect plays once each time this changes. */
21
+ value?: unknown;
22
+ }
23
+ export declare function SymbolEffect({ spec, children }: {
24
+ spec: SymbolEffectModifier;
25
+ children?: ReactNode;
26
+ }): ReactNode;
27
+ /** `@Namespace`: a namespace for `matchedGeometryEffect` ids. */
28
+ export declare function useNamespace(): string;
29
+ export type KeyEquivalent = 'return' | 'escape' | 'delete' | 'tab' | 'space' | 'upArrow' | 'downArrow' | 'leftArrow' | 'rightArrow' | (string & {});
30
+ export type EventModifier = 'command' | 'shift' | 'option' | 'control';
31
+ export interface KeyboardShortcut {
32
+ key: KeyEquivalent;
33
+ /** `command` by default, as SwiftUI's; `[]` for none. `command` is Ctrl off Apple platforms. */
34
+ modifiers?: EventModifier[];
35
+ }
36
+ export declare function matchesKey(event: KeyboardEvent, key: KeyEquivalent): boolean;
37
+ /** A shortcut that runs `action` while the component is mounted. */
38
+ export declare function useKeyboardShortcut(shortcut: KeyboardShortcut | undefined, action: () => void): void;
39
+ export interface KeyPress {
40
+ key: string;
41
+ characters: string;
42
+ modifiers: EventModifier[];
43
+ phase: 'down' | 'repeat';
44
+ }
45
+ export interface OnKeyPressModifier {
46
+ /** Only these keys (`KeyEquivalent`s or characters); every key when absent. */
47
+ keys?: KeyEquivalent[];
48
+ /** Return `'handled'` to stop the key there. */
49
+ action: (press: KeyPress) => 'handled' | 'ignored' | void;
50
+ }
51
+ /**
52
+ * `.onKeyPress`: keys pressed while the view is on screen and no text field
53
+ * has the focus (the page has no focus for a plain view, so the screen
54
+ * stands in for it).
55
+ */
56
+ export declare function KeyPressListener({ spec }: {
57
+ spec: OnKeyPressModifier;
58
+ }): null;
59
+ export type SensoryFeedback = 'success' | 'warning' | 'error' | 'selection' | 'increase' | 'decrease' | 'start' | 'stop' | 'alignment' | 'levelChange' | 'impact';
60
+ /** `.sensoryFeedback(_:trigger:)`: a vibration where the browser and device have one (Android), nothing elsewhere. */
61
+ export declare function SensoryFeedbackPlayer({ feedback, trigger }: {
62
+ feedback: SensoryFeedback;
63
+ trigger: unknown;
64
+ }): null;
65
+ //# sourceMappingURL=pointer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pointer.d.ts","sourceRoot":"","sources":["../src/pointer.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIjE,wBAAgB,KAAK,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;IAAE,MAAM,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IA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GAAG,IAAI,CAcpG;AAED,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,KAAK,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,+EAA+E;IAC/E,IAAI,CAAC,EAAE,aAAa,EAAE,CAAC;IACvB,gDAAgD;IAChD,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,SAAS,GAAG,SAAS,GAAG,IAAI,CAAC;CAC3D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,kBAAkB,CAAA;CAAE,GAAG,IAAI,CAsB7E;AAMD,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAC;AAgBlK,sHAAsH;AACtH,wBAAgB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IAAE,QAAQ,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAUlH"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Sheets and alerts: presented content becomes a root-level `sheet` / `alert`
3
+ * element after the app's tree, as the Swift core emits them.
4
+ */
5
+ import type { Detent } from '@swiftbrowser/web/src/protocol';
6
+ import { type ReactNode } from 'react';
7
+ import { type BindingValue } from './binding';
8
+ export interface SheetModifier {
9
+ isPresented: BindingValue<boolean>;
10
+ onDismiss?: () => void;
11
+ content: ReactNode;
12
+ /** `.fullScreenCover` */
13
+ fullScreen?: boolean;
14
+ }
15
+ export declare function SheetPresenter({ isPresented, onDismiss, content, fullScreen }: SheetModifier): ReactNode;
16
+ /** `.presentationDetents([.medium])`, inside a sheet's content. */
17
+ export type DetentValue = Detent | {
18
+ height: number;
19
+ } | {
20
+ fraction: number;
21
+ };
22
+ export declare function presentationDetents(detents: DetentValue[]): ReactNode;
23
+ export interface AlertModifier {
24
+ title: string;
25
+ isPresented: BindingValue<boolean>;
26
+ message?: string;
27
+ /** The buttons; each dismisses the alert when tapped. */
28
+ actions?: ReactNode;
29
+ /** `.confirmationDialog` */
30
+ style?: 'alert' | 'dialog';
31
+ }
32
+ export declare function AlertPresenter({ title, isPresented, message, actions, style }: AlertModifier): ReactNode;
33
+ /** `.onAppear` / `.onDisappear` */
34
+ export declare function Lifecycle({ onAppear, onDisappear }: {
35
+ onAppear?: () => void;
36
+ onDisappear?: () => void;
37
+ }): null;
38
+ //# sourceMappingURL=presentation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation.d.ts","sourceRoot":"","sources":["../src/presentation.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAM3D,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,EAAE,SAAS,CAAC;IACnB,yBAAyB;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,cAAc,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,aAAa,GAAG,SAAS,CAsBxG;AAED,mEAAmE;AACnE,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,SAAS,CAKrE;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,4BAA4B;IAC5B,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC5B;AAED,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,aAAa,GAAG,SAAS,CAgBxG;AAED,mCAAmC;AACnC,wBAAgB,SAAS,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,GAAG,IAAI,CAO9G"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * The scroll modifiers that pass down to the scroll views below, as SwiftUI's
3
+ * environment does: `.scrollEdgeEffectStyle(_:for:)`,
4
+ * `.scrollEdgeEffectHidden(_:for:)` and `.contentMargins(_:_:for:)`. A
5
+ * `ScrollView` or `List` reads them from above and from its own props, the
6
+ * closer setting winning edge by edge.
7
+ */
8
+ import type { EdgeEffectProps, EdgeInsets } from '@swiftbrowser/web/src/protocol';
9
+ import { type ReactNode } from 'react';
10
+ import { type PaddingValue } from './values';
11
+ export type ScrollEdgeEffectStyle = 'automatic' | 'hard' | 'soft';
12
+ /** The vertical edges a scroll edge effect sits on. */
13
+ export type ScrollEdges = 'top' | 'bottom' | 'all' | 'vertical' | ('top' | 'bottom')[];
14
+ /**
15
+ * `.scrollEdgeEffectStyle(.hard, for: .top)` is `["hard", "top"]`; a bare
16
+ * style applies to both edges.
17
+ */
18
+ export type ScrollEdgeEffectStyleValue = ScrollEdgeEffectStyle | [ScrollEdgeEffectStyle, ScrollEdges];
19
+ /** `.scrollEdgeEffectHidden()` is `true`; `.scrollEdgeEffectHidden(true, for: .bottom)` is `[true, "bottom"]`. */
20
+ export type ScrollEdgeEffectHiddenValue = boolean | [boolean, ScrollEdges];
21
+ /** The scroll settings in force at a point of the tree. */
22
+ export interface ScrollSettings {
23
+ /** Per edge: a style (`hard`, `soft`; absent is automatic) or hidden. */
24
+ topStyle?: 'hard' | 'soft';
25
+ bottomStyle?: 'hard' | 'soft';
26
+ topHidden?: boolean;
27
+ bottomHidden?: boolean;
28
+ /** `.contentMargins`: padding inside the scroll views below. */
29
+ margins?: EdgeInsets;
30
+ }
31
+ /** The settings one modifier adds. */
32
+ export declare function edgeStyleSettings(value: ScrollEdgeEffectStyleValue): ScrollSettings;
33
+ export declare function edgeHiddenSettings(value: ScrollEdgeEffectHiddenValue): ScrollSettings;
34
+ /** `contentMargins={12}`, `{["horizontal", 20]}` or insets; `true` is the default 16. */
35
+ export type ContentMarginsValue = PaddingValue;
36
+ export declare function marginSettings(value: ContentMarginsValue): ScrollSettings;
37
+ /** `inner` over `outer`, edge by edge. */
38
+ export declare function mergeScrollSettings(outer: ScrollSettings, inner: ScrollSettings): ScrollSettings;
39
+ /** The views below see `settings` added to the ones around them. */
40
+ export declare function withScrollSettings(settings: ScrollSettings, children: ReactNode): ReactNode;
41
+ /** The settings in force here, with a scroll view's own modifiers applied over them. */
42
+ export declare function useScrollSettings(own: ScrollSettings): ScrollSettings;
43
+ /** The `edgeEffect` prop of a `list` or `scrollview`, absent when both edges are automatic. */
44
+ export declare function edgeEffectProp(settings: ScrollSettings): EdgeEffectProps | undefined;
45
+ /**
46
+ * A scroll view's content with its content margins as padding inside it
47
+ * (several children first become the stack the scroll view would make).
48
+ */
49
+ export declare function marginedContent(children: ReactNode, margins: EdgeInsets | undefined, axis: 'horizontal' | 'vertical'): ReactNode;
50
+ //# sourceMappingURL=scrollEnvironment.d.ts.map
@@ -0,0 +1 @@
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c,CAEzE;AAED,0CAA0C;AAC1C,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,GAAG,cAAc,CAOhG;AAED,oEAAoE;AACpE,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,SAAS,GAAG,SAAS,CAE3F;AAOD,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,cAAc,CAErE;AAED,+FAA+F;AAC/F,wBAAgB,cAAc,CAAC,QAAQ,EAAE,cAAc,GAAG,eAAe,GAAG,SAAS,CAOpF;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,GAAG,SAAS,EAAE,IAAI,EAAE,YAAY,GAAG,UAAU,GAAG,SAAS,CAKhI"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * `ScrollViewReader` and `.id` (the `scrollID` modifier): `proxy.scrollTo(id)`
3
+ * marks the view with that id with a `scrollTo` command whose serial is new,
4
+ * and the page scrolls every scrolling ancestor to it after the pass.
5
+ */
6
+ import type { UnitPoint } from '@swiftbrowser/web/src/protocol';
7
+ import { type ReactNode } from 'react';
8
+ import { type UnitPointValue } from './values';
9
+ interface ScrollRequest {
10
+ id: string | number;
11
+ anchor: UnitPoint | null;
12
+ serial: number;
13
+ }
14
+ export declare const ScrollRequestContext: import("react").Context<ScrollRequest | null>;
15
+ export interface ScrollViewProxy {
16
+ /** Scroll so `anchor` of the view with that `scrollID` meets the same point of the visible area; no anchor: as little as shows it. */
17
+ scrollTo(id: string | number, anchor?: UnitPointValue): void;
18
+ }
19
+ export declare function ScrollViewReader({ children }: {
20
+ children: (proxy: ScrollViewProxy) => ReactNode;
21
+ }): ReactNode;
22
+ export declare function ScrollTarget({ id, children }: {
23
+ id: string | number;
24
+ children?: ReactNode;
25
+ }): ReactNode;
26
+ export {};
27
+ //# sourceMappingURL=scrollReader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scrollReader.d.ts","sourceRoot":"","sources":["../src/scrollReader.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1D,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,oBAAoB,+CAA4C,CAAC;AAG9E,MAAM,WAAW,eAAe;IAC9B,sIAAsI;IACtI,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;CAC9D;AAED,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,SAAS,CAAA;CAAE,GAAG,SAAS,CAM7G;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAIvG"}
@@ -0,0 +1,118 @@
1
+ /**
2
+ * Value types of the SwiftUI API as plain data: colors and shape styles,
3
+ * fonts, frames, insets and gradients, encoded as the ops protocol wants them.
4
+ */
5
+ import type { Color as ProtocolColor, EdgeInsets, Font as ProtocolFont, FontDesign, FontWeight, Frame, FrameAlignment, RGBAColor, SemanticColorName, ShapeStyle, TextStyle, UnitPoint } from '@swiftbrowser/web/src/protocol';
6
+ export type { EdgeInsets, FontDesign, FontWeight, Frame, FrameAlignment, ShapeStyle, TextStyle, UnitPoint };
7
+ /** The protocol's color value (the `Color` export is the view, with the color helpers as members). */
8
+ export type ColorType = ProtocolColor;
9
+ /** The protocol's font value (the `Font` export is the helper object). */
10
+ export type FontType = ProtocolFont;
11
+ /** `.primary` … `.quaternary` as foreground styles (the label colors) or fills. */
12
+ export type HierarchyName = 'primary' | 'secondary' | 'tertiary' | 'quaternary';
13
+ /**
14
+ * A style as a prop: a protocol value, or a name. A hierarchy name
15
+ * (`"secondary"`) is the hierarchical style, as `.foregroundStyle(.secondary)`
16
+ * is; a palette or UIKit name (`"red"`, `"secondarySystemBackground"`) is that
17
+ * semantic color; `"white"`, `"black"` and `"#rrggbb[aa]"` are explicit colors.
18
+ */
19
+ export type StyleValue = ShapeStyle | HierarchyName | SemanticColorName | 'white' | 'black' | `#${string}`;
20
+ export declare function rgb(r: number, g: number, b: number, a?: number): RGBAColor;
21
+ export declare function hex(value: string): RGBAColor;
22
+ export declare function shapeStyle(value: StyleValue): ShapeStyle;
23
+ /** A color as a prop: a protocol color or a name (hierarchy names are not colors). */
24
+ export type ColorValue = ProtocolColor | SemanticColorName | 'white' | 'black' | `#${string}`;
25
+ export declare function color(value: ColorValue): ProtocolColor;
26
+ /** `color.opacity(a)` */
27
+ export declare function opacity(value: ColorValue, a: number): ProtocolColor;
28
+ export declare function opacity(value: StyleValue, a: number): ShapeStyle;
29
+ /** `color.gradient`: the subtle vertical gradient iOS derives from a color. */
30
+ export declare function gradient(value: ColorValue): ShapeStyle;
31
+ /** `Color.red`, `Color.white`, `Color(.secondarySystemBackground)`… (`Color` itself, a view, carries these as members). */
32
+ export declare const ColorValues: {
33
+ red: ProtocolColor;
34
+ orange: ProtocolColor;
35
+ yellow: ProtocolColor;
36
+ green: ProtocolColor;
37
+ mint: ProtocolColor;
38
+ teal: ProtocolColor;
39
+ cyan: ProtocolColor;
40
+ blue: ProtocolColor;
41
+ indigo: ProtocolColor;
42
+ purple: ProtocolColor;
43
+ pink: ProtocolColor;
44
+ brown: ProtocolColor;
45
+ gray: ProtocolColor;
46
+ white: ProtocolColor;
47
+ black: ProtocolColor;
48
+ clear: ProtocolColor;
49
+ primary: ProtocolColor;
50
+ secondary: ProtocolColor;
51
+ accent: ProtocolColor;
52
+ /** `Color(uiColor:)` / `Color(.name)`: a UIKit semantic color by its iOS name. */
53
+ system: (name: SemanticColorName) => ProtocolColor;
54
+ rgb: typeof rgb;
55
+ hex: typeof hex;
56
+ opacity: typeof opacity;
57
+ gradient: typeof gradient;
58
+ };
59
+ export type UnitPointName = 'center' | 'top' | 'bottom' | 'leading' | 'trailing' | 'topLeading' | 'topTrailing' | 'bottomLeading' | 'bottomTrailing';
60
+ export type UnitPointValue = UnitPoint | UnitPointName;
61
+ export declare function unitPoint(value: UnitPointValue): UnitPoint;
62
+ export interface GradientColors {
63
+ /** Evenly spaced colors, or explicit stops. */
64
+ colors?: ColorValue[];
65
+ stops?: {
66
+ color: ColorValue;
67
+ location: number;
68
+ }[];
69
+ }
70
+ export declare function LinearGradient(spec: GradientColors & {
71
+ startPoint: UnitPointValue;
72
+ endPoint: UnitPointValue;
73
+ }): ShapeStyle;
74
+ export declare function RadialGradient(spec: GradientColors & {
75
+ center: UnitPointValue;
76
+ startRadius: number;
77
+ endRadius: number;
78
+ }): ShapeStyle;
79
+ export declare function AngularGradient(spec: GradientColors & {
80
+ center: UnitPointValue;
81
+ startAngle?: number;
82
+ endAngle?: number;
83
+ }): ShapeStyle;
84
+ /** A font as a prop: a text style name (`"headline"`) or a `Font` object. */
85
+ export type FontValue = TextStyle | ProtocolFont;
86
+ export declare function font(value: FontValue): ProtocolFont;
87
+ /** `Font.system(size:weight:design:)` */
88
+ export declare function system(size: number, weight?: FontWeight, design?: FontDesign): ProtocolFont;
89
+ /** `Font.system(.body, design:weight:)` */
90
+ export declare function system(textStyle: TextStyle, design?: FontDesign, weight?: FontWeight): ProtocolFont;
91
+ /** `.font(.title2.bold())`, `.font(.subheadline.weight(.semibold))` */
92
+ export declare function weighted(value: FontValue, weight: FontWeight): ProtocolFont;
93
+ export declare const Font: {
94
+ system: typeof system;
95
+ weighted: typeof weighted;
96
+ bold: (value: FontValue) => ProtocolFont;
97
+ };
98
+ /** `Infinity` stands for `.infinity`. */
99
+ export interface FrameValue {
100
+ width?: number;
101
+ height?: number;
102
+ minWidth?: number;
103
+ maxWidth?: number;
104
+ minHeight?: number;
105
+ maxHeight?: number;
106
+ alignment?: FrameAlignment;
107
+ }
108
+ export declare function frame(value: FrameValue): Frame;
109
+ export type EdgeName = 'top' | 'bottom' | 'leading' | 'trailing' | 'horizontal' | 'vertical' | 'all';
110
+ /**
111
+ * `.padding()` (`true`), `.padding(12)`, `.padding(.vertical, 6)` (`["vertical", 6]`),
112
+ * `.padding([.top, .leading], 8)`, or explicit insets.
113
+ */
114
+ export type PaddingValue = true | number | EdgeInsets | [EdgeName | EdgeName[], number?];
115
+ export declare const DEFAULT_PADDING = 16;
116
+ export declare function padding(value: PaddingValue): EdgeInsets;
117
+ export declare function insets(edges: EdgeName[], amount: number): EdgeInsets;
118
+ //# sourceMappingURL=values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"values.d.ts","sourceRoot":"","sources":["../src/values.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,KAAK,IAAI,aAAa,EACtB,UAAU,EACV,IAAI,IAAI,YAAY,EACpB,UAAU,EACV,UAAU,EACV,KAAK,EACL,cAAc,EAGd,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,SAAS,EACV,MAAM,gCAAgC,CAAC;AAExC,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;AAC5G,sGAAsG;AACtG,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC;AACtC,0EAA0E;AAC1E,MAAM,MAAM,QAAQ,GAAG,YAAY,CAAC;AAMpC,mFAAmF;AACnF,MAAM,MAAM,a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EAAE,MAAM,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;AAUrG,uEAAuE;AACvE,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,YAAY,CAE3E;AAED,eAAO,MAAM,IAAI;;;kBAAqC,SAAS,KAAG,YAAY;CAA6B,CAAC;AAM5G,yCAAyC;AACzC,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,cAAc,CAAC;CAC5B;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,KAAK,CAe9C;AAED,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,GAAG,KAAK,CAAC;AACrG;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,MAAM,GAAG,UAAU,GAAG,CAAC,QAAQ,GAAG,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;AAEzF,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,CAQvD;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CASpE"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * `.visualEffect { content, proxy in … }` and `.scrollTransition { content, phase in … }`.
3
+ *
4
+ * Both draw effects that depend on where the view is, without changing its
5
+ * layout. The view is wrapped in a layout-transparent box that reports its
6
+ * frame on screen (and the visible rectangle of the scroll view it is in),
7
+ * kept current as the page scrolls; the effects apply inside that box, so
8
+ * they never move what is measured.
9
+ */
10
+ import type { Rotation3D, Style } from '@swiftbrowser/web/src/protocol';
11
+ import { type ReactNode } from 'react';
12
+ import { type GeometryProxy, type ReportedGeometry } from './components/geometry';
13
+ import { type UnitPoint, type UnitPointValue } from './values';
14
+ interface EffectValues {
15
+ offsetX: number;
16
+ offsetY: number;
17
+ scaleX: number;
18
+ scaleY: number;
19
+ scaleAnchor?: UnitPoint;
20
+ rotation: number;
21
+ rotationAnchor?: UnitPoint;
22
+ rotation3D?: Rotation3D;
23
+ opacity: number;
24
+ blur: number;
25
+ brightness: number;
26
+ contrast: number;
27
+ saturation: number;
28
+ grayscale: number;
29
+ hueRotation: number;
30
+ }
31
+ /**
32
+ * SwiftUI's `VisualEffect`: the effects a `visualEffect` or `scrollTransition`
33
+ * closure returns, chained from the `effect` it is handed
34
+ * (`effect.offset({ y: 20 }).opacity(0.5)`). Chained effects compose:
35
+ * offsets and rotations add, scales and opacities multiply.
36
+ */
37
+ export declare class VisualEffect {
38
+ readonly values: EffectValues;
39
+ /** @internal */
40
+ constructor(values?: EffectValues);
41
+ private with;
42
+ offset(offset: {
43
+ x?: number;
44
+ y?: number;
45
+ }): VisualEffect;
46
+ scaleEffect(scale: number | {
47
+ x?: number;
48
+ y?: number;
49
+ }, anchor?: UnitPointValue): VisualEffect;
50
+ /** Degrees. */
51
+ rotationEffect(degrees: number, anchor?: UnitPointValue): VisualEffect;
52
+ rotation3DEffect(spec: {
53
+ angle: number;
54
+ axis: {
55
+ x: number;
56
+ y: number;
57
+ z: number;
58
+ };
59
+ anchor?: UnitPointValue;
60
+ perspective?: number;
61
+ }): VisualEffect;
62
+ opacity(opacity: number): VisualEffect;
63
+ blur(radius: number): VisualEffect;
64
+ brightness(amount: number): VisualEffect;
65
+ contrast(amount: number): VisualEffect;
66
+ saturation(amount: number): VisualEffect;
67
+ grayscale(amount: number): VisualEffect;
68
+ /** Degrees. */
69
+ hueRotation(degrees: number): VisualEffect;
70
+ }
71
+ /** The effect a closure starts from. */
72
+ export declare const EMPTY_EFFECT: VisualEffect;
73
+ /** The `styled` style that draws `values` (identity fields left out). */
74
+ export declare function effectStyle(values: EffectValues): Style;
75
+ /** `from` → `to` by `t` (0…1), field by field; anchors and 3-D axes come from the side that sets them. */
76
+ export declare function interpolateEffects(from: EffectValues, to: EffectValues, t: number): EffectValues;
77
+ export type VisualEffectClosure = (effect: VisualEffect, proxy: GeometryProxy) => VisualEffect;
78
+ /** `.visualEffect { content, proxy in … }`. */
79
+ export declare function VisualEffectView({ effect, children }: {
80
+ effect: VisualEffectClosure;
81
+ children?: ReactNode;
82
+ }): ReactNode;
83
+ /**
84
+ * Where a view is in its scroll view: `topLeading` (going out past the top or
85
+ * leading edge), `identity` (in view) or `bottomTrailing`, with `value` -1, 0
86
+ * or 1. An `interactive` transition draws the effect partway between phases
87
+ * as the view crosses the edge.
88
+ */
89
+ export interface ScrollTransitionPhase {
90
+ phase: 'topLeading' | 'identity' | 'bottomTrailing';
91
+ value: -1 | 0 | 1;
92
+ isIdentity: boolean;
93
+ }
94
+ export type ScrollTransitionClosure = (effect: VisualEffect, phase: ScrollTransitionPhase) => VisualEffect;
95
+ export interface ScrollTransitionSpec {
96
+ transition: ScrollTransitionClosure;
97
+ /**
98
+ * `interactive` (the default) follows the scrolling, drawing the effect
99
+ * partway as the view crosses the edge; `animated` switches phases once the
100
+ * view is partly out; `identity` never leaves the identity phase.
101
+ */
102
+ configuration?: 'interactive' | 'animated' | 'identity';
103
+ /** The axis to follow; the scroll view's own by default. */
104
+ axis?: 'horizontal' | 'vertical';
105
+ }
106
+ /**
107
+ * How far the view has gone out of its scroll view's visible rectangle:
108
+ * negative past the top or leading edge, positive past the bottom or
109
+ * trailing one, as a fraction of its own length (0 while wholly in view).
110
+ */
111
+ export declare function scrollProgress(reported: ReportedGeometry, axis?: 'horizontal' | 'vertical'): number;
112
+ /** The effect values a scroll transition draws at `progress` (see `scrollProgress`). */
113
+ export declare function scrollTransitionValues(spec: ScrollTransitionSpec, progress: number): EffectValues;
114
+ /** `.scrollTransition { content, phase in … }`. */
115
+ export declare function ScrollTransitionView({ spec, children }: {
116
+ spec: ScrollTransitionSpec;
117
+ children?: ReactNode;
118
+ }): ReactNode;
119
+ export {};
120
+ //# sourceMappingURL=visualEffect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"visualEffect.d.ts","sourceRoot":"","sources":["../src/visualEffect.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5D,OAAO,EAA4C,KAAK,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE5H,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1E,UAAU,YAAY;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAiBD;;;;;GAKG;AACH,qBAAa,YAAY;IAEX,QAAQ,CAAC,MAAM,EAAE,YAAY;IADzC,gBAAgB;gBACK,MAAM,GAAE,YAAuB;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G,SAAS,CAUxH"}
package/package.json CHANGED
@@ -1,6 +1,50 @@
1
1
  {
2
2
  "name": "@swiftbrowser/react",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.5.0",
4
+ "type": "module",
5
+ "description": "SwiftUI's components for React: a react-reconciler host that emits SwiftBrowser render ops into the @swiftbrowser/web renderer, so a pure React/TypeScript web app gets the same iOS UI as a SwiftUI app in the browser.",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/noya-app/SwiftBrowser.git",
9
+ "directory": "packages/react"
10
+ },
11
+ "main": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.js"
17
+ }
18
+ },
19
+ "files": [
20
+ "dist",
21
+ "README.md"
22
+ ],
23
+ "sideEffects": false,
24
+ "scripts": {
25
+ "dev": "vite",
26
+ "build": "tsc --noEmit -p tsconfig.json && vite build --config vite.lib.config.ts && tsc -p tsconfig.build.json",
27
+ "build:demo": "vite build",
28
+ "typecheck": "tsc --noEmit -p tsconfig.json",
29
+ "test:unit": "vitest run"
30
+ },
31
+ "dependencies": {
32
+ "@swiftbrowser/web": "0.5.0"
33
+ },
34
+ "peerDependencies": {
35
+ "react": "^19.0.0",
36
+ "react-dom": "^19.0.0",
37
+ "react-reconciler": "^0.31.0 || ^0.32.0 || ^0.33.0 || ^0.34.0"
38
+ },
39
+ "devDependencies": {
40
+ "@types/react": "^19.3.0",
41
+ "@types/react-dom": "^19.3.0",
42
+ "@types/react-reconciler": "^0.33.1",
43
+ "react": "^19.3.0",
44
+ "react-dom": "^19.3.0",
45
+ "react-reconciler": "^0.34.0",
46
+ "typescript": "^5.9.2",
47
+ "vite": "^7.1.7",
48
+ "vitest": "^5.0.3"
49
+ }
50
+ }