@narrat/plugin-counter 2.17.0 → 2.18.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, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, 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, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
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
+ }>;
@@ -23,7 +23,6 @@ layout:
23
23
  screens: data/screens.yaml
24
24
  buttons: data/buttons.yaml
25
25
  skills: data/skills.yaml
26
- scripts: data/scripts.yaml
27
26
  characters: data/characters.yaml
28
27
  audio: data/audio.yaml
29
28
  notifications:
package/dist/demo.d.ts CHANGED
@@ -1 +1 @@
1
- import 'narrat/dist/style.css';
1
+ import 'narrat/dist/style.css';
@@ -44,7 +44,7 @@ class w extends C {
44
44
  c(this, "customStores");
45
45
  c(this, "customCommands");
46
46
  c(this, "customMenuTabs");
47
- const o = "2.17.0", e = new Date("2023-06-21T21:04:52.198Z").toLocaleString();
47
+ const o = "2.18.0-alpha.2", e = new Date("2023-06-24T18:22:19.985Z").toLocaleString();
48
48
  console.log(
49
49
  `%c [Narrat plugin] [@narrat/plugin-counter] v${o} - Built at ${e}`,
50
50
  "background: #222; color: #bada55"
@@ -1 +1 @@
1
- (function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("pinia"),require("narrat")):typeof define=="function"&&define.amd?define(["exports","vue","pinia","narrat"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n["narrat-plugin-counter"]={},n.Vue,n.pinia,n.narrat))})(this,function(n,e,o,a){"use strict";var C=Object.defineProperty;var h=(n,e,o)=>e in n?C(n,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[e]=o;var i=(n,e,o)=>(h(n,typeof e!="symbol"?e+"":e,o),o);const c=o.defineStore("counter",{state:()=>({count:0}),actions:{save(){return{count:this.count}},load(t){this.count=t.count},reset(){this.count=0}}}),m=e.defineComponent({setup(){console.log("counter ui");const t=c();return{counter:e.computed(()=>t.count)}}}),y="",p=(t,r)=>{const u=t.__vccOpts||t;for(const[s,d]of r)u[s]=d;return u};function f(t,r,u,s,d,l){return e.openBlock(),e.createElementBlock("h1",null,"Counter value: "+e.toDisplayString(t.counter),1)}const _=p(m,[["render",f]]);class g extends a.NarratPlugin{constructor(){super();i(this,"customStores");i(this,"customCommands");i(this,"customMenuTabs");const u="2.17.0",s=new Date("2023-06-21T21:04:52.198Z").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 l=>c().count++),new a.CommandPlugin("get_counter",[],async l=>c().count)],this.customMenuTabs=[{menuId:"menu",config:{id:"counter",text:"Counter",cssClass:"counter-menu-button",component:"CounterUi"},component:_}]}}n.CounterPlugin=g,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("pinia"),require("narrat")):typeof define=="function"&&define.amd?define(["exports","vue","pinia","narrat"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n["narrat-plugin-counter"]={},n.Vue,n.pinia,n.narrat))})(this,function(n,e,o,a){"use strict";var C=Object.defineProperty;var h=(n,e,o)=>e in n?C(n,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[e]=o;var i=(n,e,o)=>(h(n,typeof e!="symbol"?e+"":e,o),o);const c=o.defineStore("counter",{state:()=>({count:0}),actions:{save(){return{count:this.count}},load(t){this.count=t.count},reset(){this.count=0}}}),p=e.defineComponent({setup(){console.log("counter ui");const t=c();return{counter:e.computed(()=>t.count)}}}),y="",m=(t,r)=>{const u=t.__vccOpts||t;for(const[s,d]of r)u[s]=d;return u};function f(t,r,u,s,d,l){return e.openBlock(),e.createElementBlock("h1",null,"Counter value: "+e.toDisplayString(t.counter),1)}const _=m(p,[["render",f]]);class g extends a.NarratPlugin{constructor(){super();i(this,"customStores");i(this,"customCommands");i(this,"customMenuTabs");const u="2.18.0-alpha.2",s=new Date("2023-06-24T18:22:19.985Z").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 l=>c().count++),new a.CommandPlugin("get_counter",[],async l=>c().count)],this.customMenuTabs=[{menuId:"menu",config:{id:"counter",text:"Counter",cssClass:"counter-menu-button",component:"CounterUi"},component:_}]}}n.CounterPlugin=g,Object.defineProperties(n,{__esModule:{value:!0},[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": "2.17.0",
7
+ "version": "2.18.0-alpha.2",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git@github.com:liana-p/narrat-engine.git",
@@ -23,7 +23,6 @@ layout:
23
23
  screens: data/screens.yaml
24
24
  buttons: data/buttons.yaml
25
25
  skills: data/skills.yaml
26
- scripts: data/scripts.yaml
27
26
  characters: data/characters.yaml
28
27
  audio: data/audio.yaml
29
28
  notifications:
package/src/demo.ts CHANGED
@@ -2,11 +2,14 @@ import 'narrat/dist/style.css';
2
2
  import { registerPlugin, startApp } from 'narrat';
3
3
  import { CounterPlugin } from './plugin';
4
4
 
5
+ import game from './scripts/game.narrat';
6
+
5
7
  window.addEventListener('load', () => {
6
8
  registerPlugin(new CounterPlugin());
7
9
  startApp({
8
10
  configPath: 'data/config.yaml',
9
11
  logging: false,
10
12
  debug: true,
13
+ scripts: [game],
11
14
  });
12
15
  });
@@ -0,0 +1,7 @@
1
+ // shims-narrat.d.ts
2
+
3
+ declare module '*.narrat' {
4
+ import { NarratScript } from 'narrat';
5
+ const narratScript: NarratScript;
6
+ export default narratScript;
7
+ }
@@ -1,2 +0,0 @@
1
- ---
2
- - data/game.narrat
@@ -1,2 +0,0 @@
1
- main:
2
- "Hello world"
@@ -1,2 +0,0 @@
1
- ---
2
- - data/game.narrat
File without changes