@symbiote-native/angular 3.1.3 → 3.3.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 (165) hide show
  1. package/babel-register-composed.cjs +1 -0
  2. package/build/angular/accessibility-events.d.ts +12 -0
  3. package/build/angular/accessibility-events.js +28 -0
  4. package/build/angular/accessibility-events.js.map +1 -0
  5. package/build/angular/accessibility-inputs.d.ts +40 -0
  6. package/build/angular/accessibility-inputs.js +130 -0
  7. package/build/angular/accessibility-inputs.js.map +1 -0
  8. package/build/angular/bootstrap.d.ts +3 -1
  9. package/build/angular/bootstrap.js +4 -1
  10. package/build/angular/bootstrap.js.map +1 -1
  11. package/build/angular/components/checkbox-props.d.ts +2 -0
  12. package/build/angular/components/checkbox-props.js +2 -0
  13. package/build/angular/components/checkbox-props.js.map +1 -0
  14. package/build/angular/components/flat-list/flat-list-template.d.ts +1 -0
  15. package/build/angular/components/flat-list/flat-list-template.js +158 -0
  16. package/build/angular/components/flat-list/flat-list-template.js.map +1 -0
  17. package/build/angular/components/flat-list/index.d.ts +6 -61
  18. package/build/angular/components/flat-list/index.js +26 -463
  19. package/build/angular/components/flat-list/index.js.map +1 -1
  20. package/build/angular/components/keyboard-avoiding-view/index.d.ts +4 -40
  21. package/build/angular/components/keyboard-avoiding-view/index.js +7 -131
  22. package/build/angular/components/keyboard-avoiding-view/index.js.map +1 -1
  23. package/build/angular/components/modal/index.d.ts +5 -41
  24. package/build/angular/components/modal/index.js +8 -133
  25. package/build/angular/components/modal/index.js.map +1 -1
  26. package/build/angular/components/section-list/index.d.ts +4 -51
  27. package/build/angular/components/section-list/index.js +18 -335
  28. package/build/angular/components/section-list/index.js.map +1 -1
  29. package/build/angular/components/virtualized-list/cell-registry.d.ts +35 -0
  30. package/build/angular/components/virtualized-list/cell-registry.js +133 -0
  31. package/build/angular/components/virtualized-list/cell-registry.js.map +1 -0
  32. package/build/angular/components/virtualized-list/index.d.ts +18 -253
  33. package/build/angular/components/virtualized-list/index.js +112 -1178
  34. package/build/angular/components/virtualized-list/index.js.map +1 -1
  35. package/build/angular/components/virtualized-list/list-a11y-forward.d.ts +1 -0
  36. package/build/angular/components/virtualized-list/list-a11y-forward.js +42 -0
  37. package/build/angular/components/virtualized-list/list-a11y-forward.js.map +1 -0
  38. package/build/angular/components/virtualized-list/list-bags.d.ts +32 -0
  39. package/build/angular/components/virtualized-list/list-bags.js +120 -0
  40. package/build/angular/components/virtualized-list/list-bags.js.map +1 -0
  41. package/build/angular/components/virtualized-list/list-effects.d.ts +31 -0
  42. package/build/angular/components/virtualized-list/list-effects.js +83 -0
  43. package/build/angular/components/virtualized-list/list-effects.js.map +1 -0
  44. package/build/angular/components/virtualized-list/list-events.d.ts +17 -0
  45. package/build/angular/components/virtualized-list/list-events.js +34 -0
  46. package/build/angular/components/virtualized-list/list-events.js.map +1 -0
  47. package/build/angular/components/virtualized-list/list-handle.d.ts +35 -0
  48. package/build/angular/components/virtualized-list/list-handle.js +61 -0
  49. package/build/angular/components/virtualized-list/list-handle.js.map +1 -0
  50. package/build/angular/components/virtualized-list/list-inputs.d.ts +78 -0
  51. package/build/angular/components/virtualized-list/list-inputs.js +150 -0
  52. package/build/angular/components/virtualized-list/list-inputs.js.map +1 -0
  53. package/build/angular/components/virtualized-list/list-props.d.ts +58 -0
  54. package/build/angular/components/virtualized-list/list-props.js +3 -0
  55. package/build/angular/components/virtualized-list/list-props.js.map +1 -0
  56. package/build/angular/components/virtualized-list/list-styles.d.ts +23 -0
  57. package/build/angular/components/virtualized-list/list-styles.js +26 -0
  58. package/build/angular/components/virtualized-list/list-styles.js.map +1 -0
  59. package/build/angular/components/virtualized-list/list-template.d.ts +1 -0
  60. package/build/angular/components/virtualized-list/list-template.js +176 -0
  61. package/build/angular/components/virtualized-list/list-template.js.map +1 -0
  62. package/build/angular/components/virtualized-section-list/index.d.ts +13 -70
  63. package/build/angular/components/virtualized-section-list/index.js +22 -455
  64. package/build/angular/components/virtualized-section-list/index.js.map +1 -1
  65. package/build/angular/components/virtualized-section-list/section-list-template.d.ts +1 -0
  66. package/build/angular/components/virtualized-section-list/section-list-template.js +107 -0
  67. package/build/angular/components/virtualized-section-list/section-list-template.js.map +1 -0
  68. package/build/angular/components.d.ts +1 -0
  69. package/build/angular/components.js.map +1 -1
  70. package/build/angular/descriptor-to-angular/descriptor-host.d.ts +8 -0
  71. package/build/angular/descriptor-to-angular/descriptor-host.js +38 -0
  72. package/build/angular/descriptor-to-angular/descriptor-host.js.map +1 -0
  73. package/build/angular/descriptor-to-angular/index.d.ts +1 -0
  74. package/build/angular/descriptor-to-angular/index.js +4 -0
  75. package/build/angular/descriptor-to-angular/index.js.map +1 -1
  76. package/build/angular/element-base.d.ts +153 -0
  77. package/build/angular/element-base.js +272 -0
  78. package/build/angular/element-base.js.map +1 -0
  79. package/build/angular/elements-controls.d.ts +165 -0
  80. package/build/angular/elements-controls.js +382 -0
  81. package/build/angular/elements-controls.js.map +1 -0
  82. package/build/angular/elements-layout.d.ts +122 -0
  83. package/build/angular/elements-layout.js +242 -0
  84. package/build/angular/elements-layout.js.map +1 -0
  85. package/build/angular/elements-press.d.ts +96 -0
  86. package/build/angular/elements-press.js +227 -0
  87. package/build/angular/elements-press.js.map +1 -0
  88. package/build/angular/elements.d.ts +6 -516
  89. package/build/angular/elements.js +8 -1091
  90. package/build/angular/elements.js.map +1 -1
  91. package/build/angular/finalization-registry.d.ts +4 -0
  92. package/build/angular/finalization-registry.js +17 -0
  93. package/build/angular/finalization-registry.js.map +1 -0
  94. package/build/angular/host-instance/index.d.ts +2 -0
  95. package/build/angular/host-instance/index.js +4 -4
  96. package/build/angular/host-instance/index.js.map +1 -1
  97. package/build/angular/index.d.ts +9 -4
  98. package/build/angular/index.js +8 -3
  99. package/build/angular/index.js.map +1 -1
  100. package/build/angular/native-view-base.d.ts +27 -0
  101. package/build/angular/native-view-base.js +69 -0
  102. package/build/angular/native-view-base.js.map +1 -0
  103. package/build/angular/render/index.d.ts +2 -1
  104. package/build/angular/render/index.js +46 -73
  105. package/build/angular/render/index.js.map +1 -1
  106. package/build/angular/services/connect-watched-signal.d.ts +2 -0
  107. package/build/angular/services/connect-watched-signal.js +9 -0
  108. package/build/angular/services/connect-watched-signal.js.map +1 -0
  109. package/build/angular/services/create-event-value-hook.d.ts +3 -0
  110. package/build/angular/services/create-event-value-hook.js +17 -0
  111. package/build/angular/services/create-event-value-hook.js.map +1 -0
  112. package/build/angular/services/create-resource-hook.d.ts +7 -0
  113. package/build/angular/services/create-resource-hook.js +20 -0
  114. package/build/angular/services/create-resource-hook.js.map +1 -0
  115. package/build/angular/services/index.d.ts +5 -0
  116. package/build/angular/services/index.js +5 -0
  117. package/build/angular/services/index.js.map +1 -1
  118. package/build/angular/services/inject-event.d.ts +6 -0
  119. package/build/angular/services/inject-event.js +24 -0
  120. package/build/angular/services/inject-event.js.map +1 -0
  121. package/build/angular/services/permissions-service-base.d.ts +14 -0
  122. package/build/angular/services/permissions-service-base.js +38 -0
  123. package/build/angular/services/permissions-service-base.js.map +1 -0
  124. package/package.json +6 -6
  125. package/src/accessibility-events.ts +13 -0
  126. package/src/accessibility-inputs.ts +89 -0
  127. package/src/bootstrap.ts +6 -2
  128. package/src/components/checkbox-props.ts +12 -0
  129. package/src/components/flat-list/flat-list-template.ts +159 -0
  130. package/src/components/flat-list/index.ts +30 -307
  131. package/src/components/keyboard-avoiding-view/index.ts +4 -78
  132. package/src/components/modal/index.ts +7 -80
  133. package/src/components/section-list/index.ts +21 -172
  134. package/src/components/virtualized-list/cell-registry.ts +199 -0
  135. package/src/components/virtualized-list/index.ts +145 -1181
  136. package/src/components/virtualized-list/list-a11y-forward.ts +42 -0
  137. package/src/components/virtualized-list/list-bags.ts +142 -0
  138. package/src/components/virtualized-list/list-effects.ts +116 -0
  139. package/src/components/virtualized-list/list-events.ts +31 -0
  140. package/src/components/virtualized-list/list-handle.ts +92 -0
  141. package/src/components/virtualized-list/list-inputs.ts +149 -0
  142. package/src/components/virtualized-list/list-props.ts +81 -0
  143. package/src/components/virtualized-list/list-styles.ts +62 -0
  144. package/src/components/virtualized-list/list-template.ts +175 -0
  145. package/src/components/virtualized-section-list/index.ts +40 -351
  146. package/src/components/virtualized-section-list/section-list-template.ts +108 -0
  147. package/src/components.ts +1 -0
  148. package/src/descriptor-to-angular/descriptor-host.ts +27 -0
  149. package/src/descriptor-to-angular/index.ts +5 -0
  150. package/src/element-base.ts +272 -0
  151. package/src/elements-controls.ts +282 -0
  152. package/src/elements-layout.ts +141 -0
  153. package/src/elements-press.ts +145 -0
  154. package/src/elements.ts +73 -788
  155. package/src/finalization-registry.ts +18 -0
  156. package/src/host-instance/index.ts +4 -4
  157. package/src/index.ts +18 -2
  158. package/src/native-view-base.ts +86 -0
  159. package/src/render/index.ts +76 -77
  160. package/src/services/connect-watched-signal.ts +15 -0
  161. package/src/services/create-event-value-hook.ts +24 -0
  162. package/src/services/create-resource-hook.ts +32 -0
  163. package/src/services/index.ts +5 -0
  164. package/src/services/inject-event.ts +52 -0
  165. package/src/services/permissions-service-base.ts +46 -0
