drawnui-react 0.1.0-preview.9 → 1.0.1

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 (117) hide show
  1. package/README.md +229 -22
  2. package/SKIPPED.md +37 -28
  3. package/dist/controls/AnimatedFramesRenderer.d.ts +9 -0
  4. package/dist/controls/AnimatedFramesRenderer.js +18 -1
  5. package/dist/controls/DrawnGame.d.ts +44 -0
  6. package/dist/controls/DrawnGame.js +82 -0
  7. package/dist/controls/GridStructure.d.ts +25 -3
  8. package/dist/controls/GridStructure.js +81 -5
  9. package/dist/controls/SkiaBackdrop.d.ts +8 -2
  10. package/dist/controls/SkiaBackdrop.js +42 -14
  11. package/dist/controls/SkiaButton.d.ts +17 -3
  12. package/dist/controls/SkiaButton.js +26 -8
  13. package/dist/controls/SkiaCarousel.d.ts +22 -3
  14. package/dist/controls/SkiaCarousel.js +85 -9
  15. package/dist/controls/SkiaCheckbox.d.ts +0 -1
  16. package/dist/controls/SkiaCheckbox.js +2 -7
  17. package/dist/controls/SkiaDrawer.d.ts +15 -0
  18. package/dist/controls/SkiaDrawer.js +42 -7
  19. package/dist/controls/SkiaEditor.d.ts +51 -2
  20. package/dist/controls/SkiaEditor.js +292 -58
  21. package/dist/controls/SkiaGif.d.ts +7 -0
  22. package/dist/controls/SkiaGif.js +25 -4
  23. package/dist/controls/SkiaImage.d.ts +10 -0
  24. package/dist/controls/SkiaImage.js +80 -19
  25. package/dist/controls/SkiaLabel.d.ts +200 -11
  26. package/dist/controls/SkiaLabel.js +925 -93
  27. package/dist/controls/SkiaLabelFps.d.ts +12 -0
  28. package/dist/controls/SkiaLabelFps.js +35 -0
  29. package/dist/controls/SkiaLayout.d.ts +89 -9
  30. package/dist/controls/SkiaLayout.js +397 -23
  31. package/dist/controls/SkiaLottie.js +5 -3
  32. package/dist/controls/SkiaProgress.d.ts +2 -1
  33. package/dist/controls/SkiaProgress.js +8 -5
  34. package/dist/controls/SkiaRadioButton.d.ts +2 -0
  35. package/dist/controls/SkiaRadioButton.js +16 -4
  36. package/dist/controls/SkiaRichLabel.d.ts +1 -1
  37. package/dist/controls/SkiaRichLabel.js +11 -1
  38. package/dist/controls/SkiaScroll.d.ts +86 -7
  39. package/dist/controls/SkiaScroll.js +361 -40
  40. package/dist/controls/SkiaScrollBar.d.ts +27 -0
  41. package/dist/controls/SkiaScrollBar.js +51 -2
  42. package/dist/controls/SkiaShaderCarousel.d.ts +11 -1
  43. package/dist/controls/SkiaShaderCarousel.js +27 -5
  44. package/dist/controls/SkiaShape.d.ts +15 -2
  45. package/dist/controls/SkiaShape.js +57 -10
  46. package/dist/controls/SkiaShell.d.ts +282 -0
  47. package/dist/controls/SkiaShell.js +972 -0
  48. package/dist/controls/SkiaSlider.d.ts +20 -2
  49. package/dist/controls/SkiaSlider.js +61 -7
  50. package/dist/controls/SkiaSprite.d.ts +4 -0
  51. package/dist/controls/SkiaSprite.js +27 -11
  52. package/dist/controls/SkiaSvg.d.ts +4 -0
  53. package/dist/controls/SkiaSvg.js +28 -4
  54. package/dist/controls/SkiaSwitch.d.ts +0 -1
  55. package/dist/controls/SkiaSwitch.js +4 -8
  56. package/dist/controls/SkiaToggle.d.ts +25 -5
  57. package/dist/controls/SkiaToggle.js +58 -5
  58. package/dist/controls/SnappingLayout.d.ts +12 -1
  59. package/dist/controls/SnappingLayout.js +21 -2
  60. package/dist/controls/TooltipStyle.d.ts +52 -0
  61. package/dist/controls/TooltipStyle.js +88 -0
  62. package/dist/core/Accessibility.d.ts +162 -11
  63. package/dist/core/Accessibility.js +882 -22
  64. package/dist/core/Animators.d.ts +37 -1
  65. package/dist/core/Animators.js +102 -9
  66. package/dist/core/Canvas.d.ts +307 -8
  67. package/dist/core/Canvas.js +1202 -66
  68. package/dist/core/ControlStyle.d.ts +2 -0
  69. package/dist/core/ControlStyle.js +2 -0
  70. package/dist/core/DesignerActions.d.ts +32 -0
  71. package/dist/core/DesignerActions.js +68 -0
  72. package/dist/core/Easing.d.ts +12 -1
  73. package/dist/core/Easing.js +25 -1
  74. package/dist/core/Gestures.d.ts +86 -2
  75. package/dist/core/Gestures.js +184 -4
  76. package/dist/core/Hover.d.ts +51 -0
  77. package/dist/core/Hover.js +140 -0
  78. package/dist/core/ImageEffects.d.ts +2 -0
  79. package/dist/core/ImageEffects.js +2 -0
  80. package/dist/core/KeyboardManager.d.ts +40 -0
  81. package/dist/core/KeyboardManager.js +98 -8
  82. package/dist/core/PopupWindows.d.ts +94 -0
  83. package/dist/core/PopupWindows.js +207 -0
  84. package/dist/core/Props.d.ts +11 -0
  85. package/dist/core/Props.js +44 -0
  86. package/dist/core/ScrollAnimators.d.ts +6 -0
  87. package/dist/core/ScrollAnimators.js +16 -1
  88. package/dist/core/Shaping.d.ts +40 -0
  89. package/dist/core/Shaping.js +224 -0
  90. package/dist/core/SkiaControl.d.ts +306 -13
  91. package/dist/core/SkiaControl.js +681 -75
  92. package/dist/core/SkiaEffect.d.ts +29 -1
  93. package/dist/core/SkiaEffect.js +78 -16
  94. package/dist/core/SkiaImageManager.d.ts +101 -18
  95. package/dist/core/SkiaImageManager.js +318 -63
  96. package/dist/core/Styles.js +7 -1
  97. package/dist/core/Super.d.ts +33 -2
  98. package/dist/core/Super.js +58 -12
  99. package/dist/core/TextInputProxy.d.ts +31 -1
  100. package/dist/core/TextInputProxy.js +97 -15
  101. package/dist/core/Tooltips.d.ts +71 -0
  102. package/dist/core/Tooltips.js +205 -0
  103. package/dist/core/Types.d.ts +11 -1
  104. package/dist/core/Types.js +32 -1
  105. package/dist/core/ViewsAdapter.d.ts +7 -2
  106. package/dist/core/ViewsAdapter.js +10 -3
  107. package/dist/index.d.ts +8 -0
  108. package/dist/index.js +8 -0
  109. package/dist/react/SkiaShell.d.ts +8 -74
  110. package/dist/react/SkiaShell.js +163 -475
  111. package/dist/react/index.d.ts +48 -4
  112. package/dist/react/index.js +210 -43
  113. package/dist/react/reconciler.d.ts +32 -0
  114. package/dist/react/reconciler.js +71 -40
  115. package/dist/vite/index.d.ts +9 -0
  116. package/dist/vite/index.js +36 -3
  117. package/package.json +103 -5
