{"id":42215143,"url":"https://github.com/abcnews/progress-utils","last_synced_at":"2026-01-27T01:12:02.986Z","repository":{"id":57094082,"uuid":"401587580","full_name":"abcnews/progress-utils","owner":"abcnews","description":"Utility functions for using DOM nodes as waypoints for controling a state object typically used for scrollytelling elements","archived":false,"fork":false,"pushed_at":"2022-11-01T12:41:58.000Z","size":3064,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-05T09:27:26.694Z","etag":null,"topics":["library","scrollytelling"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abcnews.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-31T05:47:37.000Z","updated_at":"2022-09-23T00:55:43.000Z","dependencies_parsed_at":"2023-01-21T04:46:48.394Z","dependency_job_id":null,"html_url":"https://github.com/abcnews/progress-utils","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/abcnews/progress-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abcnews%2Fprogress-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abcnews%2Fprogress-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abcnews%2Fprogress-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abcnews%2Fprogress-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abcnews","download_url":"https://codeload.github.com/abcnews/progress-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abcnews%2Fprogress-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28794961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T01:07:07.743Z","status":"ssl_error","status_checked_at":"2026-01-27T01:07:06.974Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library","scrollytelling"],"created_at":"2026-01-27T01:12:02.390Z","updated_at":"2026-01-27T01:12:02.976Z","avatar_url":"https://github.com/abcnews.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# progress-utils\n\nUse any vertically distributed elements as a source of scrollytelling state.\n\nBy default, it will use `#progressNAME{name}` mount points and determine state from their alternating-case properties, but you can configure the selection and state parsing for other types of DOM node.\n\n## Exports\n\n### `subscribe(name: string, subscriber: Subscriber, options?: Partial\u003cConfig\u003e): () =\u003e void`\n\nRegister a subscriber to scroll progress on a given `name`. The subscriber is called immediately (with a state message) and then again for every progress or state update.\n\nAn unsubscribe function is returned.\n\n### `invalidate()`\n\nManually invalidate the progress data to force a re-measure and update for all subscribers.\n\n### `getReadableStore(name: string, options?: Partial\u003cConfig\u003e)`\n\nGet a [readable store](https://svelte.dev/docs#component-format-script-4-prefix-stores-with-$-to-access-their-values-store-contract) for state and progress updates on a given `name`. This is mostly for convenient integration with Svelte.\n\n### `getReadableStateStore(name: string, options?: Partial\u003cConfig\u003e)`\n\nSame as `getReadableStore` but will only subscribe to state updates.\n\n### `getReadableProgressStore(name: string, options?: Partial\u003cConfig\u003e)`\n\nSame as `getReadableStore` but will only subscribe to progress updates.\n\n## Config\n\nThe subscription functions all take an (optional) config object to modify behaviour. Available options are:\n\n## `indicatorSelector`\n\nA function which returns a CSS selector string for use with `document.querySelectorAll`.\n\n**Default:** `` (name: string) =\u003e `[data-mount][id^=\"progressNAME${name}\"]`  ``\n\n## `indicatorStateParser`\n\nA function which takes a DOM element and returns a state object.\n\n**Default:** See [alternating-case-to-object](https://github.com/abcnews/alternating-case-to-object).\n\n## `indicatorStateHasher`\n\nA function which takes a state object and returns a serialized version.\n\n**Default:** `JSON.stringify`\n\n## `regionTop` \u0026 `regionBottom`\n\nThe lower and upper bounds of the window height that form the region in which elements are evaluated to generate progress and state updates.\n\n**Defaults:** `0` \u0026 `1`\n\n## `regionThreshold`\n\nThe vertical point in the window at which a tracked element is considered to have passed the threshold.\n\n**Default:** `0.5`\n\n## `shouldClampProgress`\n\nShould progress updates be clamped to the defined range (usually `[0,1]`) or can the scale interpolate beyond the defined range.\n\n**Default:** `true`\n\n## shouldOptimiseIndicatorTracking\n\nShould updates to subscribers be paused when no elements effecting the result are on screen?\n\n**Default:** `true`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabcnews%2Fprogress-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabcnews%2Fprogress-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabcnews%2Fprogress-utils/lists"}