@faith-tools/bible-sdk 0.0.0-stage → 0.6.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.
@@ -0,0 +1,61 @@
1
+ import { type BibleProvider, type ProviderOptions } from "./providers";
2
+ export declare const SCRIPTURE_PASSAGE_TAG = "si-passage";
3
+ export declare const BIBLE_PASSAGE_TAG = "bible-sk-passage";
4
+ export declare const BIBLE_TOKENS: Record<string, string>;
5
+ export type ReferenceLayout = "heading" | "citation" | "quote" | "none";
6
+ /**
7
+ * Displays Scripture with its required attribution. Works in the page or inside a shadow root.
8
+ *
9
+ * Attributes choose what shows: `reference`, `verse-numbers="hide"`, `red-letter="off"`,
10
+ * `headings="hide"`, `direction`, and `theme`. CSS properties choose how it looks:
11
+ * `--scripture-font-size`, `--scripture-line-height`, `--scripture-font-family`, `--scripture-max-width`.
12
+ * Parts: `text`, `citation`, `version`, `attribution`, `quote`, `loader`, `error`.
13
+ */
14
+ export declare class ScripturePassage extends HTMLElement {
15
+ static observedAttributes: string[];
16
+ private providerOverride?;
17
+ /** A custom provider for this passage. The provider attribute takes precedence. */
18
+ get bibleProvider(): BibleProvider | undefined;
19
+ set bibleProvider(provider: BibleProvider | undefined);
20
+ private generation;
21
+ /** The loaded passage, kept so a layout change re-renders without a request. */
22
+ private loaded;
23
+ private scheduled;
24
+ private cancelLoad?;
25
+ private cancelTheme?;
26
+ private cancelAnimation?;
27
+ private readonly systemDark;
28
+ private readonly onSystemTheme;
29
+ /** Holds everything the element shows, inside its shadow root. */
30
+ private readonly root;
31
+ constructor();
32
+ connectedCallback(): void;
33
+ disconnectedCallback(): void;
34
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
35
+ private scheduleLoad;
36
+ private applyTheme;
37
+ /** "heading" (default), "citation", "quote", or "none". */
38
+ get referenceLayout(): ReferenceLayout;
39
+ /** Swaps the reference layout in place. Only the label moves, so there is no loader or grow. */
40
+ private relayout;
41
+ /** Builds the passage, its reference and version in the chosen layout, and its attribution. */
42
+ private compose;
43
+ private showLoading;
44
+ private showError;
45
+ private readonly load;
46
+ /** Resolves once every Bible stylesheet has loaded (or failed, so text still shows). */
47
+ private installStylesheets;
48
+ /**
49
+ * Grows from the loader's height to the passage's height after removing the loader.
50
+ * The text fades in with a light blur.
51
+ */
52
+ private growFrom;
53
+ }
54
+ /** Registers <bible-sk-passage> and its <si-passage> compatibility name. */
55
+ export declare function defineScripturePassage(options?: ProviderOptions): void;
56
+ declare global {
57
+ interface HTMLElementTagNameMap {
58
+ "si-passage": ScripturePassage;
59
+ "bible-sk-passage": ScripturePassage;
60
+ }
61
+ }
@@ -0,0 +1,64 @@
1
+ import { type BibleProvider, type BibleVersion, type ProviderOptions } from "./providers";
2
+ export declare const VERSION_INPUT_TAG = "si-version-input";
3
+ export declare const BIBLE_VERSION_INPUT_TAG = "bible-sk-version-input";
4
+ export type VersionInputDetail = {
5
+ provider: string;
6
+ bibleVersionId: string;
7
+ bibleVersion: BibleVersion | null;
8
+ };
9
+ /** A form-associated translation picker. Search names/abbreviations, not provider IDs. */
10
+ export declare class ScriptureVersionInput extends HTMLElement {
11
+ static formAssociated: boolean;
12
+ static observedAttributes: string[];
13
+ private readonly internals;
14
+ private readonly input;
15
+ private readonly language;
16
+ private readonly list;
17
+ private readonly status;
18
+ private readonly retry;
19
+ private versions;
20
+ private filtered;
21
+ private selected?;
22
+ private pendingValue?;
23
+ private provider?;
24
+ private override?;
25
+ private active;
26
+ private generation;
27
+ private scheduled;
28
+ private cancelLoad?;
29
+ private loading;
30
+ private failed;
31
+ private formDisabled;
32
+ constructor();
33
+ connectedCallback(): void;
34
+ disconnectedCallback(): void;
35
+ attributeChangedCallback(name: string, old: string | null, value: string | null): void;
36
+ get value(): string;
37
+ set value(value: string);
38
+ get bibleProvider(): BibleProvider | undefined;
39
+ set bibleProvider(provider: BibleProvider | undefined);
40
+ get form(): HTMLFormElement | null;
41
+ get validity(): ValidityState;
42
+ get validationMessage(): string;
43
+ checkValidity(): boolean;
44
+ reportValidity(): boolean;
45
+ focus(options?: FocusOptions): void;
46
+ formResetCallback(): void;
47
+ formDisabledCallback(disabled: boolean): void;
48
+ private defaultValue;
49
+ private updateDisabled;
50
+ private close;
51
+ private highlight;
52
+ private suggest;
53
+ private commit;
54
+ private scheduleLoad;
55
+ private readonly load;
56
+ }
57
+ /** Registers <bible-sk-version-input> and <si-version-input>, sharing provider defaults. */
58
+ export declare function defineVersionInput(options?: ProviderOptions): void;
59
+ declare global {
60
+ interface HTMLElementTagNameMap {
61
+ "si-version-input": ScriptureVersionInput;
62
+ "bible-sk-version-input": ScriptureVersionInput;
63
+ }
64
+ }
package/package.json CHANGED
@@ -1,6 +1,81 @@
1
1
  {
2
2
  "name": "@faith-tools/bible-sdk",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.6.0",
4
+ "description": "Unified Bible data SDK with async and Effect APIs, plus drop-in Scripture web components.",
5
+ "license": "MIT",
6
+ "author": "Cameron Pak (https://cameronpak.com)",
7
+ "homepage": "https://bible-sdk.com",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/cameronapak/bible-sdk.git"
11
+ },
12
+ "bugs": "https://github.com/cameronapak/bible-sdk/issues",
13
+ "keywords": [
14
+ "bible",
15
+ "scripture",
16
+ "web-components",
17
+ "youversion",
18
+ "bible-references"
19
+ ],
20
+ "type": "module",
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/types/index.d.ts",
24
+ "default": "./dist/index.js"
25
+ },
26
+ "./data": {
27
+ "types": "./dist/types/data.d.ts",
28
+ "default": "./dist/data.js"
29
+ },
30
+ "./data/effect": {
31
+ "types": "./dist/types/data-effect.d.ts",
32
+ "default": "./dist/data/effect.js"
33
+ },
34
+ "./providers/helloao": {
35
+ "types": "./dist/types/providers/helloao.d.ts",
36
+ "default": "./dist/providers/helloao.js"
37
+ },
38
+ "./providers/youversion": {
39
+ "types": "./dist/types/providers/youversion.d.ts",
40
+ "default": "./dist/providers/youversion.js"
41
+ },
42
+ "./providers/fetch-bible": {
43
+ "types": "./dist/types/providers/fetch-bible.d.ts",
44
+ "default": "./dist/providers/fetch-bible.js"
45
+ },
46
+ "./embed": "./dist/bible-sdk.js"
47
+ },
48
+ "types": "./dist/types/index.d.ts",
49
+ "files": [
50
+ "dist"
51
+ ],
52
+ "dependencies": {
53
+ "@gracious.tech/fetch-client": "2.6.0",
54
+ "@youversion/platform-core": "^2.16.0",
55
+ "effect": "^4.1.2",
56
+ "free-use-bible-api": "^1.16.0",
57
+ "grab-bcv": "^0.1.8",
58
+ "sanitize-html": "^2.18.1"
59
+ },
60
+ "devDependencies": {
61
+ "@changesets/cli": "3.0.3",
62
+ "@effect/vitest": "4.1.2",
63
+ "@faith-tools/sensible-ui": "1.8.2",
64
+ "@types/sanitize-html": "^2.16.2",
65
+ "jsdom": "^30.1.3",
66
+ "typescript": "^7.0.2",
67
+ "vite": "^8.3.5",
68
+ "vitest": "^5.0.5"
69
+ },
70
+ "scripts": {
71
+ "dev": "vite",
72
+ "build": "vite build && vite build --mode lib && tsc -p tsconfig.build.json",
73
+ "build:site": "vite build --mode site",
74
+ "typecheck": "tsc --noEmit",
75
+ "check:data-types": "tsc --ignoreConfig --noEmit --strict --module NodeNext --moduleResolution NodeNext --target ES2022 --lib ES2022,DOM scripts/check-data-types.ts",
76
+ "test": "vitest run",
77
+ "check": "pnpm typecheck && pnpm test && pnpm build && pnpm check:data-types && pnpm build:site",
78
+ "changeset": "changeset",
79
+ "version-packages": "changeset version && node scripts/sync-cdn-version.ts"
80
+ }
6
81
  }