package/dist/index.js CHANGED
@@ -9,9 +9,14 @@ export * from "./core/SkiaControl";
9
9
  export * from "./core/Canvas";
10
10
  export * from "./controls/SkiaLayout";
11
11
  export * from "./core/Accessibility";
12
+ export * from "./core/Hover";
13
+ export * from "./core/Tooltips";
14
+ export * from "./core/PopupWindows";
12
15
  export * from "./controls/SkiaLabel";
13
16
  export * from "./controls/TextSpan";
14
17
  export * from "./controls/SkiaRichLabel";
18
+ export * from "./controls/SkiaLabelFps";
19
+ export * from "./controls/TooltipStyle";
15
20
  export * from "./core/ControlStyle";
16
21
  export * from "./core/ImageEffects";
17
22
  export * from "./controls/SkiaToggle";
@@ -30,6 +35,7 @@ export * from "./controls/RefreshIndicator";
30
35
  export * from "./core/TextInputProxy";
31
36
  export * from "./core/SkiaEffect";
32
37
  export * from "./controls/SkiaDrawer";
38
+ export * from "./controls/SkiaShell";
33
39
  export * from "./controls/SkiaHotspot";
34
40
  export * from "./controls/SkiaShape";
35
41
  export * from "./controls/SkiaButton";
