zen-wdg 2.0.7 → 2.0.9

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.
@@ -0,0 +1,14 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {
2
+ hours: string;
3
+ minutes: string;
4
+ seconds: string;
5
+ dayOfWeek: string;
6
+ day: string;
7
+ month: string;
8
+ year: string;
9
+ }, {}, {
10
+ updateClock(): void;
11
+ getDayOfWeek(dayIndex: any): string;
12
+ getMonthName(monthIndex: any): string;
13
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
14
+ export default _default;
@@ -0,0 +1 @@
1
+ .clock-container[data-v-e9445086]{display:flex;justify-content:center;align-items:center;height:100%;width:100%}.clock[data-v-e9445086]{text-align:center;font-family:Arial,sans-serif;color:#333;background-color:#14141466;backdrop-filter:blur(.2rem);border-radius:15px;padding:20px;width:100%}.time[data-v-e9445086]{font-size:4em;font-weight:700;color:#fff;display:flex;justify-content:center}.date[data-v-e9445086]{font-size:1.2em;color:#fff;margin-top:10px}@media (max-width: 500px){.time[data-v-e9445086]{font-size:3em}.date[data-v-e9445086]{font-size:1em}}
@@ -1,5 +1,4 @@
1
1
  import { createElementBlock, openBlock, createElementVNode, createTextVNode, toDisplayString, defineCustomElement } from "vue";
2
- const _style_0 = ".clock-container[data-v-e9445086]{display:flex;justify-content:center;align-items:center;height:100%;width:100%}.clock[data-v-e9445086]{text-align:center;font-family:Arial,sans-serif;color:#333;background-color:#14141466;backdrop-filter:blur(.2rem);border-radius:15px;padding:20px;width:100%}.time[data-v-e9445086]{font-size:4em;font-weight:700;color:#fff;display:flex;justify-content:center}.date[data-v-e9445086]{font-size:1.2em;color:#fff;margin-top:10px}@media (max-width: 500px){.time[data-v-e9445086]{font-size:3em}.date[data-v-e9445086]{font-size:1em}}";
3
2
  const _export_sfc = (sfc, props) => {
4
3
  const target = sfc.__vccOpts || sfc;
5
4
  for (const [key, val] of props) {
@@ -76,7 +75,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
76
75
  ])
77
76
  ]);
78
77
  }
79
- const ZClockWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["styles", [_style_0]], ["__scopeId", "data-v-e9445086"]]);
78
+ const ZClockWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e9445086"]]);
80
79
  const ZClockElement = defineCustomElement(ZClockWidget);
