analog-clock-components 0.2.66 → 0.2.68

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 +1 @@
1
- import{p as e,b as o}from"./p-DmB9wucR.js";export{s as setNonce}from"./p-DmB9wucR.js";import{g as m}from"./p-DQuL1Twl.js";(()=>{const o=import.meta.url,m={};return""!==o&&(m.resourcesUrl=new URL(".",o).href),e(m)})().then((async e=>(await m(),o([["p-b6de1b20",[[257,"analog-clock",{size:[2],timeZone:[2,"time-zone"],time:[32]}]]]],e))));
1
+ import{p as e,b as o}from"./p-6zWiImGa.js";export{s as setNonce}from"./p-6zWiImGa.js";import{g as a}from"./p-DQuL1Twl.js";(()=>{const o=import.meta.url,a={};return""!==o&&(a.resourcesUrl=new URL(".",o).href),e(a)})().then((async e=>(await a(),o([["p-d3086dee",[[257,"analog-clock",{size:[2],timeZone:[2,"time-zone"],time:[32]}]]]],e))));
@@ -1 +1 @@
1
- import{r as e,h as t}from"./p-DmB9wucR.js";const c=class{constructor(t){e(this,t),this.size=void 0,this.timeZone=0,this.time=Date.now()}componentDidLoad(){this.timer=window.setInterval((()=>{this.time=Date.now()}),250)}disconnectedCallback(){clearInterval(this.timer)}get hour(){return new Date(this.time).getHours()}get minute(){return new Date(this.time).getMinutes()}get second(){return new Date(this.time).getSeconds()}hourToDegrees(){const e=this.hour+this.timeZone;return Math.floor(this.minute/2)+30*e}minuteToDegrees(){return Math.floor(this.second/10)+6*this.minute}secondToDegrees(){return 6*this.second}render(){return t("svg",{key:"39e3465d3bf04035966b00bb15186d1f712163cd",class:"clock",viewBox:"0 0 200 200",width:this.size,height:this.size},t("circle",{key:"e4c4288aa0efc9cf98027eef1f5bd7c550c23a18",id:"circle",cx:"100",cy:"100",r:"95","stroke-width":"10",fill:"transparent"}),t("line",{key:"296fb8ac19749103439f2ce1878db5ccfb214c20",id:"hour",transform:`rotate(${this.hourToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"60","stroke-width":"10","stroke-linecap":"round"}),t("line",{key:"acbe2c6ebdf05ff46e06144839dec43c45e8b40d",id:"minute",transform:`rotate(${this.minuteToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"30","stroke-width":"8","stroke-linecap":"round"}),t("line",{key:"f275abf7169379b2f61c9cdd185068f5e2373d4a",id:"second",transform:`rotate(${this.secondToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"20","stroke-width":"2","stroke-linecap":"round"}))}};c.style=".clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}";export{c as analog_clock}
1
+ import{r as e,h as t}from"./p-6zWiImGa.js";const c=class{constructor(t){e(this,t),this.size=void 0,this.timeZone=0,this.time=Date.now()}componentDidLoad(){this.timer=window.setInterval((()=>{this.time=Date.now()}),250)}disconnectedCallback(){clearInterval(this.timer)}get hour(){return new Date(this.time).getHours()}get minute(){return new Date(this.time).getMinutes()}get second(){return new Date(this.time).getSeconds()}hourToDegrees(){const e=this.hour+this.timeZone;return Math.floor(this.minute/2)+30*e}minuteToDegrees(){return Math.floor(this.second/10)+6*this.minute}secondToDegrees(){return 6*this.second}render(){return t("svg",{key:"39e3465d3bf04035966b00bb15186d1f712163cd",class:"clock",viewBox:"0 0 200 200",width:this.size,height:this.size},t("circle",{key:"e4c4288aa0efc9cf98027eef1f5bd7c550c23a18",id:"circle",cx:"100",cy:"100",r:"95","stroke-width":"10",fill:"transparent"}),t("line",{key:"296fb8ac19749103439f2ce1878db5ccfb214c20",id:"hour",transform:`rotate(${this.hourToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"60","stroke-width":"10","stroke-linecap":"round"}),t("line",{key:"acbe2c6ebdf05ff46e06144839dec43c45e8b40d",id:"minute",transform:`rotate(${this.minuteToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"30","stroke-width":"8","stroke-linecap":"round"}),t("line",{key:"f275abf7169379b2f61c9cdd185068f5e2373d4a",id:"second",transform:`rotate(${this.secondToDegrees()}, 100, 100)`,x1:"100",y1:"100",x2:"100",y2:"20","stroke-width":"2","stroke-linecap":"round"}))}};c.style=".clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}";export{c as analog_clock}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-BpOZr18C.js');
3
+ var index = require('./index-C6H0Qpg2.js');
4
4
 
5
- const analogClockCss = ".clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}";
5
+ const analogClockCss = () => `.clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}`;
6
6
 
7
7
  const AnalogClock = class {
8
8
  constructor(hostRef) {
@@ -42,6 +42,6 @@ const AnalogClock = class {
42
42
  return (index.h("svg", { key: '39e3465d3bf04035966b00bb15186d1f712163cd', class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size }, index.h("circle", { key: 'e4c4288aa0efc9cf98027eef1f5bd7c550c23a18', id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }), index.h("line", { key: '296fb8ac19749103439f2ce1878db5ccfb214c20', id: "hour", transform: `rotate(${this.hourToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "60", "stroke-width": "10", "stroke-linecap": "round" }), index.h("line", { key: 'acbe2c6ebdf05ff46e06144839dec43c45e8b40d', id: "minute", transform: `rotate(${this.minuteToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "30", "stroke-width": "8", "stroke-linecap": "round" }), index.h("line", { key: 'f275abf7169379b2f61c9cdd185068f5e2373d4a', id: "second", transform: `rotate(${this.secondToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "20", "stroke-width": "2", "stroke-linecap": "round" })));
43
43
  }
44
44
  };
45
- AnalogClock.style = analogClockCss;
45
+ AnalogClock.style = analogClockCss();
46
46
 
47
47
  exports.analog_clock = AnalogClock;
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-BpOZr18C.js');
3
+ var index = require('./index-C6H0Qpg2.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
7
7
  /*
8
- Stencil Client Patch Browser v4.38.3 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Browser v4.39.0 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
 
11
11
  var patchBrowser = () => {
@@ -4,7 +4,7 @@ const NAMESPACE = 'analog-clock';
4
4
  const BUILD = /* analog-clock */ { hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: false, state: true, updatable: true};
5
5
 
6
6
  /*
7
- Stencil Client Platform v4.38.3 | MIT Licensed | https://stenciljs.com
7
+ Stencil Client Platform v4.39.0 | MIT Licensed | https://stenciljs.com
8
8
  */
9
9
  var __defProp = Object.defineProperty;
10
10
  var __export = (target, all) => {
@@ -380,6 +380,9 @@ var attachStyles = (hostRef) => {
380
380
  };
381
381
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
382
382
  var h = (nodeName, vnodeData, ...children) => {
383
+ if (typeof nodeName === "string") {
384
+ nodeName = transformTag(nodeName);
385
+ }
383
386
  let child = null;
384
387
  let key = null;
385
388
  let simple = false;
@@ -1285,7 +1288,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1285
1288
  {
1286
1289
  cmpMeta.$members$ = compactMeta[2];
1287
1290
  }
1288
- const tagName = cmpMeta.$tagName$;
1291
+ const tagName = transformTag(cmpMeta.$tagName$);
1289
1292
  const HostElement = class extends HTMLElement {
1290
1293
  // StencilLazyHost
1291
1294
  constructor(self) {
@@ -1386,6 +1389,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1386
1389
 
1387
1390
  // src/runtime/nonce.ts
1388
1391
  var setNonce = (nonce) => plt.$nonce$ = nonce;
1392
+ function transformTag(tag) {
1393
+ return tag;
1394
+ }
1389
1395
 
1390
1396
  exports.bootstrapLazy = bootstrapLazy;
1391
1397
  exports.h = h;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-BpOZr18C.js');
3
+ var index = require('./index-C6H0Qpg2.js');
4
4
  var appGlobals = require('./app-globals-V2Kpy_OQ.js');
5
5
 
6
6
  const defineCustomElements = async (win, options) => {
@@ -4,8 +4,8 @@
4
4
  ],
5
5
  "compiler": {
6
6
  "name": "@stencil/core",
7
- "version": "4.38.3",
8
- "typescriptVersion": "5.9.3"
7
+ "version": "4.39.0",
8
+ "typescriptVersion": "5.8.3"
9
9
  },
10
10
  "collections": [],
11
11
  "bundles": []
@@ -1,6 +1,6 @@
1
- import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
1
+ import { proxyCustomElement, HTMLElement, h, transformTag } from '@stencil/core/internal/client';
2
2
 
3
- const analogClockCss = ".clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}";
3
+ const analogClockCss = () => `.clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}`;
4
4
 
5
5
  const AnalogClock$1 = /*@__PURE__*/ proxyCustomElement(class AnalogClock extends HTMLElement {
6
6
  constructor(registerHost) {
@@ -43,7 +43,7 @@ const AnalogClock$1 = /*@__PURE__*/ proxyCustomElement(class AnalogClock extends
43
43
  render() {
44
44
  return (h("svg", { key: '39e3465d3bf04035966b00bb15186d1f712163cd', class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size }, h("circle", { key: 'e4c4288aa0efc9cf98027eef1f5bd7c550c23a18', id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }), h("line", { key: '296fb8ac19749103439f2ce1878db5ccfb214c20', id: "hour", transform: `rotate(${this.hourToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "60", "stroke-width": "10", "stroke-linecap": "round" }), h("line", { key: 'acbe2c6ebdf05ff46e06144839dec43c45e8b40d', id: "minute", transform: `rotate(${this.minuteToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "30", "stroke-width": "8", "stroke-linecap": "round" }), h("line", { key: 'f275abf7169379b2f61c9cdd185068f5e2373d4a', id: "second", transform: `rotate(${this.secondToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "20", "stroke-width": "2", "stroke-linecap": "round" })));
45
45
  }
46
- static get style() { return analogClockCss; }
46
+ static get style() { return analogClockCss(); }
47
47
  }, [257, "analog-clock", {
48
48
  "size": [2],
49
49
  "timeZone": [2, "time-zone"],
@@ -56,8 +56,8 @@ function defineCustomElement$1() {
56
56
  const components = ["analog-clock"];
57
57
  components.forEach(tagName => { switch (tagName) {
58
58
  case "analog-clock":
59
- if (!customElements.get(tagName)) {
60
- customElements.define(tagName, AnalogClock$1);
59
+ if (!customElements.get(transformTag(tagName))) {
60
+ customElements.define(transformTag(tagName), AnalogClock$1);
61
61
  }
62
62
  break;
63
63
  } });
@@ -1,6 +1,6 @@
1
- import { r as registerInstance, h } from './index-DmB9wucR.js';
1
+ import { r as registerInstance, h } from './index-6zWiImGa.js';
2
2
 
3
- const analogClockCss = ".clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}";
3
+ const analogClockCss = () => `.clock #circle{stroke:var(--clock-circle-color, black)}.clock #hour{stroke:var(--clock-hour-color, black)}.clock #minute{stroke:var(--clock-minute-color, black)}.clock #second{stroke:var(--clock-second-color, black)}`;
4
4
 
5
5
  const AnalogClock = class {
6
6
  constructor(hostRef) {
@@ -40,6 +40,6 @@ const AnalogClock = class {
40
40
  return (h("svg", { key: '39e3465d3bf04035966b00bb15186d1f712163cd', class: "clock", viewBox: "0 0 200 200", width: this.size, height: this.size }, h("circle", { key: 'e4c4288aa0efc9cf98027eef1f5bd7c550c23a18', id: "circle", cx: "100", cy: "100", r: "95", "stroke-width": "10", fill: "transparent" }), h("line", { key: '296fb8ac19749103439f2ce1878db5ccfb214c20', id: "hour", transform: `rotate(${this.hourToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "60", "stroke-width": "10", "stroke-linecap": "round" }), h("line", { key: 'acbe2c6ebdf05ff46e06144839dec43c45e8b40d', id: "minute", transform: `rotate(${this.minuteToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "30", "stroke-width": "8", "stroke-linecap": "round" }), h("line", { key: 'f275abf7169379b2f61c9cdd185068f5e2373d4a', id: "second", transform: `rotate(${this.secondToDegrees()}, 100, 100)`, x1: "100", y1: "100", x2: "100", y2: "20", "stroke-width": "2", "stroke-linecap": "round" })));
41
41
  }
42
42
  };
43
- AnalogClock.style = analogClockCss;
43
+ AnalogClock.style = analogClockCss();
44
44
 
45
45
  export { AnalogClock as analog_clock };
@@ -1,9 +1,9 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-DmB9wucR.js';
2
- export { s as setNonce } from './index-DmB9wucR.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-6zWiImGa.js';
2
+ export { s as setNonce } from './index-6zWiImGa.js';
3
3
  import { g as globalScripts } from './app-globals-DQuL1Twl.js';
4
4
 
5
5
  /*
6
- Stencil Client Patch Browser v4.38.3 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v4.39.0 | MIT Licensed | https://stenciljs.com
7
7
  */
8
8
 
9
9
  var patchBrowser = () => {
@@ -2,7 +2,7 @@ const NAMESPACE = 'analog-clock';
2
2
  const BUILD = /* analog-clock */ { hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: false, state: true, updatable: true};
3
3
 
4
4
  /*
5
- Stencil Client Platform v4.38.3 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Platform v4.39.0 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  var __defProp = Object.defineProperty;
8
8
  var __export = (target, all) => {
@@ -378,6 +378,9 @@ var attachStyles = (hostRef) => {
378
378
  };
379
379
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
380
380
  var h = (nodeName, vnodeData, ...children) => {
381
+ if (typeof nodeName === "string") {
382
+ nodeName = transformTag(nodeName);
383
+ }
381
384
  let child = null;
382
385
  let key = null;
383
386
  let simple = false;
@@ -1283,7 +1286,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1283
1286
  {
1284
1287
  cmpMeta.$members$ = compactMeta[2];
1285
1288
  }
1286
- const tagName = cmpMeta.$tagName$;
1289
+ const tagName = transformTag(cmpMeta.$tagName$);
1287
1290
  const HostElement = class extends HTMLElement {
1288
1291
  // StencilLazyHost
1289
1292
  constructor(self) {
@@ -1384,5 +1387,8 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1384
1387
 
1385
1388
  // src/runtime/nonce.ts
1386
1389
  var setNonce = (nonce) => plt.$nonce$ = nonce;
1390
+ function transformTag(tag) {
1391
+ return tag;
1392
+ }
1387
1393
 
1388
1394
  export { bootstrapLazy as b, h, promiseResolve as p, registerInstance as r, setNonce as s };
@@ -1,5 +1,5 @@
1
- import { b as bootstrapLazy } from './index-DmB9wucR.js';
2
- export { s as setNonce } from './index-DmB9wucR.js';
1
+ import { b as bootstrapLazy } from './index-6zWiImGa.js';
2
+ export { s as setNonce } from './index-6zWiImGa.js';
3
3
  import { g as globalScripts } from './app-globals-DQuL1Twl.js';
4
4
 
5
5
  const defineCustomElements = async (win, options) => {
@@ -125,6 +125,9 @@ export interface AttachInternalsDecorator {
125
125
  export interface ListenDecorator {
126
126
  (eventName: string, opts?: ListenOptions): CustomMethodDecorator<any>;
127
127
  }
128
+ export interface ResolveVarFunction {
129
+ <T>(variable: T): string;
130
+ }
128
131
  export interface ListenOptions {
129
132
  /**
130
133
  * Handlers can also be registered for an event other than the host itself.
@@ -208,6 +211,24 @@ export declare const AttachInternals: AttachInternalsDecorator;
208
211
  * https://stenciljs.com/docs/events#listen-decorator
209
212
  */
210
213
  export declare const Listen: ListenDecorator;
214
+ /**
215
+ * The `resolveVar()` function is a compile-time utility that resolves const variables
216
+ * and object properties to their string literal values. This allows variables to be
217
+ * used in `@Listen` and `@Event` decorators instead of hardcoded strings.
218
+ *
219
+ * @example
220
+ * ```ts
221
+ * const MY_EVENT = 'myEvent';
222
+ * @Listen(resolveVar(MY_EVENT))
223
+ * ```
224
+ *
225
+ * @example
226
+ * ```ts
227
+ * const EVENTS = { MY_EVENT: 'myEvent' } as const;
228
+ * @Event({ eventName: resolveVar(EVENTS.MY_EVENT) })
229
+ * ```
230
+ */
231
+ export declare const resolveVar: ResolveVarFunction;
211
232
  /**
212
233
  * The `@Method()` decorator is used to expose methods on the public API.
213
234
  * Class methods decorated with the @Method() decorator can be called directly
@@ -365,6 +386,27 @@ export declare function readTask(task: RafCallback): void;
365
386
  * Unhandled exception raised while rendering, during event handling, or lifecycles will trigger the custom event handler.
366
387
  */
367
388
  export declare const setErrorHandler: (handler: ErrorHandler) => void;
389
+ export type TagTransformer = (tag: string) => string;
390
+ /**
391
+ * Sets a tag transformer to be used when rendering your custom elements.
392
+ * ```ts
393
+ * setTagTransformer((tag) => {
394
+ * if (tag.startsWith('my-')) return `new-${tag}`
395
+ * return tag;
396
+ * });
397
+ * ```
398
+ * Will mean all your components that start with `my-` are defined instead with `new-my-` prefix.
399
+ *
400
+ * @param transformer the transformer function to use which must return a string.
401
+ */
402
+ export declare function setTagTransformer(transformer: TagTransformer): void;
403
+ /**
404
+ * Transforms a tag name using a transformer set via `setTagTransformer`
405
+ *
406
+ * @param tag - the tag to transform e.g. `my-tag`
407
+ * @returns the transformed tag e.g. `new-my-tag`
408
+ */
409
+ export declare function transformTag(tag: string): string;
368
410
  /**
369
411
  * @deprecated - Use `MixedInCtor` instead:
370
412
  * ```ts
@@ -1747,6 +1789,7 @@ export interface CustomElementsDefineOptions {
1747
1789
  exclude?: string[];
1748
1790
  resourcesUrl?: string;
1749
1791
  syncQueue?: boolean;
1792
+ /** @deprecated in-favour of `setTagTransformer` and `transformTag` */
1750
1793
  transformTagName?: (tagName: string) => string;
1751
1794
  jmp?: (c: Function) => any;
1752
1795
  raf?: (c: FrameRequestCallback) => number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "analog-clock-components",
3
- "version": "0.2.66",
3
+ "version": "0.2.68",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -25,12 +25,12 @@
25
25
  "format": "prettier --write src"
26
26
  },
27
27
  "dependencies": {
28
- "@stencil/core": "4.38.3"
28
+ "@stencil/core": "4.39.0"
29
29
  },
30
30
  "license": "MIT",
31
31
  "devDependencies": {
32
32
  "cspell": "9.4.0",
33
- "eslint": "9.39.1",
33
+ "eslint": "9.39.2",
34
34
  "prettier": "3.7.4",
35
35
  "typescript": "5.9.3"
36
36
  },