@ng-native/components 0.27.0 → 0.29.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.
- package/android/src/main/java/dev/ngnative/components/ColorSchemeModule.kt +116 -11
- package/android/src/main/java/dev/ngnative/components/ContextMenuPopup.kt +61 -19
- package/android/src/main/java/dev/ngnative/components/MenusModule.kt +22 -0
- package/android/src/main/java/dev/ngnative/components/Shortcut.kt +13 -4
- package/dist/context-menu.d.ts +14 -6
- package/dist/context-menu.js +30 -28
- package/dist/context-menu.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/menu.d.ts +17 -8
- package/dist/menu.js +22 -36
- package/dist/menu.js.map +1 -1
- package/dist/modal.d.ts +6 -2
- package/dist/modal.js.map +1 -1
- package/dist/native-button.d.ts +31 -2
- package/dist/native-button.js +104 -6
- package/dist/native-button.js.map +1 -1
- package/dist/press-menu.d.ts +60 -0
- package/dist/press-menu.js +116 -0
- package/dist/press-menu.js.map +1 -0
- package/dist/pressable.d.ts +3 -0
- package/dist/pressable.js +7 -1
- package/dist/pressable.js.map +1 -1
- package/dist/reanimated.js +27 -3
- package/dist/reanimated.js.map +1 -1
- package/dist/scroll-view.d.ts +3 -1
- package/dist/scroll-view.js +7 -2
- package/dist/scroll-view.js.map +1 -1
- package/dist/settled-updates.d.ts +55 -0
- package/dist/settled-updates.js +77 -0
- package/dist/settled-updates.js.map +1 -0
- package/dist/sidebar-item.d.ts +18 -3
- package/dist/sidebar-item.js +29 -3
- package/dist/sidebar-item.js.map +1 -1
- package/dist/sidebar.js +4 -3
- package/dist/sidebar.js.map +1 -1
- package/dist/split-view.d.ts +23 -2
- package/dist/split-view.js +32 -5
- package/dist/split-view.js.map +1 -1
- package/dist/stand-ins/reanimated.d.ts +5 -0
- package/dist/stand-ins/reanimated.js +7 -0
- package/dist/stand-ins/reanimated.js.map +1 -1
- package/dist/sticky-headers.d.ts +19 -0
- package/dist/sticky-headers.js +67 -10
- package/dist/sticky-headers.js.map +1 -1
- package/dist/sticky-rows.d.ts +123 -26
- package/dist/sticky-rows.js +285 -71
- package/dist/sticky-rows.js.map +1 -1
- package/dist/svg-icon.d.ts +23 -0
- package/dist/svg-icon.js +53 -0
- package/dist/svg-icon.js.map +1 -0
- package/dist/tray-icon.d.ts +7 -1
- package/dist/tray-icon.js +15 -3
- package/dist/tray-icon.js.map +1 -1
- package/dist/virtual-list-sticky-level.d.ts +33 -0
- package/dist/virtual-list-sticky-level.js +58 -0
- package/dist/virtual-list-sticky-level.js.map +1 -0
- package/dist/virtual-list-sticky.d.ts +19 -0
- package/dist/virtual-list-sticky.js +13 -0
- package/dist/virtual-list-sticky.js.map +1 -0
- package/dist/virtual-list.d.ts +29 -7
- package/dist/virtual-list.js +127 -59
- package/dist/virtual-list.js.map +1 -1
- package/dist/worklet-style.d.ts +11 -0
- package/dist/worklet-style.js +15 -1
- package/dist/worklet-style.js.map +1 -1
- package/dist/worklets.d.ts +5 -1
- package/dist/worklets.js.map +1 -1
- package/dist/written-props.js +3 -0
- package/dist/written-props.js.map +1 -1
- package/ios/NgNativeButtonComponentView.mm +8 -4
- package/ios/NgNativeButtonMetrics.h +9 -2
- package/ios/NgNativeButtonMetrics.mm +33 -4
- package/ios/NgNativeButtonShadowNode.h +2 -0
- package/ios/NgNativeButtonShadowNode.mm +5 -1
- package/ios/NgNativeMenus.mm +42 -2
- package/ios/NgNativePressMenu.h +28 -0
- package/ios/NgNativePressMenu.mm +45 -0
- package/package.json +3 -3
package/dist/sticky-rows.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sticky-rows.js","sourceRoot":"","sources":["../src/sticky-rows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAe,MAAM,eAAe,CAAC;AAC9D,OAAO,EAML,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBA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GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3F,CAAC;IAED;;;OAGG;IACK,OAAO,CAAC,GAAQ;QACtB,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAC3E,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAClD,OAAO;YACL,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAC1D,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE;SAChC,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { computed, signal, type Signal } from '@angular/core';\nimport {\n type HostEngine,\n type HostNode,\n type ScrollDrive,\n type ScrollRange,\n type StaticTransform,\n pinnedRange,\n} from '@ng-native/fabric';\nimport { STICKY_SETTLE_MS } from './sticky-headers.ts';\n\n/** What `StickyRows` needs of the list whose rows it pins. */\nexport interface StickyRowsList {\n /** The sticky rows' indices, as `stickyIndices` gives them. */\n readonly indices: Signal<readonly number[]>;\n /** Whether the list header is pinned too, as `stickyHeader` says. */\n readonly header: Signal<boolean>;\n readonly headerHeight: Signal<number>;\n horizontal(): boolean;\n /** Rows size themselves and are laid out in flow. */\n measuring(): boolean;\n topOf(index: number): number;\n heightOf(index: number): number;\n /** An absolutely positioned row's style, at its own place. */\n slotStyle(index: number): Record<string, unknown>;\n /** What places a row in flow. */\n flowSpacing(): Record<string, unknown>;\n /** The list's flip, as transforms and as CSS text, when it is inverted. */\n flip(): readonly StaticTransform[] | undefined;\n flipText(): string | undefined;\n}\n\n/** A row as the list renders it, for what `StickyRows` reads of it. */\ninterface Row {\n readonly index: number;\n readonly parked?: boolean;\n}\n\n/**\n * `<virtual-list>`'s sticky rows: which one holds the leading edge, the style that pins it, the\n * header's pinned style, and, where the host moves views by the scroll on the native side, what\n * native is moving. The list's own share of `stickyIndices` and `stickyHeader`, as `StickyHeaders`\n * is `<scroll-view>`'s.\n *\n * Pinning is not native: RN's `ScrollView.js` translates a sticky child against the scroll offset\n * in JavaScript, and a row here follows the offset the same way while it is the current one, by\n * its `top` when absolutely positioned and by a transform when in flow. Where native can move a\n * view by the scroll, each sticky row instead stays at its own place in the list and native\n * translates it on every frame the list scrolls, as RN's `ScrollViewStickyHeader` does; a\n * translate committed from each scroll event lands a frame or more late, and on a fast fling the\n * row shudders and comes away from the edge.\n */\nexport class StickyRows {\n /** Whether native moves sticky rows. */\n readonly native: boolean;\n /** The leading edge of the viewport in content space, kept only while anything is pinned. */\n private readonly leading = signal(0);\n readonly offset = this.leading.asReadonly();\n\n private readonly engine: HostEngine;\n private readonly node: HostNode;\n private readonly list: StickyRowsList;\n /** The offset once scrolling pauses, which the settled translate of a native-moved row is from. */\n private readonly settled = signal(0);\n private settleTimer: ReturnType<typeof setTimeout> | undefined;\n /** What native is moving, by row view, with the transform kept beside the translate. */\n private readonly drives = new Map<HostNode, { drive: ScrollDrive; statics: string }>();\n /** The list scrolled itself, and native has not drawn its sticky rows there yet. */\n private jumped = false;\n /** Native has reported reaching the target, so this pass's drives are the last to need telling. */\n private landed = false;\n /** Where the list scrolled itself to, in the scroll view, which native reports with its event. */\n private jumpedTo = 0;\n /** Whether that scroll is animated, so native is still at its start until it reports. */\n private jumpAnimated = false;\n /** Where native's latest event since the jump said the scroll view was, header and all. */\n private reported: number | undefined;\n /** Where native's latest event of all said it was, header and all. */\n private nativeAt = 0;\n /**\n * Scroll end events still to come, one for each jump that moved native, as iOS sends one. Kept\n * across jumps: one that landed has its end still to come, and must not be taken for the next's.\n */\n private ends = 0;\n /** The recycling type of a sticky row of each `itemType`: apart from plain rows of it. */\n private readonly typeOfKind = new Map<unknown, symbol>();\n private readonly types = new Set<unknown>();\n\n constructor(engine: HostEngine, node: HostNode, list: StickyRowsList) {\n this.engine = engine;\n this.node = node;\n this.list = list;\n this.native = engine.drivesScroll;\n }\n\n /** Whether the scroll offset is needed as a signal, which only pinning needs. */\n private readonly pinning = computed(() => this.list.header() || this.list.indices().length > 0);\n\n /** Each sticky row, and the one after it, which pushes it off. */\n readonly next = computed(() => {\n const sticky = this.list.indices();\n return new Map(sticky.map((index, at) => [index, sticky[at + 1]]));\n });\n\n /**\n * The sticky row currently holding the leading edge: the last one at or before the offset.\n * Null when the list has scrolled back above the first of them.\n */\n readonly pinned = computed<number | null>(() => {\n const sticky = this.list.indices();\n if (sticky.length === 0) return null;\n const offset = this.offset();\n\n let pinned: number | null = null;\n for (const index of sticky) {\n if (this.list.topOf(index) <= offset) pinned = index;\n else break;\n }\n return pinned;\n });\n\n /**\n * The header's translation while it is pinned: the scroll position, held back at zero by an\n * overscroll and at the first sticky row, which pushes it off.\n */\n readonly headerStyle = computed(() => {\n const flip = this.list.flipText();\n if (!this.list.header()) return flip ? { transform: flip } : undefined;\n const along = this.offset() + this.list.headerHeight();\n const first = this.list.indices()[0];\n const limit = first === undefined ? Infinity : this.list.topOf(first);\n const shift = Math.min(Math.max(0, along), limit);\n const move =\n shift > 0 ? `${this.list.horizontal() ? 'translateX' : 'translateY'}(${shift}px)` : '';\n const transform = [move, flip ?? ''].filter(Boolean).join(' ');\n return transform ? { zIndex: 1, transform } : { zIndex: 1 };\n });\n\n /** A pinned row in flow, moved from where flow put it to the leading edge by a transform. */\n flowStyle(at: number): Record<string, unknown> {\n const shift = Math.max(0, this.offset() - at);\n const move = `${this.list.horizontal() ? 'translateX' : 'translateY'}(${shift}px)`;\n const flip = this.list.flipText();\n return { ...this.list.flowSpacing(), zIndex: 1, transform: flip ? `${move} ${flip}` : move };\n }\n\n /**\n * A sticky row native moves: at its own place, with the translate native had reached when\n * scrolling paused, so the props agree with what is on screen.\n */\n style(index: number): Record<string, unknown> {\n const horizontal = this.list.horizontal();\n const style: Record<string, unknown> = this.list.measuring()\n ? { ...this.list.flowSpacing() }\n : { ...this.list.slotStyle(index) };\n style['zIndex'] = 1;\n const top = this.list.topOf(index);\n const shift = Math.min(Math.max(0, this.settled() - top), this.stopOf(index) - top);\n const move = shift > 0 ? `${horizontal ? 'translateX' : 'translateY'}(${shift}px)` : '';\n const transform = [move, this.list.flipText() ?? ''].filter(Boolean).join(' ');\n if (transform) style['transform'] = transform;\n return style;\n }\n\n /**\n * The recycling type of a row: a sticky row is a type of its own, since native keeps the\n * translate it moved one by, and a plain row taking its slot commits no transform to put it\n * back. Apart from that, `kind`, the row's `itemType`.\n */\n recyclingType(index: number, kind: unknown): unknown {\n if (!this.next().has(index)) return kind;\n let type = this.typeOfKind.get(kind);\n if (!type) {\n type = Symbol('sticky');\n this.typeOfKind.set(kind, type);\n this.types.add(type);\n }\n return type;\n }\n\n /** Whether a recycling type is a sticky row's. */\n isType(type: unknown): boolean {\n return this.types.has(type);\n }\n\n /** The list scrolled, to `offset` in content space and `along` in the scroll view. */\n scrolled(offset: number, along: number): void {\n this.nativeAt = along;\n if (this.jumped) {\n this.reported = along;\n // An event from before the jump, or on the way, is not where it lands.\n if (Math.abs(along - this.jumpedTo) <= 1) this.landed = true;\n }\n // A pinned row follows the scroll continuously, so with sticky rows the offset has to be a\n // signal - and only then. Without them this stays out of change detection, and a fling that\n // moves no row in or out of the window costs none.\n if (!this.pinning()) return;\n this.leading.set(offset);\n if (!this.native) return;\n // See `STICKY_SETTLE_MS`.\n clearTimeout(this.settleTimer);\n this.settleTimer = setTimeout(() => this.settled.set(offset), STICKY_SETTLE_MS);\n }\n\n /** The list is scrolling itself, to `to` in the scroll view, where native has not drawn yet. */\n jumping(to: number, animated: boolean): void {\n // To where native last said it was, with no earlier jump on its way: it moves nothing and\n // reports nothing. With one, native moves and comes back, and reports that.\n const pending = this.jumped && !this.landed;\n if (Math.abs(to - (pending ? this.jumpedTo : this.nativeAt)) > 1) this.ends++;\n this.jumped = pending || Math.abs(to - this.nativeAt) > 1;\n this.landed = false;\n this.jumpedTo = to;\n this.jumpAnimated = animated;\n this.reported = undefined;\n }\n\n /** The user took the scroll over: native's own events move the rows from here. */\n dragged(): void {\n this.jumped = this.landed = false;\n // Android sends no end for a jump that is not animated, so none is waited for past a drag.\n this.ends = 0;\n }\n\n /**\n * A scroll came to rest. The last of the jumps on their way has landed, wherever it did: iOS\n * does not stop a scroll at the end of the content, so it can rest past where the list said,\n * and what moves it next (a tap on the status bar) is not a drag.\n */\n rested(): void {\n if (this.ends > 0) this.ends--;\n if (this.jumped && this.ends === 0) this.landed = true;\n }\n\n /**\n * Hand each rendered sticky row's view to native to move, and let go of the rest. `views` are\n * the rendered rows' views in the same order as `rows`. Each is only asked for where there is a\n * drive to make or let go.\n */\n drive(rows: () => readonly Row[], views: () => readonly HostNode[]): void {\n if (!this.pinning() && this.drives.size === 0) return;\n const rendered = views();\n const axis = this.list.horizontal() ? 'x' : 'y';\n const live = new Set<HostNode>();\n // After the list scrolled itself, where native is: it draws a graph when its offset changes,\n // and after a jump the offset of a drive just made may not. What native last reported, or\n // before it has, the target of a jump that is not animated. An animated one only once it has\n // landed: on the way native's offset changes every frame, so it draws a new graph anyway, and\n // the offset here trails native's and would set every pinned row back a frame. The same holds\n // mid-fling, which is why nothing is told outside a jump.\n const from = !this.jumped\n ? undefined\n : this.jumpAnimated\n ? this.landed\n ? this.reported\n : undefined\n : (this.reported ?? this.jumpedTo);\n rows().forEach((row, at) => {\n const view = rendered[at];\n const next = this.driveOf(row);\n if (!view || !next) return;\n live.add(view);\n const statics = JSON.stringify(next.statics);\n const held = this.drives.get(view);\n if (held?.statics === statics) return held.drive.update(next.range, from);\n held?.drive.stop();\n const drive = this.engine.driveByScroll(\n view,\n this.node,\n axis,\n next.range,\n next.statics,\n from,\n );\n if (drive) this.drives.set(view, { drive, statics });\n });\n for (const [view, held] of this.drives) {\n if (live.has(view)) continue;\n held.drive.stop();\n this.drives.delete(view);\n }\n if (this.landed) this.jumped = this.landed = false;\n }\n\n destroy(): void {\n clearTimeout(this.settleTimer);\n for (const held of this.drives.values()) held.drive.stop();\n }\n\n /** Where a sticky row stops, pushed off by the next: that row's top, less this row's size. */\n private stopOf(index: number): number {\n const next = this.next().get(index);\n return next === undefined ? Infinity : this.list.topOf(next) - this.list.heightOf(index);\n }\n\n /**\n * How native moves a rendered row, or null when it does not: along the scroll view's own\n * offset, which counts the header, from the row's top until the next sticky row pushes it off.\n */\n private driveOf(row: Row): { range: ScrollRange; statics: readonly StaticTransform[] } | null {\n if (!this.native || row.parked || !this.next().has(row.index)) return null;\n const header = this.list.headerHeight();\n const start = header + this.list.topOf(row.index);\n return {\n range: pinnedRange(start, header + this.stopOf(row.index)),\n statics: this.list.flip() ?? [],\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sticky-rows.js","sourceRoot":"","sources":["../src/sticky-rows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAe,MAAM,eAAe,CAAC;AAC9D,OAAO,EAML,WAAW,GACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AA2CvD,MAAM,IAAI,GAAsB,EAAE,CAAC;AAEnC,iDAAiD;AACjD,MAAM,KAAK,GAAgB,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,KAAK,GAAG,GAAG,CAAC;AAElB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,UAAU;IACrB,8DAA8D;IACrD,MAAM,CAAU;IACzB;;;OAGG;IACc,KAAK,GAAG,MAAM,CAAC,CAAC;8EAAC,CA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AC,EAAE,IAAI,CAAC;QAC1C,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,QAAQ,CAAC;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;OAMG;IACK,OAAO,CAAC,GAAQ;QACtB,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAC3E,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;QACxC,MAAM,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC/C,MAAM,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC7C,OAAO;YACL,KAAK,EACH,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;YACzF,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE;SAChC,CAAC;IACJ,CAAC;CACF","sourcesContent":["import { computed, signal, type Signal } from '@angular/core';\nimport {\n type HostEngine,\n type HostNode,\n type ScrollDrive,\n type ScrollRange,\n type StaticTransform,\n pinnedRange,\n} from '@ng-native/fabric';\nimport { STICKY_SETTLE_MS } from './sticky-headers.ts';\nimport type { VirtualListSticky } from './virtual-list-sticky.ts';\n\n/** What `StickyRows` needs of the list whose rows it pins. */\nexport interface StickyRowsList {\n /** The sticky rows' indices, as `stickyIndices` gives them. */\n readonly indices: Signal<readonly number[]>;\n /** The rows' levels, when a directive on the list gives them, read from the items. */\n readonly levels: VirtualListSticky | null;\n readonly items: Signal<readonly unknown[]>;\n /** Whether the list header is pinned too, as `stickyHeader` says. */\n readonly header: Signal<boolean>;\n readonly headerHeight: Signal<number>;\n horizontal(): boolean;\n /** Rows size themselves and are laid out in flow. */\n measuring(): boolean;\n topOf(index: number): number;\n heightOf(index: number): number;\n /** An absolutely positioned row's style, at its own place. */\n slotStyle(index: number): Record<string, unknown>;\n /** What places a row in flow. */\n flowSpacing(): Record<string, unknown>;\n /** The list's flip, as transforms and as CSS text, when it is inverted. */\n flip(): readonly StaticTransform[] | undefined;\n flipText(): string | undefined;\n}\n\n/** A row as the list renders it, for what `StickyRows` reads of it. */\ninterface Row {\n readonly index: number;\n readonly parked?: boolean;\n}\n\n/** A sticky row: how deep it is, the rows it pins under, and the row that pushes it off. */\ninterface StickyRow {\n /** 0 for the outermost. The rows of `stickyIndices` are all at 0. */\n readonly level: number;\n /** The nearest row before it of each level further out, outermost first. */\n readonly above: readonly number[];\n /** The next row at its level or further out, if there is one. */\n next: number | undefined;\n}\n\nconst NONE: readonly number[] = [];\n\n/** A range native moves a view nowhere along. */\nconst STILL: ScrollRange = { input: [0, 1], output: [0, 0] };\n\n/**\n * The zIndex of a level 0 row where rows have levels, each level further in one under it. Fixed,\n * not counted from the levels the list holds: a deeper level arriving would otherwise commit new\n * props on every sticky row, and a view native is moving goes back to its place for a frame.\n * Levels this deep and deeper share a zIndex of 1.\n */\nconst FRONT = 100;\n\n/**\n * `<virtual-list>`'s sticky rows: which hold the leading edge, the style that pins each, the\n * header's pinned style, and, where the host moves views by the scroll on the native side, what\n * native is moving. The list's own share of `stickyIndices` and `stickyHeader`, as `StickyHeaders`\n * is `<scroll-view>`'s.\n *\n * Rows pin at levels, when `virtualListStickyLevel` gives them: a row holds the edge under the\n * rows of the levels further out than its own, and the next row at its level or further out pushes\n * it off. Without levels every sticky row is at level 0, each pushed off by the next.\n *\n * Pinning is not native: RN's `ScrollView.js` translates a sticky child against the scroll offset\n * in JavaScript, and a row here follows the offset the same way while it is the current one, by\n * its `top` when absolutely positioned and by a transform when in flow. Where native can move a\n * view by the scroll, each sticky row, and a pinned header, instead stays at its own place in the\n * list and native translates it on every frame the list scrolls, as RN's `ScrollViewStickyHeader`\n * does; a translate committed from each scroll event lands a frame or more late, and on a fast\n * fling the row shudders and comes away from the edge.\n */\nexport class StickyRows {\n /** Whether native moves sticky rows and the pinned header. */\n readonly native: boolean;\n /**\n * Where the scroll view is along its axis, header and all: 0 until native says otherwise, since\n * Android sends no scroll event until the list moves.\n */\n private readonly along = signal(0);\n /** The leading edge of the viewport in content space, past the header at its current size. */\n readonly offset = computed(() => this.along() - this.list.headerHeight());\n\n private readonly engine: HostEngine;\n private readonly node: HostNode;\n private readonly list: StickyRowsList;\n /**\n * Where the scroll view is once scrolling pauses, header and all, which the settled translate of\n * a native-moved row is from.\n */\n private readonly settled = signal(0);\n private settleTimer: ReturnType<typeof setTimeout> | undefined;\n /**\n * What native is moving, by row view: the axis with the transform kept beside the translate,\n * and the range it moves the row by.\n */\n private readonly drives = new Map<\n HostNode,\n // `drawn`: native has been told where the scroll view is since the range last changed. A range\n // changed mid-scroll is told once the scroll pauses: one changed just before then has no\n // scroll event on its way to draw it.\n { drive: ScrollDrive; statics: string; range: string; drawn: boolean }\n >();\n /**\n * What native moves the header by, once it has been pinned. Kept, moving it nowhere, when it no\n * longer is: native goes on drawing a translate it set after its drive is gone.\n */\n private headerDrive: {\n drive: ScrollDrive;\n statics: string;\n pinned: boolean;\n range: string;\n } | null = null;\n /** The list scrolled itself, and native has not drawn its sticky rows there yet. */\n private jumped = false;\n /** Native has reported reaching the target, so this pass's drives are the last to need telling. */\n private landed = false;\n /** Where the list scrolled itself to, in the scroll view, which native reports with its event. */\n private jumpedTo = 0;\n /** Whether that scroll is animated, so native is still at its start until it reports. */\n private jumpAnimated = false;\n /** Where native's latest event since the jump said the scroll view was, header and all. */\n private reported: number | undefined;\n /** Where native's latest event of all said it was, header and all. */\n private nativeAt = 0;\n /** The axis the list scrolled along when native said so, until then none. */\n private nativeAxis: 'x' | 'y' | undefined;\n /** No scroll event has come for `STICKY_SETTLE_MS`, so none is on its way to draw a new graph. */\n private resting = true;\n /**\n * Scroll end events still to come, one for each jump that moved native, as iOS sends one. Kept\n * across jumps: one that landed has its end still to come, and must not be taken for the next's.\n */\n private ends = 0;\n /** The recycling type of a sticky row of each `itemType`: apart from plain rows of it. */\n private readonly typeOfKind = new Map<unknown, symbol>();\n private readonly types = new Set<unknown>();\n\n constructor(engine: HostEngine, node: HostNode, list: StickyRowsList) {\n this.engine = engine;\n this.node = node;\n this.list = list;\n this.native = engine.drivesScroll;\n }\n\n /** Whether the scroll offset is needed as a signal, which only pinning needs. */\n private readonly pinning = computed(() => this.list.header() || this.rows().size > 0);\n\n /**\n * Each sticky row's level, in list order: the rows of `stickyIndices` at level 0, and with a\n * level function every row it gives one. A sticky index given for rows not there yet pins\n * nothing and pushes nothing off until its row arrives.\n */\n private readonly levels = computed<readonly (readonly [index: number, level: number])[]>(() => {\n const indices = this.list.indices();\n const levelOf = this.list.levels?.levelOf();\n const items = this.list.items();\n const levels: [number, number][] = [];\n if (!levelOf) {\n for (const index of indices) if (index < items.length) levels.push([index, 0]);\n return levels;\n }\n const outermost = new Set(indices);\n items.forEach((item, index) => {\n const level = outermost.has(index) ? 0 : levelOf(item, index);\n if (level !== null) levels.push([index, level]);\n });\n return levels;\n });\n\n /** Each sticky row, with the rows it pins under and the one that pushes it off. */\n readonly rows = computed(() => {\n const rows = new Map<number, StickyRow>();\n // The rows a row here would pin under: each deeper than the one before it.\n const open: number[] = [];\n for (const [index, level] of this.levels()) {\n while (open.length > 0 && rows.get(open.at(-1)!)!.level >= level) {\n rows.get(open.pop()!)!.next = index;\n }\n rows.set(index, { level, above: [...open], next: undefined });\n open.push(index);\n }\n return rows;\n });\n\n /**\n * For each sticky row in list order, the least offset that reaches it or a row after it. Where a\n * row starts to hold never comes before where the row before it does, unless a negative `rowGap`\n * overlaps the rows, and this stays in order either way, so `pinned` can halve over it.\n */\n private readonly reach = computed(() => {\n const order = this.levels();\n const reach = new Array<number>(order.length);\n let least = Infinity;\n for (let at = order.length - 1; at >= 0; at--) {\n least = Math.min(least, this.startOf(order[at]![0]));\n reach[at] = least;\n }\n return reach;\n });\n\n /**\n * The sticky rows currently holding the leading edge, outermost first: the last one the offset\n * has reached, under the rows it pins under. Empty when the list has scrolled back above the\n * first of them.\n */\n readonly pinned = computed<readonly number[]>(\n () => {\n const order = this.levels();\n if (order.length === 0) return NONE;\n const offset = this.offset();\n\n // The last row the offset has reached is the last whose `reach` it has, found by halving.\n const reach = this.reach();\n let low = 0;\n let high = order.length;\n while (low < high) {\n const middle = (low + high) >> 1;\n if (reach[middle]! <= offset) low = middle + 1;\n else high = middle;\n }\n if (low === 0) return NONE;\n const pinned = order[low - 1]![0];\n return [...this.rows().get(pinned)!.above, pinned];\n },\n // The same rows are the same pinning: where native moves them, a scroll then re-renders none.\n { equal: (a, b) => a.length === b.length && a.every((index, at) => index === b[at]) },\n );\n\n /**\n * The header's translation while it is pinned: the scroll position, held back at zero by an\n * overscroll and at the first sticky row, which pushes it off. Where native moves it, the\n * translate native had reached when scrolling paused, as for a sticky row.\n */\n readonly headerStyle = computed(() => {\n const flip = this.list.flipText();\n if (!this.list.header()) return flip ? { transform: flip } : undefined;\n const along = this.native ? this.settled() : this.along();\n const shift = Math.min(Math.max(0, along), this.headerLimit());\n const move =\n shift > 0 ? `${this.list.horizontal() ? 'translateX' : 'translateY'}(${shift}px)` : '';\n const transform = [move, flip ?? ''].filter(Boolean).join(' ');\n return transform ? { zIndex: 1, transform } : { zIndex: 1 };\n });\n\n /**\n * A pinned row in flow, moved by a transform from `at`, where flow put it, to where it holds:\n * under the rows it pins under, until the next row at its level or further out pushes it off.\n */\n flowStyle(index: number, at: number): Record<string, unknown> {\n const holds = Math.min(this.offset(), this.stopOf(index)) + this.above(index);\n const shift = Math.max(0, holds - at);\n const move = `${this.list.horizontal() ? 'translateX' : 'translateY'}(${shift}px)`;\n const flip = this.list.flipText();\n return {\n ...this.list.flowSpacing(),\n zIndex: this.zIndexOf(index),\n transform: flip ? `${move} ${flip}` : move,\n };\n }\n\n /**\n * A pinned row placed by its `top`: under the rows it pins under, until the next row at its\n * level or further out reaches it there and pushes it off.\n */\n slotStyle(index: number): Record<string, unknown> {\n const at = Math.min(this.offset(), this.stopOf(index)) + this.above(index);\n return {\n ...this.list.slotStyle(index),\n [this.list.horizontal() ? 'left' : 'top']: at,\n zIndex: this.zIndexOf(index),\n };\n }\n\n /**\n * A sticky row native moves: at its own place, with the translate native had reached when\n * scrolling paused, so the props agree with what is on screen.\n */\n style(index: number): Record<string, unknown> {\n const horizontal = this.list.horizontal();\n const style: Record<string, unknown> = this.list.measuring()\n ? { ...this.list.flowSpacing() }\n : { ...this.list.slotStyle(index) };\n style['zIndex'] = this.zIndexOf(index);\n const start = this.startOf(index);\n const settled = this.settled() - this.list.headerHeight();\n const shift = Math.min(Math.max(0, settled - start), this.stopOf(index) - start);\n const move = shift > 0 ? `${horizontal ? 'translateX' : 'translateY'}(${shift}px)` : '';\n const transform = [move, this.list.flipText() ?? ''].filter(Boolean).join(' ');\n if (transform) style['transform'] = transform;\n return style;\n }\n\n /**\n * The recycling type of a row: a sticky row is a type of its own, since native keeps the\n * translate it moved one by, and a plain row taking its slot commits no transform to put it\n * back. Apart from that, `kind`, the row's `itemType`.\n */\n recyclingType(index: number, kind: unknown): unknown {\n if (!this.rows().has(index)) return kind;\n let type = this.typeOfKind.get(kind);\n if (!type) {\n type = Symbol('sticky');\n this.typeOfKind.set(kind, type);\n this.types.add(type);\n }\n return type;\n }\n\n /** Whether a recycling type is a sticky row's. */\n isType(type: unknown): boolean {\n return this.types.has(type);\n }\n\n /** The list scrolled, to `along` in the scroll view. */\n scrolled(along: number): void {\n this.nativeAt = along;\n this.nativeAxis = this.list.horizontal() ? 'x' : 'y';\n if (this.jumped) {\n this.reported = along;\n // An event from before the jump, or on the way, is not where it lands.\n if (Math.abs(along - this.jumpedTo) <= 1) this.landed = true;\n }\n // A pinned row follows the scroll continuously, so the offset is a signal. Nothing reads it\n // until a row or the header is pinned, so without them this stays out of change detection,\n // and a fling that moves no row in or out of the window costs none. It is kept all the same:\n // a row that turns sticky in a scrolled list is pinned where the list is, not where it was.\n this.along.set(along);\n if (!this.native) return;\n clearTimeout(this.settleTimer);\n this.resting = false;\n const settle = () => {\n this.resting = true;\n this.settled.set(along);\n };\n if (!this.pinning()) return settle();\n // See `STICKY_SETTLE_MS`.\n this.settleTimer = setTimeout(settle, STICKY_SETTLE_MS);\n }\n\n /** The list is scrolling itself, to `to` in the scroll view, where native has not drawn yet. */\n jumping(to: number, animated: boolean): void {\n // To where native last said it was, with no earlier jump on its way: it moves nothing and\n // reports nothing. With one, native moves and comes back, and reports that.\n const pending = this.jumped && !this.landed;\n if (Math.abs(to - (pending ? this.jumpedTo : this.nativeAt)) > 1) this.ends++;\n this.jumped = pending || Math.abs(to - this.nativeAt) > 1;\n this.landed = false;\n this.jumpedTo = to;\n this.jumpAnimated = animated;\n this.reported = undefined;\n }\n\n /** The user took the scroll over: native's own events move the rows from here. */\n dragged(): void {\n this.jumped = this.landed = false;\n // Android sends no end for a jump that is not animated, so none is waited for past a drag.\n this.ends = 0;\n }\n\n /**\n * A scroll came to rest. The last of the jumps on their way has landed, wherever it did: iOS\n * does not stop a scroll at the end of the content, so it can rest past where the list said,\n * and what moves it next (a tap on the status bar) is not a drag.\n */\n rested(): void {\n if (this.ends > 0) this.ends--;\n if (this.jumped && this.ends === 0) this.landed = true;\n }\n\n /**\n * Hand each rendered sticky row's view to native to move, and let go of the rest, and the\n * header's view, `header`, while it is pinned. `views` are the rendered rows' views in the same\n * order as `rows`. Each is only asked for where there is a drive to make or let go.\n */\n drive(\n rows: () => readonly Row[],\n views: () => readonly HostNode[],\n header: () => HostNode,\n ): void {\n if (!this.pinning() && this.drives.size === 0 && !this.headerDrive) return;\n const rendered = views();\n const axis = this.list.horizontal() ? 'x' : 'y';\n const live = new Set<HostNode>();\n // After the list scrolled itself, where native is: it draws a graph when its offset changes,\n // and after a jump the offset of a drive just made may not. What native last reported, or\n // before it has, the target of a jump that is not animated. An animated one only once it has\n // landed: on the way native's offset changes every frame, so it draws a new graph anyway, and\n // the offset here trails native's and would set every pinned row back a frame. The same holds\n // mid-fling, which is why nothing is told outside a jump.\n const from = !this.jumped\n ? undefined\n : this.jumpAnimated\n ? this.landed\n ? this.reported\n : undefined\n : (this.reported ?? this.jumpedTo);\n rows().forEach((row, at) => {\n const view = rendered[at];\n const next = this.driveOf(row);\n if (!view || !next) return;\n live.add(view);\n // The axis too: a list turned horizontal moves its sticky rows along x.\n const statics = axis + JSON.stringify(next.statics);\n const range = JSON.stringify(next.range);\n const held = this.drives.get(view);\n if (held?.statics === statics) {\n const drawn = held.range === range && held.drawn;\n const at = drawn ? from : this.drawnFrom(axis, from);\n held.range = range;\n held.drawn = drawn || at !== undefined;\n return held.drive.update(next.range, at);\n }\n held?.drive.stop();\n const told = this.drawnFrom(axis, from);\n const drive = this.engine.driveByScroll(\n view,\n this.node,\n axis,\n next.range,\n next.statics,\n told,\n );\n if (drive) this.drives.set(view, { drive, statics, range, drawn: told !== undefined });\n });\n for (const [view, held] of this.drives) {\n if (live.has(view)) continue;\n held.drive.stop();\n this.drives.delete(view);\n }\n this.driveHeader(header, axis, from);\n if (this.landed) this.jumped = this.landed = false;\n }\n\n /**\n * Hand the header to native to move while it is pinned, by the scroll view's offset until the\n * first sticky row pushes it off. Unpinned, it is moved nowhere.\n */\n private driveHeader(view: () => HostNode, axis: 'x' | 'y', from: number | undefined): void {\n const pinned = this.list.header();\n if (!pinned && !this.headerDrive) return;\n const range = pinned ? this.headerRange() : STILL;\n const held = this.headerDrive;\n const moved = JSON.stringify(range);\n const at = this.headerFrom(pinned, moved, axis, from);\n const statics = this.list.flip() ?? [];\n // The axis too: a list turned horizontal moves the header along x.\n const key = axis + JSON.stringify(statics);\n if (held?.statics === key) {\n held.pinned = pinned;\n held.range = moved;\n return held.drive.update(range, at);\n }\n held?.drive.stop();\n const drive = this.engine.driveByScroll(\n view(),\n this.node,\n axis,\n range,\n statics,\n held ? (at ?? this.drawnFrom(axis, from)) : at,\n );\n this.headerDrive = drive && { drive, statics: key, pinned, range: moved };\n }\n\n /**\n * Where native is told the scroll view is for the header's drive, `pinned` and moved by the range\n * `moved`. Pinned, let go, or moved by a new range at rest, native has no new scroll event to draw\n * it from: it is told where it last said it was. Mid-scroll the next event draws it, and what\n * native last said trails it, and what it said along the other axis says nothing of `axis`. After a\n * jump, `from`, where the list scrolled itself.\n */\n private headerFrom(\n pinned: boolean,\n moved: string,\n axis: 'x' | 'y',\n from: number | undefined,\n ): number | undefined {\n const held = this.headerDrive;\n const changed = held?.pinned !== pinned || (this.resting && held.range !== moved);\n if (!changed) return from;\n return from ?? (this.nativeAxis === axis ? this.nativeAt : undefined);\n }\n\n /**\n * Where native is told the scroll view is for a drive made, or moved by a new range, along\n * `axis`. Native draws a graph when the offset changes, and at rest no scroll event comes to draw\n * it: it is told where native last said it was, unless that was along the other axis. Mid-scroll\n * the next event draws it. After a jump, `from`.\n */\n private drawnFrom(axis: 'x' | 'y', from: number | undefined): number | undefined {\n return from ?? (this.resting && this.nativeAxis === axis ? this.nativeAt : undefined);\n }\n\n /** How native moves the pinned header. A first sticky row at the very top holds it in place. */\n private headerRange(): ScrollRange {\n const limit = this.headerLimit();\n return limit > 0 ? pinnedRange(0, limit) : STILL;\n }\n\n /** How far the header moves before the first sticky row pushes it off: to that row's top. */\n private headerLimit(): number {\n const [first] = this.rows().keys();\n return first === undefined ? Infinity : this.list.topOf(first);\n }\n\n destroy(): void {\n clearTimeout(this.settleTimer);\n for (const held of this.drives.values()) held.drive.stop();\n this.headerDrive?.drive.stop();\n }\n\n /** The size of the rows a sticky row pins under, which is how far from the edge it holds. */\n private above(index: number): number {\n let size = 0;\n for (const over of this.rows().get(index)?.above ?? NONE) size += this.list.heightOf(over);\n return size;\n }\n\n /**\n * A deeper row is drawn under the rows it pins under, and every sticky row over the rest. See\n * `FRONT`. Without levels a sticky row's zIndex is 1, as it was before there were any.\n */\n private zIndexOf(index: number): number {\n if (!this.list.levels?.levelOf()) return 1;\n return Math.max(1, FRONT - (this.rows().get(index)?.level ?? 0));\n }\n\n /** The offset a sticky row starts to hold from: where its top meets the rows it pins under. */\n private startOf(index: number): number {\n return this.list.topOf(index) - this.above(index);\n }\n\n /**\n * The offset a sticky row stops holding at, pushed off by the next: where that row's top meets\n * this row's far edge.\n */\n private stopOf(index: number): number {\n const next = this.rows().get(index)?.next;\n if (next === undefined) return Infinity;\n return this.list.topOf(next) - this.list.heightOf(index) - this.above(index);\n }\n\n /**\n * How native moves a rendered row, or null when it does not: along the scroll view's own\n * offset, which counts the header, from where the row meets the rows it pins under until the\n * next sticky row pushes it off. A row the next one follows with no space between them holds\n * nowhere, so native moves it nowhere: it is not let go, since native keeps the translate it\n * had moved a row by.\n */\n private driveOf(row: Row): { range: ScrollRange; statics: readonly StaticTransform[] } | null {\n if (!this.native || row.parked || !this.rows().has(row.index)) return null;\n const header = this.list.headerHeight();\n const start = header + this.startOf(row.index);\n const stop = header + this.stopOf(row.index);\n return {\n range:\n stop > start ? pinnedRange(start, stop) : { input: [start, start + 1], output: [0, 0] },\n statics: this.list.flip() ?? [],\n };\n }\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ButtonIcon } from './native-button.ts';
|
|
2
|
+
/**
|
|
3
|
+
* The markup to commit as `svgIcon` for an icon, or undefined when it is not `{ svg }`. Says once,
|
|
4
|
+
* in development, when the markup is no `<svg>` element (the icon's name in place of its markup is
|
|
5
|
+
* the usual slip), and with `offDesktop` when the platform running draws a symbol or a drawable for
|
|
6
|
+
* the element but no SVG, since either shows no icon. `drawnOn` names the OSes that draw it.
|
|
7
|
+
*/
|
|
8
|
+
export declare function svgIconMarkup(icon: {
|
|
9
|
+
readonly svg?: string;
|
|
10
|
+
} | object | undefined, element: string, offDesktop?: boolean, drawnOn?: string): string | undefined;
|
|
11
|
+
/** A picture as a menu item or a tray icon sends it: each form under the key the host reads. */
|
|
12
|
+
export interface IconFields {
|
|
13
|
+
readonly sfSymbol?: string;
|
|
14
|
+
/** A drawable resource's name, which Android draws. */
|
|
15
|
+
readonly icon?: string;
|
|
16
|
+
readonly svgIcon?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The fields for an element's `sfSymbol` and `icon` inputs, where `icon` is a `ButtonIcon` or, as it
|
|
20
|
+
* was before it took one, a drawable's name. The `sfSymbol` input wins over an `icon` of
|
|
21
|
+
* `{ sfSymbol }`, as on `<native-button>`. Says what `svgIconMarkup` says.
|
|
22
|
+
*/
|
|
23
|
+
export declare function iconFields(sfSymbol: string | undefined, icon: string | ButtonIcon | undefined, element: string, offDesktop?: boolean): IconFields;
|
package/dist/svg-icon.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `{ svg }` form of a `ButtonIcon`: an icon's SVG markup, such as an `@ng-icons` set's, which
|
|
3
|
+
* the macOS and Linux hosts draw as their own icon (a template image AppKit tints, and a symbolic
|
|
4
|
+
* icon GTK draws in the text colour). They take it as the `svgIcon` prop.
|
|
5
|
+
*/
|
|
6
|
+
import { nativePlatform } from '@ng-native/fabric';
|
|
7
|
+
/** What was already said, so a list of rows says it once. */
|
|
8
|
+
const warned = new Set();
|
|
9
|
+
function warnOnce(key, message) {
|
|
10
|
+
if ((typeof ngDevMode !== 'undefined' && !ngDevMode) || warned.has(key))
|
|
11
|
+
return;
|
|
12
|
+
warned.add(key);
|
|
13
|
+
console.warn(`[angular-native] ${message}`);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The markup to commit as `svgIcon` for an icon, or undefined when it is not `{ svg }`. Says once,
|
|
17
|
+
* in development, when the markup is no `<svg>` element (the icon's name in place of its markup is
|
|
18
|
+
* the usual slip), and with `offDesktop` when the platform running draws a symbol or a drawable for
|
|
19
|
+
* the element but no SVG, since either shows no icon. `drawnOn` names the OSes that draw it.
|
|
20
|
+
*/
|
|
21
|
+
export function svgIconMarkup(icon, element, offDesktop = false, drawnOn = 'macOS and Linux') {
|
|
22
|
+
if (!icon || !('svg' in icon) || typeof icon.svg !== 'string')
|
|
23
|
+
return undefined;
|
|
24
|
+
const markup = icon.svg;
|
|
25
|
+
if (!/<svg[\s/>]/i.test(markup)) {
|
|
26
|
+
warnOnce(`markup:${markup}`, `<${element}> was given an SVG icon that is no <svg> element, so it shows none: ` +
|
|
27
|
+
`"${markup.slice(0, 40)}". Pass the icon's markup, such as the string ` +
|
|
28
|
+
`@ng-icons/lucide exports, not its name.`);
|
|
29
|
+
}
|
|
30
|
+
const os = nativePlatform();
|
|
31
|
+
if (offDesktop && os !== 'macos' && os !== 'linux') {
|
|
32
|
+
warnOnce(`platform:${element}:${os}`, `<${element}> draws an SVG icon on ${drawnOn} only, so on ${os} it shows none. ` +
|
|
33
|
+
`Give it { sfSymbol } or { drawable } there.`);
|
|
34
|
+
}
|
|
35
|
+
return markup;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The fields for an element's `sfSymbol` and `icon` inputs, where `icon` is a `ButtonIcon` or, as it
|
|
39
|
+
* was before it took one, a drawable's name. The `sfSymbol` input wins over an `icon` of
|
|
40
|
+
* `{ sfSymbol }`, as on `<native-button>`. Says what `svgIconMarkup` says.
|
|
41
|
+
*/
|
|
42
|
+
export function iconFields(sfSymbol, icon, element, offDesktop = false) {
|
|
43
|
+
const given = typeof icon === 'string' ? { drawable: icon } : icon;
|
|
44
|
+
const symbol = sfSymbol || (given && 'sfSymbol' in given ? given.sfSymbol : undefined);
|
|
45
|
+
const drawable = given && 'drawable' in given ? given.drawable : undefined;
|
|
46
|
+
const svgIcon = svgIconMarkup(given, element, offDesktop);
|
|
47
|
+
return {
|
|
48
|
+
...(symbol && { sfSymbol: symbol }),
|
|
49
|
+
...(drawable && { icon: drawable }),
|
|
50
|
+
...(svgIcon && { svgIcon }),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=svg-icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg-icon.js","sourceRoot":"","sources":["../src/svg-icon.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKnD,6DAA6D;AAC7D,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;AAEjC,SAAS,QAAQ,CAAC,GAAW,EAAE,OAAe;IAC5C,IAAI,CAAC,OAAO,SAAS,KAAK,WAAW,IAAI,CAAC,SAAS,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,OAAO;IAChF,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAChB,OAAO,CAAC,IAAI,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,IAAoD,EACpD,OAAe,EACf,UAAU,GAAG,KAAK,EAClB,OAAO,GAAG,iBAAiB;IAE3B,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAChF,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC;IACxB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAChC,QAAQ,CACN,UAAU,MAAM,EAAE,EAClB,IAAI,OAAO,sEAAsE;YAC/E,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,C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* the macOS and Linux hosts draw as their own icon (a template image AppKit tints, and a symbolic\n * icon GTK draws in the text colour). They take it as the `svgIcon` prop.\n */\nimport { nativePlatform } from '@ng-native/fabric';\nimport type { ButtonIcon } from './native-button.ts';\n\ndeclare const ngDevMode: unknown;\n\n/** What was already said, so a list of rows says it once. */\nconst warned = new Set<string>();\n\nfunction warnOnce(key: string, message: string): void {\n if ((typeof ngDevMode !== 'undefined' && !ngDevMode) || warned.has(key)) return;\n warned.add(key);\n console.warn(`[angular-native] ${message}`);\n}\n\n/**\n * The markup to commit as `svgIcon` for an icon, or undefined when it is not `{ svg }`. Says once,\n * in development, when the markup is no `<svg>` element (the icon's name in place of its markup is\n * the usual slip), and with `offDesktop` when the platform running draws a symbol or a drawable for\n * the element but no SVG, since either shows no icon. `drawnOn` names the OSes that draw it.\n */\nexport function svgIconMarkup(\n icon: { readonly svg?: string } | object | undefined,\n element: string,\n offDesktop = false,\n drawnOn = 'macOS and Linux',\n): string | undefined {\n if (!icon || !('svg' in icon) || typeof icon.svg !== 'string') return undefined;\n const markup = icon.svg;\n if (!/<svg[\\s/>]/i.test(markup)) {\n warnOnce(\n `markup:${markup}`,\n `<${element}> was given an SVG icon that is no <svg> element, so it shows none: ` +\n `\"${markup.slice(0, 40)}\". Pass the icon's markup, such as the string ` +\n `@ng-icons/lucide exports, not its name.`,\n );\n }\n const os = nativePlatform();\n if (offDesktop && os !== 'macos' && os !== 'linux') {\n warnOnce(\n `platform:${element}:${os}`,\n `<${element}> draws an SVG icon on ${drawnOn} only, so on ${os} it shows none. ` +\n `Give it { sfSymbol } or { drawable } there.`,\n );\n }\n return markup;\n}\n\n/** A picture as a menu item or a tray icon sends it: each form under the key the host reads. */\nexport interface IconFields {\n readonly sfSymbol?: string;\n /** A drawable resource's name, which Android draws. */\n readonly icon?: string;\n readonly svgIcon?: string;\n}\n\n/**\n * The fields for an element's `sfSymbol` and `icon` inputs, where `icon` is a `ButtonIcon` or, as it\n * was before it took one, a drawable's name. The `sfSymbol` input wins over an `icon` of\n * `{ sfSymbol }`, as on `<native-button>`. Says what `svgIconMarkup` says.\n */\nexport function iconFields(\n sfSymbol: string | undefined,\n icon: string | ButtonIcon | undefined,\n element: string,\n offDesktop = false,\n): IconFields {\n const given = typeof icon === 'string' ? { drawable: icon } : icon;\n const symbol = sfSymbol || (given && 'sfSymbol' in given ? given.sfSymbol : undefined);\n const drawable = given && 'drawable' in given ? given.drawable : undefined;\n const svgIcon = svgIconMarkup(given, element, offDesktop);\n return {\n ...(symbol && { sfSymbol: symbol }),\n ...(drawable && { icon: drawable }),\n ...(svgIcon && { svgIcon }),\n };\n}\n"]}
|
package/dist/tray-icon.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ButtonIcon } from './native-button.ts';
|
|
1
2
|
import * as i0 from "@angular/core";
|
|
2
3
|
/**
|
|
3
4
|
* An icon in the macOS menu bar's status area, for as long as the element is there. Its
|
|
@@ -8,11 +9,16 @@ export declare class TrayIcon {
|
|
|
8
9
|
readonly title: import("@angular/core").InputSignal<string | undefined>;
|
|
9
10
|
/** An SF Symbol, drawn to follow the menu bar's light or dark appearance. */
|
|
10
11
|
readonly sfSymbol: import("@angular/core").InputSignal<string | undefined>;
|
|
12
|
+
/**
|
|
13
|
+
* The picture as a `ButtonIcon`: `{ sfSymbol }`, or an icon's SVG markup, `{ svg }`, such as an
|
|
14
|
+
* `@ng-icons` icon, drawn as a symbol is. `sfSymbol` wins over it.
|
|
15
|
+
*/
|
|
16
|
+
readonly icon: import("@angular/core").InputSignal<ButtonIcon | undefined>;
|
|
11
17
|
/** An image asset of the app's own. */
|
|
12
18
|
readonly image: import("@angular/core").InputSignal<string | undefined>;
|
|
13
19
|
readonly tooltip: import("@angular/core").InputSignal<string | undefined>;
|
|
14
20
|
readonly press: import("@angular/core").OutputEmitterRef<void>;
|
|
15
21
|
constructor();
|
|
16
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<TrayIcon, never>;
|
|
17
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TrayIcon, "tray-icon", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "sfSymbol": { "alias": "sfSymbol"; "required": false; "isSignal": true; }; "image": { "alias": "image"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; }, { "press": "press"; }, never, ["*"], true, never>;
|
|
23
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TrayIcon, "tray-icon", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "sfSymbol": { "alias": "sfSymbol"; "required": false; "isSignal": true; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "image": { "alias": "image"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; }, { "press": "press"; }, never, ["*"], true, never>;
|
|
18
24
|
}
|
package/dist/tray-icon.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { Component, DestroyRef, computed, inject, input, output } from '@angular/core';
|
|
2
2
|
import { MENU_MODEL, Tray } from '@ng-native/device';
|
|
3
3
|
import { menuModelInTreeOrder } from "./menu.js";
|
|
4
|
+
import { iconFields } from "./svg-icon.js";
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
6
|
+
/** An icon's symbol and SVG markup: a tray draws no drawable. */
|
|
7
|
+
function trayIcon(sfSymbol, icon) {
|
|
8
|
+
const { icon: _drawable, ...fields } = iconFields(sfSymbol, icon, 'tray-icon');
|
|
9
|
+
return fields;
|
|
10
|
+
}
|
|
5
11
|
/**
|
|
6
12
|
* An icon in the macOS menu bar's status area, for as long as the element is there. Its
|
|
7
13
|
* `<menu-item>`s are the menu a click opens; with none, a click fires `(press)`. On iOS and Android
|
|
@@ -13,6 +19,12 @@ export class TrayIcon {
|
|
|
13
19
|
/** An SF Symbol, drawn to follow the menu bar's light or dark appearance. */
|
|
14
20
|
sfSymbol = input(/* @ts-ignore */
|
|
15
21
|
...(ngDevMode ? [undefined, { debugName: "sfSymbol" }] : /* istanbul ignore next */ []));
|
|
22
|
+
/**
|
|
23
|
+
* The picture as a `ButtonIcon`: `{ sfSymbol }`, or an icon's SVG markup, `{ svg }`, such as an
|
|
24
|
+
* `@ng-icons` icon, drawn as a symbol is. `sfSymbol` wins over it.
|
|
25
|
+
*/
|
|
26
|
+
icon = input(/* @ts-ignore */
|
|
27
|
+
...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
16
28
|
/** An image asset of the app's own. */
|
|
17
29
|
image = input(/* @ts-ignore */
|
|
18
30
|
...(ngDevMode ? [undefined, { debugName: "image" }] : /* istanbul ignore next */ []));
|
|
@@ -23,7 +35,7 @@ export class TrayIcon {
|
|
|
23
35
|
const menu = inject(MENU_MODEL, { self: true });
|
|
24
36
|
const stop = inject(Tray).add(computed(() => ({
|
|
25
37
|
...(this.title() && { title: this.title() }),
|
|
26
|
-
...(this.sfSymbol()
|
|
38
|
+
...trayIcon(this.sfSymbol(), this.icon()),
|
|
27
39
|
...(this.image() && { image: this.image() }),
|
|
28
40
|
...(this.tooltip() && { tooltip: this.tooltip() }),
|
|
29
41
|
menu: menu.entries(),
|
|
@@ -32,7 +44,7 @@ export class TrayIcon {
|
|
|
32
44
|
inject(DestroyRef).onDestroy(stop);
|
|
33
45
|
}
|
|
34
46
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: TrayIcon, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
35
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.0", type: TrayIcon, isStandalone: true, selector: "tray-icon", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, sfSymbol: { classPropertyName: "sfSymbol", publicName: "sfSymbol", isSignal: true, isRequired: false, transformFunction: null }, image: { classPropertyName: "image", publicName: "image", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { press: "press" }, host: { properties: { "style.display": "\"none\"" } }, providers: [{ provide: MENU_MODEL, useFactory: menuModelInTreeOrder }], ngImport: i0, template: '<ng-content />', isInline: true });
|
|
47
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.0", type: TrayIcon, isStandalone: true, selector: "tray-icon", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, sfSymbol: { classPropertyName: "sfSymbol", publicName: "sfSymbol", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, image: { classPropertyName: "image", publicName: "image", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { press: "press" }, host: { properties: { "style.display": "\"none\"" } }, providers: [{ provide: MENU_MODEL, useFactory: menuModelInTreeOrder }], ngImport: i0, template: '<ng-content />', isInline: true });
|
|
36
48
|
}
|
|
37
49
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: TrayIcon, decorators: [{
|
|
38
50
|
type: Component,
|
|
@@ -42,5 +54,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
|
|
|
42
54
|
host: { '[style.display]': '"none"' },
|
|
43
55
|
providers: [{ provide: MENU_MODEL, useFactory: menuModelInTreeOrder }],
|
|
44
56
|
}]
|
|
45
|
-
}], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], sfSymbol: [{ type: i0.Input, args: [{ isSignal: true, alias: "sfSymbol", required: false }] }], image: [{ type: i0.Input, args: [{ isSignal: true, alias: "image", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], press: [{ type: i0.Output, args: ["press"] }] } });
|
|
57
|
+
}], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], sfSymbol: [{ type: i0.Input, args: [{ isSignal: true, alias: "sfSymbol", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], image: [{ type: i0.Input, args: [{ isSignal: true, alias: "image", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], press: [{ type: i0.Output, args: ["press"] }] } });
|
|
46
58
|
//# sourceMappingURL=tray-icon.js.map
|
package/dist/tray-icon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tray-icon.js","sourceRoot":"","sources":["../src/tray-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;;
|
|
1
|
+
{"version":3,"file":"tray-icon.js","sourceRoot":"","sources":["../src/tray-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;AAE3C,iEAAiE;AACjE,SAAS,QAAQ,CAAC,QAA4B,EAAE,IAA4B;IAC1E,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,GAAG,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,W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AAO,EAAE,UAAU,EAAE,UAAU,EAAE,oBAAoB,EAAE,CAAC,0BAF5D,gBAAgB;;2FAIf,QAAQ;kBANpB,SAAS;mBAAC;oBACT,QAAQ,EAAE,WAAW;oBACrB,QAAQ,EAAE,gBAAgB;oBAC1B,IAAI,EAAE,EAAE,iBAAiB,EAAE,QAAQ,EAAE;oBACrC,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,oBAAoB,EAAE,CAAC;iBACvE","sourcesContent":["import { Component, DestroyRef, computed, inject, input, output } from '@angular/core';\nimport { MENU_MODEL, Tray } from '@ng-native/device';\nimport { menuModelInTreeOrder } from './menu.ts';\nimport type { ButtonIcon } from './native-button.ts';\nimport { iconFields } from './svg-icon.ts';\n\n/** An icon's symbol and SVG markup: a tray draws no drawable. */\nfunction trayIcon(sfSymbol: string | undefined, icon: ButtonIcon | undefined) {\n const { icon: _drawable, ...fields } = iconFields(sfSymbol, icon, 'tray-icon');\n return fields;\n}\n\n/**\n * An icon in the macOS menu bar's status area, for as long as the element is there. Its\n * `<menu-item>`s are the menu a click opens; with none, a click fires `(press)`. On iOS and Android\n * nothing is drawn.\n */\n@Component({\n selector: 'tray-icon',\n template: '<ng-content />',\n host: { '[style.display]': '\"none\"' },\n providers: [{ provide: MENU_MODEL, useFactory: menuModelInTreeOrder }],\n})\nexport class TrayIcon {\n readonly title = input<string>();\n /** An SF Symbol, drawn to follow the menu bar's light or dark appearance. */\n readonly sfSymbol = input<string>();\n /**\n * The picture as a `ButtonIcon`: `{ sfSymbol }`, or an icon's SVG markup, `{ svg }`, such as an\n * `@ng-icons` icon, drawn as a symbol is. `sfSymbol` wins over it.\n */\n readonly icon = input<ButtonIcon>();\n /** An image asset of the app's own. */\n readonly image = input<string>();\n readonly tooltip = input<string>();\n readonly press = output<void>();\n\n constructor() {\n const menu = inject(MENU_MODEL, { self: true });\n const stop = inject(Tray).add(\n computed(() => ({\n ...(this.title() && { title: this.title() }),\n ...trayIcon(this.sfSymbol(), this.icon()),\n ...(this.image() && { image: this.image() }),\n ...(this.tooltip() && { tooltip: this.tooltip() }),\n menu: menu.entries(),\n press: () => this.press.emit(),\n })),\n );\n inject(DestroyRef).onDestroy(stop);\n }\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type VirtualListSticky } from './virtual-list-sticky.ts';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Sticky rows at more than one level, on `<virtual-list>` itself: a year pinned at the leading
|
|
5
|
+
* edge, its month under it and the day under that, each pushed off by the next of its own level
|
|
6
|
+
* or of one further out.
|
|
7
|
+
*
|
|
8
|
+
* ```html
|
|
9
|
+
* <virtual-list #list [items]="rows" [itemHeight]="44" [virtualListStickyLevel]="levelOf">
|
|
10
|
+
* @for (row of list.window(); track row.slot) {
|
|
11
|
+
* <view [virtualListRow]="row"><text>{{ row.item.label }}</text></view>
|
|
12
|
+
* }
|
|
13
|
+
* </virtual-list>
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* `levelOf` is given each item and its index and returns the row's level: 0 for the outermost,
|
|
17
|
+
* 1 for the rows pinned under those, and so on, or `null` for a row that scrolls with the rest.
|
|
18
|
+
* A row pins under the nearest row before it of each level further out than its own, and stays
|
|
19
|
+
* until the next row of its own level, or of one further out, pushes it off. The rows of
|
|
20
|
+
* `stickyIndices` are at level 0, so the two can be given together.
|
|
21
|
+
*/
|
|
22
|
+
export declare class VirtualListStickyLevel<T = unknown> implements VirtualListSticky {
|
|
23
|
+
/** A row's level, from 0 for the outermost, or `null` for a row that is not sticky. */
|
|
24
|
+
readonly level: import("@angular/core").InputSignal<((item: T, index: number) => number | null | undefined) | null | undefined>;
|
|
25
|
+
/**
|
|
26
|
+
* How many levels pin at once, from the outermost. Rows deeper than that are not sticky. It
|
|
27
|
+
* limits the levels the function gives: the rows of `stickyIndices` pin whatever it is.
|
|
28
|
+
*/
|
|
29
|
+
readonly maxLevels: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
30
|
+
readonly levelOf: import("@angular/core").Signal<((item: unknown, index: number) => number | null) | null>;
|
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VirtualListStickyLevel<any>, never>;
|
|
32
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<VirtualListStickyLevel<any>, "virtual-list[virtualListStickyLevel]", never, { "level": { "alias": "virtualListStickyLevel"; "required": false; "isSignal": true; }; "maxLevels": { "alias": "virtualListMaxStickyLevels"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Directive, computed, forwardRef, input } from '@angular/core';
|
|
2
|
+
import { numberOr } from "./transforms.js";
|
|
3
|
+
import { VIRTUAL_LIST_STICKY } from "./virtual-list-sticky.js";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Sticky rows at more than one level, on `<virtual-list>` itself: a year pinned at the leading
|
|
7
|
+
* edge, its month under it and the day under that, each pushed off by the next of its own level
|
|
8
|
+
* or of one further out.
|
|
9
|
+
*
|
|
10
|
+
* ```html
|
|
11
|
+
* <virtual-list #list [items]="rows" [itemHeight]="44" [virtualListStickyLevel]="levelOf">
|
|
12
|
+
* @for (row of list.window(); track row.slot) {
|
|
13
|
+
* <view [virtualListRow]="row"><text>{{ row.item.label }}</text></view>
|
|
14
|
+
* }
|
|
15
|
+
* </virtual-list>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* `levelOf` is given each item and its index and returns the row's level: 0 for the outermost,
|
|
19
|
+
* 1 for the rows pinned under those, and so on, or `null` for a row that scrolls with the rest.
|
|
20
|
+
* A row pins under the nearest row before it of each level further out than its own, and stays
|
|
21
|
+
* until the next row of its own level, or of one further out, pushes it off. The rows of
|
|
22
|
+
* `stickyIndices` are at level 0, so the two can be given together.
|
|
23
|
+
*/
|
|
24
|
+
export class VirtualListStickyLevel {
|
|
25
|
+
/** A row's level, from 0 for the outermost, or `null` for a row that is not sticky. */
|
|
26
|
+
level = input(undefined, { ...(ngDevMode ? { debugName: "level" } : /* istanbul ignore next */ {}), alias: 'virtualListStickyLevel' });
|
|
27
|
+
/**
|
|
28
|
+
* How many levels pin at once, from the outermost. Rows deeper than that are not sticky. It
|
|
29
|
+
* limits the levels the function gives: the rows of `stickyIndices` pin whatever it is.
|
|
30
|
+
*/
|
|
31
|
+
maxLevels = input(Infinity, { ...(ngDevMode ? { debugName: "maxLevels" } : /* istanbul ignore next */ {}), alias: 'virtualListMaxStickyLevels',
|
|
32
|
+
transform: numberOr(Infinity) });
|
|
33
|
+
levelOf = computed(() => {
|
|
34
|
+
const level = this.level();
|
|
35
|
+
if (!level)
|
|
36
|
+
return null;
|
|
37
|
+
const levels = this.maxLevels();
|
|
38
|
+
return (item, index) => {
|
|
39
|
+
const at = level(item, index);
|
|
40
|
+
return typeof at === 'number' && at >= 0 && at < levels ? Math.floor(at) : null;
|
|
41
|
+
};
|
|
42
|
+
}, /* @ts-ignore */
|
|
43
|
+
...(ngDevMode ? [{ debugName: "levelOf" }] : /* istanbul ignore next */ []));
|
|
44
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: VirtualListStickyLevel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
45
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.0", type: VirtualListStickyLevel, isStandalone: true, selector: "virtual-list[virtualListStickyLevel]", inputs: { level: { classPropertyName: "level", publicName: "virtualListStickyLevel", isSignal: true, isRequired: false, transformFunction: null }, maxLevels: { classPropertyName: "maxLevels", publicName: "virtualListMaxStickyLevels", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
46
|
+
{ provide: VIRTUAL_LIST_STICKY, useExisting: forwardRef(() => VirtualListStickyLevel) },
|
|
47
|
+
], ngImport: i0 });
|
|
48
|
+
}
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: VirtualListStickyLevel, decorators: [{
|
|
50
|
+
type: Directive,
|
|
51
|
+
args: [{
|
|
52
|
+
selector: 'virtual-list[virtualListStickyLevel]',
|
|
53
|
+
providers: [
|
|
54
|
+
{ provide: VIRTUAL_LIST_STICKY, useExisting: forwardRef(() => VirtualListStickyLevel) },
|
|
55
|
+
],
|
|
56
|
+
}]
|
|
57
|
+
}], propDecorators: { level: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualListStickyLevel", required: false }] }], maxLevels: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualListMaxStickyLevels", required: false }] }] } });
|
|
58
|
+
//# sourceMappingURL=virtual-list-sticky-level.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-list-sticky-level.js","sourceRoot":"","sources":["../src/virtual-list-sticky-level.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAA0B,MAAM,0BAA0B,CAAC;;AAEvF;;;;;;;;;;;;;;;;;;GAkBG;AAOH,MAAM,OAAO,sBAAsB;IACjC,uFAAuF;IAC9E,KAAK,GAAG,KAAK,CAEpB,SAAS,6EAAI,KAAK,EAAE,wBAAwB,GAAG,CAAC;IAClD;;;OAGG;IACM,SAAS,GAAG,KAAK,CAAC,QAAQ,iFACjC,KAAK,EAAE,4BAA4B;QACnC,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAC7B,CAAC;IAEM,OAAO,GAAG,QAAQ,CAAC,GAAG,EAAE;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAChC,OAAO,CAAC,IAAa,EAAE,KAAa,EAAE,EAAE;YACtC,MAAM,EAAE,GAAG,KAAK,CAAC,IAAS,EAAE,KAAK,CAAC,CAAC;YACnC,OAAO,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAClF,CAAC,CAAC;IACJ,CAAC;gFAAC,CAAC;uGAtBQ,sBAAsB;2FAAtB,sBAAsB,6XAJtB;YACT,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC,EAAE;SACxF;;2FAEU,sBAAsB;kBANlC,SAAS;mBAAC;oBACT,QAAQ,EAAE,sCAAsC;oBAChD,SAAS,EAAE;wBACT,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,uBAAuB,CAAC,EAAE;qBACxF;iBACF","sourcesContent":["import { Directive, computed, forwardRef, input } from '@angular/core';\nimport { numberOr } from './transforms.ts';\nimport { VIRTUAL_LIST_STICKY, type VirtualListSticky } from './virtual-list-sticky.ts';\n\n/**\n * Sticky rows at more than one level, on `<virtual-list>` itself: a year pinned at the leading\n * edge, its month under it and the day under that, each pushed off by the next of its own level\n * or of one further out.\n *\n * ```html\n * <virtual-list #list [items]=\"rows\" [itemHeight]=\"44\" [virtualListStickyLevel]=\"levelOf\">\n * @for (row of list.window(); track row.slot) {\n * <view [virtualListRow]=\"row\"><text>{{ row.item.label }}</text></view>\n * }\n * </virtual-list>\n * ```\n *\n * `levelOf` is given each item and its index and returns the row's level: 0 for the outermost,\n * 1 for the rows pinned under those, and so on, or `null` for a row that scrolls with the rest.\n * A row pins under the nearest row before it of each level further out than its own, and stays\n * until the next row of its own level, or of one further out, pushes it off. The rows of\n * `stickyIndices` are at level 0, so the two can be given together.\n */\n@Directive({\n selector: 'virtual-list[virtualListStickyLevel]',\n providers: [\n { provide: VIRTUAL_LIST_STICKY, useExisting: forwardRef(() => VirtualListStickyLevel) },\n ],\n})\nexport class VirtualListStickyLevel<T = unknown> implements VirtualListSticky {\n /** A row's level, from 0 for the outermost, or `null` for a row that is not sticky. */\n readonly level = input<\n ((item: T, index: number) => number | null | undefined) | null | undefined\n >(undefined, { alias: 'virtualListStickyLevel' });\n /**\n * How many levels pin at once, from the outermost. Rows deeper than that are not sticky. It\n * limits the levels the function gives: the rows of `stickyIndices` pin whatever it is.\n */\n readonly maxLevels = input(Infinity, {\n alias: 'virtualListMaxStickyLevels',\n transform: numberOr(Infinity),\n });\n\n readonly levelOf = computed(() => {\n const level = this.level();\n if (!level) return null;\n const levels = this.maxLevels();\n return (item: unknown, index: number) => {\n const at = level(item as T, index);\n return typeof at === 'number' && at >= 0 && at < levels ? Math.floor(at) : null;\n };\n });\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which of `<virtual-list>`'s rows pin at more than one level, when a directive on the list says
|
|
3
|
+
* so.
|
|
4
|
+
*
|
|
5
|
+
* `stickyIndices` pins rows one at a time: each pushes the one before it off. A list grouped more
|
|
6
|
+
* than once, days in months in years, pins a row under the rows of the groups it is in, and how
|
|
7
|
+
* deep each row is comes from the items rather than from a list of indices. A directive on the
|
|
8
|
+
* list's own element provides this, as `[virtualListNumColumns]` provides `VIRTUAL_LIST_LAYOUT`,
|
|
9
|
+
* and the list reads it with `{ self: true, optional: true }`.
|
|
10
|
+
*/
|
|
11
|
+
import { InjectionToken, type Signal } from '@angular/core';
|
|
12
|
+
export interface VirtualListSticky {
|
|
13
|
+
/**
|
|
14
|
+
* What gives a row's level, or null when nothing does. A level is a whole number from 0, the
|
|
15
|
+
* outermost; null is a row that scrolls with the rest.
|
|
16
|
+
*/
|
|
17
|
+
readonly levelOf: Signal<((item: unknown, index: number) => number | null) | null>;
|
|
18
|
+
}
|
|
19
|
+
export declare const VIRTUAL_LIST_STICKY: InjectionToken<VirtualListSticky>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which of `<virtual-list>`'s rows pin at more than one level, when a directive on the list says
|
|
3
|
+
* so.
|
|
4
|
+
*
|
|
5
|
+
* `stickyIndices` pins rows one at a time: each pushes the one before it off. A list grouped more
|
|
6
|
+
* than once, days in months in years, pins a row under the rows of the groups it is in, and how
|
|
7
|
+
* deep each row is comes from the items rather than from a list of indices. A directive on the
|
|
8
|
+
* list's own element provides this, as `[virtualListNumColumns]` provides `VIRTUAL_LIST_LAYOUT`,
|
|
9
|
+
* and the list reads it with `{ self: true, optional: true }`.
|
|
10
|
+
*/
|
|
11
|
+
import { InjectionToken } from '@angular/core';
|
|
12
|
+
export const VIRTUAL_LIST_STICKY = new InjectionToken('angular-native.virtualListSticky');
|
|
13
|
+
//# sourceMappingURL=virtual-list-sticky.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-list-sticky.js","sourceRoot":"","sources":["../src/virtual-list-sticky.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,cAAc,EAAe,MAAM,eAAe,CAAC;AAU5D,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,cAAc,CACnD,kCAAkC,CACnC,CAAC","sourcesContent":["/**\n * Which of `<virtual-list>`'s rows pin at more than one level, when a directive on the list says\n * so.\n *\n * `stickyIndices` pins rows one at a time: each pushes the one before it off. A list grouped more\n * than once, days in months in years, pins a row under the rows of the groups it is in, and how\n * deep each row is comes from the items rather than from a list of indices. A directive on the\n * list's own element provides this, as `[virtualListNumColumns]` provides `VIRTUAL_LIST_LAYOUT`,\n * and the list reads it with `{ self: true, optional: true }`.\n */\nimport { InjectionToken, type Signal } from '@angular/core';\n\nexport interface VirtualListSticky {\n /**\n * What gives a row's level, or null when nothing does. A level is a whole number from 0, the\n * outermost; null is a row that scrolls with the rest.\n */\n readonly levelOf: Signal<((item: unknown, index: number) => number | null) | null>;\n}\n\nexport const VIRTUAL_LIST_STICKY = new InjectionToken<VirtualListSticky>(\n 'angular-native.virtualListSticky',\n);\n"]}
|
package/dist/virtual-list.d.ts
CHANGED
|
@@ -125,7 +125,8 @@ interface Gap<T> {
|
|
|
125
125
|
* the first sticky row pushes it off as RN's sticky headers push each other. Neither is native:
|
|
126
126
|
* RN's `ScrollView.js` translates a sticky child against the scroll offset in JavaScript, and a
|
|
127
127
|
* row here follows the offset the same way while it is the current one - by its `top` when
|
|
128
|
-
* absolutely positioned, by a transform when in flow.
|
|
128
|
+
* absolutely positioned, by a transform when in flow. `[virtualListStickyLevel]` on the list pins
|
|
129
|
+
* rows at more than one level, each under the rows of the levels further out.
|
|
129
130
|
*
|
|
130
131
|
* What is on screen stays on screen when a measured row above it turns out taller or shorter than
|
|
131
132
|
* its estimate: the offset is corrected by the difference. `maintainVisibleContentPosition` does
|
|
@@ -241,7 +242,8 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
241
242
|
private readonly measuredGaps;
|
|
242
243
|
protected readonly separator: import("@angular/core").Signal<VirtualListSeparator<T> | undefined>;
|
|
243
244
|
private readonly refreshControl;
|
|
244
|
-
|
|
245
|
+
private readonly inSheet;
|
|
246
|
+
/** See ScrollView: inside Android's swipe layout or a form sheet the list must see a drag first. */
|
|
245
247
|
protected readonly nestedScroll: import("@angular/core").Signal<true | undefined>;
|
|
246
248
|
/** Viewports filled past the overscan, before and after the visible rows in index order. */
|
|
247
249
|
private readonly fill;
|
|
@@ -251,6 +253,7 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
251
253
|
private readonly reach;
|
|
252
254
|
private fillTimer;
|
|
253
255
|
private readonly canvasView;
|
|
256
|
+
private readonly headerView;
|
|
254
257
|
/** The sticky rows and header: see `StickyRows`. */
|
|
255
258
|
private readonly sticky;
|
|
256
259
|
/** Rows size themselves and are laid out in flow, rather than placed at a known offset. */
|
|
@@ -432,14 +435,31 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
432
435
|
height: number;
|
|
433
436
|
width?: undefined;
|
|
434
437
|
}>;
|
|
435
|
-
/**
|
|
438
|
+
/**
|
|
439
|
+
* Where the first row rendered in flow starts: `first`'s place, less each row rendered ahead of
|
|
440
|
+
* it, or where native moves them, the first of those rows' own place. Less than nothing where a
|
|
441
|
+
* negative gap overlaps the rows not rendered, which the spacer cannot be: the first row takes
|
|
442
|
+
* the rest as a margin (`rowsFor`).
|
|
443
|
+
*/
|
|
444
|
+
private flowStart;
|
|
445
|
+
/**
|
|
446
|
+
* The rows rendered ahead of the window: the pinned rows it has left behind, and where native
|
|
447
|
+
* moves rows in flow, the row before each pinned row after the outermost. Flow places a row
|
|
448
|
+
* after the row before it, so with that row rendered too, a pinned row is at its own place
|
|
449
|
+
* with no margin of its own, and its props stay as they are as the window moves past it.
|
|
450
|
+
*/
|
|
451
|
+
private readonly rendersAhead;
|
|
452
|
+
/** The rows from `first` up to `last`, and the rows ahead of them if there are any. */
|
|
436
453
|
private rowsFor;
|
|
454
|
+
/** Start the first row in flow at `start`, below zero, where the spacer cannot reach. */
|
|
455
|
+
private startBefore;
|
|
437
456
|
/**
|
|
438
|
-
* A pinned row native moves stays at its own place, so the rows
|
|
439
|
-
* made up
|
|
440
|
-
*
|
|
457
|
+
* A pinned row native moves stays at its own place, so the rows that are not rendered between
|
|
458
|
+
* it and the next are made up by a margin on the next row that is not pinned, up to the
|
|
459
|
+
* window's first, a negative one where a negative gap overlaps them: new props on a view native
|
|
460
|
+
* is moving put its transform back for a frame.
|
|
441
461
|
*/
|
|
442
|
-
private
|
|
462
|
+
private placeAhead;
|
|
443
463
|
private styleFor;
|
|
444
464
|
/**
|
|
445
465
|
* Hand each rendered sticky row's view to native to move. The rows' views are the canvas's
|
|
@@ -563,6 +583,8 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
563
583
|
};
|
|
564
584
|
timestamp?: number;
|
|
565
585
|
}>): void;
|
|
586
|
+
/** Take the viewport's leading edge, in the rows' own space, as where the list is. */
|
|
587
|
+
private follow;
|
|
566
588
|
/**
|
|
567
589
|
* Points the window reaches past the viewport for the scroll's speed, positive toward the end,
|
|
568
590
|
* in steps of a quarter viewport: written only when it moves a step, so a fling costs a pass
|