@@ -40,6 +46,7 @@ export * from "./controls/SkiaBackdrop";
40
46
  export * from "./controls/SkiaEditor";
41
47
  export * from "./controls/SkiaSprite";
42
48
  export * from "./controls/SkiaSpriteSet";
49
+ export * from "./controls/DrawnGame";
43
50
  export * from "./core/KeyboardManager";
44
51
  export * from "./controls/AnimatedFramesRenderer";
45
52
  export * from "./controls/SkiaLottie";
@@ -47,3 +54,4 @@ export * from "./controls/SkiaGif";
47
54
  export * from "./controls/SkiaScroll";
48
55
  export * from "./controls/SkiaDynamicDrawnCell";
49
56
  export * from "./core/ViewsAdapter";
57
+ export * from "./core/DesignerActions";
@@ -1,55 +1,9 @@
1
1
  import { type ReactNode } from "react";
2
- import { Thickness } from "../core/Types";
3
- import type { SkiaControl } from "../core/SkiaControl";
4
- /** Arguments passed to a page (C# GoToAsync arguments / query string), e.g. `GoToAsync("detail", true, { id: 42 })` or `GoToAsync("detail?id=42")`. */
5
- export type ShellArguments = Record<string, unknown>;
2
+ import type { Thickness } from "../core/Types";
3
+ import { type ModalOptions, type PopupOptions, type ShellArguments, type ShellTab, type SkiaShellNavigatedArgs, type SkiaShellNavigatingArgs } from "../controls/SkiaShell";
4
+ export { BuildRoute, ShellDefaults, SplitRoute, type ModalOptions, type NavigationSource, type PopupOptions, type ShellArguments, type ShellTab, type SkiaShellNavigatedArgs, type SkiaShellNavigatingArgs } from "../controls/SkiaShell";
6
5
  /** Route name -> page factory receiving the navigation arguments. Pages are plain JSX, rendered inside the shell when navigated to. */
7
6
  export type ShellRoutes = Record<string, (args: ShellArguments) => ReactNode>;
