@stacksjs/stx 0.2.21 → 0.2.26

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,3 +1,25 @@
1
+ import type { CustomDirective, StxOptions } from './types';
2
+ /**
3
+ * Create an animation timeline for coordinated animations
4
+ */
5
+ export declare function createAnimationTimeline(entries: TimelineEntry[]): string;
6
+ /**
7
+ * Generate CSS for a custom animation
8
+ */
9
+ export declare function generateAnimationCSS(name: string, keyframes: Keyframe[], options: KeyframeAnimationOptions): string;
10
+ /**
11
+ * Parse animation shorthand string
12
+ * Format: "duration [delay] [easing] [iterations] [direction] [fill]"
13
+ */
14
+ export declare function parseAnimationShorthand(shorthand: string): KeyframeAnimationOptions;
15
+ /**
16
+ * Generate client-side animation runtime
17
+ */
18
+ export declare function generateAnimationRuntime(): string;
19
+ /**
20
+ * Register animation directives
21
+ */
22
+ export declare function registerAnimationDirectives(options: StxOptions): StxOptions;
1
23
  /**
2
24
  * Default transition options
3
25
  */
@@ -7,6 +29,14 @@ export declare const DEFAULT_TRANSITION_OPTIONS: {
7
29
  ease: string
8
30
  direction: string
9
31
  };
32
+ /**
33
+ * @stagger directive for staggered child animations
34
+ */
35
+ export declare const staggerDirective: CustomDirective;
36
+ /**
37
+ * @spring directive for spring physics animations
38
+ */
39
+ export declare const springDirective: CustomDirective;
10
40
  /**
11
41
  * Available transition types that can be used with @transition directive
12
42
  */
@@ -0,0 +1,2 @@
1
+ import type { BuiltinComponentDef } from '../component-registry';
2
+ export declare const StxDrawerBuiltin: BuiltinComponentDef;
@@ -1,4 +1,5 @@
1
1
  import { IconBuiltin } from './icon';
2
+ import { StxDrawerBuiltin } from './drawer';
2
3
  import { StxImageBuiltin } from './stx-image';
3
4
  import { StxLinkBuiltin } from './stx-link';
4
5
  import { StxLoadingIndicatorBuiltin } from './stx-loading-indicator';
@@ -12,8 +13,9 @@ export declare function registerBuiltins(): void;
12
13
  /**
13
14
  * Builtin Components Barrel
14
15
  *
15
- * Re-exports all builtin component definitions and provides a
16
- * convenience function to register them with the component registry.
16
+ * These are engine-level builtins that need deep template processing
17
+ * integration or inject runtime globals. Presentational UI components
18
+ * live in packages/components instead.
17
19
  *
18
20
  * @module builtins
19
21
  */
@@ -22,4 +24,6 @@ export { StxImageBuiltin } from './stx-image';
22
24
  export { StxLoadingIndicatorBuiltin } from './stx-loading-indicator';
23
25
  export { StxToastBuiltin } from './toast';
24
26
  export { StxModalBuiltin } from './modal';
27
+ export { StxDrawerBuiltin } from './drawer';
25
28
  export { IconBuiltin, preloadIconCollection } from './icon';
29
+ export { getTooltipRuntime } from './tooltip';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * x-tooltip Directive Runtime
3
+ *
4
+ * Provides a lightweight tooltip directive for the signals runtime.
5
+ * Uses event delegation with a single shared tooltip element.
6
+ *
7
+ * Usage:
8
+ * <button x-tooltip="Save changes">Save</button>
9
+ * <button x-tooltip="Delete item" x-tooltip-position="bottom">Delete</button>
10
+ * <span x-tooltip="Copy to clipboard" x-tooltip-position="left">Copy</span>
11
+ * <span x-tooltip="More info" x-tooltip-position="right">Info</span>
12
+ *
13
+ * Positions: top (default), bottom, left, right
14
+ * Override with x-tooltip-position attribute.
15
+ *
16
+ * @module builtins/tooltip
17
+ */
18
+ export declare function getTooltipRuntime(): string;
package/dist/caching.d.ts CHANGED
@@ -2,6 +2,14 @@ import type { StxOptions } from './types';
2
2
  /**
3
3
  * Read a file with mtime-based caching.
4
4
  * Returns cached content if file hasn't been modified since last read.
5
+ *
6
+ * Race-safe: stats → reads → re-stats. If the mtime moved between the
7
+ * initial stat and the read, the content we just got may not match the
8
+ * mtime we'd cache it under, so we retry up to 3 times. Without this,
9
+ * a writer flushing the file between our stat() and our read() would
10
+ * have us cache the *new* content under the *old* mtime — and the
11
+ * subsequent invalidation never fires because the cached mtime already
12
+ * "matches" the new file mtime on the next cache-hit check.
5
13
  */
6
14
  export declare function readFileCached(filePath: string): Promise<string>;
7
15
  /**