@symbiote-native/angular 3.1.2 → 3.2.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 (121) hide show
  1. package/build/angular/accessibility-events.d.ts +12 -0
  2. package/build/angular/accessibility-events.js +28 -0
  3. package/build/angular/accessibility-events.js.map +1 -0
  4. package/build/angular/accessibility-inputs.d.ts +40 -0
  5. package/build/angular/accessibility-inputs.js +130 -0
  6. package/build/angular/accessibility-inputs.js.map +1 -0
  7. package/build/angular/bootstrap.d.ts +3 -1
  8. package/build/angular/bootstrap.js +4 -1
  9. package/build/angular/bootstrap.js.map +1 -1
  10. package/build/angular/components/flat-list/flat-list-template.d.ts +1 -0
  11. package/build/angular/components/flat-list/flat-list-template.js +158 -0
  12. package/build/angular/components/flat-list/flat-list-template.js.map +1 -0
  13. package/build/angular/components/flat-list/index.d.ts +6 -61
  14. package/build/angular/components/flat-list/index.js +26 -463
  15. package/build/angular/components/flat-list/index.js.map +1 -1
  16. package/build/angular/components/keyboard-avoiding-view/index.d.ts +4 -40
  17. package/build/angular/components/keyboard-avoiding-view/index.js +7 -131
  18. package/build/angular/components/keyboard-avoiding-view/index.js.map +1 -1
  19. package/build/angular/components/modal/index.d.ts +5 -41
  20. package/build/angular/components/modal/index.js +8 -133
  21. package/build/angular/components/modal/index.js.map +1 -1
  22. package/build/angular/components/section-list/index.d.ts +4 -51
  23. package/build/angular/components/section-list/index.js +18 -335
  24. package/build/angular/components/section-list/index.js.map +1 -1
  25. package/build/angular/components/virtualized-list/cell-registry.d.ts +35 -0
  26. package/build/angular/components/virtualized-list/cell-registry.js +133 -0
  27. package/build/angular/components/virtualized-list/cell-registry.js.map +1 -0
  28. package/build/angular/components/virtualized-list/index.d.ts +18 -253
  29. package/build/angular/components/virtualized-list/index.js +112 -1178
  30. package/build/angular/components/virtualized-list/index.js.map +1 -1
  31. package/build/angular/components/virtualized-list/list-a11y-forward.d.ts +1 -0
  32. package/build/angular/components/virtualized-list/list-a11y-forward.js +42 -0
  33. package/build/angular/components/virtualized-list/list-a11y-forward.js.map +1 -0
  34. package/build/angular/components/virtualized-list/list-bags.d.ts +32 -0
  35. package/build/angular/components/virtualized-list/list-bags.js +120 -0
  36. package/build/angular/components/virtualized-list/list-bags.js.map +1 -0
  37. package/build/angular/components/virtualized-list/list-effects.d.ts +31 -0
  38. package/build/angular/components/virtualized-list/list-effects.js +83 -0
  39. package/build/angular/components/virtualized-list/list-effects.js.map +1 -0
  40. package/build/angular/components/virtualized-list/list-events.d.ts +17 -0
  41. package/build/angular/components/virtualized-list/list-events.js +34 -0
  42. package/build/angular/components/virtualized-list/list-events.js.map +1 -0
  43. package/build/angular/components/virtualized-list/list-handle.d.ts +35 -0
  44. package/build/angular/components/virtualized-list/list-handle.js +61 -0
  45. package/build/angular/components/virtualized-list/list-handle.js.map +1 -0
  46. package/build/angular/components/virtualized-list/list-inputs.d.ts +78 -0
  47. package/build/angular/components/virtualized-list/list-inputs.js +150 -0
  48. package/build/angular/components/virtualized-list/list-inputs.js.map +1 -0
  49. package/build/angular/components/virtualized-list/list-props.d.ts +58 -0
  50. package/build/angular/components/virtualized-list/list-props.js +3 -0
  51. package/build/angular/components/virtualized-list/list-props.js.map +1 -0
  52. package/build/angular/components/virtualized-list/list-styles.d.ts +23 -0
  53. package/build/angular/components/virtualized-list/list-styles.js +26 -0
  54. package/build/angular/components/virtualized-list/list-styles.js.map +1 -0
  55. package/build/angular/components/virtualized-list/list-template.d.ts +1 -0
  56. package/build/angular/components/virtualized-list/list-template.js +176 -0
  57. package/build/angular/components/virtualized-list/list-template.js.map +1 -0
  58. package/build/angular/components/virtualized-section-list/index.d.ts +13 -70
  59. package/build/angular/components/virtualized-section-list/index.js +22 -455
  60. package/build/angular/components/virtualized-section-list/index.js.map +1 -1
  61. package/build/angular/components/virtualized-section-list/section-list-template.d.ts +1 -0
  62. package/build/angular/components/virtualized-section-list/section-list-template.js +107 -0
  63. package/build/angular/components/virtualized-section-list/section-list-template.js.map +1 -0
  64. package/build/angular/finalization-registry.d.ts +4 -0
  65. package/build/angular/finalization-registry.js +17 -0
  66. package/build/angular/finalization-registry.js.map +1 -0
  67. package/build/angular/index.d.ts +5 -1
  68. package/build/angular/index.js +5 -1
  69. package/build/angular/index.js.map +1 -1
  70. package/build/angular/native-view-base.d.ts +19 -0
  71. package/build/angular/native-view-base.js +48 -0
  72. package/build/angular/native-view-base.js.map +1 -0
  73. package/build/angular/render/index.d.ts +2 -1
  74. package/build/angular/render/index.js +46 -73
  75. package/build/angular/render/index.js.map +1 -1
  76. package/build/angular/services/connect-watched-signal.d.ts +2 -0
  77. package/build/angular/services/connect-watched-signal.js +9 -0
  78. package/build/angular/services/connect-watched-signal.js.map +1 -0
  79. package/build/angular/services/create-event-value-hook.d.ts +3 -0
  80. package/build/angular/services/create-event-value-hook.js +17 -0
  81. package/build/angular/services/create-event-value-hook.js.map +1 -0
  82. package/build/angular/services/create-resource-hook.d.ts +7 -0
  83. package/build/angular/services/create-resource-hook.js +20 -0
  84. package/build/angular/services/create-resource-hook.js.map +1 -0
  85. package/build/angular/services/index.d.ts +4 -0
  86. package/build/angular/services/index.js +4 -0
  87. package/build/angular/services/index.js.map +1 -1
  88. package/build/angular/services/permissions-service-base.d.ts +14 -0
  89. package/build/angular/services/permissions-service-base.js +38 -0
  90. package/build/angular/services/permissions-service-base.js.map +1 -0
  91. package/package.json +6 -6
  92. package/src/accessibility-events.ts +13 -0
  93. package/src/accessibility-inputs.ts +89 -0
  94. package/src/bootstrap.ts +6 -2
  95. package/src/components/flat-list/flat-list-template.ts +159 -0
  96. package/src/components/flat-list/index.ts +30 -307
  97. package/src/components/keyboard-avoiding-view/index.ts +4 -78
  98. package/src/components/modal/index.ts +7 -80
  99. package/src/components/section-list/index.ts +21 -172
  100. package/src/components/virtualized-list/cell-registry.ts +199 -0
  101. package/src/components/virtualized-list/index.ts +145 -1181
  102. package/src/components/virtualized-list/list-a11y-forward.ts +42 -0
  103. package/src/components/virtualized-list/list-bags.ts +142 -0
  104. package/src/components/virtualized-list/list-effects.ts +116 -0
  105. package/src/components/virtualized-list/list-events.ts +31 -0
  106. package/src/components/virtualized-list/list-handle.ts +92 -0
  107. package/src/components/virtualized-list/list-inputs.ts +149 -0
  108. package/src/components/virtualized-list/list-props.ts +81 -0
  109. package/src/components/virtualized-list/list-styles.ts +62 -0
  110. package/src/components/virtualized-list/list-template.ts +175 -0
  111. package/src/components/virtualized-section-list/index.ts +40 -351
  112. package/src/components/virtualized-section-list/section-list-template.ts +108 -0
  113. package/src/finalization-registry.ts +18 -0
  114. package/src/index.ts +12 -1
  115. package/src/native-view-base.ts +51 -0
  116. package/src/render/index.ts +76 -77
  117. package/src/services/connect-watched-signal.ts +15 -0
  118. package/src/services/create-event-value-hook.ts +24 -0
  119. package/src/services/create-resource-hook.ts +32 -0
  120. package/src/services/index.ts +4 -0
  121. 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
+ `;