8
- /** C# NavigationSource. */
9
- export type NavigationSource = "Push" | "Pop";
10
- /** C# SkiaShellNavigatingArgs: set Cancel to stop the navigation. */
11
- export interface SkiaShellNavigatingArgs {
12
- Route: string;
13
- Source: NavigationSource;
14
- Cancel: boolean;
15
- View?: SkiaControl;
16
- Previous?: SkiaControl;
17
- }
18
- /** C# SkiaShellNavigatedArgs. */
19
- export interface SkiaShellNavigatedArgs {
20
- Route: string;
21
- Source: NavigationSource;
22
- View?: SkiaControl;
23
- }
24
- /** "name?a=1&b=2" -> name + arguments (query values are strings). */
25
- export declare function SplitRoute(route: string): {
26
- name: string;
27
- args: ShellArguments;
28
- };
29
- /** name + arguments -> "name?a=1" (only string / number / boolean values travel in the route, the rest stays in memory). */
30
- export declare function BuildRoute(name: string, args?: ShellArguments): string;
31
- /** C# OpenPopupAsync parameters. */
32
- export interface PopupOptions {
33
- animated?: boolean;
34
- /** A tap outside the content closes the popup (default true). */
35
- closeWhenBackgroundTapped?: boolean;
36
- /** Dim + blur the page behind (default true). */
37
- showOverlay?: boolean;
38
- backgroundColor?: string;
39
- }
40
- /** C# PushModalAsync parameters. */
41
- export interface ModalOptions {
42
- /** The modal can be dragged down to close (default false). */
43
- useGestures?: boolean;
44
- animated?: boolean;
45
- /** Dim + blur the page behind (C# freezeBackground; the frozen screenshot is not ported). */
46
- freezeBackground?: boolean;
47
- }
48
- /** A shell tab: its root route and the label shown in the tab bar. */
49
- export interface ShellTab {
50
- route: string;
51
- title: string;
52
- }
53
7
  /** Navigation API, same verbs as DrawnUi SkiaShell. */
54
8
  export interface ShellNavigation {
55
9
  /** Pushes a registered route; `route` may carry a query ("detail?id=42") and/or explicit arguments (C# GoToAsync(route, animate, arguments)). */
@@ -114,31 +68,11 @@ export interface SkiaShellProps {
114
68
  /** Safe-area insets (points) reserved above the nav bar and below the tab bar; default Super.Insets (C# Super.Insets). */
115
69
  Insets?: Thickness;
116
70
  }
117
- /** C# SkiaShell static defaults (mutable). */
118
- export declare const ShellDefaults: {
119
- ToastBackgroundColor: string;
120
- ToastTextColor: "#FFFFFF";
121
- ToastTextFont: string;
122
- ToastTextSize: number;
123
- ToastTextMargins: number;
124
- /** Default overlay tint behind popups / modals. */
125
- PopupBackgroundColor: string;
126
- /** Backdrop blur behind popups / modals, points. */
127
- PopupsBackgroundBlur: number;
128
- PopupsAnimationSpeed: number;
129
- PopupsCancelAnimationsAfterMs: number;
130
- ZIndexModals: number;
131
- ZIndexPopups: number;
132
- ZIndexToasts: number;
133
- /** Accent of the selected tab. */
134
- TabSelectedColor: string;
135
- TabColor: string;
136
- };
137
71
  /**
138
- * Mirrors DrawnUi SkiaShell at the React level: a root page (or tabs) plus per-tab stacks of routed pages drawn
139
- * inside one SkiaLayer with a nav bar (pages slide in/out like SkiaViewSwitcher), popups (blurred + dimmed
140
- * backdrop, scale + fade, tap outside to close), modals (full-screen SkiaDrawer from the bottom, optionally
141
- * draggable), toasts (bottom banner, slide + fade, auto close). Pages live in the URL hash and the browser back
142
- * button behaves like C# GoBack (popup, then modal, then page). Navigation via ref or useShell().
72
+ * DrawnUi SkiaShell for React: the engine SkiaShell ("drawnui-react/core") with JSX content. A root page (or tabs) plus
73
+ * per-tab stacks of routed pages with a nav bar (pages slide in/out like SkiaViewSwitcher), popups (blurred + dimmed
74
+ * backdrop, scale + fade, tap outside to close), modals (full-screen SkiaDrawer from the bottom, optionally draggable),
75
+ * toasts (bottom banner, slide + fade, auto close). Pages live in the URL hash and the browser back button behaves like
76
+ * C# GoBack (popup, then modal, then page). Navigation via ref or useShell().
143
77
  */
144
78
  export declare const SkiaShell: import("react").ForwardRefExoticComponent<SkiaShellProps & import("react").RefAttributes<ShellNavigation>>;