@zag-js/splitter 1.37.0 → 1.38.1
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/dist/splitter.dom.d.mts
CHANGED
|
@@ -13,7 +13,8 @@ declare const getResizeTriggerEl: (ctx: Scope, id: string) => HTMLElement | null
|
|
|
13
13
|
declare const getPanelEl: (ctx: Scope, id: string | number) => HTMLElement | null;
|
|
14
14
|
declare const getCursor: (state: CursorState, x: boolean) => (string & {}) | "col-resize" | "e-resize" | "n-resize" | "row-resize" | "s-resize" | "w-resize";
|
|
15
15
|
declare const getResizeTriggerEls: (ctx: Scope) => HTMLElement[];
|
|
16
|
+
declare const getGlobalCursorEl: (ctx: Scope) => HTMLElement | null;
|
|
16
17
|
declare const setupGlobalCursor: (ctx: Scope, state: CursorState, x: boolean, nonce?: string) => void;
|
|
17
18
|
declare const removeGlobalCursor: (ctx: Scope) => void;
|
|
18
19
|
|
|
19
|
-
export { getCursor, getGlobalCursorId, getLabelId, getPanelEl, getPanelEls, getPanelId, getResizeTriggerEl, getResizeTriggerEls, getResizeTriggerId, getRootEl, getRootId, removeGlobalCursor, setupGlobalCursor };
|
|
20
|
+
export { getCursor, getGlobalCursorEl, getGlobalCursorId, getLabelId, getPanelEl, getPanelEls, getPanelId, getResizeTriggerEl, getResizeTriggerEls, getResizeTriggerId, getRootEl, getRootId, removeGlobalCursor, setupGlobalCursor };
|
package/dist/splitter.dom.d.ts
CHANGED
|
@@ -13,7 +13,8 @@ declare const getResizeTriggerEl: (ctx: Scope, id: string) => HTMLElement | null
|
|
|
13
13
|
declare const getPanelEl: (ctx: Scope, id: string | number) => HTMLElement | null;
|
|
14
14
|
declare const getCursor: (state: CursorState, x: boolean) => (string & {}) | "col-resize" | "e-resize" | "n-resize" | "row-resize" | "s-resize" | "w-resize";
|
|
15
15
|
declare const getResizeTriggerEls: (ctx: Scope) => HTMLElement[];
|
|
16
|
+
declare const getGlobalCursorEl: (ctx: Scope) => HTMLElement | null;
|
|
16
17
|
declare const setupGlobalCursor: (ctx: Scope, state: CursorState, x: boolean, nonce?: string) => void;
|
|
17
18
|
declare const removeGlobalCursor: (ctx: Scope) => void;
|
|
18
19
|
|
|
19
|
-
export { getCursor, getGlobalCursorId, getLabelId, getPanelEl, getPanelEls, getPanelId, getResizeTriggerEl, getResizeTriggerEls, getResizeTriggerId, getRootEl, getRootId, removeGlobalCursor, setupGlobalCursor };
|
|
20
|
+
export { getCursor, getGlobalCursorEl, getGlobalCursorId, getLabelId, getPanelEl, getPanelEls, getPanelId, getResizeTriggerEl, getResizeTriggerEls, getResizeTriggerId, getRootEl, getRootId, removeGlobalCursor, setupGlobalCursor };
|
package/dist/splitter.dom.js
CHANGED
|
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
21
21
|
var splitter_dom_exports = {};
|
|
22
22
|
__export(splitter_dom_exports, {
|
|
23
23
|
getCursor: () => getCursor,
|
|
24
|
+
getGlobalCursorEl: () => getGlobalCursorEl,
|
|
24
25
|
getGlobalCursorId: () => getGlobalCursorId,
|
|
25
26
|
getLabelId: () => getLabelId,
|
|
26
27
|
getPanelEl: () => getPanelEl,
|
|
@@ -54,8 +55,11 @@ var getCursor = (state, x) => {
|
|
|
54
55
|
var getResizeTriggerEls = (ctx) => {
|
|
55
56
|
return (0, import_dom_query.queryAll)(getRootEl(ctx), `[role=separator][data-ownedby='${CSS.escape(getRootId(ctx))}']`);
|
|
56
57
|
};
|
|
58
|
+
var getGlobalCursorEl = (ctx) => {
|
|
59
|
+
return ctx.getDoc().getElementById(getGlobalCursorId(ctx));
|
|
60
|
+
};
|
|
57
61
|
var setupGlobalCursor = (ctx, state, x, nonce) => {
|
|
58
|
-
const styleEl =
|
|
62
|
+
const styleEl = getGlobalCursorEl(ctx);
|
|
59
63
|
const textContent = `* { cursor: ${getCursor(state, x)} !important; }`;
|
|
60
64
|
if (styleEl) {
|
|
61
65
|
styleEl.textContent = textContent;
|
|
@@ -68,12 +72,13 @@ var setupGlobalCursor = (ctx, state, x, nonce) => {
|
|
|
68
72
|
}
|
|
69
73
|
};
|
|
70
74
|
var removeGlobalCursor = (ctx) => {
|
|
71
|
-
const styleEl =
|
|
75
|
+
const styleEl = getGlobalCursorEl(ctx);
|
|
72
76
|
styleEl?.remove();
|
|
73
77
|
};
|
|
74
78
|
// Annotate the CommonJS export names for ESM import in node:
|
|
75
79
|
0 && (module.exports = {
|
|
76
80
|
getCursor,
|
|
81
|
+
getGlobalCursorEl,
|
|
77
82
|
getGlobalCursorId,
|
|
78
83
|
getLabelId,
|
|
79
84
|
getPanelEl,
|
package/dist/splitter.dom.mjs
CHANGED
|
@@ -18,8 +18,11 @@ var getCursor = (state, x) => {
|
|
|
18
18
|
var getResizeTriggerEls = (ctx) => {
|
|
19
19
|
return queryAll(getRootEl(ctx), `[role=separator][data-ownedby='${CSS.escape(getRootId(ctx))}']`);
|
|
20
20
|
};
|
|
21
|
+
var getGlobalCursorEl = (ctx) => {
|
|
22
|
+
return ctx.getDoc().getElementById(getGlobalCursorId(ctx));
|
|
23
|
+
};
|
|
21
24
|
var setupGlobalCursor = (ctx, state, x, nonce) => {
|
|
22
|
-
const styleEl =
|
|
25
|
+
const styleEl = getGlobalCursorEl(ctx);
|
|
23
26
|
const textContent = `* { cursor: ${getCursor(state, x)} !important; }`;
|
|
24
27
|
if (styleEl) {
|
|
25
28
|
styleEl.textContent = textContent;
|
|
@@ -32,11 +35,12 @@ var setupGlobalCursor = (ctx, state, x, nonce) => {
|
|
|
32
35
|
}
|
|
33
36
|
};
|
|
34
37
|
var removeGlobalCursor = (ctx) => {
|
|
35
|
-
const styleEl =
|
|
38
|
+
const styleEl = getGlobalCursorEl(ctx);
|
|
36
39
|
styleEl?.remove();
|
|
37
40
|
};
|
|
38
41
|
export {
|
|
39
42
|
getCursor,
|
|
43
|
+
getGlobalCursorEl,
|
|
40
44
|
getGlobalCursorId,
|
|
41
45
|
getLabelId,
|
|
42
46
|
getPanelEl,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/splitter",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.1",
|
|
4
4
|
"description": "Core logic for the splitter widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@zag-js/anatomy": "1.
|
|
31
|
-
"@zag-js/core": "1.
|
|
32
|
-
"@zag-js/types": "1.
|
|
33
|
-
"@zag-js/dom-query": "1.
|
|
34
|
-
"@zag-js/utils": "1.
|
|
30
|
+
"@zag-js/anatomy": "1.38.1",
|
|
31
|
+
"@zag-js/core": "1.38.1",
|
|
32
|
+
"@zag-js/types": "1.38.1",
|
|
33
|
+
"@zag-js/dom-query": "1.38.1",
|
|
34
|
+
"@zag-js/utils": "1.38.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"clean-package": "2.2.0"
|