oneko 0.3.0 → 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.
Files changed (41) hide show
  1. package/dist/chunks/{vanilla-CUrawvWx.js → vanilla-BNtPCdx5.js} +1079 -72
  2. package/dist/index.js +29 -7
  3. package/dist/solid.js +8 -3
  4. package/dist/svelte/Oneko.svelte +14 -4
  5. package/dist/svelte/Oneko.svelte.d.ts +2 -2
  6. package/dist/types/components/oneko.d.ts +12 -2
  7. package/dist/types/lib/oneko/affection.d.ts +16 -0
  8. package/dist/types/lib/oneko/animation/deps.d.ts +2 -0
  9. package/dist/types/lib/oneko/animation/errand-point.d.ts +7 -0
  10. package/dist/types/lib/oneko/animation/frame.d.ts +2 -1
  11. package/dist/types/lib/oneko/animation/play-types.d.ts +56 -0
  12. package/dist/types/lib/oneko/animation/play.d.ts +12 -0
  13. package/dist/types/lib/oneko/constants.d.ts +1 -0
  14. package/dist/types/lib/oneko/controls.d.ts +28 -0
  15. package/dist/types/lib/oneko/defaults.d.ts +5 -0
  16. package/dist/types/lib/oneko/initial-state.d.ts +4 -0
  17. package/dist/types/lib/oneko/mood.d.ts +7 -0
  18. package/dist/types/lib/oneko/pack.d.ts +4 -0
  19. package/dist/types/lib/oneko/pixel-art.d.ts +5 -0
  20. package/dist/types/lib/oneko/play-messages.d.ts +8 -0
  21. package/dist/types/lib/oneko/runtime-config.d.ts +2 -2
  22. package/dist/types/lib/oneko/seasons.d.ts +27 -0
  23. package/dist/types/lib/oneko/treats.d.ts +15 -0
  24. package/dist/types/lib/oneko/types.d.ts +61 -0
  25. package/dist/types/lib/oneko/vanilla.d.ts +3 -1
  26. package/dist/types/packages/oneko/src/solid.d.ts +5 -2
  27. package/dist/types/packages/oneko/src/vanilla.d.ts +2 -1
  28. package/dist/types/packages/oneko/src/vue.d.ts +71 -4
  29. package/dist/vanilla.js +4 -4
  30. package/dist/vue.js +38 -8
  31. package/package.json +1 -1
  32. package/dist/cat-sounds/Cat_royal_ambient5.ogg +0 -1
  33. package/dist/cat-sounds/Cat_royal_ambient6.ogg +0 -1
  34. package/dist/cat-sounds/Cat_royal_death.ogg +0 -1
  35. package/dist/cat-sounds/Cat_royal_hurt1.ogg +0 -1
  36. package/dist/cat-sounds/Cat_royal_hurt2.ogg +0 -1
  37. package/dist/cat-sounds/Cat_royal_hurt3.ogg +0 -1
  38. package/dist/cat-sounds/Stray_cat_idle1.ogg +0 -1
  39. package/dist/cat-sounds/Stray_cat_idle2.ogg +0 -1
  40. package/dist/cat-sounds/Stray_cat_idle3.ogg +0 -1
  41. package/dist/cat-sounds/Stray_cat_idle4.ogg +0 -1
package/dist/vanilla.js CHANGED
@@ -1,9 +1,9 @@
1
- import { e, d, c, i, o, f } from "./chunks/vanilla-CUrawvWx.js";
1
+ import { f, e, c, i, o, h } from "./chunks/vanilla-BNtPCdx5.js";
2
2
  export {
3
- e as ONEKO_SKINS,
4
- d as areCatsHidden,
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
- f as setCatsHidden
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-CUrawvWx.js";
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: { stateChange: (_state) => true },
48
- setup(props, { emit }) {
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 cat = createOneko();
57
- destroy = () => cat.destroy();
58
- update = createPropsUpdater(cat);
85
+ const created = createOneko();
86
+ cat = created;
87
+ destroy = () => created.destroy();
88
+ update = createPropsUpdater(created);
59
89
  update(options());
60
90
  });
61
91
  watch(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oneko",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "A tiny pixel cat for React, Vue, Svelte, Solid, and the browser. Bundled engine and 24 coats, no CDN required.",
5
5
  "keywords": [
6
6
  "cat",
@@ -1 +0,0 @@
1
- Forbidden. Calls to this URL via the terminal are not allowed. To save the url contents to the container, open the url in the computer tool, right click anywhere, and click "Save As...".
@@ -1 +0,0 @@
1
- Forbidden. Calls to this URL via the terminal are not allowed. To save the url contents to the container, open the url in the computer tool, right click anywhere, and click "Save As...".
@@ -1 +0,0 @@
1
- Forbidden. Calls to this URL via the terminal are not allowed. To save the url contents to the container, open the url in the computer tool, right click anywhere, and click "Save As...".
@@ -1 +0,0 @@
1
- Forbidden. Calls to this URL via the terminal are not allowed. To save the url contents to the container, open the url in the computer tool, right click anywhere, and click "Save As...".
@@ -1 +0,0 @@
1
- Forbidden. Calls to this URL via the terminal are not allowed. To save the url contents to the container, open the url in the computer tool, right click anywhere, and click "Save As...".
@@ -1 +0,0 @@
1
- Forbidden. Calls to this URL via the terminal are not allowed. To save the url contents to the container, open the url in the computer tool, right click anywhere, and click "Save As...".
@@ -1 +0,0 @@
1
- Forbidden. Calls to this URL via the terminal are not allowed. To save the url contents to the container, open the url in the computer tool, right click anywhere, and click "Save As...".
@@ -1 +0,0 @@
1
- Forbidden. Calls to this URL via the terminal are not allowed. To save the url contents to the container, open the url in the computer tool, right click anywhere, and click "Save As...".
@@ -1 +0,0 @@
1
- Forbidden. Calls to this URL via the terminal are not allowed. To save the url contents to the container, open the url in the computer tool, right click anywhere, and click "Save As...".
@@ -1 +0,0 @@
1
- Forbidden. Calls to this URL via the terminal are not allowed. To save the url contents to the container, open the url in the computer tool, right click anywhere, and click "Save As...".