@talex-touch/tuffex-wc 0.0.0-stage → 0.1.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.
- package/LICENSE +373 -0
- package/README.md +47 -2
- package/dist/chunks/TxImageGeneration.js +28478 -0
- package/dist/chunks/base-a.js +1223 -0
- package/dist/chunks/base-b.js +1648 -0
- package/dist/chunks/core.esm.js +2327 -0
- package/dist/chunks/glyphs-ai-1.js +33 -0
- package/dist/chunks/glyphs-ai-2.js +55 -0
- package/dist/chunks/glyphs-brand-1.js +23 -0
- package/dist/chunks/glyphs-brand-2.js +33 -0
- package/dist/chunks/glyphs-brand-3.js +40 -0
- package/dist/chunks/glyphs-icon-1.js +144 -0
- package/dist/chunks/glyphs-icon-2.js +124 -0
- package/dist/chunks/pinyin.js +4 -0
- package/dist/chunks/pull-down.esm.js +336 -0
- package/dist/chunks/pull-up.esm.js +234 -0
- package/dist/chunks/scroll-bar.esm.js +768 -0
- package/dist/chunks/tier-a.js +426 -0
- package/dist/chunks/tier-b.js +897 -0
- package/dist/chunks/tier-c.js +72 -0
- package/dist/chunks/tuffex-data.js +9757 -0
- package/dist/chunks/tuffex-extras.js +11692 -0
- package/dist/chunks/tuffex-media.js +13475 -0
- package/dist/chunks/tuffex-shared.js +17671 -0
- package/dist/chunks/vue-export-helper.js +10 -0
- package/dist/chunks/wc-runtime.js +922 -0
- package/dist/elements/base-a.d.ts +145 -0
- package/dist/elements/base-b.d.ts +129 -0
- package/dist/elements/index.d.ts +22 -0
- package/dist/elements/tier-a.d.ts +55 -0
- package/dist/elements/tier-b.d.ts +58 -0
- package/dist/elements/tier-c.d.ts +7 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +320 -0
- package/dist/manifest.d.ts +19 -0
- package/dist/manifest.js +1377 -0
- package/dist/runtime/coerce.d.ts +38 -0
- package/dist/runtime/events.d.ts +17 -0
- package/dist/runtime/factory.d.ts +129 -0
- package/dist/runtime/styles.d.ts +20 -0
- package/dist/style.css +1 -0
- package/dist/types.d.ts +1861 -0
- package/package.json +75 -3
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { W as _sfc_main, X as _sfc_main$1 } from "./tuffex-extras.js";
|
|
2
|
+
import { defineComponent, useHost, computed, h } from "vue";
|
|
3
|
+
import { c as createTxCustomElement, a as createTxCustomElementFromComponent, g as getHostSlotNodes, b as coercePropsBySchema, e as buildRawVueProps } from "./wc-runtime.js";
|
|
4
|
+
const streamTextBundle = createTxCustomElement({
|
|
5
|
+
tag: "tx-stream-text",
|
|
6
|
+
component: _sfc_main,
|
|
7
|
+
props: {
|
|
8
|
+
content: "string-or-json",
|
|
9
|
+
streaming: "boolean",
|
|
10
|
+
wordMs: "number",
|
|
11
|
+
maxLagMs: "number",
|
|
12
|
+
drainMs: "number",
|
|
13
|
+
pauseMs: "number",
|
|
14
|
+
reveal: "string",
|
|
15
|
+
caret: "boolean",
|
|
16
|
+
reserve: "boolean",
|
|
17
|
+
paced: "boolean",
|
|
18
|
+
appear: "boolean",
|
|
19
|
+
tag: "string",
|
|
20
|
+
locale: "string"
|
|
21
|
+
},
|
|
22
|
+
transformProps: (coerced, { host }) => {
|
|
23
|
+
if (coerced.content !== void 0)
|
|
24
|
+
return coerced;
|
|
25
|
+
const fallbackText = getHostSlotNodes(host, "default").map((n) => n.textContent ?? "").join("");
|
|
26
|
+
return {
|
|
27
|
+
...coerced,
|
|
28
|
+
content: fallbackText
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
emits: ["state-change", "done", "cite"],
|
|
32
|
+
exposeMethods: ["replay", "skip", "state"],
|
|
33
|
+
slots: ["caret"]
|
|
34
|
+
});
|
|
35
|
+
const MARKDOWN_VIEW_SCHEMA = {
|
|
36
|
+
content: "string",
|
|
37
|
+
sanitize: "boolean",
|
|
38
|
+
theme: "string"
|
|
39
|
+
};
|
|
40
|
+
const TxMarkdownViewWcWrapper = defineComponent({
|
|
41
|
+
name: "Wc_tx-markdown-view",
|
|
42
|
+
props: buildRawVueProps(MARKDOWN_VIEW_SCHEMA),
|
|
43
|
+
setup(rawProps) {
|
|
44
|
+
const host = useHost();
|
|
45
|
+
const initialSlotMarkdown = getHostSlotNodes(host, "default").map((n) => n.textContent ?? "").join("").trim();
|
|
46
|
+
const coercedProps = computed(() => coercePropsBySchema(rawProps, MARKDOWN_VIEW_SCHEMA));
|
|
47
|
+
return () => {
|
|
48
|
+
const p = coercedProps.value;
|
|
49
|
+
const content = typeof p.content === "string" && p.content.length > 0 ? p.content : initialSlotMarkdown;
|
|
50
|
+
return h(_sfc_main$1, {
|
|
51
|
+
...p,
|
|
52
|
+
content
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
const markdownViewBundle = createTxCustomElementFromComponent("tx-markdown-view", TxMarkdownViewWcWrapper);
|
|
58
|
+
const TxStreamTextElement = streamTextBundle.ElementClass;
|
|
59
|
+
const defineTxStreamText = streamTextBundle.define;
|
|
60
|
+
const TxMarkdownViewElement = markdownViewBundle.ElementClass;
|
|
61
|
+
const defineTxMarkdownView = markdownViewBundle.define;
|
|
62
|
+
const TIER_C_BUNDLES = [
|
|
63
|
+
streamTextBundle,
|
|
64
|
+
markdownViewBundle
|
|
65
|
+
];
|
|
66
|
+
export {
|
|
67
|
+
TIER_C_BUNDLES as T,
|
|
68
|
+
TxMarkdownViewElement as a,
|
|
69
|
+
TxStreamTextElement as b,
|
|
70
|
+
defineTxStreamText as c,
|
|
71
|
+
defineTxMarkdownView as d
|
|
72
|
+
};
|