@crosslink/sdk-browser 0.1.0 → 0.1.1
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/dist/crosslink.global.js +18 -9
- package/dist/index.d.ts +22 -21
- package/dist/index.js +42 -45
- package/package.json +12 -4
package/dist/index.d.ts
CHANGED
|
@@ -562,10 +562,10 @@ declare function createHttpPairingSource(basePath?: string): PairingSource;
|
|
|
562
562
|
* for the Crosslink identity rendered by every Crosslink-owned screen.
|
|
563
563
|
*
|
|
564
564
|
* The mark is an SVG filled with `currentColor`, so it takes the colour of the
|
|
565
|
-
* Crosslink surface around it.
|
|
566
|
-
*
|
|
567
|
-
*
|
|
568
|
-
*
|
|
565
|
+
* Crosslink surface around it. By default the mark is white. When an application
|
|
566
|
+
* explicitly supplies an accent, `resolveCrosslinkTheme` derives a logo colour
|
|
567
|
+
* from that accent and then lifts it until it clears the WCAG contrast floor for
|
|
568
|
+
* graphical objects against the surface behind it.
|
|
569
569
|
*
|
|
570
570
|
* Nothing here can remove the mark or the attribution. The helpers always
|
|
571
571
|
* return a logo and always return attribution text; only colour, size and
|
|
@@ -578,8 +578,8 @@ declare const CROSSLINK_LOGO_PATH = "M233.73 383.42C254.47 380.94 275.68 386.3 2
|
|
|
578
578
|
/** Where the attribution link points. */
|
|
579
579
|
declare const CROSSLINK_REPOSITORY = "https://github.com/jacobpowaza/crosslink";
|
|
580
580
|
/** Attribution wording. Not configurable — every Crosslink screen says this. */
|
|
581
|
-
declare const CROSSLINK_ATTRIBUTION_TEXT = "
|
|
582
|
-
declare const CROSSLINK_ATTRIBUTION_LINK_TEXT = "
|
|
581
|
+
declare const CROSSLINK_ATTRIBUTION_TEXT = "End-to-end encrypted with";
|
|
582
|
+
declare const CROSSLINK_ATTRIBUTION_LINK_TEXT = "crosslink";
|
|
583
583
|
/**
|
|
584
584
|
* The whole of what an application may say about how Crosslink-owned screens
|
|
585
585
|
* look. There is intentionally no slot for markup, templates or renderers: an
|
|
@@ -905,7 +905,7 @@ declare class PairingCard {
|
|
|
905
905
|
* light card as well as a dark one.
|
|
906
906
|
*/
|
|
907
907
|
private applyBrand;
|
|
908
|
-
/** Re-themes a mounted card; the mark
|
|
908
|
+
/** Re-themes a mounted card; the mark is unaffected. */
|
|
909
909
|
setBrand(brand: CrosslinkTheme): this;
|
|
910
910
|
/** The palette actually in use, after contrast correction. */
|
|
911
911
|
getBrand(): ResolvedCrosslinkTheme;
|
|
@@ -942,13 +942,14 @@ declare function normalizeNetworkMode(mode: string | undefined | null): NetworkM
|
|
|
942
942
|
declare function createPairingCard(options?: PairingCardOptions): PairingCard;
|
|
943
943
|
|
|
944
944
|
/**
|
|
945
|
-
* The Crosslink attribution
|
|
945
|
+
* The Crosslink attribution footer shown on Crosslink-owned mobile screens.
|
|
946
946
|
*
|
|
947
|
-
* It
|
|
948
|
-
*
|
|
949
|
-
*
|
|
950
|
-
*
|
|
951
|
-
* against whatever background the
|
|
947
|
+
* It participates in normal layout flow. It is not a floating badge, overlay,
|
|
948
|
+
* capsule or reserved layer: applications get a quiet full-width footer with a
|
|
949
|
+
* separator, centered text, and the shared Crosslink attribution wording.
|
|
950
|
+
* Colour defaults come from the shared brand resolver, so the footer lands on
|
|
951
|
+
* the right side of the WCAG contrast floor against whatever background the
|
|
952
|
+
* application configured.
|
|
952
953
|
*/
|
|
953
954
|
type PoweredByPlacement = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | "inline";
|
|
954
955
|
interface PoweredByCrosslinkOptions {
|
|
@@ -964,25 +965,25 @@ interface PoweredByCrosslinkOptions {
|
|
|
964
965
|
color?: string;
|
|
965
966
|
/** Any CSS font-size value, or a pixel number. */
|
|
966
967
|
size?: string | number;
|
|
967
|
-
/**
|
|
968
|
+
/** @deprecated The attribution is always rendered as a normal flow footer. */
|
|
968
969
|
placement?: PoweredByPlacement;
|
|
969
|
-
/**
|
|
970
|
+
/** Footer block padding. */
|
|
970
971
|
offset?: string | number;
|
|
971
|
-
/** Optional background
|
|
972
|
+
/** Optional footer background. */
|
|
972
973
|
background?: string;
|
|
973
974
|
/** Optional extra class for application-specific styling. */
|
|
974
975
|
className?: string;
|
|
975
|
-
/**
|
|
976
|
+
/** @deprecated The attribution no longer uses fixed positioning. */
|
|
976
977
|
zIndex?: number;
|
|
977
978
|
/** Application accent, used to tint the mark. */
|
|
978
979
|
accentColor?: string;
|
|
979
|
-
/** Background the
|
|
980
|
+
/** Background the footer sits on, used for the contrast correction. */
|
|
980
981
|
backgroundColor?: string;
|
|
981
|
-
/**
|
|
982
|
+
/** @deprecated The footer is text-only. */
|
|
982
983
|
logoWidth?: string | number;
|
|
983
984
|
}
|
|
984
985
|
/**
|
|
985
|
-
* Small reusable attribution shown by Crosslink mobile bootstrap applications.
|
|
986
|
+
* Small reusable attribution footer shown by Crosslink mobile bootstrap applications.
|
|
986
987
|
* It is also exported for apps that own their lifecycle UI directly.
|
|
987
988
|
*/
|
|
988
989
|
declare class PoweredByCrosslink {
|
|
@@ -1277,7 +1278,7 @@ interface MobileBootstrapOptions {
|
|
|
1277
1278
|
serviceWorkerUrl?: string;
|
|
1278
1279
|
/** Pairing URI override; otherwise read from `#pair=` / `?pair=` or storage. */
|
|
1279
1280
|
pairingUri?: string;
|
|
1280
|
-
/** Styling
|
|
1281
|
+
/** Styling for the Crosslink attribution footer. */
|
|
1281
1282
|
poweredBy?: PoweredByCrosslinkOptions;
|
|
1282
1283
|
/**
|
|
1283
1284
|
* Called once with what this origin can actually deliver.
|
package/dist/index.js
CHANGED
|
@@ -1051,8 +1051,8 @@ function createHttpPairingSource(basePath = DEFAULT_BASE_PATH) {
|
|
|
1051
1051
|
var CROSSLINK_LOGO_VIEWBOX = "105 363 1060 222";
|
|
1052
1052
|
var CROSSLINK_LOGO_PATH = "M233.73 383.42C254.47 380.94 275.68 386.3 293.3 397.22C298.36 400.36 310.34 407.06 306.92 414.39C305.05 418.41 299.18 424.66 294.5 424.16C290.7 423.75 283.6 416.8 279.92 414.57C271.58 409.53 262.05 406.61 252.45 405.27C210.49 399.39 171.23 433.96 172.83 476.5C174.51 521.08 215.67 550.01 258.38 541.73C267.91 539.88 276.87 535.81 284.85 530.38C288.81 527.68 292.08 522.77 297.47 523.95C299.49 524.39 307.14 531.68 307.85 533.67C308.39 535.19 308.34 536.9 307.92 538.44C307.04 541.58 302.8 544.02 300.34 545.88C285.61 557.02 267.9 563.4 249.5 564.79C194.73 568.93 147.61 523.68 151.02 468.5C152.07 451.5 158.16 436.04 167.48 421.97C173.81 412.42 182.42 403.72 192.26 397.74C205.14 389.9 218.77 385.21 233.73 383.42ZM791.59 387.27C795.36 386.55 802.6 386.03 805.44 389.07C807.56 391.34 807.21 394.63 807.24 397.5C807.3 404.17 807.27 410.83 807.25 417.5C807.15 451.5 807.23 485.5 807.25 519.5C807.26 529.5 807.29 539.5 807.27 549.5C807.26 554.33 807.43 559.18 801.47 559.66C797.97 559.94 791 560.91 788.25 558.23C786.05 556.09 786.66 552.28 786.64 549.5C786.6 542.17 786.66 534.83 786.64 527.5C786.54 494.5 786.59 461.5 786.65 428.5C786.67 418.17 786.7 407.83 786.62 397.5C786.59 393.48 786.61 388.22 791.59 387.27ZM1047.5 490.33C1049.96 490.3 1052.92 490.63 1055.26 489.73C1058.8 488.37 1065.75 479.23 1068.61 476.12C1077.64 466.3 1086.84 456.19 1096.5 447C1100.43 443.26 1119.54 442.69 1123.5 445.8C1123.66 451.35 1115.32 457.13 1111.53 461.04C1099.51 473.43 1087.04 485.6 1075.57 498.5C1077.87 503.34 1082.73 507.17 1086.35 511.17C1095.38 521.13 1104.32 531.19 1113.52 541C1115.75 543.37 1125.96 553.61 1126.66 555.81C1127.01 556.89 1126.75 557.43 1126.8 558.5C1123.25 560.55 1118.53 559.73 1114.5 559.69C1110.76 559.66 1106.1 560.51 1102.63 558.88C1098.64 557 1095.59 552.04 1092.65 548.84C1085.62 541.2 1078.7 533.45 1071.74 525.76C1063.43 516.58 1060.8 509.28 1046.79 512.5C1044.96 522.02 1046.59 534.66 1046.57 544.5C1046.57 548.23 1047.48 553.75 1045.59 557.14C1043.49 560.88 1026.82 562.35 1025.95 554.5C1024.58 542.11 1025.96 527.16 1025.95 514.5C1025.94 486.17 1025.87 457.83 1025.93 429.5C1025.95 418.83 1025.94 408.17 1025.9 397.5C1025.89 393.57 1025.68 388.29 1030.61 387.24C1032.49 386.84 1034.59 387.09 1036.5 387.09C1038.56 387.1 1040.88 386.81 1042.81 387.66C1048.5 390.17 1046.49 406.98 1046.51 412.56C1046.56 430.21 1046.47 447.85 1046.53 465.5C1046.56 473.31 1045.12 482.95 1047.5 490.33ZM844.74 395.34C862.3 390.41 870.21 415.48 853.62 421.22C835.59 427.47 827.09 400.31 844.74 395.34ZM463.67 441.41C471.92 440.68 480.11 442.01 487.94 444.53C494.65 446.69 500.51 450.23 506.18 454.35C510.98 457.84 514.79 462.48 518.32 467.22C546.74 505.4 518.83 560.06 472.5 563.08C464.08 563.63 455.77 562.3 447.8 559.63C440.61 557.23 433.85 553.39 428.12 548.4C387.12 512.7 410.35 446.13 463.67 441.41ZM938.73 441.43C964.07 438.8 988.77 454.5 996.81 478.63C1001.03 491.31 999.84 505.34 999.82 518.5C999.8 528.5 999.67 538.5 999.8 548.5C999.85 552.1 1000.71 557.37 996.66 559.21C994.79 560.06 992.49 559.69 990.5 559.67C987.56 559.65 983.54 560.44 981.08 558.44C978.66 556.48 979.13 553.29 979.15 550.5C979.17 544.5 979.16 538.5 979.16 532.5C979.15 506.82 985.32 474.05 954.7 463.73C950.67 462.38 946.75 461.96 942.5 462.04C938.21 462.13 934.22 463.12 930.27 464.75C909.54 473.31 908.83 490.84 908.83 510.5C908.83 519.5 908.79 528.5 908.78 537.5C908.78 543.14 909.77 549.73 908.6 555.26C907.36 561.17 892.64 561.43 889.51 557.98C887.34 555.6 888.08 551.45 888.05 548.5C887.98 539.83 888.06 531.17 888.07 522.5C888.08 510.07 886.92 496.94 889.34 484.69C894.17 460.27 914.52 443.93 938.73 441.43ZM370.81 444.44C378.29 443.39 385.96 443.92 393.5 443.91C396.8 443.91 400.83 443.49 403.26 446.23C405.44 448.69 404.78 452.49 404.76 455.5C404.75 457.24 404.95 459.11 404.32 460.76C401.95 466.94 387.89 464.88 382.5 464.89C368.82 464.9 356.04 469.36 350.54 483.06C345.38 495.93 347.67 523.81 347.69 538.5C347.7 543.73 349 550.79 347.34 555.78C345.69 560.75 334.22 560.97 330.2 559.33C326.24 557.72 327 552.92 327 549.5C327 540.5 326.98 531.5 327 522.5C327.02 510.28 326.04 497.62 328.16 485.54C331.95 463.92 349.33 447.47 370.81 444.44ZM632.82 448.5C630.99 452.96 625.86 456.37 622.98 460.46C622.01 461.84 620.99 464.11 619.29 464.68C614.01 466.44 601.31 464.28 594.65 465.33C578.59 467.86 566.31 480.49 563.75 496.48C562.92 501.66 563.12 506.77 564.57 511.83C566.29 517.82 569.39 523.27 573.67 527.82C584.18 538.98 597.17 538.99 611.5 539.08C626.5 539.17 640.93 539.33 651.61 527.14C656.22 521.88 659.71 515.44 660.73 508.46C661.28 504.62 660.22 499.75 661.65 496.17C663.77 490.82 677.12 490.22 680.29 494.22C682.78 497.37 681.9 502.8 681.67 506.5C680.91 518.95 675.64 530.73 667.69 540.21C651.84 559.1 633.43 559.88 610.5 559.75C595.85 559.66 582.93 559.16 570.01 551.47C529.05 527.1 536.59 463.2 580.88 447.43C593.12 443.07 605.72 444 618.5 443.95C623.82 443.92 630.4 442.77 632.82 448.5ZM672.17 556.5C672.3 555.53 672.1 554.9 672.51 553.96C673.37 551.95 676.41 550 677.9 548.38C680.43 545.62 682.15 542.33 684.5 539.46C697.35 538.01 711.53 541.69 723.35 534.86C748.05 520.57 750.19 485.59 725.32 470.15C716.44 464.64 706.56 464.92 696.5 464.91C681.72 464.89 667.28 463.66 655.36 473.89C648.93 479.41 644.84 487.35 643.27 495.62C642.39 500.25 644.05 506.55 640.99 510.49C636.17 516.71 623.36 514.7 622.14 506.47C618.6 482.48 637.65 455.23 659.96 447.48C671.89 443.34 684.08 443.97 696.5 443.96C712.53 443.94 727.02 445.31 740.35 455.09C776.51 481.63 768.28 540.25 726.62 556.17C714.11 560.95 700.63 559.64 687.5 559.74C682.23 559.78 675.73 561.11 672.17 556.5ZM843.71 444.37C848.02 443.53 856.53 442.92 858.52 447.96C860.51 453 859.14 467.45 859.13 473.5C859.09 492.83 859.08 512.17 859.13 531.5C859.15 538.17 859.16 544.83 859.1 551.5C859.07 555.16 858.76 558.98 854.37 559.61C850.62 560.16 841.54 561.12 839.26 557.25C836.93 553.29 838.56 539.46 838.55 534.5C838.47 514.17 838.44 493.83 838.52 473.5C838.55 467.55 837.15 452.54 839.22 447.7C839.97 445.93 841.87 444.73 843.71 444.37ZM461.77 462.42C418.77 469.25 416.23 530.16 458.13 541.44C464.19 543.07 470.34 543.03 476.49 541.92C517.97 534.45 519.66 475.76 479.83 463.58C474.06 461.82 467.74 461.46 461.77 462.42Z";
|
|
1053
1053
|
var CROSSLINK_REPOSITORY = "https://github.com/jacobpowaza/crosslink";
|
|
1054
|
-
var CROSSLINK_ATTRIBUTION_TEXT = "
|
|
1055
|
-
var CROSSLINK_ATTRIBUTION_LINK_TEXT = "
|
|
1054
|
+
var CROSSLINK_ATTRIBUTION_TEXT = "End-to-end encrypted with";
|
|
1055
|
+
var CROSSLINK_ATTRIBUTION_LINK_TEXT = "crosslink";
|
|
1056
1056
|
var DEFAULT_ACCENT = "#38bdf8";
|
|
1057
1057
|
var DEFAULT_DARK_BG = "#0b1120";
|
|
1058
1058
|
var DEFAULT_LIGHT_BG = "#ffffff";
|
|
@@ -1123,6 +1123,7 @@ function resolveCrosslinkTheme(theme = {}) {
|
|
|
1123
1123
|
const requestedBg = parseColor(theme.backgroundColor);
|
|
1124
1124
|
const appearance = theme.appearance === "light" || theme.appearance === "dark" ? theme.appearance : requestedBg ? relativeLuminance(requestedBg) > 0.4 ? "light" : "dark" : "dark";
|
|
1125
1125
|
const background = requestedBg ?? parseColor(appearance === "light" ? DEFAULT_LIGHT_BG : DEFAULT_DARK_BG);
|
|
1126
|
+
const hasAccent = Boolean(theme.accentColor?.trim());
|
|
1126
1127
|
const accent = parseColor(theme.accentColor) ?? parseColor(DEFAULT_ACCENT);
|
|
1127
1128
|
const text = parseColor(theme.textColor) ?? (appearance === "light" ? { r: 15, g: 23, b: 42 } : { r: 226, g: 232, b: 240 });
|
|
1128
1129
|
const surface = mix(background, appearance === "light" ? { r: 0, g: 0, b: 0 } : { r: 255, g: 255, b: 255 }, 0.06);
|
|
@@ -1137,7 +1138,7 @@ function resolveCrosslinkTheme(theme = {}) {
|
|
|
1137
1138
|
textColor: toHex(text),
|
|
1138
1139
|
mutedColor: toHex(muted),
|
|
1139
1140
|
dividerColor: toHex(divider),
|
|
1140
|
-
logoColor: toHex(ensureContrast(accent, background, LOGO_MIN_CONTRAST)),
|
|
1141
|
+
logoColor: hasAccent ? toHex(ensureContrast(accent, background, LOGO_MIN_CONTRAST)) : "#ffffff",
|
|
1141
1142
|
attributionColor: toHex(ensureContrast(muted, background, ATTRIBUTION_MIN_CONTRAST)),
|
|
1142
1143
|
appearance
|
|
1143
1144
|
};
|
|
@@ -1148,7 +1149,8 @@ function cssSize(value, fallback) {
|
|
|
1148
1149
|
}
|
|
1149
1150
|
function crosslinkLogoSvg(options = {}) {
|
|
1150
1151
|
const width = cssSize(options.width, "140px");
|
|
1151
|
-
const
|
|
1152
|
+
const color = options.color ?? "#ffffff";
|
|
1153
|
+
const style = `width:${width};height:auto;display:block;color:${color};${options.style ?? ""}`;
|
|
1152
1154
|
const className = options.className ? ` class="${options.className}"` : "";
|
|
1153
1155
|
const title = options.title ?? "Crosslink";
|
|
1154
1156
|
return [
|
|
@@ -2385,7 +2387,7 @@ var PairingCard = class {
|
|
|
2385
2387
|
style.setProperty("--cl-attribution", this.brand.attributionColor);
|
|
2386
2388
|
this.applyTheme(this.options.theme);
|
|
2387
2389
|
}
|
|
2388
|
-
/** Re-themes a mounted card; the mark
|
|
2390
|
+
/** Re-themes a mounted card; the mark is unaffected. */
|
|
2389
2391
|
setBrand(brand) {
|
|
2390
2392
|
this.brand = resolvePairingCardTheme({ ...this.options.brand, ...brand });
|
|
2391
2393
|
this.applyBrand();
|
|
@@ -2749,51 +2751,39 @@ var PoweredByCrosslink = class {
|
|
|
2749
2751
|
this.element.remove();
|
|
2750
2752
|
}
|
|
2751
2753
|
render() {
|
|
2752
|
-
const
|
|
2753
|
-
const offset = cssLength(this.options.offset, "8px");
|
|
2754
|
+
const offset = cssLength(this.options.offset, "10px");
|
|
2754
2755
|
const size = cssLength(this.options.size, "11px");
|
|
2755
|
-
const
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
if (placement.endsWith("left")) position.push(`left:${offset}`);
|
|
2761
|
-
else if (placement.endsWith("right")) position.push(`right:${offset}`);
|
|
2762
|
-
else position.push("left:50%", "transform:translateX(-50%)");
|
|
2763
|
-
}
|
|
2764
|
-
this.element.className = `cl-powered-by-crosslink${this.options.className ? ` ${this.options.className}` : ""}`;
|
|
2756
|
+
const brand = resolveCrosslinkTheme({
|
|
2757
|
+
accentColor: this.options.accentColor,
|
|
2758
|
+
backgroundColor: this.options.backgroundColor ?? this.options.background
|
|
2759
|
+
});
|
|
2760
|
+
this.element.className = `cl-crosslink-attribution-footer${this.options.className ? ` ${this.options.className}` : ""}`;
|
|
2765
2761
|
this.element.style.cssText = [
|
|
2766
|
-
|
|
2767
|
-
"display:
|
|
2762
|
+
"width:100%",
|
|
2763
|
+
"display:flex",
|
|
2768
2764
|
"align-items:center",
|
|
2769
|
-
"
|
|
2770
|
-
"
|
|
2771
|
-
"
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
`
|
|
2765
|
+
"justify-content:center",
|
|
2766
|
+
"gap:.35em",
|
|
2767
|
+
"flex-shrink:0",
|
|
2768
|
+
`padding:${offset} 16px`,
|
|
2769
|
+
"border-top:1px solid rgba(148,163,184,.24)",
|
|
2770
|
+
`background:${this.options.background ?? "transparent"}`,
|
|
2771
|
+
`color:${this.options.color ?? brand.attributionColor}`,
|
|
2775
2772
|
`font:${size}/1.2 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif`,
|
|
2776
|
-
"
|
|
2773
|
+
"text-align:center",
|
|
2774
|
+
"white-space:normal",
|
|
2777
2775
|
"box-sizing:border-box"
|
|
2778
2776
|
].join(";");
|
|
2779
2777
|
this.element.textContent = "";
|
|
2780
|
-
const brand = resolveCrosslinkTheme({
|
|
2781
|
-
accentColor: this.options.accentColor,
|
|
2782
|
-
backgroundColor: this.options.backgroundColor ?? this.options.background
|
|
2783
|
-
});
|
|
2784
2778
|
const prefix = document.createElement("span");
|
|
2785
|
-
prefix.textContent = this.options.text ?? CROSSLINK_ATTRIBUTION_TEXT
|
|
2779
|
+
prefix.textContent = `${this.options.text ?? CROSSLINK_ATTRIBUTION_TEXT} `;
|
|
2786
2780
|
const link = document.createElement("a");
|
|
2787
2781
|
link.href = CROSSLINK_REPOSITORY;
|
|
2788
2782
|
link.target = "_blank";
|
|
2789
2783
|
link.rel = "noopener noreferrer";
|
|
2790
2784
|
link.setAttribute("aria-label", CROSSLINK_ATTRIBUTION_LINK_TEXT);
|
|
2791
|
-
link.style.cssText = "color:inherit;
|
|
2792
|
-
link.
|
|
2793
|
-
width: cssLength(this.options.logoWidth, "58px"),
|
|
2794
|
-
color: this.options.accentColor ? brand.logoColor : void 0,
|
|
2795
|
-
title: CROSSLINK_ATTRIBUTION_LINK_TEXT
|
|
2796
|
-
});
|
|
2785
|
+
link.style.cssText = "color:inherit;font-weight:600;text-decoration:none";
|
|
2786
|
+
link.textContent = this.options.linkText ?? CROSSLINK_ATTRIBUTION_LINK_TEXT;
|
|
2797
2787
|
this.element.append(prefix, link);
|
|
2798
2788
|
if (this.options.suffix) {
|
|
2799
2789
|
const suffix = document.createElement("span");
|
|
@@ -3257,10 +3247,16 @@ function createOfflineUI(config, onRetry) {
|
|
|
3257
3247
|
container.appendChild(guide);
|
|
3258
3248
|
const brandFooter = document.createElement("div");
|
|
3259
3249
|
brandFooter.id = "crosslink-offline-brand";
|
|
3260
|
-
brandFooter.style.cssText =
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3250
|
+
brandFooter.style.cssText = `
|
|
3251
|
+
width: calc(100% + 48px);
|
|
3252
|
+
margin: auto -24px 0;
|
|
3253
|
+
padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
|
|
3254
|
+
border-top: 1px solid ${brand.dividerColor};
|
|
3255
|
+
display: flex;
|
|
3256
|
+
align-items: center;
|
|
3257
|
+
justify-content: center;
|
|
3258
|
+
box-sizing: border-box;
|
|
3259
|
+
`;
|
|
3264
3260
|
const attribution = document.createElement("div");
|
|
3265
3261
|
attribution.style.cssText = `font-size:11px;color:${brand.attributionColor}`;
|
|
3266
3262
|
const prefix = document.createElement("span");
|
|
@@ -3270,9 +3266,9 @@ function createOfflineUI(config, onRetry) {
|
|
|
3270
3266
|
link.target = "_blank";
|
|
3271
3267
|
link.rel = "noopener noreferrer";
|
|
3272
3268
|
link.textContent = CROSSLINK_ATTRIBUTION_LINK_TEXT;
|
|
3273
|
-
link.style.cssText = "color:inherit;font-weight:
|
|
3269
|
+
link.style.cssText = "color:inherit;font-weight:600;text-decoration:none";
|
|
3274
3270
|
attribution.append(prefix, link);
|
|
3275
|
-
brandFooter.
|
|
3271
|
+
brandFooter.appendChild(attribution);
|
|
3276
3272
|
container.appendChild(brandFooter);
|
|
3277
3273
|
return container;
|
|
3278
3274
|
}
|
|
@@ -3665,7 +3661,6 @@ var CrosslinkMobileBootstrap = class {
|
|
|
3665
3661
|
* This is the single entry point controlling what the mobile device sees.
|
|
3666
3662
|
*/
|
|
3667
3663
|
async start() {
|
|
3668
|
-
this.ensurePoweredBy();
|
|
3669
3664
|
this.environment = describeBootstrapEnvironment();
|
|
3670
3665
|
for (const limitation of this.environment.limitations) {
|
|
3671
3666
|
console.warn(`[crosslink] ${limitation}`);
|
|
@@ -3947,7 +3942,6 @@ var CrosslinkMobileBootstrap = class {
|
|
|
3947
3942
|
* Transition state machine to a new state and mount appropriate UI.
|
|
3948
3943
|
*/
|
|
3949
3944
|
transitionTo(newState, detail) {
|
|
3950
|
-
this.ensurePoweredBy();
|
|
3951
3945
|
this.state = newState;
|
|
3952
3946
|
this.options.onStateChange?.(newState, detail);
|
|
3953
3947
|
this.unmountCurrentScreen();
|
|
@@ -3962,8 +3956,11 @@ var CrosslinkMobileBootstrap = class {
|
|
|
3962
3956
|
if (rpc) {
|
|
3963
3957
|
this.options.onAuthorized(rpc, this.client);
|
|
3964
3958
|
}
|
|
3959
|
+
this.ensurePoweredBy();
|
|
3965
3960
|
return;
|
|
3966
3961
|
}
|
|
3962
|
+
this.poweredBy?.destroy();
|
|
3963
|
+
this.poweredBy = null;
|
|
3967
3964
|
this.options.onUnauthorized?.();
|
|
3968
3965
|
const container = this.options.container ?? (typeof document !== "undefined" ? document.body : null);
|
|
3969
3966
|
if (!container) return;
|
package/package.json
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crosslink/sdk-browser",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Crosslink client SDK for browsers and PWAs",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
-
"repository": {
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/jacobpowaza/crosslink.git",
|
|
9
|
+
"directory": "packages/sdk-browser"
|
|
10
|
+
},
|
|
7
11
|
"homepage": "https://crosslink.mintlify.site",
|
|
8
|
-
"bugs": {
|
|
9
|
-
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/jacobpowaza/crosslink/issues"
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
10
18
|
"type": "module",
|
|
11
19
|
"exports": {
|
|
12
20
|
".": {
|