@opentiny/tiny-robot 0.2.13 → 0.3.0-alpha.1
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/action-group/index.js +39 -42
- package/dist/bubble/index.js +2003 -1229
- package/dist/container/index.js +4 -4
- package/dist/dropdown-menu/index.js +62 -77
- package/dist/feedback/index.js +42 -42
- package/dist/flow-layout-buttons/index.js +31 -34
- package/dist/history/index.js +42 -42
- package/dist/index.d.ts +350 -437
- package/dist/index.js +64 -57
- package/dist/index2.js +290 -358
- package/dist/loading.js +4 -0
- package/dist/question/index.js +54 -54
- package/dist/sender/index.js +1128 -935
- package/dist/style.css +1 -1
- package/dist/suggestion/index.js +74 -74
- package/dist/suggestion-pills/index.js +129 -179
- package/dist/suggestion-popover/index.js +177 -189
- package/dist/tiny-robot-svgs.js +197 -148
- package/dist/utils.js +15 -4
- package/package.json +4 -3
- package/dist/base-popper/index.js +0 -108
package/dist/utils.js
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(t) {
|
|
2
2
|
if (typeof t == "number") return `${t}px`;
|
|
3
|
-
const
|
|
4
|
-
return
|
|
3
|
+
const o = t == null ? void 0 : t.trim();
|
|
4
|
+
return o ? /^-?\d+(\.\d+)?$/.test(o) ? `${o}px` : o : "0px";
|
|
5
|
+
}
|
|
6
|
+
function i(t) {
|
|
7
|
+
var n;
|
|
8
|
+
if (!t) return window.getSelection();
|
|
9
|
+
const o = t.getRootNode();
|
|
10
|
+
return o instanceof ShadowRoot && ((n = o.getSelection) == null ? void 0 : n.call(o)) || window.getSelection();
|
|
11
|
+
}
|
|
12
|
+
function r(t) {
|
|
13
|
+
return t.getRootNode() instanceof ShadowRoot;
|
|
5
14
|
}
|
|
6
15
|
export {
|
|
7
|
-
|
|
16
|
+
i as g,
|
|
17
|
+
r as i,
|
|
18
|
+
e as t
|
|
8
19
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opentiny/tiny-robot",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-alpha.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -20,13 +20,14 @@
|
|
|
20
20
|
"vue": "^3.3.11"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@opentiny/tiny-robot-svgs": "0.
|
|
23
|
+
"@opentiny/tiny-robot-svgs": "0.3.0-alpha.1",
|
|
24
24
|
"@opentiny/vue": "^3.21.0",
|
|
25
25
|
"@opentiny/vue-button": "^3.21.0",
|
|
26
26
|
"@opentiny/vue-icon": "^3.22.0",
|
|
27
27
|
"@opentiny/vue-input": "^3.21.0",
|
|
28
28
|
"@opentiny/vue-tooltip": "^3.22.0",
|
|
29
29
|
"@vueuse/core": "^13.1.0",
|
|
30
|
+
"dompurify": "^3.2.6",
|
|
30
31
|
"markdown-it": "^14.1.0"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
@@ -44,5 +45,5 @@
|
|
|
44
45
|
"vue": "^3.3.11",
|
|
45
46
|
"vue-tsc": "^2.2.8"
|
|
46
47
|
},
|
|
47
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "af289d1181066abbca7e3b24098ad962df1d2bd1"
|
|
48
49
|
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { computed as a, defineComponent as j, useSlots as F, Fragment as x, ref as R, watch as E, nextTick as U, createElementBlock as S, openBlock as d, createVNode as W, renderList as Z, createBlock as V, resolveDynamicComponent as q, mergeProps as k, Transition as J, normalizeProps as K, guardReactiveProps as Q, withCtx as X, createCommentVNode as Y, Teleport as ee, unref as te, createElementVNode as oe, renderSlot as re } from "vue";
|
|
2
|
-
import { d as ne, e as se, b as ae } from "../index2.js";
|
|
3
|
-
import { t as l } from "../utils.js";
|
|
4
|
-
import { _ as ie } from "../_plugin-vue_export-helper.js";
|
|
5
|
-
function le(m, w) {
|
|
6
|
-
return a(() => {
|
|
7
|
-
var c;
|
|
8
|
-
const o = ne(m), i = (c = o == null ? void 0 : o.getRootNode) == null ? void 0 : c.call(o);
|
|
9
|
-
return i instanceof ShadowRoot ? i : document.body;
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
const ce = /* @__PURE__ */ j({
|
|
13
|
-
inheritAttrs: !1,
|
|
14
|
-
__name: "index",
|
|
15
|
-
props: {
|
|
16
|
-
appendTo: {},
|
|
17
|
-
offset: {},
|
|
18
|
-
placement: { default: "top-center" },
|
|
19
|
-
preventOverflow: { type: Boolean },
|
|
20
|
-
renderAllTriggers: { type: Boolean },
|
|
21
|
-
show: { type: Boolean },
|
|
22
|
-
transitionProps: {},
|
|
23
|
-
triggerEvents: {}
|
|
24
|
-
},
|
|
25
|
-
setup(m, { expose: w }) {
|
|
26
|
-
const o = m, i = F(), v = a(() => {
|
|
27
|
-
var r;
|
|
28
|
-
const e = (r = i.trigger) == null ? void 0 : r.call(i), t = e ? Array.isArray(e) ? e : [e] : [];
|
|
29
|
-
return t[0].type === x && Array.isArray(t[0].children) ? t[0].children : t;
|
|
30
|
-
}), g = a(() => o.renderAllTriggers ? v.value.length : 1), c = a(() => v.value.slice(0, g.value)), p = R([]), h = a(() => p.value.at(0)), B = (e) => e != null && e.$el || e instanceof HTMLElement || e instanceof SVGElement ? e : (console.warn("trigger must be an HTMLElement or SVGElement or Vue component instance"), null), $ = (e, t) => {
|
|
31
|
-
p.value[t] = B(e);
|
|
32
|
-
};
|
|
33
|
-
E(
|
|
34
|
-
g,
|
|
35
|
-
(e) => {
|
|
36
|
-
p.value.length = e;
|
|
37
|
-
},
|
|
38
|
-
{ flush: "post" }
|
|
39
|
-
);
|
|
40
|
-
function N(e = {}, t) {
|
|
41
|
-
const r = {};
|
|
42
|
-
for (const [n, s] of Object.entries(e))
|
|
43
|
-
/^on[A-Z]/.test(n) && typeof s == "function" && (r[n] = (...f) => s(...f, t));
|
|
44
|
-
return r;
|
|
45
|
-
}
|
|
46
|
-
const P = a(
|
|
47
|
-
() => c.value.map((e, t) => N(o.triggerEvents, t))
|
|
48
|
-
), y = R(null), u = a(() => {
|
|
49
|
-
var e, t;
|
|
50
|
-
return typeof o.offset == "number" ? { mainAxis: o.offset, crossAxis: 0 } : {
|
|
51
|
-
mainAxis: ((e = o.offset) == null ? void 0 : e.mainAxis) ?? 0,
|
|
52
|
-
crossAxis: ((t = o.offset) == null ? void 0 : t.crossAxis) ?? 0
|
|
53
|
-
};
|
|
54
|
-
}), { top: O, bottom: C, left: b, right: H, width: L, update: M } = se(h), { width: T, height: A } = ae(y, void 0, { box: "border-box" }), z = a(() => {
|
|
55
|
-
const { placement: e, preventOverflow: t } = o, r = {}, n = (s, f) => {
|
|
56
|
-
if (!t) {
|
|
57
|
-
r[s] = f;
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const _ = s === "top" || s === "bottom", G = _ ? "100dvh" : "100dvw", I = l(_ ? A.value : T.value);
|
|
61
|
-
r[s] = `clamp(0px, ${f}, calc(${G} - ${I}))`;
|
|
62
|
-
};
|
|
63
|
-
return e.includes("top") && n("top", l(O.value - A.value - u.value.mainAxis)), e.includes("bottom") && n("bottom", `calc(100% - ${l(C.value + A.value + u.value.mainAxis)})`), e.includes("left") && n("left", l(b.value + u.value.crossAxis)), e.includes("right") && n("right", `calc(100% - ${l(H.value + u.value.crossAxis)})`), e.includes("center") && n("left", l(b.value + L.value / 2 - T.value / 2 + u.value.crossAxis)), r;
|
|
64
|
-
});
|
|
65
|
-
E(
|
|
66
|
-
() => o.show,
|
|
67
|
-
(e) => {
|
|
68
|
-
e && U(() => {
|
|
69
|
-
M();
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
);
|
|
73
|
-
const D = le(h);
|
|
74
|
-
return w({
|
|
75
|
-
triggerRef: h,
|
|
76
|
-
triggerRefs: p,
|
|
77
|
-
popperRef: y
|
|
78
|
-
}), (e, t) => (d(), S(x, null, [
|
|
79
|
-
(d(!0), S(x, null, Z(c.value, (r, n) => (d(), V(q(r), k({
|
|
80
|
-
key: r.key ?? n,
|
|
81
|
-
ref_for: !0,
|
|
82
|
-
ref: (s) => $(s, n)
|
|
83
|
-
}, { ref_for: !0 }, P.value[n]), null, 16))), 128)),
|
|
84
|
-
W(J, K(Q(e.transitionProps)), {
|
|
85
|
-
default: X(() => [
|
|
86
|
-
e.show ? (d(), V(ee, {
|
|
87
|
-
key: 0,
|
|
88
|
-
to: o.appendTo || te(D)
|
|
89
|
-
}, [
|
|
90
|
-
oe("div", k({
|
|
91
|
-
class: "tr-base-popper",
|
|
92
|
-
ref_key: "popperRef",
|
|
93
|
-
ref: y,
|
|
94
|
-
style: z.value
|
|
95
|
-
}, e.$attrs), [
|
|
96
|
-
re(e.$slots, "content", {}, void 0, !0)
|
|
97
|
-
], 16)
|
|
98
|
-
], 8, ["to"])) : Y("", !0)
|
|
99
|
-
]),
|
|
100
|
-
_: 3
|
|
101
|
-
}, 16)
|
|
102
|
-
], 64));
|
|
103
|
-
}
|
|
104
|
-
}), ue = /* @__PURE__ */ ie(ce, [["__scopeId", "data-v-9984ba18"]]);
|
|
105
|
-
ue.name = "TrBasePopper";
|
|
106
|
-
export {
|
|
107
|
-
ue as default
|
|
108
|
-
};
|