81
80
  if (!customElements.get("z-clock-widget")) {
82
81
  customElements.define("z-clock-widget", ZClockElement);
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ZenWdg={},e.Vue)}(this,function(e,t){"use strict";const o={class:"clock-container"},n={class:"clock"},i={class:"time"},a={class:"date"};const s=((e,t)=>{const o=e.__vccOpts||e;for(const[n,i]of t)o[n]=i;return o})({name:"ZClockWidget",data:()=>({hours:"00",minutes:"00",seconds:"00",dayOfWeek:"",day:"",month:"",year:""}),mounted(){this.updateClock(),setInterval(this.updateClock,1e3)},methods:{updateClock(){const e=new Date;this.hours=e.getHours().toString().padStart(2,"0"),this.minutes=e.getMinutes().toString().padStart(2,"0"),this.seconds=e.getSeconds().toString().padStart(2,"0"),this.dayOfWeek=this.getDayOfWeek(e.getDay()),this.day=e.getDate(),this.month=this.getMonthName(e.getMonth()),this.year=e.getFullYear()},getDayOfWeek:e=>["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"][e],getMonthName:e=>["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"][e]}},[["render",function(e,s,r,d,l,c){return t.openBlock(),t.createElementBlock("div",o,[t.createElementVNode("div",n,[t.createElementVNode("div",i,[t.createElementVNode("span",null,t.toDisplayString(l.hours),1),s[0]||(s[0]=t.createTextVNode(":",-1)),t.createElementVNode("span",null,t.toDisplayString(l.minutes),1)]),t.createElementVNode("div",a,[t.createElementVNode("span",null,t.toDisplayString(l.dayOfWeek)+", "+t.toDisplayString(l.day)+" "+t.toDisplayString(l.month)+" "+t.toDisplayString(l.year),1)])])])}],["styles",[".clock-container[data-v-e9445086]{display:flex;justify-content:center;align-items:center;height:100%;width:100%}.clock[data-v-e9445086]{text-align:center;font-family:Arial,sans-serif;color:#333;background-color:#14141466;backdrop-filter:blur(.2rem);border-radius:15px;padding:20px;width:100%}.time[data-v-e9445086]{font-size:4em;font-weight:700;color:#fff;display:flex;justify-content:center}.date[data-v-e9445086]{font-size:1.2em;color:#fff;margin-top:10px}@media (max-width: 500px){.time[data-v-e9445086]{font-size:3em}.date[data-v-e9445086]{font-size:1em}}"]],["__scopeId","data-v-e9445086"]]),r=t.defineCustomElement(s);customElements.get("z-clock-widget")||customElements.define("z-clock-widget",r),e.ZClockWidget=s,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ZenWdg={},e.Vue)}(this,function(e,t){"use strict";const o={class:"clock-container"},n={class:"clock"},s={class:"time"},i={class:"date"};const a=((e,t)=>{const o=e.__vccOpts||e;for(const[n,s]of t)o[n]=s;return o})({name:"ZClockWidget",data:()=>({hours:"00",minutes:"00",seconds:"00",dayOfWeek:"",day:"",month:"",year:""}),mounted(){this.updateClock(),setInterval(this.updateClock,1e3)},methods:{updateClock(){const e=new Date;this.hours=e.getHours().toString().padStart(2,"0"),this.minutes=e.getMinutes().toString().padStart(2,"0"),this.seconds=e.getSeconds().toString().padStart(2,"0"),this.dayOfWeek=this.getDayOfWeek(e.getDay()),this.day=e.getDate(),this.month=this.getMonthName(e.getMonth()),this.year=e.getFullYear()},getDayOfWeek:e=>["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"][e],getMonthName:e=>["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"][e]}},[["render",function(e,a,r,d,l,c){return t.openBlock(),t.createElementBlock("div",o,[t.createElementVNode("div",n,[t.createElementVNode("div",s,[t.createElementVNode("span",null,t.toDisplayString(l.hours),1),a[0]||(a[0]=t.createTextVNode(":",-1)),t.createElementVNode("span",null,t.toDisplayString(l.minutes),1)]),t.createElementVNode("div",i,[t.createElementVNode("span",null,t.toDisplayString(l.dayOfWeek)+", "+t.toDisplayString(l.day)+" "+t.toDisplayString(l.month)+" "+t.toDisplayString(l.year),1)])])])}],["__scopeId","data-v-e9445086"]]),r=t.defineCustomElement(a);customElements.get("z-clock-widget")||customElements.define("z-clock-widget",r),e.ZClockWidget=a,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-wdg",
3
- "version": "2.0.7",
3
+ "version": "2.0.9",
4
4
  "description": "Minimal widget library for Gridstack-based newtab extensions",
5
5
  "main": "dist/zen-wdg.umd.js",
6
6
  "module": "dist/zen-wdg.es.js",
@@ -13,24 +13,25 @@
13
13
  },
14
14
  "type": "module",
15
15
  "scripts": {
16
- "build": "vite build && tsc",
16
+ "build": "vite build && vue-tsc --declaration --emitDeclarationOnly --outDir dist",
17
17
  "dev": "vite"
18
18
  },
19
19
  "author": "Im-Jota",
20
20
  "license": "AGPL-3.0",
21
21
  "devDependencies": {
22
22
  "@vitejs/plugin-vue": "^6.0.0",
23
+ "rollup-plugin-postcss": "^4.0.2",
23
24
  "terser": "^5.43.1",
24
25
  "typescript": "^5.8.3",
25
26
  "vite": "^6.0.0",
26
27
  "vite-plugin-copy": "^0.1.6",
27
- "vue": "^3.5.18"
28
+ "vue": "^3.5.18",
29
+ "vue-tsc": "^3.0.3"
28
30
  },
29
31
  "files": [
30
32
  "dist/",
31
33
  "src/index.js",
32
34
  "src/widgets/",
33
- "src/register.js",
34
35
  "AUTHORS.md"
35
36
  ]
36
37
  }
package/src/register.js DELETED
@@ -1,13 +0,0 @@
1
- // src/register.js
2
- import { defineCustomElement } from 'vue'
3
- import ClockWidget from './widgets/z-clock-widget.vue'
4
-
5
- const widgets = [
6
- { name: 'z-clock-widget', component: defineCustomElement(ClockWidget) },
7
- ]
8
-
9
- widgets.forEach(({ name, component }) => {
10
- if (!customElements.get(name)) {
11
- customElements.define(name, component)
12
- }
13
- })