@xihan-ui/web-components 1.0.0-alpha.2 → 1.0.0

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,5 @@
1
1
  import { t as defineElement } from "./registry-DR6I2_zF.js";
2
- import { n as version, t as XhReactiveElement } from "./element-BHyfNDKE.js";
2
+ import { n as version, t as XhReactiveElement } from "./element-ib25-l85.js";
3
3
  import { DIAGNOSTIC_CODES, reportDiagnostic } from "@xihan-ui/kernel";
4
4
  import { createBackgroundSurface, registerBuiltinEffects } from "@xihan-ui/backgrounds";
5
5
  //#region src/backgrounds.ts
@@ -0,0 +1,37 @@
1
+ import { XhConfigBase, XhTranslationOverrides as XhTranslationOverrides$1 } from "@xihan-ui/headless";
2
+ //#region src/dom/spread.d.ts
3
+ interface Spreader {
4
+ spread: (node: HTMLElement, props: Record<string, unknown>) => void;
5
+ release: (node: HTMLElement) => void;
6
+ }
7
+ declare function createSpreader(): Spreader;
8
+ //#endregion
9
+ //#region src/config.d.ts
10
+ /** 与 Vue 适配器同一份字段;WC 是 Light DOM,浮层不搬运,没有 portalContainer。 */
11
+ type XhConfig = XhConfigBase;
12
+ /** 覆写全局配置。整份替换,不做深合并——想改一处就把整份拿去改。 */
13
+ declare function setXhConfig(next: XhConfig): void;
14
+ declare function getXhConfig(): Readonly<XhConfig>;
15
+ /** 订阅配置变更,返回退订函数。已挂载的元素靠它在切语言时重渲。 */
16
+ declare function onXhConfigChange(listener: () => void): () => void;
17
+ /**
18
+ * 外层与内层逐键合并。
19
+ *
20
+ * 键缺席与写成 undefined 都算「这一层没说」,一律回落外层——子树里只想改文案时,
21
+ * 不该把外层的 locale 一并抹掉。
22
+ */
23
+ declare function mergeXhConfig$1(base: XhConfig | undefined, over: XhConfig | undefined): XhConfig;
24
+ /** `<xh-config>` 认领这个接口,配置解析沿 DOM 祖先链找它,不必反向依赖元素类。 */
25
+ interface XhConfigScope extends Element {
26
+ readonly xhConfig: XhConfig;
27
+ }
28
+ /**
29
+ * 某个节点看到的配置:从全局那份起,沿祖先链自外向内逐层并进来。
30
+ *
31
+ * 不传节点(或它还没进文档)就只有全局那份。跨 shadow root 不追:
32
+ * 本适配器是 Light DOM,作者的 <xh-config> 与元素天然同树。
33
+ */
34
+ declare function resolveXhConfig(node: Element | null | undefined): XhConfig;
35
+ //#endregion
36
+ export { mergeXhConfig$1 as a, setXhConfig as c, getXhConfig as i, Spreader as l, XhConfigScope as n, onXhConfigChange as o, XhTranslationOverrides$1 as r, resolveXhConfig as s, XhConfig as t, createSpreader as u };
37
+ //# sourceMappingURL=config-Cz16-P4i.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-Cz16-P4i.d.ts","names":[],"sources":["../src/dom/spread.ts","../src/config.ts"],"mappings":";;UA2BiB;EACf,SAAS,MAAM,aAAa,OAAO;EACnC,UAAU,MAAM;;iBASF,kBAAkB;;;;KCzBtB,WAAW;;iBAWP,YAAY,MAAM;iBAYlB,eAAe,SAAS;;iBAKxB,iBAAiB;;;;;;;iBAWjB,gBAAc,MAAM,sBAAsB,MAAM,uBAAuB;;UAKtE,sBAAsB;WAC5B,UAAU;;;;;;;;iBAaL,gBAAgB,MAAM,6BAA6B"}