@kanyun-ai-infra/band-plugin-react 0.0.0-stage → 0.1.2
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/chunk-47BPPTXZ.js +8 -0
- package/dist/chunk-6VMUZ4PQ.js +26 -0
- package/dist/chunk-HX653UQN.js +729 -0
- package/dist/chunk-IJBJEU3H.js +56 -0
- package/dist/chunk-VKASR4EL.js +46 -0
- package/dist/chunk-X32B5VUS.js +107 -0
- package/dist/components.d.ts +313 -0
- package/dist/components.js +94 -0
- package/dist/errors.d.ts +28 -0
- package/dist/errors.js +18 -0
- package/dist/first-delivery.d.ts +52 -0
- package/dist/first-delivery.js +28 -0
- package/dist/image-view.d.ts +153 -0
- package/dist/image-view.js +788 -0
- package/dist/index.d.ts +1311 -0
- package/dist/index.js +5796 -0
- package/dist/scroll.d.ts +20 -0
- package/dist/scroll.js +6 -0
- package/dist/stopped-turn.d.ts +8 -0
- package/dist/stopped-turn.js +6 -0
- package/dist/upgrade-text.d.ts +81 -0
- package/dist/upgrade-text.js +9 -0
- package/package.json +64 -4
- package/README.md +0 -3
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 错误怎么写给人看。不依赖 React:宿主的数据层(apps/web)也从子路径 `@kanyun-ai-infra/band-plugin-react/errors` 引,
|
|
3
|
+
* 和插件用同一个出口、同一句话。
|
|
4
|
+
*/
|
|
5
|
+
declare function errorText(e: unknown): string;
|
|
6
|
+
/**
|
|
7
|
+
* 请求根本没到服务端(断网、DNS、被代理拦下):宿主抛的错误带这个 `code`,插件按它认,不看各家浏览器的报错原文。
|
|
8
|
+
* 全站对这类失败只有这一个出口、这一句话(card-1810 先合定下,card-1794 的「全站 fetch 失败」复用):
|
|
9
|
+
* 原因写 `NETWORK_LOST`,后面跟这一处能做的下一步,见 `failedBecause`。
|
|
10
|
+
*/
|
|
11
|
+
declare const NETWORK_LOST_CODE = "NETWORK";
|
|
12
|
+
declare const NETWORK_LOST = "\u7F51\u7EDC\u65AD\u4E86";
|
|
13
|
+
declare function isNetworkLost(e: unknown): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 写在「…没传上去:」「…没撤成:」后面的原因。网络断了写「网络断了,<下一步>」,下一步写这一处界面上真有的按钮名
|
|
16
|
+
* (附件旁有「重试」写「点重试」,队列行上只有「撤回」写「再点一次撤回」,没有按钮写「稍后再试」;pm 10-29),
|
|
17
|
+
* 其余照错误原文:宿主的话已经写清上限、配额还剩多少这类能照着做的事。
|
|
18
|
+
*/
|
|
19
|
+
declare function failedBecause(e: unknown, next: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* 服务端回了 403(没有权限):宿主抛的错误带服务端的错误码 `code` = `FORBIDDEN_CODE`,插件按它认。
|
|
22
|
+
* 读接口的 403 不是「没读出来」,重试也不会好:画「没有权限」说明(谁能看、去找谁),不放「重试」。
|
|
23
|
+
* 写接口的 403 照旧写原因(服务端的话已经说清为什么不让做)。
|
|
24
|
+
*/
|
|
25
|
+
declare const FORBIDDEN_CODE = "FORBIDDEN";
|
|
26
|
+
declare function isForbidden(e: unknown): boolean;
|
|
27
|
+
|
|
28
|
+
export { FORBIDDEN_CODE, NETWORK_LOST, NETWORK_LOST_CODE, errorText, failedBecause, isForbidden, isNetworkLost };
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FORBIDDEN_CODE,
|
|
3
|
+
NETWORK_LOST,
|
|
4
|
+
NETWORK_LOST_CODE,
|
|
5
|
+
errorText,
|
|
6
|
+
failedBecause,
|
|
7
|
+
isForbidden,
|
|
8
|
+
isNetworkLost
|
|
9
|
+
} from "./chunk-6VMUZ4PQ.js";
|
|
10
|
+
export {
|
|
11
|
+
FORBIDDEN_CODE,
|
|
12
|
+
NETWORK_LOST,
|
|
13
|
+
NETWORK_LOST_CODE,
|
|
14
|
+
errorText,
|
|
15
|
+
failedBecause,
|
|
16
|
+
isForbidden,
|
|
17
|
+
isNetworkLost
|
|
18
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { StageRunSummary } from '@kanyun-ai-infra/band-plugin-sdk';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 从没产出过产物的失败阶段「手动交第一版」的唯一说法与判定:按钮名、置灰原因、非 store 说明、还缺哪几项。
|
|
5
|
+
* 失败阶段上能看到的地方(回合栏等)、对话框、端到端用例都读这里,调用处不各自再判。不依赖 React:端到端用例从
|
|
6
|
+
* 子路径 `@kanyun-ai-infra/band-plugin-react/first-delivery` 引。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
declare const FIRST_DELIVERY_LABEL = "\u624B\u52A8\u4EA4\u7B2C\u4E00\u7248";
|
|
10
|
+
declare const FIRST_DELIVERY_SUBMIT = "\u63D0\u4EA4\u7B2C\u4E00\u7248";
|
|
11
|
+
type Failure = NonNullable<StageRunSummary["failure"]>;
|
|
12
|
+
type FirstDelivery = NonNullable<Failure["firstDelivery"]>;
|
|
13
|
+
/** 目标仓库或外部存放的产物不能在这里手动交,只留「重试」时失败原因下的那一行。 */
|
|
14
|
+
declare function firstDeliveryNotStoreNote(typeLabel: string): string;
|
|
15
|
+
type FirstDeliveryEntry =
|
|
16
|
+
/** 不画入口;`note` 有就写在失败原因下面。 */
|
|
17
|
+
{
|
|
18
|
+
draw: false;
|
|
19
|
+
note?: string;
|
|
20
|
+
}
|
|
21
|
+
/** 画入口;`disabled` 时置灰,`title` 写原因。 */
|
|
22
|
+
| {
|
|
23
|
+
draw: true;
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
title: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* 该不该画入口、为什么置灰。没有 `submit-change` 不画(不分原因);上游不满足画出来置灰,`title` 写原因;
|
|
29
|
+
* 非 store 不画,只给说明。不是从没产出过的失败阶段(没有 `firstDelivery`)不画。
|
|
30
|
+
*/
|
|
31
|
+
declare function firstDeliveryEntry(failure: Failure | undefined, can: {
|
|
32
|
+
submitChange: boolean;
|
|
33
|
+
}): FirstDeliveryEntry;
|
|
34
|
+
/** 清单里要交的一格:产物类型加扇出键(键由提交人定时没有 `key`)。 */
|
|
35
|
+
interface FirstDeliverySlot {
|
|
36
|
+
id: string;
|
|
37
|
+
type: string;
|
|
38
|
+
key?: string;
|
|
39
|
+
label: string;
|
|
40
|
+
}
|
|
41
|
+
declare function firstDeliverySlots(fd: FirstDelivery): FirstDeliverySlot[];
|
|
42
|
+
/** 还缺哪几项:`filled` 是已选了文件的格子 id。 */
|
|
43
|
+
declare function firstDeliveryMissing(slots: readonly FirstDeliverySlot[], filled: ReadonlySet<string>): FirstDeliverySlot[];
|
|
44
|
+
declare function firstDeliveryMissingText(missing: readonly FirstDeliverySlot[]): string;
|
|
45
|
+
declare const FIRST_DELIVERY_PICK = "\u9009\u62E9\u6587\u4EF6";
|
|
46
|
+
declare const FIRST_DELIVERY_REMOVE = "\u79FB\u9664";
|
|
47
|
+
/** 同一格再选同名文件:新的替换旧的,那一行这样标。 */
|
|
48
|
+
declare const FIRST_DELIVERY_REPLACED = "\u5DF2\u66FF\u6362";
|
|
49
|
+
declare const firstDeliveryFilesText: (n: number) => string;
|
|
50
|
+
declare function fileSizeText(bytes: number): string;
|
|
51
|
+
|
|
52
|
+
export { FIRST_DELIVERY_LABEL, FIRST_DELIVERY_PICK, FIRST_DELIVERY_REMOVE, FIRST_DELIVERY_REPLACED, FIRST_DELIVERY_SUBMIT, type FirstDelivery, type FirstDeliveryEntry, type FirstDeliverySlot, fileSizeText, firstDeliveryEntry, firstDeliveryFilesText, firstDeliveryMissing, firstDeliveryMissingText, firstDeliveryNotStoreNote, firstDeliverySlots };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FIRST_DELIVERY_LABEL,
|
|
3
|
+
FIRST_DELIVERY_PICK,
|
|
4
|
+
FIRST_DELIVERY_REMOVE,
|
|
5
|
+
FIRST_DELIVERY_REPLACED,
|
|
6
|
+
FIRST_DELIVERY_SUBMIT,
|
|
7
|
+
fileSizeText,
|
|
8
|
+
firstDeliveryEntry,
|
|
9
|
+
firstDeliveryFilesText,
|
|
10
|
+
firstDeliveryMissing,
|
|
11
|
+
firstDeliveryMissingText,
|
|
12
|
+
firstDeliveryNotStoreNote,
|
|
13
|
+
firstDeliverySlots
|
|
14
|
+
} from "./chunk-IJBJEU3H.js";
|
|
15
|
+
export {
|
|
16
|
+
FIRST_DELIVERY_LABEL,
|
|
17
|
+
FIRST_DELIVERY_PICK,
|
|
18
|
+
FIRST_DELIVERY_REMOVE,
|
|
19
|
+
FIRST_DELIVERY_REPLACED,
|
|
20
|
+
FIRST_DELIVERY_SUBMIT,
|
|
21
|
+
fileSizeText,
|
|
22
|
+
firstDeliveryEntry,
|
|
23
|
+
firstDeliveryFilesText,
|
|
24
|
+
firstDeliveryMissing,
|
|
25
|
+
firstDeliveryMissingText,
|
|
26
|
+
firstDeliveryNotStoreNote,
|
|
27
|
+
firstDeliverySlots
|
|
28
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { Anchor, ProjectCtx, AnchorPlace, ThreadView } from '@kanyun-ai-infra/band-plugin-sdk';
|
|
2
|
+
|
|
3
|
+
/** 图片、视频与分镜共用的几何纯函数。由 viewer-image/image 与 viewer-media/media 原样搬入;不依赖 React 或插件实例。 */
|
|
4
|
+
/** 0–1 相对内容本身的矩形;点是 `w = h = 0`。 */
|
|
5
|
+
interface UnitRect {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
w: number;
|
|
9
|
+
h: number;
|
|
10
|
+
}
|
|
11
|
+
/** 读 `rect`:坐标出界、缺字段的不认(schema 同 `region`,标注 §3.2)。 */
|
|
12
|
+
declare function unitRectFrom(value: unknown): UnitRect | null;
|
|
13
|
+
interface Box {
|
|
14
|
+
left: number;
|
|
15
|
+
top: number;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
}
|
|
19
|
+
/** 按下后移动不到这么多像素算点,不算拖(标注 §4.4,各查看器同一个阈值)。 */
|
|
20
|
+
declare const DRAG_PX = 4;
|
|
21
|
+
/**
|
|
22
|
+
* 屏幕上从 `a` 拖到 `b`(或只点了 `a`)换成相对内容的矩形:限制在内容内,取到千分之一。
|
|
23
|
+
* 内容还没显示出来(宽或高为 0)给 null。
|
|
24
|
+
*/
|
|
25
|
+
declare function unitRectOf(content: Box, a: {
|
|
26
|
+
x: number;
|
|
27
|
+
y: number;
|
|
28
|
+
}, b?: {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
}): UnitRect | null;
|
|
32
|
+
declare const MIN_SCALE = 1;
|
|
33
|
+
declare const MAX_SCALE = 8;
|
|
34
|
+
/** 缩到这个倍数以下自动回到适应窗口(产物交付 §3「看图手感」)。 */
|
|
35
|
+
declare const SNAP_SCALE = 1.05;
|
|
36
|
+
/** 缩放与平移:`scale` 相对「适应窗口」的大小,`x`、`y` 是图片中心偏离窗口中心的像素。 */
|
|
37
|
+
interface View {
|
|
38
|
+
scale: number;
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
}
|
|
42
|
+
declare const FIT: View;
|
|
43
|
+
/**
|
|
44
|
+
* 图片在窗口里适应时的大小:整张放得下,小图不放大(放大会糊,用户自己点放大)。
|
|
45
|
+
*/
|
|
46
|
+
declare function fitSize(natural: {
|
|
47
|
+
width: number;
|
|
48
|
+
height: number;
|
|
49
|
+
}, viewport: {
|
|
50
|
+
width: number;
|
|
51
|
+
height: number;
|
|
52
|
+
}): {
|
|
53
|
+
width: number;
|
|
54
|
+
height: number;
|
|
55
|
+
};
|
|
56
|
+
/** 平移不让图片边缘离开窗口:图比窗口小的那一维居中。`max` 默认 `MAX_SCALE`;超大图要放到实际像素时调用方给更大的。 */
|
|
57
|
+
declare function clampView(v: View, base: {
|
|
58
|
+
width: number;
|
|
59
|
+
height: number;
|
|
60
|
+
}, viewport: {
|
|
61
|
+
width: number;
|
|
62
|
+
height: number;
|
|
63
|
+
}, max?: number): View;
|
|
64
|
+
/**
|
|
65
|
+
* 以窗口里的一点(相对窗口中心的像素)为中心缩放:那一点下面的图片内容缩放前后不动。
|
|
66
|
+
* 往小缩到 `SNAP_SCALE` 以下回到适应窗口;往大不吸附,触控板双指每次只放大百分之几,吸附会让它永远放不大。
|
|
67
|
+
*/
|
|
68
|
+
declare function zoomAt(v: View, factor: number, at: {
|
|
69
|
+
x: number;
|
|
70
|
+
y: number;
|
|
71
|
+
}, base: {
|
|
72
|
+
width: number;
|
|
73
|
+
height: number;
|
|
74
|
+
}, viewport: {
|
|
75
|
+
width: number;
|
|
76
|
+
height: number;
|
|
77
|
+
}, max?: number): View;
|
|
78
|
+
|
|
79
|
+
declare const LIGHTBOX_MAX_SCALE: number;
|
|
80
|
+
declare const LIGHTBOX_DRAG_PX: number;
|
|
81
|
+
interface Size {
|
|
82
|
+
width: number;
|
|
83
|
+
height: number;
|
|
84
|
+
}
|
|
85
|
+
declare function lightboxSize(natural: Size, viewport: Size, narrow: boolean): Size;
|
|
86
|
+
/** 和原型一样,放大后的边缘允许离舞台边最多 40px;适应时不平移。 */
|
|
87
|
+
declare function lightboxClamp(view: View, base: Size, viewport: Size): View;
|
|
88
|
+
declare function lightboxZoom(view: View, factor: number, at: {
|
|
89
|
+
x: number;
|
|
90
|
+
y: number;
|
|
91
|
+
}, base: Size, viewport: Size): View;
|
|
92
|
+
declare function focusRegion(rect: UnitRect, base: Size, viewport: Size): View;
|
|
93
|
+
/** 首尾不环绕;切图是否真的发生由返回值判断,边界上不收用户的草稿。 */
|
|
94
|
+
declare function nextImage(index: number, delta: number, count: number): number;
|
|
95
|
+
|
|
96
|
+
/** 由分镜大图抽出的共用控制器;业务信息与锚点语义由查看器提供。 */
|
|
97
|
+
|
|
98
|
+
declare const LIGHTBOX_STYLE = "\n.bs-frame { position: relative; min-height: 0; height: 100%; display: grid; }\n.bs-frame .bs-lb [hidden] { display: none; }\n.bs-picture { display: block; position: relative; padding: 0; border: 0; background: none; border-radius: var(--r-sm); cursor: zoom-in; justify-self: start; }\n.bs-picture:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }\n.bs-wall .bs-picture { width: 100%; justify-self: stretch; }\n.bs-wall .bs-thumb { max-width: 100%; }\n.bs-magnify { position: absolute; right: 4px; bottom: 4px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px; background: rgba(0,0,0,.45); color: var(--media-ink); opacity: 0; }\n.bs-magnify svg { width: 14px; height: 14px; }\n.bs-picture:hover .bs-magnify, .bs-picture:focus-visible .bs-magnify { opacity: 1; }\n.bs-count { position: absolute; top: 4px; left: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: 600 10px var(--mono); }\n.bs-returned { outline: 2px solid var(--accent); outline-offset: -2px; }\n.bs-lb { position: absolute; inset: 0; display: grid; grid-template-rows: auto minmax(0,1fr) auto; background: var(--media); color: var(--media-ink); min-width: 0; }\n/* \u5168\u5C4F\u5C42\u7EA7\u7531\u771F\u5B9E\u6302\u8F7D\u70B9\u7BA1\u7406\uFF1B\u9501\u5B9A\u8BC4\u8BBA\u5BBF\u4E3B\u540C\u6863\u540E\u7F6E\uFF0C\u7EE7\u7EED\u753B\u5728\u5927\u56FE\u4E0A\u9762\u3002 */\n.bs-lb[data-full=\"true\"] { position: fixed; inset: 0; }\n.bs-lb-bar { display: flex; align-items: center; gap: 4px; padding: 8px 12px; min-width: 0; }\n.bs-lb-title { font-size: var(--fs-ui); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; margin: 0 6px; }\n.bs-lb-title span { color: rgba(255,255,255,.6); font: var(--fs-meta) var(--mono); margin-left: 6px; }\n.bs-lb-grow { flex: 1; }\n.bs-lb .bs-lb-button { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; display: inline-grid; place-items: center; background: transparent; color: rgba(255,255,255,.85); cursor: pointer; flex: none; }\n.bs-lb-button svg { width: 18px; height: 18px; }\n.bs-lb .bs-lb-button:hover, .bs-lb-back:hover, .bs-lb-zoom:hover { background: rgba(255,255,255,.12); }\n.bs-lb button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }\n.bs-lb button:disabled { opacity: .3; cursor: default; }\n.bs-lb-back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: rgba(255,255,255,.85); font: var(--fs-ui) var(--font); padding: 5px 8px 5px 4px; border-radius: var(--r); cursor: pointer; white-space: nowrap; }\n.bs-lb-back svg { width: 16px; height: 16px; }\n.bs-lb-zoom { font: 500 var(--fs-meta) var(--mono); color: rgba(255,255,255,.8); min-width: 48px; text-align: center; border: 0; background: transparent; cursor: pointer; border-radius: var(--r-sm); padding: 4px 2px; font-variant-numeric: tabular-nums; }\n.bs-lb-main { display: grid; grid-template-columns: minmax(0,1fr) 300px; min-height: 0; }\n.bs-lb-stage { position: relative; overflow: hidden; touch-action: none; user-select: none; min-height: 0; outline: none; }\n.bs-lb-stage[data-pan=\"true\"] { cursor: grab; }\n.bs-lb-stage[data-pan=\"true\"]:active { cursor: grabbing; }\n.bs-lb-stage[data-mark=\"true\"] { cursor: crosshair; }\n.bs-lb-image { position: absolute; border-radius: 2px; box-shadow: 0 8px 30px rgba(0,0,0,.5); max-width: none; object-fit: fill; pointer-events: none; }\n.bs-lb-regions { position: absolute; inset: 0; pointer-events: none; }\n.bs-lb-region { position: absolute; border: 2px solid var(--accent); background: color-mix(in srgb,var(--accent) 13%,transparent); border-radius: 2px; }\n.bs-lb-region.old { border-width: 1.5px; border-style: dashed; background: color-mix(in srgb,var(--accent) 8%,transparent); }\n.bs-lb-point { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb,var(--accent) 30%,transparent); translate: -50% -50%; }\n.bs-lb-nav { position: absolute; top: 50%; translate: 0 -50%; width: 40px; height: 40px; border-radius: 20px; border: 0; background: rgba(0,0,0,.45); color: var(--media-ink); display: grid; place-items: center; cursor: pointer; }\n.bs-lb-nav:hover { background: rgba(0,0,0,.7); }\n.bs-lb-nav svg { width: 20px; height: 20px; }\n.bs-lb-nav.prev { left: 12px; } .bs-lb-nav.next { right: 12px; }\n.bs-lb-side { background: var(--panel); color: var(--ink); overflow: auto; overscroll-behavior: contain; padding: 16px; display: grid; gap: 12px; align-content: start; border-left: 1px solid var(--rule); min-width: 0; }\n.bs-lb-side h3 { margin: 0; font-size: var(--fs-title); display: flex; align-items: baseline; gap: 8px; }\n.bs-lb-side h3 span { font: var(--fs-meta) var(--mono); color: var(--muted); font-weight: 400; }\n.bs-lb-side dl { margin: 0; display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 6px 8px; font-size: var(--fs-ui); }\n.bs-lb-side dt { color: var(--muted); font-size: var(--fs-meta); padding-top: 1px; }\n.bs-lb-side dd { margin: 0; overflow-wrap: anywhere; }\n.bs-lb-path { font-family: var(--mono); }\n.bs-lb-cm-head { font-size: var(--fs-meta); color: var(--muted); border-top: 1px solid var(--rule); padding-top: 10px; }\n.bs-lb-cm { border: 0; background: none; text-align: left; display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 8px; padding: 6px; border-radius: var(--r); cursor: pointer; font: var(--fs-ui) var(--font); color: var(--ink); }\n.bs-lb-cm:hover { background: var(--fill-2); }\n.bs-lb-excerpt { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }\n.bs-lb-hint { margin: 0; font-size: var(--fs-meta); color: var(--muted); }\n.bs-lb-stage .bs-lb-hint { padding: 40px; color: var(--media-ink); }\n.bs-lb-strip { display: flex; gap: 6px; padding: 8px 12px 10px; overflow-x: auto; overscroll-behavior: contain; justify-content: safe center; }\n.bs-lb-strip button { flex: none; width: 88px; aspect-ratio: 16/9; border-radius: 4px; border: 2px solid transparent; padding: 0; position: relative; overflow: hidden; cursor: pointer; background: none; opacity: .65; }\n.bs-lb-strip button[aria-current=\"true\"] { border-color: rgba(255,255,255,1); opacity: 1; }\n.bs-lb-strip button:hover { opacity: 1; }\n.bs-lb-strip img { width: 100%; height: 100%; object-fit: cover; }\n.bs-lb-strip span { position: absolute; left: 4px; bottom: 2px; font: 600 10px var(--mono); color: var(--media-ink); text-shadow: 0 1px 2px rgba(0,0,0,.6); }\n@media (max-width: 600px) {\n .bs-lb-main { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(0,1fr) minmax(0,1fr); }\n .bs-lb-side { border-left: 0; border-top: 1px solid var(--rule); }\n .bs-lb-strip { display: none; }\n .bs-lb-nav { width: 34px; height: 34px; }\n .bs-lb-title { margin: 0; }\n .bs-lb-back { font-size: 0; padding: 5px 4px; }\n}\n";
|
|
99
|
+
declare const ICONS: {
|
|
100
|
+
back: string;
|
|
101
|
+
next: string;
|
|
102
|
+
minus: string;
|
|
103
|
+
plus: string;
|
|
104
|
+
full: string;
|
|
105
|
+
comment: string;
|
|
106
|
+
};
|
|
107
|
+
declare function lightboxIcon(doc: Document, name: keyof typeof ICONS): SVGSVGElement;
|
|
108
|
+
interface ImageLightboxItem {
|
|
109
|
+
title: string;
|
|
110
|
+
path: string | null;
|
|
111
|
+
alt?: string;
|
|
112
|
+
}
|
|
113
|
+
interface ImageLightboxOptions {
|
|
114
|
+
items(): readonly ImageLightboxItem[];
|
|
115
|
+
imageUrl(path: string): Promise<string>;
|
|
116
|
+
canComment(): boolean;
|
|
117
|
+
region(anchor: Anchor): {
|
|
118
|
+
index: number;
|
|
119
|
+
path: string;
|
|
120
|
+
rect: UnitRect;
|
|
121
|
+
} | null;
|
|
122
|
+
makeAnchor?(index: number, rect: UnitRect): Anchor | null;
|
|
123
|
+
changed(anchor: Anchor, path: string): boolean;
|
|
124
|
+
renderSide(side: HTMLElement, index: number): void;
|
|
125
|
+
heading(index: number): {
|
|
126
|
+
title: string;
|
|
127
|
+
meta?: string;
|
|
128
|
+
};
|
|
129
|
+
labels: {
|
|
130
|
+
layer: string;
|
|
131
|
+
back: string;
|
|
132
|
+
stage: string;
|
|
133
|
+
side: string;
|
|
134
|
+
strip: string;
|
|
135
|
+
previous: string;
|
|
136
|
+
next: string;
|
|
137
|
+
item(index: number): string;
|
|
138
|
+
error: string;
|
|
139
|
+
};
|
|
140
|
+
notify(): void;
|
|
141
|
+
returned(index: number): void;
|
|
142
|
+
}
|
|
143
|
+
declare function createImageLightbox(ctx: ProjectCtx, root: HTMLElement, frame: HTMLElement, options: ImageLightboxOptions): {
|
|
144
|
+
open: (next: number) => void;
|
|
145
|
+
locate: (anchor: Anchor) => AnchorPlace;
|
|
146
|
+
reveal: (anchor: Anchor) => Promise<boolean>;
|
|
147
|
+
setThreads(next: ThreadView[]): void;
|
|
148
|
+
close: () => void;
|
|
149
|
+
refresh(): void;
|
|
150
|
+
dispose(): void;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export { DRAG_PX, FIT, type ImageLightboxItem, type ImageLightboxOptions, LIGHTBOX_DRAG_PX, LIGHTBOX_MAX_SCALE, LIGHTBOX_STYLE, MAX_SCALE, MIN_SCALE, SNAP_SCALE, type Size, type UnitRect, type View, clampView, createImageLightbox, fitSize, focusRegion, lightboxClamp, lightboxIcon, lightboxSize, lightboxZoom, nextImage, unitRectFrom, unitRectOf, zoomAt };
|