@sdata/web-vue 3.26.0 → 3.28.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/dist/sd.css +8 -0
- package/dist/sd.min.css +2 -2
- package/es/_hooks/use-theme-mode.d.ts +1 -1
- package/es/_utils/date.js +5 -38
- package/es/_utils/grapheme.d.ts +5 -0
- package/es/_utils/grapheme.js +93 -0
- package/es/basic-crud-table/basic-crud-table.vue_vue_type_script_setup_true_lang.js +33 -23
- package/es/basic-crud-table/index.d.ts +1 -1
- package/es/basic-crud-table/types.d.ts +9 -1
- package/es/components.d.ts +2 -0
- package/es/index.css +8 -0
- package/es/index.d.ts +6 -1
- package/es/index.js +6 -1
- package/es/index.scss +2 -0
- package/es/input/input.js +5 -6
- package/es/input-mask/index.d.ts +120 -0
- package/es/input-mask/index.js +12 -0
- package/es/input-mask/input-mask.js +5 -0
- package/es/input-mask/input-mask.vue.d.ts +49 -0
- package/es/input-mask/input-mask.vue_vue_type_script_setup_true_lang.js +346 -0
- package/es/input-mask/mask-engine.d.ts +18 -0
- package/es/input-mask/mask-engine.js +176 -0
- package/es/input-mask/presets.d.ts +2 -0
- package/es/input-mask/presets.js +220 -0
- package/es/input-mask/style/css.js +1 -0
- package/es/input-mask/style/index.css +20 -0
- package/es/input-mask/style/index.d.ts +2 -0
- package/es/input-mask/style/index.js +1 -0
- package/es/input-mask/style/index.scss +10 -0
- package/es/input-mask/style/token.scss +5 -0
- package/es/input-mask/types.d.ts +49 -0
- package/es/locale/constant.d.ts +2 -0
- package/es/locale/constant.js +5 -0
- package/es/locale/index.d.ts +1 -0
- package/es/locale/index.js +6 -5
- package/es/locale/interface.d.ts +11 -0
- package/es/locale/lang/en-us.js +12 -1
- package/es/locale/lang/zh-cn.js +14 -2
- package/es/sd-vue.js +4 -0
- package/es/textarea/textarea.vue_vue_type_script_setup_true_lang.js +5 -6
- package/es/thinking-orb/engine/braid.d.ts +2 -0
- package/es/thinking-orb/engine/braid.js +52 -0
- package/es/thinking-orb/engine/core.d.ts +28 -0
- package/es/thinking-orb/engine/core.js +104 -0
- package/es/thinking-orb/engine/lattice.d.ts +4 -0
- package/es/thinking-orb/engine/lattice.js +188 -0
- package/es/thinking-orb/engine/morph.d.ts +2 -0
- package/es/thinking-orb/engine/morph.js +111 -0
- package/es/thinking-orb/engine/orbits.d.ts +2 -0
- package/es/thinking-orb/engine/orbits.js +65 -0
- package/es/thinking-orb/engine/profiles.d.ts +6 -0
- package/es/thinking-orb/engine/profiles.js +150 -0
- package/es/thinking-orb/engine/registry.d.ts +3 -0
- package/es/thinking-orb/engine/registry.js +20 -0
- package/es/thinking-orb/engine/ribbon.d.ts +2 -0
- package/es/thinking-orb/engine/ribbon.js +71 -0
- package/es/thinking-orb/engine/types.d.ts +3 -0
- package/es/thinking-orb/engine/web.d.ts +2 -0
- package/es/thinking-orb/engine/web.js +87 -0
- package/es/thinking-orb/index.d.ts +21 -0
- package/es/thinking-orb/index.js +10 -0
- package/es/thinking-orb/presets.d.ts +10 -0
- package/es/thinking-orb/presets.js +176 -0
- package/es/thinking-orb/style/css.js +2 -0
- package/es/thinking-orb/style/index.css +20 -0
- package/es/thinking-orb/style/index.d.ts +2 -0
- package/es/thinking-orb/style/index.js +2 -0
- package/es/thinking-orb/style/index.scss +8 -0
- package/es/thinking-orb/thinking-orb.js +5 -0
- package/es/thinking-orb/thinking-orb.vue.d.ts +4 -0
- package/es/thinking-orb/thinking-orb.vue_vue_type_script_setup_true_lang.js +140 -0
- package/es/thinking-orb/types.d.ts +12 -0
- package/es/toolbar/toolbar.vue_vue_type_script_setup_true_lang.js +8 -10
- package/es/toolbar/types.d.ts +3 -0
- package/json/vetur-attributes.json +23 -0
- package/json/vetur-tags.json +14 -0
- package/json/web-types.json +70 -1
- package/package.json +1 -1
- package/es/locale/lang/ar-eg.d.ts +0 -3
- package/es/locale/lang/ar-eg.js +0 -262
- package/es/locale/lang/de-de.d.ts +0 -3
- package/es/locale/lang/de-de.js +0 -262
- package/es/locale/lang/es-es.d.ts +0 -3
- package/es/locale/lang/es-es.js +0 -262
- package/es/locale/lang/fr-fr.d.ts +0 -3
- package/es/locale/lang/fr-fr.js +0 -262
- package/es/locale/lang/id-id.d.ts +0 -3
- package/es/locale/lang/id-id.js +0 -262
- package/es/locale/lang/it-it.d.ts +0 -3
- package/es/locale/lang/it-it.js +0 -262
- package/es/locale/lang/ja-jp.d.ts +0 -3
- package/es/locale/lang/ja-jp.js +0 -262
- package/es/locale/lang/km-kh.d.ts +0 -3
- package/es/locale/lang/km-kh.js +0 -262
- package/es/locale/lang/ko-kr.d.ts +0 -3
- package/es/locale/lang/ko-kr.js +0 -262
- package/es/locale/lang/ms-my.d.ts +0 -3
- package/es/locale/lang/ms-my.js +0 -262
- package/es/locale/lang/nl-nl.d.ts +0 -3
- package/es/locale/lang/nl-nl.js +0 -262
- package/es/locale/lang/pt-pt.d.ts +0 -3
- package/es/locale/lang/pt-pt.js +0 -262
- package/es/locale/lang/ru-ru.d.ts +0 -3
- package/es/locale/lang/ru-ru.js +0 -262
- package/es/locale/lang/th-th.d.ts +0 -3
- package/es/locale/lang/th-th.js +0 -262
- package/es/locale/lang/vi-vn.d.ts +0 -3
- package/es/locale/lang/vi-vn.js +0 -262
- package/es/locale/lang/zh-tw.d.ts +0 -3
- package/es/locale/lang/zh-tw.js +0 -272
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { fibDir, makeProj, paint, radiusScale } from "./core.js";
|
|
2
|
+
//#region components/thinking-orb/engine/ribbon.ts
|
|
3
|
+
var drawRibbon = (ctx, size, t, dark, o) => {
|
|
4
|
+
var _o$spin, _o$rsPow, _o$ghostN, _o$wobMul, _o$lanes, _o$segs, _o$bandMul;
|
|
5
|
+
const cx = size / 2;
|
|
6
|
+
const cy = size / 2;
|
|
7
|
+
const R = size / 2 * .78;
|
|
8
|
+
const spin = (_o$spin = o.spin) !== null && _o$spin !== void 0 ? _o$spin : 1;
|
|
9
|
+
const pt = makeProj(t * .1 * spin, .3, cx, cy, 1);
|
|
10
|
+
const rs = radiusScale(size, (_o$rsPow = o.rsPow) !== null && _o$rsPow !== void 0 ? _o$rsPow : .6);
|
|
11
|
+
const dots = [];
|
|
12
|
+
const ghostN = (_o$ghostN = o.ghostN) !== null && _o$ghostN !== void 0 ? _o$ghostN : 150;
|
|
13
|
+
for (let i = 0; i < ghostN; i++) {
|
|
14
|
+
const d = fibDir(i, ghostN);
|
|
15
|
+
const [px, py, z] = pt(d[0] * R, d[1] * R, d[2] * R);
|
|
16
|
+
const depth = (z / R + 1) / 2;
|
|
17
|
+
dots.push({
|
|
18
|
+
x: px,
|
|
19
|
+
y: py,
|
|
20
|
+
z,
|
|
21
|
+
r: .8 * rs,
|
|
22
|
+
white: .78,
|
|
23
|
+
a: .1 + .22 * depth
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const ya = t * .24 * spin;
|
|
27
|
+
const ta = o.faceOn ? -.3 : .55 + .3 * Math.sin(t * .18) * spin;
|
|
28
|
+
const ux = Math.cos(ya);
|
|
29
|
+
const uy = 0;
|
|
30
|
+
const uz = Math.sin(ya);
|
|
31
|
+
const vx = -uz * Math.sin(ta);
|
|
32
|
+
const vy = Math.cos(ta);
|
|
33
|
+
const vz = ux * Math.sin(ta);
|
|
34
|
+
const nx = uy * vz - uz * vy;
|
|
35
|
+
const ny = uz * vx - ux * vz;
|
|
36
|
+
const nz = ux * vy - uy * vx;
|
|
37
|
+
const wobAmp = .23 * ((_o$wobMul = o.wobMul) !== null && _o$wobMul !== void 0 ? _o$wobMul : 1);
|
|
38
|
+
const baseR = o.faceOn ? R / (1 + .85 * wobAmp) : R;
|
|
39
|
+
const baseLanes = (_o$lanes = o.lanes) !== null && _o$lanes !== void 0 ? _o$lanes : 5;
|
|
40
|
+
const segs = (_o$segs = o.segs) !== null && _o$segs !== void 0 ? _o$segs : 88;
|
|
41
|
+
const lanes = Math.max(1, Math.round(baseLanes * ((_o$bandMul = o.bandMul) !== null && _o$bandMul !== void 0 ? _o$bandMul : 1)));
|
|
42
|
+
for (let w = 0; w < lanes; w++) {
|
|
43
|
+
const laneOff = (w - (lanes - 1) / 2) * .075;
|
|
44
|
+
const edge = Math.abs(w - (lanes - 1) / 2) / Math.max(1, (lanes - 1) / 2);
|
|
45
|
+
for (let k = 0; k < segs; k++) {
|
|
46
|
+
var _o$wobMul2, _o$rBase, _o$rDepth;
|
|
47
|
+
const a = k / segs * 2 * Math.PI;
|
|
48
|
+
const wob = (.16 * Math.sin(a * 3 - t * 1.7 + w * .22) + .07 * Math.sin(a * 5 + t * 1.1)) * ((_o$wobMul2 = o.wobMul) !== null && _o$wobMul2 !== void 0 ? _o$wobMul2 : 1);
|
|
49
|
+
const radial = o.faceOn ? 1 + wob : 1;
|
|
50
|
+
const off = o.faceOn ? laneOff : laneOff + wob;
|
|
51
|
+
const x = ux * Math.cos(a) + vx * Math.sin(a) + nx * off;
|
|
52
|
+
const y = uy * Math.cos(a) + vy * Math.sin(a) + ny * off;
|
|
53
|
+
const z = uz * Math.cos(a) + vz * Math.sin(a) + nz * off;
|
|
54
|
+
const l = Math.sqrt(x * x + y * y + z * z);
|
|
55
|
+
const rr = baseR * radial;
|
|
56
|
+
const [px, py, zr] = pt(x / l * rr, y / l * rr, z / l * rr);
|
|
57
|
+
const depth = (zr / R + 1) / 2;
|
|
58
|
+
dots.push({
|
|
59
|
+
x: px,
|
|
60
|
+
y: py,
|
|
61
|
+
z: zr,
|
|
62
|
+
r: (((_o$rBase = o.rBase) !== null && _o$rBase !== void 0 ? _o$rBase : 1.1) + ((_o$rDepth = o.rDepth) !== null && _o$rDepth !== void 0 ? _o$rDepth : 1.7) * depth) * (1 - .25 * edge) * rs,
|
|
63
|
+
white: .52 - .44 * depth + .18 * edge,
|
|
64
|
+
a: .4 + .6 * depth
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
paint(ctx, dots, dark, o.rMin);
|
|
69
|
+
};
|
|
70
|
+
//#endregion
|
|
71
|
+
export { drawRibbon };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { fibDir, frac, hashD, lerp, makeProj, paint, paintLines, radiusScale, vnoise } from "./core.js";
|
|
2
|
+
//#region components/thinking-orb/engine/web.ts
|
|
3
|
+
var drawWeb = (ctx, size, t, dark, o) => {
|
|
4
|
+
var _o$spread, _o$rsPow, _o$nodeN, _o$thr, _o$nodeR, _o$nodeRDepth, _o$signals;
|
|
5
|
+
const cx = size / 2;
|
|
6
|
+
const cy = size / 2;
|
|
7
|
+
const R = size / 2 * .8 * ((_o$spread = o.spread) !== null && _o$spread !== void 0 ? _o$spread : 1);
|
|
8
|
+
const pt = makeProj(t * .12, .32, cx, cy, R);
|
|
9
|
+
const rs = radiusScale(size, (_o$rsPow = o.rsPow) !== null && _o$rsPow !== void 0 ? _o$rsPow : .6);
|
|
10
|
+
const nodeN = (_o$nodeN = o.nodeN) !== null && _o$nodeN !== void 0 ? _o$nodeN : 30;
|
|
11
|
+
const thr = (_o$thr = o.thr) !== null && _o$thr !== void 0 ? _o$thr : .72;
|
|
12
|
+
const nodeR = (_o$nodeR = o.nodeR) !== null && _o$nodeR !== void 0 ? _o$nodeR : 1.4;
|
|
13
|
+
const nodeRDepth = (_o$nodeRDepth = o.nodeRDepth) !== null && _o$nodeRDepth !== void 0 ? _o$nodeRDepth : 1.8;
|
|
14
|
+
const nodes = [];
|
|
15
|
+
for (let i = 0; i < nodeN; i++) {
|
|
16
|
+
const d = fibDir(i, nodeN);
|
|
17
|
+
const x = d[0] + .3 * (vnoise(i * .31 + 9, t * .24) - .5) * 2;
|
|
18
|
+
const y = d[1] + .3 * (vnoise(i * .53 + 27, t * .21) - .5) * 2;
|
|
19
|
+
const z = d[2] + .3 * (vnoise(i * .77 + 55, t * .27) - .5) * 2;
|
|
20
|
+
const l = Math.sqrt(x * x + y * y + z * z);
|
|
21
|
+
nodes.push([
|
|
22
|
+
x / l,
|
|
23
|
+
y / l,
|
|
24
|
+
z / l
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
const lines = [];
|
|
28
|
+
const dots = [];
|
|
29
|
+
for (let i = 0; i < nodeN; i++) for (let j = i + 1; j < nodeN; j++) {
|
|
30
|
+
var _o$lineW;
|
|
31
|
+
const dx = nodes[i][0] - nodes[j][0];
|
|
32
|
+
const dy = nodes[i][1] - nodes[j][1];
|
|
33
|
+
const dz = nodes[i][2] - nodes[j][2];
|
|
34
|
+
const dist = Math.sqrt(dx * dx + dy * dy + dz * dz);
|
|
35
|
+
if (dist >= thr) continue;
|
|
36
|
+
const [x1, y1, z1] = pt(nodes[i][0], nodes[i][1], nodes[i][2]);
|
|
37
|
+
const [x2, y2, z2] = pt(nodes[j][0], nodes[j][1], nodes[j][2]);
|
|
38
|
+
const depth = ((z1 + z2) / 2 + 1) / 2;
|
|
39
|
+
lines.push({
|
|
40
|
+
x1,
|
|
41
|
+
y1,
|
|
42
|
+
x2,
|
|
43
|
+
y2,
|
|
44
|
+
white: .42,
|
|
45
|
+
a: (1 - dist / thr) * (.3 + .55 * depth),
|
|
46
|
+
w: Math.max(.6, ((_o$lineW = o.lineW) !== null && _o$lineW !== void 0 ? _o$lineW : .8) * rs)
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
for (let i = 0; i < nodeN; i++) {
|
|
50
|
+
const [px, py, z] = pt(nodes[i][0], nodes[i][1], nodes[i][2]);
|
|
51
|
+
const depth = (z + 1) / 2;
|
|
52
|
+
const pulse = 1 + .25 * Math.sin(t * 1.4 + i * 2.7);
|
|
53
|
+
dots.push({
|
|
54
|
+
x: px,
|
|
55
|
+
y: py,
|
|
56
|
+
z,
|
|
57
|
+
r: (nodeR + nodeRDepth * depth) * pulse * rs,
|
|
58
|
+
white: .55 - .45 * depth
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
const signals = (_o$signals = o.signals) !== null && _o$signals !== void 0 ? _o$signals : 5;
|
|
62
|
+
for (let s = 0; s < signals; s++) {
|
|
63
|
+
const seg = Math.floor(t * .55 + s * 7.31);
|
|
64
|
+
const a = Math.floor(hashD(seg, s * 3.1 + 1.7) * nodeN);
|
|
65
|
+
const b = Math.floor(hashD(seg, s * 5.7 + 4.2) * nodeN);
|
|
66
|
+
if (a === b) continue;
|
|
67
|
+
const f = frac(t * .55 + s * 7.31);
|
|
68
|
+
const x = lerp(nodes[a][0], nodes[b][0], f);
|
|
69
|
+
const y = lerp(nodes[a][1], nodes[b][1], f);
|
|
70
|
+
const z = lerp(nodes[a][2], nodes[b][2], f);
|
|
71
|
+
const l = Math.max(1e-6, Math.sqrt(x * x + y * y + z * z));
|
|
72
|
+
const [px, py, zr] = pt(x / l, y / l, z / l);
|
|
73
|
+
const depth = (zr + 1) / 2;
|
|
74
|
+
dots.push({
|
|
75
|
+
x: px,
|
|
76
|
+
y: py,
|
|
77
|
+
z: zr,
|
|
78
|
+
r: (nodeR * 1.5 + nodeRDepth * depth) * rs,
|
|
79
|
+
white: .05,
|
|
80
|
+
a: .5 + .5 * depth
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
paintLines(ctx, lines, dark);
|
|
84
|
+
paint(ctx, dots, dark, o.rMin);
|
|
85
|
+
};
|
|
86
|
+
//#endregion
|
|
87
|
+
export { drawWeb };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { App } from 'vue';
|
|
2
|
+
import type { SDOptions } from '../_utils/types';
|
|
3
|
+
import _ThinkingOrb from './thinking-orb.vue';
|
|
4
|
+
declare const ThinkingOrb: {
|
|
5
|
+
new (...args: any[]): import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("./types").ThinkingOrbProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, import("vue").PublicProps, {}, false, {}, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, {}, any, import("vue").ComponentProvideOptions, {
|
|
6
|
+
P: {};
|
|
7
|
+
B: {};
|
|
8
|
+
D: {};
|
|
9
|
+
C: {};
|
|
10
|
+
M: {};
|
|
11
|
+
Defaults: {};
|
|
12
|
+
}, Readonly<import("./types").ThinkingOrbProps> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
13
|
+
__isFragment?: never;
|
|
14
|
+
__isTeleport?: never;
|
|
15
|
+
__isSuspense?: never;
|
|
16
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("./types").ThinkingOrbProps> & Readonly<{}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & {
|
|
17
|
+
install: (app: App, options?: SDOptions) => void;
|
|
18
|
+
};
|
|
19
|
+
export type ThinkingOrbInstance = InstanceType<typeof _ThinkingOrb>;
|
|
20
|
+
export type { ThinkingOrbProps, ThinkingOrbSize, ThinkingOrbState, ThinkingOrbTheme, } from './types';
|
|
21
|
+
export default ThinkingOrb;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getComponentPrefix, setGlobalConfig } from "../_utils/global-config.js";
|
|
2
|
+
import thinking_orb_default from "./thinking-orb.js";
|
|
3
|
+
//#region components/thinking-orb/index.ts
|
|
4
|
+
var ThinkingOrb = Object.assign(thinking_orb_default, { install: (app, options) => {
|
|
5
|
+
setGlobalConfig(app, options);
|
|
6
|
+
const componentPrefix = getComponentPrefix(options);
|
|
7
|
+
app.component(componentPrefix + thinking_orb_default.name, thinking_orb_default);
|
|
8
|
+
} });
|
|
9
|
+
//#endregion
|
|
10
|
+
export { ThinkingOrb as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ModeOpts } from './engine/profiles';
|
|
2
|
+
import type { OrbSize, OrbState } from './types';
|
|
3
|
+
export type ModeKey = 'orbits' | 'globe' | 'rubik' | 'wave' | 'web' | 'braid' | 'ribbon' | 'ring' | 'morph';
|
|
4
|
+
export declare const STATE_TO_MODE: Record<OrbState, ModeKey>;
|
|
5
|
+
export interface Resolved {
|
|
6
|
+
mode: ModeKey;
|
|
7
|
+
speed: number;
|
|
8
|
+
opts: ModeOpts;
|
|
9
|
+
}
|
|
10
|
+
export declare function resolvePreset(state: OrbState, size: OrbSize): Resolved;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/objectSpread2.js";
|
|
2
|
+
import { BASE_PROFILES, scaleCounts, scaleRadii } from "./engine/profiles.js";
|
|
3
|
+
//#region components/thinking-orb/presets.ts
|
|
4
|
+
var STATE_TO_MODE = {
|
|
5
|
+
working: "orbits",
|
|
6
|
+
searching: "globe",
|
|
7
|
+
solving: "rubik",
|
|
8
|
+
listening: "wave",
|
|
9
|
+
connecting: "web",
|
|
10
|
+
weaving: "braid",
|
|
11
|
+
composing: "ribbon",
|
|
12
|
+
breathing: "ring",
|
|
13
|
+
shaping: "morph"
|
|
14
|
+
};
|
|
15
|
+
var PRESETS = {
|
|
16
|
+
orbits: {
|
|
17
|
+
64: {
|
|
18
|
+
speed: 1.885,
|
|
19
|
+
count: 1,
|
|
20
|
+
size: 1
|
|
21
|
+
},
|
|
22
|
+
20: {
|
|
23
|
+
speed: 3.9,
|
|
24
|
+
count: .238,
|
|
25
|
+
size: 2.4
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
globe: {
|
|
29
|
+
64: {
|
|
30
|
+
speed: 2.015,
|
|
31
|
+
count: .42,
|
|
32
|
+
size: 1.15,
|
|
33
|
+
extra: {
|
|
34
|
+
scanMul: 4.08,
|
|
35
|
+
dimBase: .45
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
20: {
|
|
39
|
+
speed: 2.665,
|
|
40
|
+
count: .105,
|
|
41
|
+
size: 1.75,
|
|
42
|
+
extra: {
|
|
43
|
+
scanMul: 4.335,
|
|
44
|
+
dimBase: .45
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
rubik: {
|
|
49
|
+
64: {
|
|
50
|
+
speed: 1.82,
|
|
51
|
+
count: .35,
|
|
52
|
+
size: 1.05
|
|
53
|
+
},
|
|
54
|
+
20: {
|
|
55
|
+
speed: 1.95,
|
|
56
|
+
count: .088,
|
|
57
|
+
size: 1.9
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
wave: {
|
|
61
|
+
64: {
|
|
62
|
+
speed: 4.388,
|
|
63
|
+
count: .341,
|
|
64
|
+
size: 1
|
|
65
|
+
},
|
|
66
|
+
20: {
|
|
67
|
+
speed: 3.998,
|
|
68
|
+
count: .105,
|
|
69
|
+
size: 1.6
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
web: {
|
|
73
|
+
64: {
|
|
74
|
+
speed: 3.315,
|
|
75
|
+
count: 1.35,
|
|
76
|
+
size: .95
|
|
77
|
+
},
|
|
78
|
+
20: {
|
|
79
|
+
speed: 6.63,
|
|
80
|
+
count: .25,
|
|
81
|
+
size: 1.52
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
braid: {
|
|
85
|
+
64: {
|
|
86
|
+
speed: 1.625,
|
|
87
|
+
count: .5,
|
|
88
|
+
size: 1
|
|
89
|
+
},
|
|
90
|
+
20: {
|
|
91
|
+
speed: 2.75,
|
|
92
|
+
count: .1125,
|
|
93
|
+
size: 1.36
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
ribbon: {
|
|
97
|
+
64: {
|
|
98
|
+
speed: 2.34,
|
|
99
|
+
count: .25,
|
|
100
|
+
size: .85,
|
|
101
|
+
extra: {
|
|
102
|
+
spin: 0,
|
|
103
|
+
bandMul: 3.9,
|
|
104
|
+
wobMul: 1
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
20: {
|
|
108
|
+
speed: 3.12,
|
|
109
|
+
count: .051,
|
|
110
|
+
size: 1.073,
|
|
111
|
+
extra: {
|
|
112
|
+
spin: 0,
|
|
113
|
+
bandMul: 4.94,
|
|
114
|
+
wobMul: 1
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
ring: {
|
|
119
|
+
64: {
|
|
120
|
+
speed: 3.24,
|
|
121
|
+
count: .25,
|
|
122
|
+
size: .956,
|
|
123
|
+
extra: {
|
|
124
|
+
spin: 0,
|
|
125
|
+
bandMul: 3.627,
|
|
126
|
+
wobMul: .368
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
20: {
|
|
130
|
+
speed: 3.78,
|
|
131
|
+
count: .028,
|
|
132
|
+
size: 1.622,
|
|
133
|
+
extra: {
|
|
134
|
+
spin: 0,
|
|
135
|
+
bandMul: 3.968,
|
|
136
|
+
wobMul: .565
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
morph: {
|
|
141
|
+
64: {
|
|
142
|
+
speed: 2.405,
|
|
143
|
+
count: .702,
|
|
144
|
+
size: .395,
|
|
145
|
+
extra: { spread: 1.45 }
|
|
146
|
+
},
|
|
147
|
+
20: {
|
|
148
|
+
speed: 2.08,
|
|
149
|
+
count: .53,
|
|
150
|
+
size: 1.011,
|
|
151
|
+
extra: { spread: 1.45 }
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
var cache = /* @__PURE__ */ new Map();
|
|
156
|
+
/** Resolve a (state, size) pair to its mode + fully-scaled draw options. */
|
|
157
|
+
function resolvePreset(state, size) {
|
|
158
|
+
const key = `${state}-${size}`;
|
|
159
|
+
const hit = cache.get(key);
|
|
160
|
+
if (hit) return hit;
|
|
161
|
+
const mode = STATE_TO_MODE[state];
|
|
162
|
+
const preset = PRESETS[mode][size];
|
|
163
|
+
let opts = _objectSpread2({}, BASE_PROFILES[mode]);
|
|
164
|
+
if (preset.count !== 1) opts = scaleCounts(opts, preset.count);
|
|
165
|
+
if (preset.size !== 1) opts = scaleRadii(opts, preset.size);
|
|
166
|
+
if (preset.extra) opts = _objectSpread2(_objectSpread2({}, opts), preset.extra);
|
|
167
|
+
const resolved = {
|
|
168
|
+
mode,
|
|
169
|
+
speed: preset.speed,
|
|
170
|
+
opts
|
|
171
|
+
};
|
|
172
|
+
cache.set(key, resolved);
|
|
173
|
+
return resolved;
|
|
174
|
+
}
|
|
175
|
+
//#endregion
|
|
176
|
+
export { STATE_TO_MODE, resolvePreset };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/******** borderSize *******/
|
|
2
|
+
/******** borderStyle *******/
|
|
3
|
+
/******** radius *******/
|
|
4
|
+
/******** shadow distance *******/
|
|
5
|
+
/******** size *******/
|
|
6
|
+
/******** spacing *******/
|
|
7
|
+
/******** shadow *******/
|
|
8
|
+
/******** opacity *******/
|
|
9
|
+
/******** fontSize *******/
|
|
10
|
+
/******** fontWeight ********/
|
|
11
|
+
/******** Primary *******/
|
|
12
|
+
/******** success *******/
|
|
13
|
+
/******** warning *******/
|
|
14
|
+
/******** danger *******/
|
|
15
|
+
/******** link *******/
|
|
16
|
+
/******** radius *******/
|
|
17
|
+
/********* icon hover *********/
|
|
18
|
+
.sd-thinking-orb {
|
|
19
|
+
display: block;
|
|
20
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import thinking_orb_vue_vue_type_script_setup_true_lang_default from "./thinking-orb.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region components/thinking-orb/thinking-orb.vue
|
|
3
|
+
var thinking_orb_default = thinking_orb_vue_vue_type_script_setup_true_lang_default;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { thinking_orb_default as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ThinkingOrbProps } from './types';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<ThinkingOrbProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ThinkingOrbProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import _objectSpread2 from "../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/objectSpread2.js";
|
|
2
|
+
import { getPrefixCls } from "../_utils/global-config.js";
|
|
3
|
+
import { useI18n } from "../locale/index.js";
|
|
4
|
+
import { useThemeMode } from "../_hooks/use-theme-mode.js";
|
|
5
|
+
import { MODE_DRAWS } from "./engine/registry.js";
|
|
6
|
+
import { resolvePreset } from "./presets.js";
|
|
7
|
+
import { computed, createElementBlock, defineComponent, mergeProps, onMounted, onUnmounted, openBlock, ref, shallowRef, useAttrs, watch } from "vue";
|
|
8
|
+
//#region components/thinking-orb/thinking-orb.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var thinking_orb_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent(_objectSpread2(_objectSpread2({}, {
|
|
10
|
+
name: "ThinkingOrb",
|
|
11
|
+
inheritAttrs: false
|
|
12
|
+
}), {}, {
|
|
13
|
+
__name: "thinking-orb",
|
|
14
|
+
props: {
|
|
15
|
+
state: { default: "working" },
|
|
16
|
+
size: { default: 64 },
|
|
17
|
+
theme: { default: "auto" },
|
|
18
|
+
speed: { default: 1 },
|
|
19
|
+
paused: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
setup(__props) {
|
|
25
|
+
const attrs = useAttrs();
|
|
26
|
+
const canvasRef = ref(null);
|
|
27
|
+
const inheritedTheme = useThemeMode(canvasRef);
|
|
28
|
+
const reducedMotion = shallowRef(false);
|
|
29
|
+
const prefixCls = getPrefixCls("thinking-orb");
|
|
30
|
+
const { t } = useI18n();
|
|
31
|
+
const isDark = computed(() => __props.theme === "auto" ? inheritedTheme.value === "dark" : __props.theme === "dark");
|
|
32
|
+
const resolvedSize = computed(() => __props.size === 20 || __props.size === 64 ? __props.size : 64);
|
|
33
|
+
const canvasAttrs = computed(() => mergeProps({
|
|
34
|
+
"class": prefixCls,
|
|
35
|
+
"role": "img",
|
|
36
|
+
"aria-label": t(`a11y.thinkingOrb.${__props.state}`),
|
|
37
|
+
"data-theme": isDark.value ? "dark" : "light",
|
|
38
|
+
"data-state": __props.state,
|
|
39
|
+
"style": {
|
|
40
|
+
width: `${resolvedSize.value}px`,
|
|
41
|
+
height: `${resolvedSize.value}px`
|
|
42
|
+
}
|
|
43
|
+
}, attrs));
|
|
44
|
+
let stopRenderer;
|
|
45
|
+
let stopReducedMotion;
|
|
46
|
+
function setupRenderer() {
|
|
47
|
+
stopRenderer === null || stopRenderer === void 0 || stopRenderer();
|
|
48
|
+
stopRenderer = void 0;
|
|
49
|
+
const canvas = canvasRef.value;
|
|
50
|
+
if (!canvas) return;
|
|
51
|
+
const representativePhase = .6;
|
|
52
|
+
const sz = resolvedSize.value;
|
|
53
|
+
const dpr = Math.min(2, window.devicePixelRatio || 1);
|
|
54
|
+
canvas.width = Math.round(sz * dpr);
|
|
55
|
+
canvas.height = Math.round(sz * dpr);
|
|
56
|
+
const context = canvas.getContext("2d");
|
|
57
|
+
if (!context) return;
|
|
58
|
+
const { mode, speed: presetSpeed, opts } = resolvePreset(__props.state, sz);
|
|
59
|
+
const draw = MODE_DRAWS[mode];
|
|
60
|
+
const effectiveSpeed = presetSpeed * __props.speed;
|
|
61
|
+
const drawFrame = (time) => {
|
|
62
|
+
context.setTransform(dpr, 0, 0, dpr, 0, 0);
|
|
63
|
+
context.clearRect(0, 0, sz, sz);
|
|
64
|
+
draw(context, sz, time, isDark.value, opts);
|
|
65
|
+
};
|
|
66
|
+
if (reducedMotion.value) {
|
|
67
|
+
drawFrame(representativePhase);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
let animationFrame = 0;
|
|
71
|
+
let running = false;
|
|
72
|
+
let visible = true;
|
|
73
|
+
const loop = () => {
|
|
74
|
+
drawFrame(performance.now() / 1e3 * effectiveSpeed);
|
|
75
|
+
if (running) animationFrame = requestAnimationFrame(loop);
|
|
76
|
+
};
|
|
77
|
+
const start = () => {
|
|
78
|
+
if (running || __props.paused) return;
|
|
79
|
+
running = true;
|
|
80
|
+
animationFrame = requestAnimationFrame(loop);
|
|
81
|
+
};
|
|
82
|
+
const stop = () => {
|
|
83
|
+
running = false;
|
|
84
|
+
cancelAnimationFrame(animationFrame);
|
|
85
|
+
};
|
|
86
|
+
drawFrame(__props.paused ? representativePhase : performance.now() / 1e3 * effectiveSpeed);
|
|
87
|
+
const observer = typeof IntersectionObserver === "undefined" ? void 0 : new IntersectionObserver(([entry]) => {
|
|
88
|
+
var _entry$isIntersecting;
|
|
89
|
+
visible = (_entry$isIntersecting = entry === null || entry === void 0 ? void 0 : entry.isIntersecting) !== null && _entry$isIntersecting !== void 0 ? _entry$isIntersecting : false;
|
|
90
|
+
if (visible && document.visibilityState !== "hidden") start();
|
|
91
|
+
else stop();
|
|
92
|
+
});
|
|
93
|
+
observer === null || observer === void 0 || observer.observe(canvas);
|
|
94
|
+
const handleVisibilityChange = () => {
|
|
95
|
+
if (document.visibilityState === "hidden") stop();
|
|
96
|
+
else if (visible) start();
|
|
97
|
+
};
|
|
98
|
+
document.addEventListener("visibilitychange", handleVisibilityChange);
|
|
99
|
+
if (!observer) start();
|
|
100
|
+
stopRenderer = () => {
|
|
101
|
+
stop();
|
|
102
|
+
observer === null || observer === void 0 || observer.disconnect();
|
|
103
|
+
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function setupReducedMotion() {
|
|
107
|
+
const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
108
|
+
const update = () => {
|
|
109
|
+
reducedMotion.value = mediaQuery.matches;
|
|
110
|
+
};
|
|
111
|
+
update();
|
|
112
|
+
mediaQuery.addEventListener("change", update);
|
|
113
|
+
stopReducedMotion = () => mediaQuery.removeEventListener("change", update);
|
|
114
|
+
}
|
|
115
|
+
watch([
|
|
116
|
+
() => __props.state,
|
|
117
|
+
resolvedSize,
|
|
118
|
+
() => __props.speed,
|
|
119
|
+
() => __props.paused,
|
|
120
|
+
isDark,
|
|
121
|
+
reducedMotion
|
|
122
|
+
], setupRenderer, { flush: "post" });
|
|
123
|
+
onMounted(() => {
|
|
124
|
+
setupReducedMotion();
|
|
125
|
+
setupRenderer();
|
|
126
|
+
});
|
|
127
|
+
onUnmounted(() => {
|
|
128
|
+
stopRenderer === null || stopRenderer === void 0 || stopRenderer();
|
|
129
|
+
stopReducedMotion === null || stopReducedMotion === void 0 || stopReducedMotion();
|
|
130
|
+
});
|
|
131
|
+
return (_ctx, _cache) => {
|
|
132
|
+
return openBlock(), createElementBlock("canvas", mergeProps({
|
|
133
|
+
ref_key: "canvasRef",
|
|
134
|
+
ref: canvasRef
|
|
135
|
+
}, canvasAttrs.value), null, 16);
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}));
|
|
139
|
+
//#endregion
|
|
140
|
+
export { thinking_orb_vue_vue_type_script_setup_true_lang_default as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ThinkingOrbState = 'working' | 'searching' | 'solving' | 'listening' | 'connecting' | 'weaving' | 'composing' | 'breathing' | 'shaping';
|
|
2
|
+
export type ThinkingOrbSize = 20 | 64;
|
|
3
|
+
export type ThinkingOrbTheme = 'auto' | 'dark' | 'light';
|
|
4
|
+
export type OrbState = ThinkingOrbState;
|
|
5
|
+
export type OrbSize = ThinkingOrbSize;
|
|
6
|
+
export interface ThinkingOrbProps {
|
|
7
|
+
state?: ThinkingOrbState;
|
|
8
|
+
size?: ThinkingOrbSize;
|
|
9
|
+
theme?: ThinkingOrbTheme;
|
|
10
|
+
speed?: number;
|
|
11
|
+
paused?: boolean;
|
|
12
|
+
}
|
|
@@ -27,6 +27,8 @@ var toolbar_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
|
|
|
27
27
|
type: Boolean,
|
|
28
28
|
default: true
|
|
29
29
|
},
|
|
30
|
+
searchBtn: {},
|
|
31
|
+
resetBtn: {},
|
|
30
32
|
showActions: {
|
|
31
33
|
type: Boolean,
|
|
32
34
|
default: true
|
|
@@ -175,21 +177,17 @@ var toolbar_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
|
|
|
175
177
|
_: 3
|
|
176
178
|
}, 8, ["class"])) : createCommentVNode("", true), _ctx.$slots.extra ? renderSlot(_ctx.$slots, "extra", {}, void 0, void 0, 1) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
177
179
|
renderSlot(_ctx.$slots, "action-prepend"),
|
|
178
|
-
__props.showSearch ? (openBlock(), createBlock(unref(Button), {
|
|
180
|
+
__props.showSearch ? (openBlock(), createBlock(unref(Button), mergeProps({
|
|
179
181
|
key: 0,
|
|
180
|
-
type: "primary"
|
|
181
|
-
|
|
182
|
-
}, {
|
|
182
|
+
type: "primary"
|
|
183
|
+
}, __props.searchBtn, { onClick: handleSearch }), {
|
|
183
184
|
default: withCtx(() => [createTextVNode(toDisplayString(__props.searchText), 1)]),
|
|
184
185
|
_: 1
|
|
185
|
-
})) : createCommentVNode("", true),
|
|
186
|
-
__props.showReset ? (openBlock(), createBlock(unref(Button), {
|
|
187
|
-
key: 1,
|
|
188
|
-
onClick: _cache[1] || (_cache[1] = ($event) => reset())
|
|
189
|
-
}, {
|
|
186
|
+
}, 16)) : createCommentVNode("", true),
|
|
187
|
+
__props.showReset ? (openBlock(), createBlock(unref(Button), mergeProps({ key: 1 }, __props.resetBtn, { onClick: _cache[1] || (_cache[1] = ($event) => reset()) }), {
|
|
190
188
|
default: withCtx(() => [createTextVNode(toDisplayString(__props.resetText), 1)]),
|
|
191
189
|
_: 1
|
|
192
|
-
})) : createCommentVNode("", true),
|
|
190
|
+
}, 16)) : createCommentVNode("", true),
|
|
193
191
|
renderSlot(_ctx.$slots, "action-append")
|
|
194
192
|
], 64))], 2)) : createCommentVNode("", true)]),
|
|
195
193
|
_: 3
|
package/es/toolbar/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ButtonProps } from '../button';
|
|
1
2
|
import type { JsonFormSchema } from '../json-form';
|
|
2
3
|
import type { SpinProps } from '../spin';
|
|
3
4
|
export type ToolbarModelValue = Record<string, unknown>;
|
|
@@ -7,6 +8,8 @@ export interface ToolbarProps {
|
|
|
7
8
|
spinProps?: SpinProps;
|
|
8
9
|
showSearch?: boolean;
|
|
9
10
|
showReset?: boolean;
|
|
11
|
+
searchBtn?: ButtonProps;
|
|
12
|
+
resetBtn?: ButtonProps;
|
|
10
13
|
showActions?: boolean;
|
|
11
14
|
searchText?: string;
|
|
12
15
|
resetText?: string;
|