oneko 0.3.1 → 0.4.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/chunks/{vanilla-BmeHFErE.js → vanilla-BNtPCdx5.js} +1074 -65
- package/dist/index.js +29 -7
- package/dist/solid.js +8 -3
- package/dist/svelte/Oneko.svelte +14 -4
- package/dist/svelte/Oneko.svelte.d.ts +2 -2
- package/dist/types/components/oneko.d.ts +12 -2
- package/dist/types/lib/oneko/affection.d.ts +16 -0
- package/dist/types/lib/oneko/animation/deps.d.ts +2 -0
- package/dist/types/lib/oneko/animation/errand-point.d.ts +7 -0
- package/dist/types/lib/oneko/animation/frame.d.ts +2 -1
- package/dist/types/lib/oneko/animation/play-types.d.ts +56 -0
- package/dist/types/lib/oneko/animation/play.d.ts +12 -0
- package/dist/types/lib/oneko/constants.d.ts +1 -0
- package/dist/types/lib/oneko/controls.d.ts +28 -0
- package/dist/types/lib/oneko/defaults.d.ts +5 -0
- package/dist/types/lib/oneko/initial-state.d.ts +4 -0
- package/dist/types/lib/oneko/mood.d.ts +7 -0
- package/dist/types/lib/oneko/pack.d.ts +4 -0
- package/dist/types/lib/oneko/pixel-art.d.ts +5 -0
- package/dist/types/lib/oneko/play-messages.d.ts +8 -0
- package/dist/types/lib/oneko/runtime-config.d.ts +2 -2
- package/dist/types/lib/oneko/seasons.d.ts +27 -0
- package/dist/types/lib/oneko/treats.d.ts +15 -0
- package/dist/types/lib/oneko/types.d.ts +61 -0
- package/dist/types/lib/oneko/vanilla.d.ts +3 -1
- package/dist/types/packages/oneko/src/solid.d.ts +5 -2
- package/dist/types/packages/oneko/src/vanilla.d.ts +2 -1
- package/dist/types/packages/oneko/src/vue.d.ts +71 -4
- package/dist/vanilla.js +4 -4
- package/dist/vue.js +38 -8
- package/package.json +1 -1
package/dist/vanilla.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { f, e, c, i, o, h } from "./chunks/vanilla-BNtPCdx5.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
f as ONEKO_SKINS,
|
|
4
|
+
e as areCatsHidden,
|
|
5
5
|
c as createOneko,
|
|
6
6
|
i as isOnekoSkin,
|
|
7
7
|
o as onCatsHiddenChange,
|
|
8
|
-
|
|
8
|
+
h as setCatsHidden
|
|
9
9
|
};
|
package/dist/vue.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, onMounted, watch, onBeforeUnmount } from "vue";
|
|
2
|
-
import { c as createOneko } from "./chunks/vanilla-
|
|
2
|
+
import { c as createOneko } from "./chunks/vanilla-BNtPCdx5.js";
|
|
3
3
|
import { createPropsUpdater } from "./adapter.js";
|
|
4
4
|
const vue = defineComponent({
|
|
5
5
|
name: "Oneko",
|
|
@@ -42,20 +42,50 @@ const vue = defineComponent({
|
|
|
42
42
|
napWhileTyping: { type: Boolean, default: void 0 },
|
|
43
43
|
followFocus: { type: Boolean, default: void 0 },
|
|
44
44
|
perchOnHover: { type: Boolean, default: void 0 },
|
|
45
|
-
pettable: { type: Boolean, default: void 0 }
|
|
45
|
+
pettable: { type: Boolean, default: void 0 },
|
|
46
|
+
seasonal: {
|
|
47
|
+
type: [Boolean, String],
|
|
48
|
+
default: void 0
|
|
49
|
+
},
|
|
50
|
+
grabbable: { type: Boolean, default: void 0 },
|
|
51
|
+
treats: { type: Boolean, default: void 0 },
|
|
52
|
+
timeOfDay: { type: Boolean, default: void 0 },
|
|
53
|
+
affection: { type: Boolean, default: void 0 }
|
|
46
54
|
},
|
|
47
|
-
emits: {
|
|
48
|
-
|
|
55
|
+
emits: {
|
|
56
|
+
stateChange: (_state) => true,
|
|
57
|
+
pet: (_detail) => true,
|
|
58
|
+
catchCursor: () => true,
|
|
59
|
+
sleep: () => true,
|
|
60
|
+
toss: (_detail) => true,
|
|
61
|
+
treat: (_detail) => true
|
|
62
|
+
},
|
|
63
|
+
setup(props, { emit, expose }) {
|
|
49
64
|
let update;
|
|
50
65
|
let destroy;
|
|
51
66
|
const options = () => ({
|
|
52
67
|
...props,
|
|
53
|
-
onStateChange: (state) => emit("stateChange", state)
|
|
68
|
+
onStateChange: (state) => emit("stateChange", state),
|
|
69
|
+
onPet: (detail) => emit("pet", detail),
|
|
70
|
+
onCatchCursor: () => emit("catchCursor"),
|
|
71
|
+
onSleep: () => emit("sleep"),
|
|
72
|
+
onToss: (detail) => emit("toss", detail),
|
|
73
|
+
onTreat: (detail) => emit("treat", detail)
|
|
74
|
+
});
|
|
75
|
+
let cat;
|
|
76
|
+
expose({
|
|
77
|
+
goTo: (target) => cat?.goTo(target) ?? Promise.resolve(false),
|
|
78
|
+
say: (text, options2) => cat?.say(text, options2),
|
|
79
|
+
sit: () => cat?.sit(),
|
|
80
|
+
follow: () => cat?.follow(),
|
|
81
|
+
pet: () => cat?.pet(),
|
|
82
|
+
dropTreat: (x, y) => cat?.dropTreat(x, y)
|
|
54
83
|
});
|
|
55
84
|
onMounted(() => {
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
85
|
+
const created = createOneko();
|
|
86
|
+
cat = created;
|
|
87
|
+
destroy = () => created.destroy();
|
|
88
|
+
update = createPropsUpdater(created);
|
|
59
89
|
update(options());
|
|
60
90
|
});
|
|
61
91
|
watch(
|