@@ -0,0 +1,62 @@
1
+ // The styles a windowed list derives from its inputs each pass. Pure, so the component's recompute
2
+ // only assigns the result
3
+
4
+ import {
5
+ INVERTED_X_STYLE,
6
+ INVERTED_Y_STYLE,
7
+ } from '@symbiote-native/components';
8
+ import {
9
+ flattenStyle,
10
+ type IStyleProp,
11
+ type IViewStyle,
12
+ } from '@symbiote-native/engine';
13
+
14
+ type IMaintainVisibleContentPosition = {
15
+ minIndexForVisible: number;
16
+ autoscrollToTopThreshold?: number;
17
+ };
18
+
19
+ export type IListStyleInput = {
20
+ isHorizontal: boolean;
21
+ isInverted: boolean;
22
+ total: number;
23
+ hasHeader: boolean;
24
+ style: IStyleProp<IViewStyle> | undefined;
25
+ contentContainerStyle: IStyleProp<IViewStyle> | undefined;
26
+ // The class-derived style of the list's own anchor host
27
+ anchorStyle: unknown;
28
+ maintainVisibleContentPosition: IMaintainVisibleContentPosition | undefined;
29
+ };
30
+
31
+ export type IListStyles = {
32
+ // Bound to `[style]`, which Angular compiles to an instruction that only understands a flat
33
+ // object, so it is always pre-flattened
34
+ style: IViewStyle | undefined;
35
+ contentContainerStyle: IStyleProp<IViewStyle> | undefined;
36
+ cellStyle: IViewStyle | undefined;
37
+ maintainVisibleContentPosition: IMaintainVisibleContentPosition | undefined;
38
+ };
39
+
40
+ export function resolveListStyles(input: IListStyleInput): IListStyles {
41
+ const inversion = input.isHorizontal ? INVERTED_X_STYLE : INVERTED_Y_STYLE;
42
+ const mvcp = input.maintainVisibleContentPosition;
43
+ return {
44
+ contentContainerStyle: input.isHorizontal
45
+ ? [input.contentContainerStyle, { width: input.total }]
46
+ : input.contentContainerStyle,
47
+ // The app's style comes after the inversion, so it can override the flip
48
+ style: flattenStyle([
49
+ input.anchorStyle,
50
+ input.isInverted ? [inversion, input.style] : input.style,
51
+ ]),
52
+ cellStyle: input.isInverted ? inversion : undefined,
53
+ maintainVisibleContentPosition:
54
+ mvcp === undefined
55
+ ? undefined
56
+ : {
57
+ ...mvcp,
58
+ minIndexForVisible:
59
+ mvcp.minIndexForVisible + (input.hasHeader ? 1 : 0),
60
+ },
61
+ };
62
+ }
@@ -0,0 +1,175 @@
1
+ // Same body on both axes, only the outer tag differs
2
+ // Written out once per branch: ngc needs one literal, no shared outlet primitive exists
3
+ export const VIRTUALIZED_LIST_TEMPLATE = `
4
+ @if (isHorizontal) {
5
+ <horizontal-scroll-view #scrollHost [symbioteHostProps]="scrollViewBag()">
6
+ @if (shouldRenderRefreshControl) {
7
+ <refresh-control
8
+ [symbioteHostProps]="refreshControlBag()"
9
+ ></refresh-control>
10
+ }
11
+
12
+ @if (headerDir !== undefined) {
13
+ <view>
14
+ <ng-container [vListOutlet]="headerDir.templateRef"></ng-container>
15
+ </view>
16
+ }
17
+
18
+ @if (itemCount === 0) {
19
+ @if (emptyDir !== undefined) {
20
+ <view>
21
+ <ng-container [vListOutlet]="emptyDir.templateRef"></ng-container>
22
+ </view>
23
+ }
24
+ } @else {
25
+ @if (leadingSpacerStyle !== null) {
26
+ <view [style]="leadingSpacerStyle"></view>
27
+ }
28
+ @if (forcedStickyCell !== null) {
29
+ <sticky-header
30
+ (layout)="handleCellLayout(forcedStickyCell.measure, $event)"
31
+ [style]="cellStyle"
32
+ >
33
+ <ng-container
34
+ [vListOutlet]="cellTemplate"
35
+ [vListOutletContext]="forcedStickyCell.context"
36
+ ></ng-container>
37
+ </sticky-header>
38
+ }
39
+ @if (gapSpacerStyle !== null) {
40
+ <view [style]="gapSpacerStyle"></view>
41
+ }
42
+ @for (cell of windowCells; track cell.key) {
43
+ @if (cell.isSticky) {
44
+ <sticky-header
45
+ (layout)="handleCellLayout(cell.measure, $event)"
46
+ [style]="cellStyle"
47
+ >
48
+ <ng-container
49
+ [vListOutlet]="cellTemplate"
50
+ [vListOutletContext]="cell.context"
51
+ ></ng-container>
52
+ @if (cell.separatorContext !== undefined) {
53
+ <ng-container
54
+ [vListOutlet]="separatorTemplate"
55
+ [vListOutletContext]="cell.separatorContext"
56
+ ></ng-container>
57
+ }
58
+ </sticky-header>
59
+ } @else {
60
+ <view
61
+ (layout)="handleCellLayout(cell.measure, $event)"
62
+ [style]="cellStyle"
63
+ >
64
+ <ng-container
65
+ [vListOutlet]="cellTemplate"
66
+ [vListOutletContext]="cell.context"
67
+ ></ng-container>
68
+ @if (cell.separatorContext !== undefined) {
69
+ <ng-container
70
+ [vListOutlet]="separatorTemplate"
71
+ [vListOutletContext]="cell.separatorContext"
72
+ ></ng-container>
73
+ }
74
+ </view>
75
+ }
76
+ }
77
+ @if (trailingSpacerStyle !== null) {
78
+ <view [style]="trailingSpacerStyle"></view>
79
+ }
80
+ }
81
+
82
+ @if (footerDir !== undefined) {
83
+ <view>
84
+ <ng-container [vListOutlet]="footerDir.templateRef"></ng-container>
85
+ </view>
86
+ }
87
+ </horizontal-scroll-view>
88
+ } @else {
89
+ <scroll-view #scrollHost [symbioteHostProps]="scrollViewBag()">
90
+ @if (shouldRenderRefreshControl) {
91
+ <refresh-control
92
+ [symbioteHostProps]="refreshControlBag()"
93
+ ></refresh-control>
94
+ }
95
+
96
+ @if (headerDir !== undefined) {
97
+ <view>
98
+ <ng-container [vListOutlet]="headerDir.templateRef"></ng-container>
99
+ </view>
100
+ }
101
+
102
+ @if (itemCount === 0) {
103
+ @if (emptyDir !== undefined) {
104
+ <view>
105
+ <ng-container [vListOutlet]="emptyDir.templateRef"></ng-container>
106
+ </view>
107
+ }
108
+ } @else {
109
+ @if (leadingSpacerStyle !== null) {
110
+ <view [style]="leadingSpacerStyle"></view>
111
+ }
112
+ @if (forcedStickyCell !== null) {
113
+ <sticky-header
114
+ (layout)="handleCellLayout(forcedStickyCell.measure, $event)"
115
+ [style]="cellStyle"
116
+ >
117
+ <ng-container
118
+ [vListOutlet]="cellTemplate"
119
+ [vListOutletContext]="forcedStickyCell.context"
120
+ ></ng-container>
121
+ </sticky-header>
122
+ }
123
+ @if (gapSpacerStyle !== null) {
124
+ <view [style]="gapSpacerStyle"></view>
125
+ }
126
+ <!-- The separator sits INSIDE the measuring view, matching RN's cell renderer, as a
127
+ sibling it would add an extra flex gap -->
128
+ @for (cell of windowCells; track cell.key) {
129
+ @if (cell.isSticky) {
130
+ <sticky-header
131
+ (layout)="handleCellLayout(cell.measure, $event)"
132
+ [style]="cellStyle"
133
+ >
134
+ <ng-container
135
+ [vListOutlet]="cellTemplate"
136
+ [vListOutletContext]="cell.context"
137
+ ></ng-container>
138
+ @if (cell.separatorContext !== undefined) {
139
+ <ng-container
140
+ [vListOutlet]="separatorTemplate"
141
+ [vListOutletContext]="cell.separatorContext"
142
+ ></ng-container>
143
+ }
144
+ </sticky-header>
145
+ } @else {
146
+ <view
147
+ (layout)="handleCellLayout(cell.measure, $event)"
148
+ [style]="cellStyle"
149
+ >
150
+ <ng-container
151
+ [vListOutlet]="cellTemplate"
152
+ [vListOutletContext]="cell.context"
153
+ ></ng-container>
154
+ @if (cell.separatorContext !== undefined) {
155
+ <ng-container
156
+ [vListOutlet]="separatorTemplate"
157
+ [vListOutletContext]="cell.separatorContext"
158
+ ></ng-container>
159
+ }
160
+ </view>
161
+ }
162
+ }
163
+ @if (trailingSpacerStyle !== null) {
164
+ <view [style]="trailingSpacerStyle"></view>
165
+ }
166
+ }
167
+
168
+ @if (footerDir !== undefined) {
169
+ <view>
170
+ <ng-container [vListOutlet]="footerDir.templateRef"></ng-container>
171
+ </view>
172
+ }
173
+ </scroll-view>
174
+ }
175
+ `;