directix 1.7.0 → 1.8.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 +8 -1
- package/dist/index.cjs +28 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.iife.js +28 -12
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +2 -2
- package/dist/index.mjs +28 -12
- package/dist/index.mjs.map +1 -1
- package/dist/nuxt/index.cjs +23 -10
- package/dist/nuxt/index.cjs.map +2 -2
- package/dist/nuxt/index.d.ts +1 -1
- package/dist/nuxt/index.mjs +23 -10
- package/dist/nuxt/index.mjs.map +3 -3
- package/dist/nuxt/runtime/plugin.mjs +23 -10
- package/dist/nuxt/runtime/plugin.mjs.map +3 -3
- package/package.json +19 -9
package/README.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/directix)
|
|
4
4
|
[](https://www.npmjs.com/package/directix)
|
|
5
5
|
[](https://github.com/saqqdy/directix/blob/master/LICENSE)
|
|
6
|
+
[](https://github.com/saqqdy/directix/actions/workflows/ci.yml)
|
|
7
|
+
[](https://codecov.io/gh/saqqdy/directix)
|
|
6
8
|
|
|
7
9
|
**English** | **[中文文档](README_CN.md)**
|
|
8
10
|
|
|
@@ -1789,6 +1791,11 @@ Each directive accepts different options. See the [documentation](https://github
|
|
|
1789
1791
|
|
|
1790
1792
|
## Roadmap
|
|
1791
1793
|
|
|
1794
|
+
### v1.7.1 (2026-04-11) - Bug Fixes & Improvements ✅
|
|
1795
|
+
|
|
1796
|
+
- **Playground Fixes** - Monaco Editor loading, syntax highlighting, Vue version sync
|
|
1797
|
+
- **UI Improvements** - Removed redundant controls, unified documentation layout
|
|
1798
|
+
|
|
1792
1799
|
### v1.7.0 (2026-04-15) - Visual Configuration Tool ✅
|
|
1793
1800
|
|
|
1794
1801
|
- **Online Playground** - Live editing environment with Vue 2/3 support
|
|
@@ -1798,7 +1805,7 @@ Each directive accepts different options. See the [documentation](https://github
|
|
|
1798
1805
|
- **Monaco Editor** - CDN-loaded code editor with syntax highlighting
|
|
1799
1806
|
- **Live Preview** - Real-time directive effect preview
|
|
1800
1807
|
|
|
1801
|
-
### v1.8.0 (
|
|
1808
|
+
### v1.8.0 (2026-04-22) - Quality & Ecosystem ✅
|
|
1802
1809
|
|
|
1803
1810
|
- **Test Coverage** - 90%+ unit test coverage, E2E testing with Playwright
|
|
1804
1811
|
- **Performance Optimization** - Bundle size optimization, tree-shaking improvements
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* directix v1.
|
|
2
|
+
* directix v1.8.0
|
|
3
3
|
* A comprehensive, easy-to-use, and high-performance Vue custom directives library supporting both Vue 2 and Vue 3
|
|
4
4
|
* (c) 2021-present saqqdy <https://github.com/saqqdy>
|
|
5
5
|
* Released under the MIT License.
|
|
@@ -78,7 +78,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
78
78
|
});
|
|
79
79
|
};
|
|
80
80
|
/*!
|
|
81
|
-
* directix v1.
|
|
81
|
+
* directix v1.8.0
|
|
82
82
|
* A comprehensive, easy-to-use, and high-performance Vue custom directives library supporting both Vue 2 and Vue 3
|
|
83
83
|
* (c) 2021-present saqqdy <https://github.com/saqqdy>
|
|
84
84
|
* Released under the MIT License.
|
|
@@ -2528,14 +2528,16 @@ const vFade = defineDirective({
|
|
|
2528
2528
|
el.style.opacity = String(options.minOpacity || 0);
|
|
2529
2529
|
el.style.display = "";
|
|
2530
2530
|
String(el.offsetHeight);
|
|
2531
|
-
requestAnimationFrame(() => {
|
|
2531
|
+
state.animationFrame = requestAnimationFrame(() => {
|
|
2532
|
+
state.animationFrame = null;
|
|
2532
2533
|
el.style.opacity = String(options.maxOpacity || 1);
|
|
2533
2534
|
state.currentOpacity = options.maxOpacity || 1;
|
|
2534
2535
|
});
|
|
2535
2536
|
} else if (options.direction === "out") {
|
|
2536
2537
|
el.style.opacity = String(options.maxOpacity || 1);
|
|
2537
2538
|
el.style.display = "";
|
|
2538
|
-
requestAnimationFrame(() => {
|
|
2539
|
+
state.animationFrame = requestAnimationFrame(() => {
|
|
2540
|
+
state.animationFrame = null;
|
|
2539
2541
|
el.style.opacity = String(options.minOpacity || 0);
|
|
2540
2542
|
setTimeout(() => {
|
|
2541
2543
|
el.style.display = "none";
|
|
@@ -6679,8 +6681,8 @@ const vSanitize = defineDirective({
|
|
|
6679
6681
|
mounted(el, binding) {
|
|
6680
6682
|
if (!isBrowser()) return;
|
|
6681
6683
|
const options = normalizeOptions$e(binding.value);
|
|
6682
|
-
if (options.disabled) return;
|
|
6683
6684
|
el.__sanitize = { options };
|
|
6685
|
+
if (options.disabled) return;
|
|
6684
6686
|
const content = el.innerHTML;
|
|
6685
6687
|
if (content) {
|
|
6686
6688
|
el.innerHTML = sanitizeHtml(content, options);
|
|
@@ -6689,8 +6691,17 @@ const vSanitize = defineDirective({
|
|
|
6689
6691
|
updated(el, binding) {
|
|
6690
6692
|
const state = el.__sanitize;
|
|
6691
6693
|
if (!state) return;
|
|
6694
|
+
const prevDisabled = state.options.disabled;
|
|
6692
6695
|
state.options = normalizeOptions$e(binding.value);
|
|
6693
|
-
if (state.options.disabled || !state.options.sanitizeOnUpdate)
|
|
6696
|
+
if (state.options.disabled || !state.options.sanitizeOnUpdate) {
|
|
6697
|
+
if (prevDisabled && !state.options.disabled) {
|
|
6698
|
+
const content2 = el.innerHTML;
|
|
6699
|
+
if (content2) {
|
|
6700
|
+
el.innerHTML = sanitizeHtml(content2, state.options);
|
|
6701
|
+
}
|
|
6702
|
+
}
|
|
6703
|
+
return;
|
|
6704
|
+
}
|
|
6694
6705
|
const content = el.innerHTML;
|
|
6695
6706
|
if (content) {
|
|
6696
6707
|
el.innerHTML = sanitizeHtml(content, state.options);
|
|
@@ -7339,12 +7350,13 @@ const TOOLTIP_STYLES = {
|
|
|
7339
7350
|
};
|
|
7340
7351
|
let tooltipContainer = null;
|
|
7341
7352
|
function getTooltipContainer() {
|
|
7342
|
-
if (
|
|
7343
|
-
tooltipContainer
|
|
7344
|
-
tooltipContainer.id = "directix-tooltip-container";
|
|
7345
|
-
tooltipContainer.style.cssText = "position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999;";
|
|
7346
|
-
document.body.appendChild(tooltipContainer);
|
|
7353
|
+
if (tooltipContainer && document.body.contains(tooltipContainer)) {
|
|
7354
|
+
return tooltipContainer;
|
|
7347
7355
|
}
|
|
7356
|
+
tooltipContainer = document.createElement("div");
|
|
7357
|
+
tooltipContainer.id = "directix-tooltip-container";
|
|
7358
|
+
tooltipContainer.style.cssText = "position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999;";
|
|
7359
|
+
document.body.appendChild(tooltipContainer);
|
|
7348
7360
|
return tooltipContainer;
|
|
7349
7361
|
}
|
|
7350
7362
|
function createTooltip(options) {
|
|
@@ -7574,6 +7586,7 @@ const vTooltip = defineDirective({
|
|
|
7574
7586
|
const newState = createState(newOptions);
|
|
7575
7587
|
el.__tooltip = newState;
|
|
7576
7588
|
setupTriggerHandlers(el, newState);
|
|
7589
|
+
el.setAttribute("aria-describedby", "v-tooltip");
|
|
7577
7590
|
if (newOptions.trigger === "manual") {
|
|
7578
7591
|
showTooltip(el, newState);
|
|
7579
7592
|
}
|
|
@@ -9714,7 +9727,7 @@ function useDraggable(options = {}) {
|
|
|
9714
9727
|
if (!isDragging.value || vue.unref(disabled)) return;
|
|
9715
9728
|
e.preventDefault();
|
|
9716
9729
|
const { clientX, clientY } = getClientCoords(e);
|
|
9717
|
-
let deltaX = clientX - startX, deltaY = clientY - startY
|
|
9730
|
+
let deltaX = clientX - startX, deltaY = clientY - startY;
|
|
9718
9731
|
const currentAxis = vue.unref(axis);
|
|
9719
9732
|
if (currentAxis === "x") {
|
|
9720
9733
|
deltaY = 0;
|
|
@@ -9726,6 +9739,7 @@ function useDraggable(options = {}) {
|
|
|
9726
9739
|
deltaX = Math.round(deltaX / currentGrid[0]) * currentGrid[0];
|
|
9727
9740
|
deltaY = Math.round(deltaY / currentGrid[1]) * currentGrid[1];
|
|
9728
9741
|
}
|
|
9742
|
+
let newX = offsetX + deltaX, newY = offsetY + deltaY;
|
|
9729
9743
|
if (vue.unref(constrain) || boundary) {
|
|
9730
9744
|
const newLeft = initialLeft + deltaX;
|
|
9731
9745
|
const newTop = initialTop + deltaY;
|
|
@@ -12212,6 +12226,7 @@ function getDistance(touches) {
|
|
|
12212
12226
|
return Math.sqrt(dx * dx + dy * dy);
|
|
12213
12227
|
}
|
|
12214
12228
|
function getCenter$1(touches) {
|
|
12229
|
+
if (touches.length === 0) return { x: 0, y: 0 };
|
|
12215
12230
|
if (touches.length < 2) return { x: touches[0].clientX, y: touches[0].clientY };
|
|
12216
12231
|
return {
|
|
12217
12232
|
x: (touches[0].clientX + touches[1].clientX) / 2,
|
|
@@ -12989,6 +13004,7 @@ function getAngle(touches) {
|
|
|
12989
13004
|
return Math.atan2(dy, dx) * (180 / Math.PI);
|
|
12990
13005
|
}
|
|
12991
13006
|
function getCenter(touches) {
|
|
13007
|
+
if (touches.length === 0) return { x: 0, y: 0 };
|
|
12992
13008
|
if (touches.length < 2) return { x: touches[0].clientX, y: touches[0].clientY };
|
|
12993
13009
|
return {
|
|
12994
13010
|
x: (touches[0].clientX + touches[1].clientX) / 2,
|