@the-seeker/changes-react 0.0.0-stage → 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/README.md +104 -2
- package/dist/core/cache.d.ts +14 -0
- package/dist/core/cache.js +34 -0
- package/dist/core/client.d.ts +163 -0
- package/dist/core/client.js +98 -0
- package/dist/core/decide.d.ts +16 -0
- package/dist/core/decide.js +57 -0
- package/dist/core/rating.d.ts +7 -0
- package/dist/core/rating.js +18 -0
- package/dist/core/storage.d.ts +20 -0
- package/dist/core/storage.js +73 -0
- package/dist/core/types.d.ts +332 -0
- package/dist/core/types.js +126 -0
- package/dist/core/versions.d.ts +2 -0
- package/dist/core/versions.js +20 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +47 -0
- package/dist/web/Blocks.d.ts +5 -0
- package/dist/web/Blocks.js +42 -0
- package/dist/web/ChangelogButton.d.ts +5 -0
- package/dist/web/ChangelogButton.js +17 -0
- package/dist/web/ChangelogDialog.d.ts +2 -0
- package/dist/web/ChangelogDialog.js +20 -0
- package/dist/web/ChangelogList.d.ts +2 -0
- package/dist/web/ChangelogList.js +32 -0
- package/dist/web/CommentComposer.d.ts +9 -0
- package/dist/web/CommentComposer.js +47 -0
- package/dist/web/CommentItem.d.ts +11 -0
- package/dist/web/CommentItem.js +23 -0
- package/dist/web/CommentsThread.d.ts +4 -0
- package/dist/web/CommentsThread.js +15 -0
- package/dist/web/DialogShell.d.ts +11 -0
- package/dist/web/DialogShell.js +36 -0
- package/dist/web/Provider.d.ts +24 -0
- package/dist/web/Provider.js +109 -0
- package/dist/web/ReleaseCard.d.ts +5 -0
- package/dist/web/ReleaseCard.js +23 -0
- package/dist/web/ReleaseEngagement.d.ts +5 -0
- package/dist/web/ReleaseEngagement.js +24 -0
- package/dist/web/ReleaseSummary.d.ts +8 -0
- package/dist/web/ReleaseSummary.js +15 -0
- package/dist/web/ReportMenu.d.ts +4 -0
- package/dist/web/ReportMenu.js +79 -0
- package/dist/web/VoteCapsule.d.ts +9 -0
- package/dist/web/VoteCapsule.js +12 -0
- package/dist/web/WhatsNewModal.d.ts +2 -0
- package/dist/web/WhatsNewModal.js +26 -0
- package/dist/web/context.d.ts +82 -0
- package/dist/web/context.js +5 -0
- package/dist/web/controls-css.d.ts +1 -0
- package/dist/web/controls-css.js +48 -0
- package/dist/web/focus-trap.d.ts +7 -0
- package/dist/web/focus-trap.js +69 -0
- package/dist/web/icons.d.ts +17 -0
- package/dist/web/icons.js +29 -0
- package/dist/web/links.d.ts +11 -0
- package/dist/web/links.js +48 -0
- package/dist/web/load.d.ts +35 -0
- package/dist/web/load.js +61 -0
- package/dist/web/local-store.d.ts +7 -0
- package/dist/web/local-store.js +27 -0
- package/dist/web/model.d.ts +36 -0
- package/dist/web/model.js +37 -0
- package/dist/web/storage.d.ts +7 -0
- package/dist/web/storage.js +53 -0
- package/dist/web/styles.d.ts +273 -0
- package/dist/web/styles.js +201 -0
- package/dist/web/texts-defaults.d.ts +115 -0
- package/dist/web/texts-defaults.js +117 -0
- package/dist/web/texts.d.ts +9 -0
- package/dist/web/texts.js +49 -0
- package/dist/web/theme.d.ts +6 -0
- package/dist/web/theme.js +82 -0
- package/dist/web/use-actions.d.ts +10 -0
- package/dist/web/use-actions.js +114 -0
- package/dist/web/use-comments-api.d.ts +5 -0
- package/dist/web/use-comments-api.js +75 -0
- package/dist/web/use-thread.d.ts +23 -0
- package/dist/web/use-thread.js +82 -0
- package/dist/web/useChanges.d.ts +5 -0
- package/dist/web/useChanges.js +19 -0
- package/package.json +36 -4
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
import type { ChangesClient, FeedbackInput } from "../core/client";
|
|
3
|
+
import type { CommentReply, Config, ErrorCode, Release, Result } from "../core/types";
|
|
4
|
+
import type { ChangesStatus } from "./model";
|
|
5
|
+
import type { Locale, Texts } from "./texts";
|
|
6
|
+
import type { ColorScheme } from "./theme";
|
|
7
|
+
export type VoteValue = -1 | 0 | 1;
|
|
8
|
+
export type ReportReason = "spam" | "abuse" | "off_topic" | "other";
|
|
9
|
+
type ClientResult<K extends keyof ChangesClient> = Awaited<ReturnType<ChangesClient[K]>>;
|
|
10
|
+
export type VoteResult = ClientResult<"vote">;
|
|
11
|
+
export type CommentsPage = ClientResult<"listComments">;
|
|
12
|
+
export type PostCommentInput = Readonly<{
|
|
13
|
+
releaseId: string;
|
|
14
|
+
body: string;
|
|
15
|
+
parentId?: string;
|
|
16
|
+
guidelinesAccepted?: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
export type CommentsApi = Readonly<{
|
|
19
|
+
list(releaseId: string, cursor?: string): Promise<CommentsPage>;
|
|
20
|
+
post(input: PostCommentInput): Promise<Result<CommentReply>>;
|
|
21
|
+
vote(commentId: string, value: VoteValue): Promise<VoteResult>;
|
|
22
|
+
report(commentId: string, reason: ReportReason, note?: string): Promise<ClientResult<"reportComment">>;
|
|
23
|
+
}>;
|
|
24
|
+
export type RootProps = Readonly<{
|
|
25
|
+
"data-tsc": "";
|
|
26
|
+
"data-tsc-scheme": ColorScheme;
|
|
27
|
+
style: CSSProperties;
|
|
28
|
+
}>;
|
|
29
|
+
export type FeedbackRequest = Pick<FeedbackInput, "releaseId" | "message" | "email">;
|
|
30
|
+
export type ChangesContextValue = Readonly<{
|
|
31
|
+
status: ChangesStatus;
|
|
32
|
+
error: ErrorCode | null;
|
|
33
|
+
stale: boolean;
|
|
34
|
+
config: Config | null;
|
|
35
|
+
locale: Locale;
|
|
36
|
+
texts: Texts;
|
|
37
|
+
releases: readonly Release[];
|
|
38
|
+
latest: Release | null;
|
|
39
|
+
unseenCount: number;
|
|
40
|
+
pendingWhatsNew: Release | null;
|
|
41
|
+
changelogOpen: boolean;
|
|
42
|
+
guidelinesAccepted: boolean;
|
|
43
|
+
banned: boolean;
|
|
44
|
+
rootProps: RootProps;
|
|
45
|
+
vote(releaseId: string, value: VoteValue): Promise<VoteResult>;
|
|
46
|
+
sendFeedback(input: FeedbackRequest): Promise<ClientResult<"sendFeedback">>;
|
|
47
|
+
openChangelog(): void;
|
|
48
|
+
closeChangelog(): void;
|
|
49
|
+
markPresented(release: Release): void;
|
|
50
|
+
dismissWhatsNew(): void;
|
|
51
|
+
openRating(release?: Release): void;
|
|
52
|
+
comments: CommentsApi;
|
|
53
|
+
acceptGuidelines(): void;
|
|
54
|
+
reload(): void;
|
|
55
|
+
}>;
|
|
56
|
+
export declare const ChangesContext: import("react").Context<Readonly<{
|
|
57
|
+
status: ChangesStatus;
|
|
58
|
+
error: ErrorCode | null;
|
|
59
|
+
stale: boolean;
|
|
60
|
+
config: Config | null;
|
|
61
|
+
locale: Locale;
|
|
62
|
+
texts: Texts;
|
|
63
|
+
releases: readonly Release[];
|
|
64
|
+
latest: Release | null;
|
|
65
|
+
unseenCount: number;
|
|
66
|
+
pendingWhatsNew: Release | null;
|
|
67
|
+
changelogOpen: boolean;
|
|
68
|
+
guidelinesAccepted: boolean;
|
|
69
|
+
banned: boolean;
|
|
70
|
+
rootProps: RootProps;
|
|
71
|
+
vote(releaseId: string, value: VoteValue): Promise<VoteResult>;
|
|
72
|
+
sendFeedback(input: FeedbackRequest): Promise<ClientResult<"sendFeedback">>;
|
|
73
|
+
openChangelog(): void;
|
|
74
|
+
closeChangelog(): void;
|
|
75
|
+
markPresented(release: Release): void;
|
|
76
|
+
dismissWhatsNew(): void;
|
|
77
|
+
openRating(release?: Release): void;
|
|
78
|
+
comments: CommentsApi;
|
|
79
|
+
acceptGuidelines(): void;
|
|
80
|
+
reload(): void;
|
|
81
|
+
}> | null>;
|
|
82
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CONTROLS_CSS: string;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CONTROLS_CSS = void 0;
|
|
4
|
+
// Rules inline styles cannot express: pseudo-classes, media queries and keyframes. Static layout and
|
|
5
|
+
// typography stay in styles.ts. Timing follows crm DESIGN.md §6 (120ms color, 160ms dialog, 240ms sheet).
|
|
6
|
+
const HOVER = [
|
|
7
|
+
`[data-tsc-btn=primary]:hover:not(:disabled){filter:brightness(1.08)}`,
|
|
8
|
+
`[data-tsc-btn=secondary]:hover:not(:disabled),[data-tsc-btn=ghost]:hover:not(:disabled),[data-tsc-btn=icon]:hover:not(:disabled),[data-tsc-vote]:hover:not(:disabled){background:var(--tsc-hover);color:var(--tsc-fg)}`,
|
|
9
|
+
`[data-tsc-menuitem]:hover{background:var(--tsc-hover)}`,
|
|
10
|
+
`[data-tsc-link]:hover{text-decoration-thickness:2px}`,
|
|
11
|
+
].join("");
|
|
12
|
+
exports.CONTROLS_CSS = [
|
|
13
|
+
`[data-tsc-btn],[data-tsc-vote],[data-tsc-menuitem]{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;border:1px solid transparent;background:transparent;font-size:15px;line-height:20px;font-weight:500;cursor:pointer;text-decoration:none;white-space:nowrap;-webkit-user-select:none;user-select:none;transition-property:color,background-color,border-color,opacity,filter;transition-duration:120ms;transition-timing-function:var(--tsc-ease)}`,
|
|
14
|
+
`[data-tsc-btn]{padding:0 16px;border-radius:8px;color:var(--tsc-fg)}`,
|
|
15
|
+
`[data-tsc-btn=primary]{width:100%;background:var(--tsc-accent);color:var(--tsc-accent-fg);font-weight:600}`,
|
|
16
|
+
`[data-tsc-btn=secondary]{background:var(--tsc-control);border-color:var(--tsc-border-strong)}`,
|
|
17
|
+
`[data-tsc-btn=ghost]{padding:0 12px;color:var(--tsc-fg-2)}`,
|
|
18
|
+
`[data-tsc-btn=ghost][aria-expanded=true]{color:var(--tsc-fg)}`,
|
|
19
|
+
`[data-tsc-btn=icon]{width:44px;padding:0;color:var(--tsc-fg-2)}`,
|
|
20
|
+
`[data-tsc-btn]:focus-visible,[data-tsc-menuitem]:focus-visible{outline:none;box-shadow:0 0 0 1px var(--tsc-surface),0 0 0 3px var(--tsc-accent-ring)}`,
|
|
21
|
+
`[data-tsc-btn]:disabled,[data-tsc-vote]:disabled{opacity:.45;cursor:default}`,
|
|
22
|
+
`[data-tsc-capsule]{display:inline-flex;align-items:center;border:1px solid var(--tsc-border-strong);border-radius:999px;background:var(--tsc-control)}`,
|
|
23
|
+
`[data-tsc-vote]{min-width:52px;padding:0 14px;border-width:0;color:var(--tsc-fg-2);font-weight:600;font-variant-numeric:tabular-nums}`,
|
|
24
|
+
`[data-tsc-vote=up]{border-radius:999px 0 0 999px;padding-inline-start:16px}`,
|
|
25
|
+
`[data-tsc-vote=down]{border-radius:0 999px 999px 0;padding-inline-end:16px}`,
|
|
26
|
+
`[data-tsc-vote][aria-pressed=true]{background:var(--tsc-accent-soft);color:var(--tsc-fg)}`,
|
|
27
|
+
`[data-tsc-vote][aria-pressed=true] svg{color:var(--tsc-accent);fill:currentColor}`,
|
|
28
|
+
`[data-tsc-vote]:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--tsc-accent)}`,
|
|
29
|
+
`[data-tsc-chevron]{transition:transform 160ms var(--tsc-ease)}`,
|
|
30
|
+
`[aria-expanded=true] [data-tsc-chevron]{transform:rotate(180deg)}`,
|
|
31
|
+
`[data-tsc-field]{display:block;width:100%;min-height:88px;padding:10px 12px;border:1px solid var(--tsc-border-strong);border-radius:8px;background:var(--tsc-control);color:var(--tsc-fg);font-size:16px;line-height:24px;resize:vertical;transition-property:border-color,box-shadow;transition-duration:120ms;transition-timing-function:var(--tsc-ease)}`,
|
|
32
|
+
`[data-tsc-field]::placeholder{color:var(--tsc-fg-3)}`,
|
|
33
|
+
`[data-tsc-field]:focus{outline:none;border-color:var(--tsc-accent);box-shadow:0 0 0 3px var(--tsc-accent-ring)}`,
|
|
34
|
+
`[data-tsc] input[type=checkbox]{width:18px;height:18px;flex:none;accent-color:var(--tsc-accent)}`,
|
|
35
|
+
`[data-tsc] input[type=checkbox]:focus-visible{outline:2px solid var(--tsc-accent);outline-offset:2px}`,
|
|
36
|
+
`[data-tsc-link]{color:var(--tsc-fg);text-decoration-line:underline;text-decoration-color:var(--tsc-accent);text-decoration-thickness:1px;text-underline-offset:3px;border-radius:4px}`,
|
|
37
|
+
`[data-tsc-link]:focus-visible{outline:none;box-shadow:0 0 0 3px var(--tsc-accent-ring)}`,
|
|
38
|
+
`[data-tsc-menuitem]{width:100%;justify-content:flex-start;padding:0 12px;border-radius:6px;color:var(--tsc-fg)}`,
|
|
39
|
+
`@media (hover:hover){${HOVER}}`,
|
|
40
|
+
`[data-tsc-overlay]{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:24px;background:var(--tsc-backdrop);animation:tsc-fade 160ms var(--tsc-ease)}`,
|
|
41
|
+
`[data-tsc-dialog]{position:relative;display:flex;flex-direction:column;width:100%;max-width:440px;max-height:calc(100vh - 48px);max-height:min(760px,calc(100dvh - 48px));background:var(--tsc-surface);border-radius:12px;box-shadow:var(--tsc-shadow);outline:none;animation:tsc-rise 160ms var(--tsc-ease)}`,
|
|
42
|
+
`[data-tsc-dialog=wide]{max-width:560px}`,
|
|
43
|
+
`@media (max-width:520px){[data-tsc-overlay]{align-items:flex-end;padding:0}[data-tsc-dialog],[data-tsc-dialog=wide]{max-width:none;max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);border-radius:12px 12px 0 0;padding-bottom:env(safe-area-inset-bottom);animation:tsc-sheet 240ms var(--tsc-ease)}}`,
|
|
44
|
+
`@keyframes tsc-fade{from{opacity:0}}`,
|
|
45
|
+
`@keyframes tsc-rise{from{opacity:0;transform:translateY(4px) scale(.98)}}`,
|
|
46
|
+
`@keyframes tsc-sheet{from{transform:translateY(100%)}}`,
|
|
47
|
+
`@media (prefers-reduced-motion:reduce){[data-tsc-overlay],[data-tsc-dialog]{animation:none}[data-tsc] *,[data-tsc]{transition-duration:0ms !important}}`,
|
|
48
|
+
].join("\n");
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RefObject } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Modal focus contract: focus moves into the panel on open, Tab and Shift+Tab cycle inside it,
|
|
4
|
+
* focus that escapes (pointer on the backdrop, programmatic) is pulled back, Escape calls `onEscape`,
|
|
5
|
+
* page scroll is locked while open, and the previously focused element regains focus on close.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useFocusTrap(panel: RefObject<HTMLElement | null>, onEscape: () => void): void;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useFocusTrap = useFocusTrap;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const FOCUSABLE = 'a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
6
|
+
function focusables(container) {
|
|
7
|
+
return Array.from(container.querySelectorAll(FOCUSABLE)).filter((element) => element.getAttribute("tabindex") !== "-1" && element.closest("[inert]") === null);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Modal focus contract: focus moves into the panel on open, Tab and Shift+Tab cycle inside it,
|
|
11
|
+
* focus that escapes (pointer on the backdrop, programmatic) is pulled back, Escape calls `onEscape`,
|
|
12
|
+
* page scroll is locked while open, and the previously focused element regains focus on close.
|
|
13
|
+
*/
|
|
14
|
+
function useFocusTrap(panel, onEscape) {
|
|
15
|
+
const escape = (0, react_1.useRef)(onEscape);
|
|
16
|
+
(0, react_1.useEffect)(() => {
|
|
17
|
+
escape.current = onEscape;
|
|
18
|
+
});
|
|
19
|
+
(0, react_1.useEffect)(() => {
|
|
20
|
+
const container = panel.current;
|
|
21
|
+
if (container === null)
|
|
22
|
+
return;
|
|
23
|
+
const previous = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
24
|
+
const overflow = document.body.style.overflow;
|
|
25
|
+
document.body.style.overflow = "hidden";
|
|
26
|
+
container.focus({ preventScroll: true });
|
|
27
|
+
const pull = (event) => {
|
|
28
|
+
if (event.target instanceof Node && !container.contains(event.target))
|
|
29
|
+
container.focus({ preventScroll: true });
|
|
30
|
+
};
|
|
31
|
+
// Native listener: nested widgets (the report menu) stop their own Escape before it reaches the panel.
|
|
32
|
+
const keydown = (event) => {
|
|
33
|
+
if (event.key === "Escape") {
|
|
34
|
+
event.stopPropagation();
|
|
35
|
+
escape.current();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (event.key === "Tab")
|
|
39
|
+
cycle(container, event);
|
|
40
|
+
};
|
|
41
|
+
document.addEventListener("focusin", pull);
|
|
42
|
+
container.addEventListener("keydown", keydown);
|
|
43
|
+
return () => {
|
|
44
|
+
document.removeEventListener("focusin", pull);
|
|
45
|
+
container.removeEventListener("keydown", keydown);
|
|
46
|
+
document.body.style.overflow = overflow;
|
|
47
|
+
if (previous?.isConnected)
|
|
48
|
+
previous.focus({ preventScroll: true });
|
|
49
|
+
};
|
|
50
|
+
}, [panel]);
|
|
51
|
+
}
|
|
52
|
+
function cycle(container, event) {
|
|
53
|
+
const items = focusables(container);
|
|
54
|
+
const first = items[0];
|
|
55
|
+
const last = items[items.length - 1];
|
|
56
|
+
if (first === undefined || last === undefined) {
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const active = document.activeElement;
|
|
61
|
+
if (event.shiftKey && (active === first || active === container)) {
|
|
62
|
+
event.preventDefault();
|
|
63
|
+
last.focus();
|
|
64
|
+
}
|
|
65
|
+
else if (!event.shiftKey && active === last) {
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
first.focus();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type IconProps = Readonly<{
|
|
2
|
+
size?: number;
|
|
3
|
+
filled?: boolean;
|
|
4
|
+
chevron?: boolean;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const ArrowBigUp: (props: IconProps) => import("react").JSX.Element;
|
|
7
|
+
export declare const ArrowBigDown: (props: IconProps) => import("react").JSX.Element;
|
|
8
|
+
export declare const MessageCircle: (props: IconProps) => import("react").JSX.Element;
|
|
9
|
+
export declare const Ellipsis: (props: IconProps) => import("react").JSX.Element;
|
|
10
|
+
export declare const Star: (props: IconProps) => import("react").JSX.Element;
|
|
11
|
+
export declare const Megaphone: (props: IconProps) => import("react").JSX.Element;
|
|
12
|
+
export declare const Reply: (props: IconProps) => import("react").JSX.Element;
|
|
13
|
+
export declare const Close: (props: IconProps) => import("react").JSX.Element;
|
|
14
|
+
export declare const ArrowUpRight: (props: IconProps) => import("react").JSX.Element;
|
|
15
|
+
export declare const ChevronDown: (props: IconProps) => import("react").JSX.Element;
|
|
16
|
+
export declare const ArrowRight: (props: IconProps) => import("react").JSX.Element;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArrowRight = exports.ChevronDown = exports.ArrowUpRight = exports.Close = exports.Reply = exports.Megaphone = exports.Star = exports.Ellipsis = exports.MessageCircle = exports.ArrowBigDown = exports.ArrowBigUp = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
function Svg({ size = 18, filled = false, chevron = false, children }) {
|
|
6
|
+
return ((0, jsx_runtime_1.jsx)("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: filled ? "currentColor" : "none", stroke: "currentColor", strokeWidth: 1.75, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", focusable: "false", "data-tsc-chevron": chevron ? "" : undefined, style: { flex: "none" }, children: children }));
|
|
7
|
+
}
|
|
8
|
+
const ArrowBigUp = (props) => ((0, jsx_runtime_1.jsx)(Svg, { ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M9 13a1 1 0 0 0-1-1H5.061a1 1 0 0 1-.75-1.811l6.836-6.835a1.207 1.207 0 0 1 1.707 0l6.835 6.835a1 1 0 0 1-.75 1.811H16a1 1 0 0 0-1 1v6a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1z" }) }));
|
|
9
|
+
exports.ArrowBigUp = ArrowBigUp;
|
|
10
|
+
const ArrowBigDown = (props) => ((0, jsx_runtime_1.jsx)(Svg, { ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M15 11a1 1 0 0 0 1 1h2.939a1 1 0 0 1 .75 1.811l-6.835 6.836a1.207 1.207 0 0 1-1.707 0L4.31 13.81a1 1 0 0 1 .75-1.811H8a1 1 0 0 0 1-1V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1z" }) }));
|
|
11
|
+
exports.ArrowBigDown = ArrowBigDown;
|
|
12
|
+
const MessageCircle = (props) => ((0, jsx_runtime_1.jsx)(Svg, { ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092a10 10 0 1 0-4.777-4.719" }) }));
|
|
13
|
+
exports.MessageCircle = MessageCircle;
|
|
14
|
+
const Ellipsis = (props) => ((0, jsx_runtime_1.jsxs)(Svg, { ...props, children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "1" }), (0, jsx_runtime_1.jsx)("circle", { cx: "19", cy: "12", r: "1" }), (0, jsx_runtime_1.jsx)("circle", { cx: "5", cy: "12", r: "1" })] }));
|
|
15
|
+
exports.Ellipsis = Ellipsis;
|
|
16
|
+
const Star = (props) => ((0, jsx_runtime_1.jsx)(Svg, { ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.12 2.12 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.12 2.12 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.12 2.12 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.12 2.12 0 0 0 1.597-1.16z" }) }));
|
|
17
|
+
exports.Star = Star;
|
|
18
|
+
const Megaphone = (props) => ((0, jsx_runtime_1.jsxs)(Svg, { ...props, children: [(0, jsx_runtime_1.jsx)("path", { d: "M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z" }), (0, jsx_runtime_1.jsx)("path", { d: "M6 14a12 12 0 0 0 2.4 7.2a2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14M8 6v8" })] }));
|
|
19
|
+
exports.Megaphone = Megaphone;
|
|
20
|
+
const Reply = (props) => ((0, jsx_runtime_1.jsxs)(Svg, { ...props, children: [(0, jsx_runtime_1.jsx)("path", { d: "M20 18v-2a4 4 0 0 0-4-4H4" }), (0, jsx_runtime_1.jsx)("path", { d: "m9 17l-5-5l5-5" })] }));
|
|
21
|
+
exports.Reply = Reply;
|
|
22
|
+
const Close = (props) => ((0, jsx_runtime_1.jsx)(Svg, { ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M18 6L6 18M6 6l12 12" }) }));
|
|
23
|
+
exports.Close = Close;
|
|
24
|
+
const ArrowUpRight = (props) => ((0, jsx_runtime_1.jsx)(Svg, { ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M7 7h10v10M7 17L17 7" }) }));
|
|
25
|
+
exports.ArrowUpRight = ArrowUpRight;
|
|
26
|
+
const ChevronDown = (props) => ((0, jsx_runtime_1.jsx)(Svg, { ...props, chevron: true, children: (0, jsx_runtime_1.jsx)("path", { d: "m6 9l6 6l6-6" }) }));
|
|
27
|
+
exports.ChevronDown = ChevronDown;
|
|
28
|
+
const ArrowRight = (props) => ((0, jsx_runtime_1.jsx)(Svg, { ...props, children: (0, jsx_runtime_1.jsx)("path", { d: "M5 12h14m-7-7l7 7l-7 7" }) }));
|
|
29
|
+
exports.ArrowRight = ArrowRight;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Config, Release } from "../core/types";
|
|
2
|
+
import type { TextKey } from "./texts";
|
|
3
|
+
export type RatingTarget = Readonly<{
|
|
4
|
+
url: string;
|
|
5
|
+
label: Extract<TextKey, "rateWeb" | "rateAppStore" | "ratePlay">;
|
|
6
|
+
}>;
|
|
7
|
+
/** `reviewUrl ?? appStoreUrl ?? playStoreUrl`, preferring the App Store write-review page when the id is known. */
|
|
8
|
+
export declare function ratingTarget(config: Config | null): RatingTarget | null;
|
|
9
|
+
/** `always`, or `after_upvote` once this install upvoted the release. */
|
|
10
|
+
export declare function offersRating(config: Config | null, release: Release): boolean;
|
|
11
|
+
export declare function permalink(config: Config | null, release: Release): string | null;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ratingTarget = ratingTarget;
|
|
4
|
+
exports.offersRating = offersRating;
|
|
5
|
+
exports.permalink = permalink;
|
|
6
|
+
const rating_1 = require("../core/rating");
|
|
7
|
+
/** `reviewUrl ?? appStoreUrl ?? playStoreUrl`, preferring the App Store write-review page when the id is known. */
|
|
8
|
+
function ratingTarget(config) {
|
|
9
|
+
if (config === null || config.rating.mode === "off")
|
|
10
|
+
return null;
|
|
11
|
+
const { rating, app } = config;
|
|
12
|
+
if (rating.reviewUrl)
|
|
13
|
+
return { url: rating.reviewUrl, label: "rateWeb" };
|
|
14
|
+
if (rating.iosAppStoreId)
|
|
15
|
+
return { url: (0, rating_1.iosReviewUrl)(rating.iosAppStoreId), label: "rateAppStore" };
|
|
16
|
+
if (app.appStoreUrl)
|
|
17
|
+
return { url: app.appStoreUrl, label: "rateAppStore" };
|
|
18
|
+
if (rating.androidPackage)
|
|
19
|
+
return { url: (0, rating_1.playStoreUrl)(rating.androidPackage), label: "ratePlay" };
|
|
20
|
+
if (app.playStoreUrl)
|
|
21
|
+
return { url: app.playStoreUrl, label: "ratePlay" };
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
/** `always`, or `after_upvote` once this install upvoted the release. */
|
|
25
|
+
function offersRating(config, release) {
|
|
26
|
+
if (config === null || ratingTarget(config) === null)
|
|
27
|
+
return false;
|
|
28
|
+
switch (config.rating.mode) {
|
|
29
|
+
case "always":
|
|
30
|
+
return true;
|
|
31
|
+
case "after_upvote":
|
|
32
|
+
return release.myVote === 1;
|
|
33
|
+
case "off":
|
|
34
|
+
return false;
|
|
35
|
+
default: {
|
|
36
|
+
const exhaustive = config.rating.mode;
|
|
37
|
+
return exhaustive;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function permalink(config, release) {
|
|
42
|
+
if (config === null)
|
|
43
|
+
return null;
|
|
44
|
+
const url = config.page.enabled ? config.page.url : null;
|
|
45
|
+
if (url === null || !url.startsWith("https://"))
|
|
46
|
+
return null;
|
|
47
|
+
return `${url.replace(/\/+$/, "")}/${encodeURIComponent(release.ref)}`;
|
|
48
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ChangesClient } from "../core/client";
|
|
2
|
+
import type { ChangesStorage } from "../core/storage";
|
|
3
|
+
import type { ChangesState, Config, ErrorCode, Release } from "../core/types";
|
|
4
|
+
import type { VoteMap } from "./local-store";
|
|
5
|
+
import type { ChangesStatus } from "./model";
|
|
6
|
+
import type { Locale, LocalePreference } from "./texts";
|
|
7
|
+
export type LoadInput = Readonly<{
|
|
8
|
+
client: ChangesClient;
|
|
9
|
+
storage: ChangesStorage;
|
|
10
|
+
key: string;
|
|
11
|
+
appVersion: string | null;
|
|
12
|
+
showOnFirstLaunch: boolean;
|
|
13
|
+
forceShow: boolean;
|
|
14
|
+
now: Date;
|
|
15
|
+
locale: LocalePreference;
|
|
16
|
+
languages: readonly string[];
|
|
17
|
+
}>;
|
|
18
|
+
export type Loaded = Readonly<{
|
|
19
|
+
status: Exclude<ChangesStatus, "loading">;
|
|
20
|
+
error: ErrorCode | null;
|
|
21
|
+
stale: boolean;
|
|
22
|
+
config: Config | null;
|
|
23
|
+
locale: Locale;
|
|
24
|
+
releases: readonly Release[];
|
|
25
|
+
state: ChangesState | null;
|
|
26
|
+
votes: VoteMap;
|
|
27
|
+
guidelinesAccepted: boolean;
|
|
28
|
+
pending: Release | null;
|
|
29
|
+
}>;
|
|
30
|
+
/**
|
|
31
|
+
* Loads config and releases, applies the show-once decision and records a first launch. A config
|
|
32
|
+
* that fails only because the device is offline falls back to read-only defaults so cached notes
|
|
33
|
+
* still render; any other config error (unknown key, origin not allowed) stops the SDK.
|
|
34
|
+
*/
|
|
35
|
+
export declare function loadChanges(input: LoadInput): Promise<Loaded>;
|
package/dist/web/load.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadChanges = loadChanges;
|
|
4
|
+
const cache_1 = require("../core/cache");
|
|
5
|
+
const decide_1 = require("../core/decide");
|
|
6
|
+
const storage_1 = require("../core/storage");
|
|
7
|
+
const local_store_1 = require("./local-store");
|
|
8
|
+
const texts_1 = require("./texts");
|
|
9
|
+
/**
|
|
10
|
+
* Loads config and releases, applies the show-once decision and records a first launch. A config
|
|
11
|
+
* that fails only because the device is offline falls back to read-only defaults so cached notes
|
|
12
|
+
* still render; any other config error (unknown key, origin not allowed) stops the SDK.
|
|
13
|
+
*/
|
|
14
|
+
async function loadChanges(input) {
|
|
15
|
+
const { client, storage, key } = input;
|
|
16
|
+
const [configResult, releasesResult, storedState, votes, guidelinesAccepted] = await Promise.all([
|
|
17
|
+
client.getConfig(),
|
|
18
|
+
(0, cache_1.loadReleasesWithCache)({ client, storage, key, now: input.now.getTime() }),
|
|
19
|
+
(0, storage_1.readState)(storage, key),
|
|
20
|
+
(0, local_store_1.readVotes)(storage, key),
|
|
21
|
+
(0, local_store_1.readGuidelines)(storage, key),
|
|
22
|
+
]);
|
|
23
|
+
const config = configResult.ok ? configResult.body : null;
|
|
24
|
+
const base = {
|
|
25
|
+
stale: false,
|
|
26
|
+
config,
|
|
27
|
+
locale: (0, texts_1.resolveLocale)(input.locale, config, input.languages),
|
|
28
|
+
releases: [],
|
|
29
|
+
state: storedState,
|
|
30
|
+
votes,
|
|
31
|
+
guidelinesAccepted,
|
|
32
|
+
pending: null,
|
|
33
|
+
};
|
|
34
|
+
if (config !== null && !config.enabled)
|
|
35
|
+
return { ...base, status: "disabled", error: null };
|
|
36
|
+
if (!configResult.ok && configResult.code !== "NETWORK_ERROR") {
|
|
37
|
+
return { ...base, status: "error", error: configResult.code };
|
|
38
|
+
}
|
|
39
|
+
if (!releasesResult.ok)
|
|
40
|
+
return { ...base, status: "error", error: releasesResult.code };
|
|
41
|
+
const releases = releasesResult.body.items;
|
|
42
|
+
const decision = (0, decide_1.decideWhatsNew)({
|
|
43
|
+
releases,
|
|
44
|
+
state: storedState,
|
|
45
|
+
appVersion: input.appVersion,
|
|
46
|
+
showOnFirstLaunch: input.showOnFirstLaunch,
|
|
47
|
+
forceShow: input.forceShow,
|
|
48
|
+
now: input.now.toISOString(),
|
|
49
|
+
});
|
|
50
|
+
if (decision.nextState !== storedState)
|
|
51
|
+
await (0, storage_1.writeState)(storage, key, decision.nextState);
|
|
52
|
+
return {
|
|
53
|
+
...base,
|
|
54
|
+
status: "ready",
|
|
55
|
+
error: null,
|
|
56
|
+
stale: releasesResult.stale === true,
|
|
57
|
+
releases,
|
|
58
|
+
state: decision.nextState,
|
|
59
|
+
pending: decision.release,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ChangesStorage } from "../core/storage";
|
|
2
|
+
export type VoteMap = Readonly<Record<string, 1 | -1>>;
|
|
3
|
+
export declare function readVotes(storage: ChangesStorage, key: string): Promise<VoteMap>;
|
|
4
|
+
export declare function withVote(votes: VoteMap, releaseId: string, value: -1 | 0 | 1): VoteMap;
|
|
5
|
+
export declare function writeVotes(storage: ChangesStorage, key: string, votes: VoteMap): Promise<void>;
|
|
6
|
+
export declare function readGuidelines(storage: ChangesStorage, key: string): Promise<boolean>;
|
|
7
|
+
export declare function writeGuidelines(storage: ChangesStorage, key: string, accepted: boolean): Promise<void>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readVotes = readVotes;
|
|
4
|
+
exports.withVote = withVote;
|
|
5
|
+
exports.writeVotes = writeVotes;
|
|
6
|
+
exports.readGuidelines = readGuidelines;
|
|
7
|
+
exports.writeGuidelines = writeGuidelines;
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
const storage_1 = require("../core/storage");
|
|
10
|
+
const votesSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.union([zod_1.z.literal(1), zod_1.z.literal(-1)]));
|
|
11
|
+
async function readVotes(storage, key) {
|
|
12
|
+
const parsed = votesSchema.safeParse((0, storage_1.parseStoredJson)(await storage.getItem((0, storage_1.storageKeys)(key).votes)));
|
|
13
|
+
return parsed.success ? parsed.data : {};
|
|
14
|
+
}
|
|
15
|
+
function withVote(votes, releaseId, value) {
|
|
16
|
+
const { [releaseId]: _previous, ...rest } = votes;
|
|
17
|
+
return value === 0 ? rest : { ...rest, [releaseId]: value };
|
|
18
|
+
}
|
|
19
|
+
async function writeVotes(storage, key, votes) {
|
|
20
|
+
await storage.setItem((0, storage_1.storageKeys)(key).votes, JSON.stringify(votes));
|
|
21
|
+
}
|
|
22
|
+
async function readGuidelines(storage, key) {
|
|
23
|
+
return (await storage.getItem((0, storage_1.storageKeys)(key).guidelines)) === "1";
|
|
24
|
+
}
|
|
25
|
+
async function writeGuidelines(storage, key, accepted) {
|
|
26
|
+
await storage.setItem((0, storage_1.storageKeys)(key).guidelines, accepted ? "1" : "0");
|
|
27
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ChangesClient } from "../core/client";
|
|
2
|
+
import type { ChangesStorage } from "../core/storage";
|
|
3
|
+
import type { ChangesState, Config, ErrorCode, Release } from "../core/types";
|
|
4
|
+
import type { VoteMap } from "./local-store";
|
|
5
|
+
import type { Locale } from "./texts";
|
|
6
|
+
export type ChangesStatus = "loading" | "ready" | "disabled" | "error";
|
|
7
|
+
export type Runtime = Readonly<{
|
|
8
|
+
client: ChangesClient;
|
|
9
|
+
storage: ChangesStorage;
|
|
10
|
+
key: string;
|
|
11
|
+
installId: string;
|
|
12
|
+
appVersion: string | null;
|
|
13
|
+
}>;
|
|
14
|
+
export type ReleaseOverride = Readonly<Partial<Pick<Release, "upvotes" | "downvotes" | "myVote" | "commentCount">>>;
|
|
15
|
+
export type Model = Readonly<{
|
|
16
|
+
status: ChangesStatus;
|
|
17
|
+
error: ErrorCode | null;
|
|
18
|
+
stale: boolean;
|
|
19
|
+
config: Config | null;
|
|
20
|
+
locale: Locale;
|
|
21
|
+
releases: readonly Release[];
|
|
22
|
+
state: ChangesState | null;
|
|
23
|
+
votes: VoteMap;
|
|
24
|
+
overrides: Readonly<Record<string, ReleaseOverride>>;
|
|
25
|
+
guidelinesAccepted: boolean;
|
|
26
|
+
banned: boolean;
|
|
27
|
+
pending: Release | null;
|
|
28
|
+
changelogOpen: boolean;
|
|
29
|
+
runtime: Runtime | null;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const initialModel: (locale: Locale) => Model;
|
|
32
|
+
/** The release as this install sees it: local vote first, then optimistic or server-confirmed counts. */
|
|
33
|
+
export declare function releaseView(model: Model, release: Release): Release;
|
|
34
|
+
export declare function withOverride(model: Model, releaseId: string, override: ReleaseOverride): Model;
|
|
35
|
+
/** Optimistic counts for switching this install's vote from `from` to `to`. */
|
|
36
|
+
export declare function optimisticVote(release: Release, to: -1 | 0 | 1): ReleaseOverride;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initialModel = void 0;
|
|
4
|
+
exports.releaseView = releaseView;
|
|
5
|
+
exports.withOverride = withOverride;
|
|
6
|
+
exports.optimisticVote = optimisticVote;
|
|
7
|
+
const initialModel = (locale) => ({
|
|
8
|
+
status: "loading",
|
|
9
|
+
error: null,
|
|
10
|
+
stale: false,
|
|
11
|
+
config: null,
|
|
12
|
+
locale,
|
|
13
|
+
releases: [],
|
|
14
|
+
state: null,
|
|
15
|
+
votes: {},
|
|
16
|
+
overrides: {},
|
|
17
|
+
guidelinesAccepted: false,
|
|
18
|
+
banned: false,
|
|
19
|
+
pending: null,
|
|
20
|
+
changelogOpen: false,
|
|
21
|
+
runtime: null,
|
|
22
|
+
});
|
|
23
|
+
exports.initialModel = initialModel;
|
|
24
|
+
/** The release as this install sees it: local vote first, then optimistic or server-confirmed counts. */
|
|
25
|
+
function releaseView(model, release) {
|
|
26
|
+
return { ...release, myVote: model.votes[release.id] ?? release.myVote, ...model.overrides[release.id] };
|
|
27
|
+
}
|
|
28
|
+
function withOverride(model, releaseId, override) {
|
|
29
|
+
return { ...model, overrides: { ...model.overrides, [releaseId]: { ...model.overrides[releaseId], ...override } } };
|
|
30
|
+
}
|
|
31
|
+
/** Optimistic counts for switching this install's vote from `from` to `to`. */
|
|
32
|
+
function optimisticVote(release, to) {
|
|
33
|
+
const from = release.myVote;
|
|
34
|
+
const up = release.upvotes - (from === 1 ? 1 : 0) + (to === 1 ? 1 : 0);
|
|
35
|
+
const down = release.downvotes - (from === -1 ? 1 : 0) + (to === -1 ? 1 : 0);
|
|
36
|
+
return { upvotes: Math.max(0, up), downvotes: Math.max(0, down), myVote: to };
|
|
37
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ChangesStorage } from "../core/storage";
|
|
2
|
+
/**
|
|
3
|
+
* `localStorage`-backed storage that is safe to construct during SSR and falls back to memory when
|
|
4
|
+
* the browser refuses access (private mode quota, sandboxed iframe). Nothing touches `window` until
|
|
5
|
+
* the first read or write.
|
|
6
|
+
*/
|
|
7
|
+
export declare function localStorageAdapter(): ChangesStorage;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.localStorageAdapter = localStorageAdapter;
|
|
4
|
+
function browserStorage() {
|
|
5
|
+
if (typeof window === "undefined")
|
|
6
|
+
return null;
|
|
7
|
+
try {
|
|
8
|
+
return window.localStorage;
|
|
9
|
+
}
|
|
10
|
+
catch (error) {
|
|
11
|
+
// Sandboxed iframes and disabled cookies throw SecurityError on property access.
|
|
12
|
+
if (error instanceof DOMException)
|
|
13
|
+
return null;
|
|
14
|
+
throw error;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* `localStorage`-backed storage that is safe to construct during SSR and falls back to memory when
|
|
19
|
+
* the browser refuses access (private mode quota, sandboxed iframe). Nothing touches `window` until
|
|
20
|
+
* the first read or write.
|
|
21
|
+
*/
|
|
22
|
+
function localStorageAdapter() {
|
|
23
|
+
const memory = new Map();
|
|
24
|
+
return {
|
|
25
|
+
getItem(key) {
|
|
26
|
+
const storage = browserStorage();
|
|
27
|
+
if (storage === null)
|
|
28
|
+
return memory.get(key) ?? null;
|
|
29
|
+
try {
|
|
30
|
+
return storage.getItem(key) ?? memory.get(key) ?? null;
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
if (error instanceof DOMException)
|
|
34
|
+
return memory.get(key) ?? null;
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
setItem(key, value) {
|
|
39
|
+
memory.set(key, value);
|
|
40
|
+
const storage = browserStorage();
|
|
41
|
+
if (storage === null)
|
|
42
|
+
return;
|
|
43
|
+
try {
|
|
44
|
+
storage.setItem(key, value);
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
// QuotaExceededError keeps the in-memory copy for this page view.
|
|
48
|
+
if (!(error instanceof DOMException))
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|