labull-framework 0.1.29 → 0.1.31

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.
@@ -1,5 +1,12 @@
1
1
  import { type Ref } from 'vue';
2
- export declare const API_BASE: string;
2
+ export declare let API_BASE: string;
3
+ /**
4
+ * 设置后端地址(**运行期**;跨源部署时由宿主调一次)。空串 = 相对本站(默认)。
5
+ *
6
+ * 结尾的 `/` 一律去掉(`'https://api.x/' + '/auth/me'` 会长出双斜杠,有的网关会 404)。
7
+ * ⚠️ 必须在**任何请求之前**调(`app.use(labull, { apiBase })` 会替你调,且排在挂别的插件之前)。
8
+ */
9
+ export declare function setApiBase(value: string | null | undefined): void;
3
10
  export declare const AUTH_DEADLINE_MS = 8000;
4
11
  export declare const CLEAR_SESSION_DEADLINE_MS = 1500;
5
12
  export interface AuthUser {
@@ -5,5 +5,5 @@ export { loadBlockRender, onBlockRenderRefresh, refreshBlockRender, type BlockRe
5
5
  export { BLOCK_BACKEND_FILE, BLOCK_ENTRY, buildPreview } from './magic-block-preview';
6
6
  export { CLIENT_SOURCE, installBridge, type BridgeDeps } from './magic-block-bridge';
7
7
  export { BLOCK_MANIFEST, MANIFEST_KEYS, MANIFEST_REQUIRED, NAME_MAX, checkSelection, parseManifest, validFileName, validName, validateBlock, type BlockValidation, type Manifest, type ManifestKey, type SelectionCheck, } from './magic-block-manifest';
8
- export { API_BASE } from './auth-real';
8
+ export { API_BASE, setApiBase } from './auth-real';
9
9
  export { BLOCK_PAGE_MARK, blockPlacementProblems, declaredMissing, declaredUuidOf, declaredUuidsOf, isBlockPage, type BlockPlacementProblem, type DeclaredEntry, type DeclaredRoute, } from './magic-block-declared';
@@ -13,6 +13,16 @@ export type { LocationResolver, TabContext } from './ui-tab-context';
13
13
  export type { SideItem } from './ui-types';
14
14
  export interface LabullOptions {
15
15
  extra?: Plugin[];
16
+ /**
17
+ * 后端地址(跨源部署时给;不给 = **相对本站**)。
18
+ *
19
+ * 🔴 **由宿主传,库自己不读构建期 env**:这个包发布的是预编译 dist,而 `import.meta.env.*`
20
+ * 是构建时的静态替换 —— 库构建那一刻的值会被烧成字面量,使用方再也覆盖不了
21
+ * (真踩过:产物里烧死了 `http://localhost:3000`,登录后所有接口打到访问者自己的机器)。
22
+ * 所以这一句要写在**宿主**的入口里,由宿主自己的构建工具替换:
23
+ * `app.use(labull, { apiBase: import.meta.env.VITE_API_BASE })`
24
+ */
25
+ apiBase?: string;
16
26
  }
17
27
  export declare function installApp(app: App, options?: LabullOptions): void;
18
28
  export declare const labull: Plugin;
package/dist/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as e, P as o, a as t, b as l, _ as T, U as b, i as r, l as i } from "./chunk-index-DGTXheeR.js";
1
+ import { A as e, P as o, a as t, b as l, _ as T, U as b, i as r, l as i } from "./chunk-index-3dQJWK2S.js";
2
2
  import { T as n, a as p, c as u, f as d, i as P, b as f, o as x, p as A, s as v, u as C, d as S } from "./chunk-ProductShell.vue_vue_type_style_index_0_scoped_06035587_lang-Fky1ghd2.js";
3
3
  export {
4
4
  e as AppSearch,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "labull-framework",
3
- "version": "0.1.29",
3
+ "version": "0.1.31",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Labull 前端 SDK:主题 CSS + 登录态 / 外壳组件 / magic block(四块合一,一个包)",