@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.
@@ -0,0 +1,20 @@
1
+ /**
2
+ * 把一个元素滚进它所在的那个滚动面板里,只滚这一个面板(owner 10-28 [M0]「整页被滚走」)。不依赖 React,
3
+ * 不用 React 的插件从子路径 `@kanyun-ai-infra/band-plugin-react/scroll` 引。
4
+ *
5
+ * 不用 `scrollIntoView`:它会把目标的所有可滚祖先都滚一遍,包括整页和外层页面;文档只要比视口高一点,整页就被
6
+ * 带起来,顶栏被切、底下露出空白。找不到可滚的面板就不动:外壳的整页不滚。全仓门禁见 `scripts/check-scroll-and-sr.mjs`。
7
+ *
8
+ * - `nearest`(缺省):已经整个看得见就不动,否则滚到贴近的那一边。
9
+ * - `start`:顶边对齐。
10
+ * - 目标没有盒子(`display: none`,比如藏在没切到的标签页里):不动,和 `scrollIntoView` 一样。
11
+ * - `page`:元素在预览页自己的文档里(网页查看器的壳页):由内往外滚每一层可滚祖先,最后滚这一页本身;
12
+ * 不越过它所在的 iframe。
13
+ */
14
+ declare function scrollIntoPanel(el: Element, { block, behavior, page, }?: {
15
+ block?: "nearest" | "start";
16
+ behavior?: ScrollBehavior;
17
+ page?: boolean;
18
+ }): void;
19
+
20
+ export { scrollIntoPanel };
package/dist/scroll.js ADDED
@@ -0,0 +1,6 @@
1
+ import {
2
+ scrollIntoPanel
3
+ } from "./chunk-VKASR4EL.js";
4
+ export {
5
+ scrollIntoPanel
6
+ };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 人停下了一个回合的唯一说法:「停下了回合 #3」,给了 `who` 前面带名字(「kld 停下了回合 #3」)。线程里那一行、回合栏、
3
+ * 第一版之前的主区与阶段回看、对话框上方都读它,别在调用点再写一遍。不依赖 React:端到端用例也从子路径
4
+ * `@kanyun-ai-infra/band-plugin-react/stopped-turn` 引,断言跟着说法走,不抄一遍字面文案。
5
+ */
6
+ declare function stoppedTurnText(number: number, who?: string): string;
7
+
8
+ export { stoppedTurnText };
@@ -0,0 +1,6 @@
1
+ import {
2
+ stoppedTurnText
3
+ } from "./chunk-47BPPTXZ.js";
4
+ export {
5
+ stoppedTurnText
6
+ };
@@ -0,0 +1,81 @@
1
+ /** 弹窗与结果里点到的一个项目:旧宿主可以不给名字,界面用序号顶上,不露 projectId。 */
2
+ interface UpgradeProjectRef {
3
+ name?: string | undefined;
4
+ }
5
+ declare const UPGRADE_TEXT: {
6
+ /** 落后但兼容:只提示。 */
7
+ readonly outdated: "项目有新版本可用。升级后页面会自动刷新。";
8
+ /** 不兼容:常显,写被挡。 */
9
+ readonly incompatible: (roles: readonly string[]) => string;
10
+ /** 部署回滚后,钉住的比本部署新。 */
11
+ readonly rolledBack: "本部署已回退,升级会换回本部署的版本";
12
+ readonly askAdmin: "请项目管理员升级";
13
+ readonly button: "升级";
14
+ readonly busy: "正在升级,完成后页面会自动刷新";
15
+ /** 按钮上的短词(`busy` 是整句,给横幅 / 读屏)。 */
16
+ readonly busyShort: "正在升级…";
17
+ readonly upgraded: "升级成功,正在刷新页面…";
18
+ /** 别人升级了、打开着的页面先落盘草稿再刷新。 */
19
+ readonly refreshingOthers: "这个项目刚升级了,正在保存你的草稿并刷新页面…";
20
+ /** 已登记的草稿或未保存内容阻止刷新时显示;旧项目首次升级前的旧组件可能尚未登记。`own` 是自己点的升级。 */
21
+ readonly refreshStuck: (own: boolean) => string;
22
+ readonly alreadyLatest: "已经是最新";
23
+ /** 实例钉点的阶段结构与当前版本不同,留在原版本;`n` 是几个实例。 */
24
+ readonly keptInstances: (n: number) => string;
25
+ /** 升级检查没过:哪个钉点、什么原因。 */
26
+ readonly checkFailed: (failures: readonly {
27
+ pin: string;
28
+ problems: readonly string[];
29
+ }[]) => string;
30
+ readonly noPermission: "没有升级的权限";
31
+ /** 工坊页。 */
32
+ readonly workshop: {
33
+ /** 落后的项目数:协作功能或本工坊自带的页面功能(工坊重新发布换了自己的插件)有新版本。 */
34
+ readonly outdatedProjects: (n: number) => string;
35
+ readonly incompatibleProjects: (n: number) => string;
36
+ readonly button: "更新本工坊全部项目";
37
+ readonly currentOutdated: "平台更新了协作功能,重新发布后,新项目才会用上";
38
+ /** 副本里自带的插件和原版某个共享版本内容一致:可以改成引用,之后跟着原版升级。只提示,不挡任何操作。 */
39
+ readonly referenceHint: {
40
+ readonly title: (n: number) => string;
41
+ /** `spec` 是该写进 `views.plugins` 的引用,如 `@teaching/wall@^1.0.0`。 */
42
+ readonly row: (name: string, version: string) => string;
43
+ readonly how: (specs: readonly string[]) => string;
44
+ };
45
+ /** 点按钮后的确认弹窗:改哪些项目、什么不变、哪些不动、能不能撤回,都说清楚。 */
46
+ readonly confirm: {
47
+ readonly title: "更新本工坊全部项目";
48
+ /** 会有变化的项目;名字都有时点名。 */
49
+ readonly willUpdate: (projects: readonly UpgradeProjectRef[]) => string;
50
+ readonly unchanged: "它们用的评论、批准、队列、版本切换和本工坊自带的页面功能会换成最新版;项目里的产物、意见和成员都不变。";
51
+ readonly checks: "升级后页面会自动刷新,聊天框草稿先保存。已升级到含未保存内容保护版本的项目,写着没法保存的内容时页面不会刷新,会提示先复制或提交,再点「刷新」。旧项目首次升级到该版本前,请先复制或提交评论、意见浮层和阶段参数表单里的内容。";
52
+ readonly archived: (n: number) => string;
53
+ /** 工坊里已经是最新、这次不会有变化的那些:写出来,免得「将更新 3 个」和这个工坊的项目数对不上。 */
54
+ readonly alreadyLatest: (n: number) => string;
55
+ readonly noUndo: "更新后不能撤回。";
56
+ readonly submit: "更新";
57
+ readonly busy: "正在更新…";
58
+ };
59
+ /** 结果四类,逐类一句;这一类为零时界面不写。 */
60
+ readonly result: {
61
+ /** `n` 是这一类有几个,`projects` 是有名字的那些(条数对不上时不点名)。 */
62
+ readonly upgraded: (n: number, projects: readonly UpgradeProjectRef[]) => string;
63
+ readonly current: (n: number) => string;
64
+ readonly archived: (n: number) => string;
65
+ /** 项目钉点换了,但有流程实例的阶段结构与当前版本不同、留在原版本;`n` 是实例数。 */
66
+ readonly keptInstances: (n: number) => string;
67
+ /** 没更新成的项目逐个点名带原因:检查没过的是哪些问题。 */
68
+ readonly failed: (projects: readonly {
69
+ name?: string | undefined;
70
+ problems: readonly string[];
71
+ }[]) => string;
72
+ };
73
+ };
74
+ };
75
+ /**
76
+ * 发起升级被拒的话:403 是没有升级的权限(服务端判,界面不另判);检查没过(`UPGRADE_CHECK_FAILED`)写清哪个钉点、
77
+ * 什么原因;别的照 `failedBecause`。
78
+ */
79
+ declare function upgradeErrorText(e: unknown): string;
80
+
81
+ export { UPGRADE_TEXT, type UpgradeProjectRef, upgradeErrorText };
@@ -0,0 +1,9 @@
1
+ import {
2
+ UPGRADE_TEXT,
3
+ upgradeErrorText
4
+ } from "./chunk-X32B5VUS.js";
5
+ import "./chunk-6VMUZ4PQ.js";
6
+ export {
7
+ UPGRADE_TEXT,
8
+ upgradeErrorText
9
+ };
package/package.json CHANGED
@@ -1,6 +1,66 @@
1
1
  {
2
2
  "name": "@kanyun-ai-infra/band-plugin-react",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.2",
4
+ "description": "用 React 写 Band 插件的小工具:挂载、hooks、PromptInput 等共用组件",
5
+ "license": "UNLICENSED",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js"
11
+ },
12
+ "./components": {
13
+ "types": "./dist/components.d.ts",
14
+ "import": "./dist/components.js"
15
+ },
16
+ "./image-view": {
17
+ "types": "./dist/image-view.d.ts",
18
+ "import": "./dist/image-view.js"
19
+ },
20
+ "./scroll": {
21
+ "types": "./dist/scroll.d.ts",
22
+ "import": "./dist/scroll.js"
23
+ },
24
+ "./errors": {
25
+ "types": "./dist/errors.d.ts",
26
+ "import": "./dist/errors.js"
27
+ },
28
+ "./first-delivery": {
29
+ "types": "./dist/first-delivery.d.ts",
30
+ "import": "./dist/first-delivery.js"
31
+ },
32
+ "./stopped-turn": {
33
+ "types": "./dist/stopped-turn.d.ts",
34
+ "import": "./dist/stopped-turn.js"
35
+ },
36
+ "./upgrade-text": {
37
+ "types": "./dist/upgrade-text.d.ts",
38
+ "import": "./dist/upgrade-text.js"
39
+ }
40
+ },
41
+ "types": "./dist/index.d.ts",
42
+ "files": [
43
+ "dist"
44
+ ],
45
+ "dependencies": {
46
+ "@kanyun-ai-infra/band-contracts": "^0.1.2",
47
+ "@kanyun-ai-infra/band-plugin-sdk": "^1.222.0",
48
+ "mdast-util-from-markdown": "^2.1.0",
49
+ "mdast-util-gfm": "^3.1.0",
50
+ "mdast-util-to-string": "^4.0.0",
51
+ "micromark-extension-gfm": "^3.0.0"
52
+ },
53
+ "peerDependencies": {
54
+ "react": "^18.3.1",
55
+ "react-dom": "^18.3.1"
56
+ },
57
+ "publishConfig": {
58
+ "access": "public",
59
+ "registry": "https://registry.npmjs.org/"
60
+ },
61
+ "repository": {
62
+ "type": "git",
63
+ "url": "git+https://github.com/kanyun-ai-explore/band.git",
64
+ "directory": "packages/plugin-react"
65
+ }
66
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.