@narrat/plugin-counter 3.17.9 → 4.0.0-alpha.2

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.
@@ -1,4 +1,4 @@
1
- declare const _default: import("vue").DefineComponent<{}, {
2
- counter: import("vue").ComputedRef<number>;
3
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
4
- export default _default;
1
+ declare const _default: import("vue").DefineComponent<{}, {
2
+ counter: import("vue").ComputedRef<number>;
3
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
4
+ export default _default;
@@ -1,9 +1,9 @@
1
- export declare const useCounter: import("pinia").StoreDefinition<"counter", {
2
- count: number;
3
- }, {}, {
4
- save(): {
5
- count: number;
6
- };
7
- load(data: any): void;
8
- reset(): void;
9
- }>;
1
+ export declare const useCounter: import("pinia").StoreDefinition<"counter", {
2
+ count: number;
3
+ }, {}, {
4
+ save(): {
5
+ count: number;
6
+ };
7
+ load(data: any): void;
8
+ reset(): void;
9
+ }>;
package/dist/demo.d.ts CHANGED
@@ -1 +1 @@
1
- import 'narrat/dist/style.css';
1
+ import 'narrat/dist/style.css';
@@ -1,10 +1,7 @@
1
- var i = Object.defineProperty;
2
- var m = (t, o, n) => o in t ? i(t, o, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[o] = n;
3
- var c = (t, o, n) => (m(t, typeof o != "symbol" ? o + "" : o, n), n);
4
- import { defineComponent as l, computed as p, openBlock as d, createElementBlock as g, toDisplayString as f } from "vue";
5
- import { defineStore as C } from "pinia";
6
- import { NarratPlugin as _, CommandPlugin as a } from "narrat";
7
- const r = C("counter", {
1
+ import { defineComponent as s, computed as a, createElementBlock as i, openBlock as m, toDisplayString as l } from "vue";
2
+ import { defineStore as p } from "pinia";
3
+ import { NarratPlugin as d, CommandPlugin as u } from "narrat";
4
+ const c = p("counter", {
8
5
  state: () => ({
9
6
  count: 0
10
7
  }),
@@ -21,41 +18,41 @@ const r = C("counter", {
21
18
  this.count = 0;
22
19
  }
23
20
  }
24
- }), h = l({
21
+ }), g = s({
25
22
  setup() {
26
23
  console.log("counter ui");
27
- const t = r();
28
- return { counter: p(() => t.count) };
24
+ const t = c();
25
+ return { counter: a(() => t.count) };
29
26
  }
30
- }), $ = (t, o) => {
27
+ }), f = (t, o) => {
31
28
  const n = t.__vccOpts || t;
32
- for (const [e, u] of o)
33
- n[e] = u;
29
+ for (const [r, e] of o)
30
+ n[r] = e;
34
31
  return n;
35
32
  };
36
- function v(t, o, n, e, u, s) {
37
- return d(), g("h1", null, "Counter value: " + f(t.counter), 1);
33
+ function C(t, o, n, r, e, h) {
34
+ return m(), i("h1", null, "Counter value: " + l(t.counter), 1);
38
35
  }
39
- const x = /* @__PURE__ */ $(h, [["render", v]]);
40
- class w extends _ {
36
+ const _ = /* @__PURE__ */ f(g, [["render", C]]);
37
+ class S extends d {
38
+ customStores;
39
+ customCommands;
40
+ customMenuTabs;
41
41
  constructor() {
42
42
  super();
43
- c(this, "customStores");
44
- c(this, "customCommands");
45
- c(this, "customMenuTabs");
46
- const n = "3.17.9", e = (/* @__PURE__ */ new Date("2025-07-23T12:02:04.285Z")).toLocaleString();
43
+ const o = "4.0.0-alpha.2", n = (/* @__PURE__ */ new Date("2025-07-27T20:01:15.382Z")).toLocaleString();
47
44
  console.log(
48
- `%c [Narrat plugin] [@narrat/plugin-counter] v${n} - Built at ${e}`,
45
+ `%c [Narrat plugin] [@narrat/plugin-counter] v${o} - Built at ${n}`,
49
46
  "background: #222; color: #bada55"
50
47
  ), this.customStores = {
51
- counter: r
48
+ counter: c
52
49
  }, this.customCommands = [
53
- new a(
50
+ new u(
54
51
  "increase_counter",
55
52
  [],
56
- async (s) => r().count++
53
+ async (e) => c().count++
57
54
  ),
58
- new a("get_counter", [], async (s) => r().count)
55
+ new u("get_counter", [], async (e) => c().count)
59
56
  ], this.customMenuTabs = [
60
57
  {
61
58
  menuId: "menu",
@@ -65,11 +62,11 @@ class w extends _ {
65
62
  cssClass: "counter-menu-button",
66
63
  component: "CounterUi"
67
64
  },
68
- component: x
65
+ component: _
69
66
  }
70
67
  ];
71
68
  }
72
69
  }
73
70
  export {
74
- w as CounterPlugin
71
+ S as CounterPlugin
75
72
  };
@@ -1 +1 @@
1
- (function(t,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("pinia"),require("narrat")):typeof define=="function"&&define.amd?define(["exports","vue","pinia","narrat"],n):(t=typeof globalThis<"u"?globalThis:t||self,n(t["narrat-plugin-counter"]={},t.Vue,t.pinia,t.narrat))})(this,function(t,n,o,a){"use strict";var h=Object.defineProperty;var _=(t,n,o)=>n in t?h(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o;var i=(t,n,o)=>(_(t,typeof n!="symbol"?n+"":n,o),o);const c=o.defineStore("counter",{state:()=>({count:0}),actions:{save(){return{count:this.count}},load(e){this.count=e.count},reset(){this.count=0}}}),p=n.defineComponent({setup(){console.log("counter ui");const e=c();return{counter:n.computed(()=>e.count)}}}),l=(e,r)=>{const u=e.__vccOpts||e;for(const[s,d]of r)u[s]=d;return u};function f(e,r,u,s,d,m){return n.openBlock(),n.createElementBlock("h1",null,"Counter value: "+n.toDisplayString(e.counter),1)}const g=l(p,[["render",f]]);class C extends a.NarratPlugin{constructor(){super();i(this,"customStores");i(this,"customCommands");i(this,"customMenuTabs");const u="3.17.9",s=new Date("2025-07-23T12:02:04.285Z").toLocaleString();console.log(`%c [Narrat plugin] [@narrat/plugin-counter] v${u} - Built at ${s}`,"background: #222; color: #bada55"),this.customStores={counter:c},this.customCommands=[new a.CommandPlugin("increase_counter",[],async m=>c().count++),new a.CommandPlugin("get_counter",[],async m=>c().count)],this.customMenuTabs=[{menuId:"menu",config:{id:"counter",text:"Counter",cssClass:"counter-menu-button",component:"CounterUi"},component:g}]}}t.CounterPlugin=C,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
1
+ (function(n,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("pinia"),require("narrat")):typeof define=="function"&&define.amd?define(["exports","vue","pinia","narrat"],t):(n=typeof globalThis<"u"?globalThis:n||self,t(n["narrat-plugin-counter"]={},n.Vue,n.pinia,n.narrat))})(this,function(n,t,a,s){"use strict";const c=a.defineStore("counter",{state:()=>({count:0}),actions:{save(){return{count:this.count}},load(e){this.count=e.count},reset(){this.count=0}}}),d=t.defineComponent({setup(){console.log("counter ui");const e=c();return{counter:t.computed(()=>e.count)}}}),m=(e,o)=>{const u=e.__vccOpts||e;for(const[i,r]of o)u[i]=r;return u};function p(e,o,u,i,r,g){return t.openBlock(),t.createElementBlock("h1",null,"Counter value: "+t.toDisplayString(e.counter),1)}const l=m(d,[["render",p]]);class f extends s.NarratPlugin{customStores;customCommands;customMenuTabs;constructor(){super();const o="4.0.0-alpha.2",u=new Date("2025-07-27T20:01:15.382Z").toLocaleString();console.log(`%c [Narrat plugin] [@narrat/plugin-counter] v${o} - Built at ${u}`,"background: #222; color: #bada55"),this.customStores={counter:c},this.customCommands=[new s.CommandPlugin("increase_counter",[],async r=>c().count++),new s.CommandPlugin("get_counter",[],async r=>c().count)],this.customMenuTabs=[{menuId:"menu",config:{id:"counter",text:"Counter",cssClass:"counter-menu-button",component:"CounterUi"},component:l}]}}n.CounterPlugin=f,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
package/dist/plugin.d.ts CHANGED
@@ -1,14 +1,14 @@
1
- import { CommandPlugin, CustomMenuTab, CustomStores, NarratPlugin } from 'narrat';
2
- /**
3
- * The CounterPlugin is a simple example plugin to showcase the various features plugins can use.
4
- * This plugin will use the `counter-store` custom store to store custom data (which gets saved and loaded)
5
- * It uses the `counter-ui.vue` component to display the counter
6
- * It uses some `CommandPlugin` to add new commands to modify or get the counter's value
7
- * It uses the `CustomMenuButton` to add a new menu button to the menu bar
8
- */
9
- export declare class CounterPlugin extends NarratPlugin {
10
- customStores: CustomStores;
11
- customCommands: CommandPlugin<any>[];
12
- customMenuTabs: CustomMenuTab[];
13
- constructor();
14
- }
1
+ import { CommandPlugin, CustomMenuTab, CustomStores, NarratPlugin } from 'narrat';
2
+ /**
3
+ * The CounterPlugin is a simple example plugin to showcase the various features plugins can use.
4
+ * This plugin will use the `counter-store` custom store to store custom data (which gets saved and loaded)
5
+ * It uses the `counter-ui.vue` component to display the counter
6
+ * It uses some `CommandPlugin` to add new commands to modify or get the counter's value
7
+ * It uses the `CustomMenuButton` to add a new menu button to the menu bar
8
+ */
9
+ export declare class CounterPlugin extends NarratPlugin {
10
+ customStores: CustomStores;
11
+ customCommands: CommandPlugin<any>[];
12
+ customMenuTabs: CustomMenuTab[];
13
+ constructor();
14
+ }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "dist/narrat-plugin-counter.es.js",
5
5
  "module": "dist/narrat-plugin-counter.es.js",
6
6
  "types": "dist/plugin.d.ts",
7
- "version": "3.17.9",
7
+ "version": "4.0.0-alpha.2",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git@github.com:liana-p/narrat-engine.git",
@@ -29,13 +29,13 @@
29
29
  "vue": "^3.2.37"
30
30
  },
31
31
  "devDependencies": {
32
- "@vitejs/plugin-vue": "^4.2.3",
33
- "tsc-alias": "^1.6.11",
34
- "typescript": "^4.6.4",
35
- "vite": "^5.0.12",
36
- "vue-tsc": "^1.8.22",
32
+ "@vitejs/plugin-vue": "^6.0.0",
33
+ "tsc-alias": "^1.8.16",
34
+ "typescript": "^5.8.3",
35
+ "vite": "^7.0.5",
36
+ "vue-tsc": "^3.0.3",
37
37
  "narrat": "workspace:*",
38
- "pinia": "^2.1.7",
39
- "vue": "^3.4.21"
38
+ "pinia": "^3.0.3",
39
+ "vue": "^3.5.18"
40
40
  }
41
41
  }
File without changes