directix 1.7.0 → 1.9.0

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.
package/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  [![npm version](https://img.shields.io/npm/v/directix.svg)](https://www.npmjs.com/package/directix)
4
4
  [![npm downloads](https://img.shields.io/npm/dm/directix.svg)](https://www.npmjs.com/package/directix)
5
5
  [![GitHub license](https://img.shields.io/github/license/saqqdy/directix)](https://github.com/saqqdy/directix/blob/master/LICENSE)
6
+ [![CI](https://github.com/saqqdy/directix/actions/workflows/ci.yml/badge.svg)](https://github.com/saqqdy/directix/actions/workflows/ci.yml)
7
+ [![codecov](https://codecov.io/gh/saqqdy/directix/branch/master/graph/badge.svg)](https://codecov.io/gh/saqqdy/directix)
6
8
 
7
9
  **English** | **[中文文档](README_CN.md)**
8
10
 
@@ -19,6 +21,139 @@ A comprehensive, easy-to-use, and high-performance Vue custom directives library
19
21
  - ⚡ **Zero Dependencies** - Lightweight with minimal bundle size
20
22
  - 🎨 **Composables** - Every directive has a corresponding composable for Composition API
21
23
  - 🔧 **Utility Exports** - Export `configurePermission`, `getPermissionConfig` and other utilities for advanced usage
24
+ - 🌐 **i18n Support** - Built-in internationalization with Chinese, English, and Japanese translations
25
+ - 🔌 **Plugin System** - Extensible plugin architecture for community contributions
26
+
27
+ ## What's New in v1.9.0
28
+
29
+ ### Internationalization (i18n)
30
+
31
+ Full i18n support for directive messages and documentation.
32
+
33
+ ```typescript
34
+ import { createI18n, setLocale } from 'directix'
35
+
36
+ // Initialize with locale
37
+ createI18n({
38
+ locale: 'en-US',
39
+ fallbackLocale: 'en-US',
40
+ messages: { 'en-US': enUS, 'zh-CN': zhCN, 'ja-JP': jaJP }
41
+ })
42
+
43
+ // Switch locale at runtime
44
+ setLocale('zh-CN')
45
+ ```
46
+
47
+ ### Unified Warning System
48
+
49
+ Improved developer experience with structured error messages.
50
+
51
+ ```typescript
52
+ import { warn, directiveWarn, assertType } from 'directix'
53
+
54
+ // Directive-specific warnings
55
+ directiveWarn('debounce', 'errors.invalid_wait', { wait: 'abc' })
56
+
57
+ // Type assertions
58
+ assertType<number>(value, 'number', 'debounce', 'wait')
59
+ ```
60
+
61
+ ### Plugin System
62
+
63
+ Extensible plugin architecture for community contributions.
64
+
65
+ ```typescript
66
+ import { definePlugin, getPluginManager } from 'directix'
67
+
68
+ const myPlugin = definePlugin({
69
+ meta: { name: 'my-plugin', version: '1.0.0' },
70
+ install(ctx) {
71
+ ctx.registerDirective('my-directive', vMyDirective)
72
+ }
73
+ })
74
+
75
+ getPluginManager().register(myPlugin)
76
+ ```
77
+
78
+ ### Community Plugin Registry
79
+
80
+ Discover and install community plugins programmatically.
81
+
82
+ ```typescript
83
+ import { getPluginRegistry } from 'directix'
84
+
85
+ const registry = getPluginRegistry()
86
+
87
+ // Search plugins
88
+ const results = await registry.search('animation')
89
+
90
+ // Get all plugins
91
+ const plugins = await registry.getAll()
92
+
93
+ // Install a plugin
94
+ await registry.install('directix-animate', manager)
95
+ ```
96
+
97
+ ### Timezone & Locale Utilities
98
+
99
+ Region-specific formatting for dates, numbers, and currencies.
100
+
101
+ ```typescript
102
+ import { getTimezoneInfo, formatDateLocale, formatCurrencyLocale } from 'directix'
103
+
104
+ // Get timezone info
105
+ const tz = getTimezoneInfo() // { id: 'Asia/Shanghai', offset: 8, ... }
106
+
107
+ // Format date by locale
108
+ formatDateLocale(new Date()) // Auto-detects user locale
109
+
110
+ // Format currency
111
+ formatCurrencyLocale(99.99) // '$99.99' (US) or '99,99€' (DE)
112
+ ```
113
+
114
+ ### Vue DevTools Integration
115
+
116
+ Debug directives directly in Vue DevTools.
117
+
118
+ ```typescript
119
+ import { enableDevtools, trackDirective } from 'directix'
120
+
121
+ // Enable DevTools integration
122
+ enableDevtools()
123
+
124
+ // Track directive usage
125
+ trackDirective('debounce', { element: 'input' })
126
+ ```
127
+
128
+ ### Performance Monitoring
129
+
130
+ Measure directive performance with detailed metrics.
131
+
132
+ ```typescript
133
+ import { enablePerformance, getPerformanceReport } from 'directix'
134
+
135
+ // Enable monitoring
136
+ enablePerformance()
137
+
138
+ // Get performance report
139
+ const report = getPerformanceReport()
140
+ // [{ name: 'debounce', mount: { p50: 0.5ms, p95: 1.2ms }, ... }]
141
+ ```
142
+
143
+ ### Scenario Examples
144
+
145
+ 10+ real-world examples demonstrating directive combinations:
146
+
147
+ - **Form Validation** - v-debounce, v-mask, v-trim, v-focus
148
+ - **Permission Management** - v-permission, v-click-outside
149
+ - **Image Gallery** - v-lazy, v-image-preview, v-swipe
150
+ - **Infinite Scroll** - v-infinite-scroll, v-virtual-list, v-loading
151
+ - **Rich Text Editor** - v-sanitize, v-highlight, v-emoji
152
+ - **Gesture Interaction** - v-touch, v-swipe, v-pan, v-pinch
153
+ - **Data Visualization** - v-progress, v-counter, v-countdown
154
+ - **Drag & Sort** - v-draggable, v-intersect
155
+ - **Print & Export** - v-print, v-export
156
+ - **Fullscreen Media** - v-fullscreen, v-lottie
22
157
 
23
158
  ## Online Demo
24
159
 
@@ -1789,6 +1924,11 @@ Each directive accepts different options. See the [documentation](https://github
1789
1924
 
1790
1925
  ## Roadmap
1791
1926
 
1927
+ ### v1.7.1 (2026-04-11) - Bug Fixes & Improvements ✅
1928
+
1929
+ - **Playground Fixes** - Monaco Editor loading, syntax highlighting, Vue version sync
1930
+ - **UI Improvements** - Removed redundant controls, unified documentation layout
1931
+
1792
1932
  ### v1.7.0 (2026-04-15) - Visual Configuration Tool ✅
1793
1933
 
1794
1934
  - **Online Playground** - Live editing environment with Vue 2/3 support
@@ -1798,7 +1938,7 @@ Each directive accepts different options. See the [documentation](https://github
1798
1938
  - **Monaco Editor** - CDN-loaded code editor with syntax highlighting
1799
1939
  - **Live Preview** - Real-time directive effect preview
1800
1940
 
1801
- ### v1.8.0 (Planned - 2026-04-22) - Quality & Ecosystem
1941
+ ### v1.8.0 (2026-04-22) - Quality & Ecosystem
1802
1942
 
1803
1943
  - **Test Coverage** - 90%+ unit test coverage, E2E testing with Playwright
1804
1944
  - **Performance Optimization** - Bundle size optimization, tree-shaking improvements