funnel-gfx-wc 0.1.128 → 0.1.133

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.
@@ -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": "funnel-gfx-wc",
3
- "version": "0.1.128",
3
+ "version": "0.1.133",
4
4
  "description": "prototype -- a simple SVG demo built with Stencil and Tailwind",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -27,8 +27,8 @@
27
27
  "format": "prettier --write src"
28
28
  },
29
29
  "dependencies": {
30
- "@stencil/core": "4.38.3",
31
- "@stencil/store": "2.2.1",
30
+ "@stencil/core": "4.39.0",
31
+ "@stencil/store": "2.2.2",
32
32
  "animejs": "4.2.2"
33
33
  },
34
34
  "devDependencies": {