layplux 0.0.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.
Files changed (201) hide show
  1. package/dist/cjs/components/center-view/index.cjs +41 -0
  2. package/dist/cjs/components/corner-glow/index.cjs +31 -0
  3. package/dist/cjs/components/dropdown/index.cjs +162 -0
  4. package/dist/cjs/components/icon/index.cjs +59 -0
  5. package/dist/cjs/components/index.cjs +25 -0
  6. package/dist/cjs/components/panel-view/index.cjs +166 -0
  7. package/dist/cjs/components/popup/index.cjs +280 -0
  8. package/dist/cjs/components/title/index.cjs +76 -0
  9. package/dist/cjs/components/tooltip/index.cjs +68 -0
  10. package/dist/cjs/components/widget/index.cjs +104 -0
  11. package/dist/cjs/index.cjs +40 -0
  12. package/dist/cjs/layout/glass-overlay.cjs +31 -0
  13. package/dist/cjs/layout/layered-manager.cjs +35 -0
  14. package/dist/cjs/layout/layplux.cjs +41 -0
  15. package/dist/cjs/layout/root-pane.cjs +46 -0
  16. package/dist/cjs/layout/skeleton/bottom-area.cjs +64 -0
  17. package/dist/cjs/layout/skeleton/bottom-left-area.cjs +42 -0
  18. package/dist/cjs/layout/skeleton/bottom-right-area.cjs +38 -0
  19. package/dist/cjs/layout/skeleton/center-area.cjs +467 -0
  20. package/dist/cjs/layout/skeleton/index.cjs +24 -0
  21. package/dist/cjs/layout/skeleton/left-bottom-area.cjs +42 -0
  22. package/dist/cjs/layout/skeleton/left-top-area.cjs +42 -0
  23. package/dist/cjs/layout/skeleton/right-bottom-area.cjs +38 -0
  24. package/dist/cjs/layout/skeleton/right-top-area.cjs +38 -0
  25. package/dist/cjs/layout/skeleton/skeleton.cjs +66 -0
  26. package/dist/cjs/layout/skeleton/top-area.cjs +64 -0
  27. package/dist/cjs/locales/en-US.cjs +34 -0
  28. package/dist/cjs/locales/index.cjs +39 -0
  29. package/dist/cjs/locales/zh-CN.cjs +34 -0
  30. package/dist/cjs/managers/area.cjs +32 -0
  31. package/dist/cjs/managers/index.cjs +20 -0
  32. package/dist/cjs/managers/pane.cjs +34 -0
  33. package/dist/cjs/managers/skeleton.cjs +208 -0
  34. package/dist/cjs/managers/theme.cjs +37 -0
  35. package/dist/cjs/managers/widget-container.cjs +96 -0
  36. package/dist/cjs/managers/widget.cjs +103 -0
  37. package/dist/cjs/types/config.cjs +16 -0
  38. package/dist/cjs/types/index.cjs +18 -0
  39. package/dist/cjs/types/locale.cjs +16 -0
  40. package/dist/cjs/utils/event-bus.cjs +154 -0
  41. package/dist/cjs/utils/focus-tracker.cjs +154 -0
  42. package/dist/cjs/utils/index.cjs +31 -0
  43. package/dist/cjs/utils/unique-id.cjs +27 -0
  44. package/dist/cjs/utils/vue.cjs +37 -0
  45. package/dist/esm/components/center-view/index.mjs +21 -0
  46. package/dist/esm/components/corner-glow/index.mjs +11 -0
  47. package/dist/esm/components/dropdown/index.mjs +146 -0
  48. package/dist/esm/components/icon/index.mjs +39 -0
  49. package/dist/esm/components/index.mjs +8 -0
  50. package/dist/esm/components/panel-view/index.mjs +152 -0
  51. package/dist/esm/components/popup/index.mjs +268 -0
  52. package/dist/esm/components/title/index.mjs +56 -0
  53. package/dist/esm/components/tooltip/index.mjs +48 -0
  54. package/dist/esm/components/widget/index.mjs +84 -0
  55. package/dist/esm/index.mjs +10 -0
  56. package/dist/esm/layout/glass-overlay.mjs +11 -0
  57. package/dist/esm/layout/layered-manager.mjs +15 -0
  58. package/dist/esm/layout/layplux.mjs +21 -0
  59. package/dist/esm/layout/root-pane.mjs +26 -0
  60. package/dist/esm/layout/skeleton/bottom-area.mjs +44 -0
  61. package/dist/esm/layout/skeleton/bottom-left-area.mjs +22 -0
  62. package/dist/esm/layout/skeleton/bottom-right-area.mjs +18 -0
  63. package/dist/esm/layout/skeleton/center-area.mjs +454 -0
  64. package/dist/esm/layout/skeleton/index.mjs +4 -0
  65. package/dist/esm/layout/skeleton/left-bottom-area.mjs +22 -0
  66. package/dist/esm/layout/skeleton/left-top-area.mjs +22 -0
  67. package/dist/esm/layout/skeleton/right-bottom-area.mjs +18 -0
  68. package/dist/esm/layout/skeleton/right-top-area.mjs +18 -0
  69. package/dist/esm/layout/skeleton/skeleton.mjs +46 -0
  70. package/dist/esm/layout/skeleton/top-area.mjs +44 -0
  71. package/dist/esm/locales/en-US.mjs +14 -0
  72. package/dist/esm/locales/index.mjs +19 -0
  73. package/dist/esm/locales/zh-CN.mjs +14 -0
  74. package/dist/esm/managers/area.mjs +12 -0
  75. package/dist/esm/managers/index.mjs +3 -0
  76. package/dist/esm/managers/pane.mjs +14 -0
  77. package/dist/esm/managers/skeleton.mjs +192 -0
  78. package/dist/esm/managers/theme.mjs +17 -0
  79. package/dist/esm/managers/widget-container.mjs +76 -0
  80. package/dist/esm/managers/widget.mjs +83 -0
  81. package/dist/esm/types/config.mjs +0 -0
  82. package/dist/esm/types/index.mjs +1 -0
  83. package/dist/esm/types/locale.mjs +0 -0
  84. package/dist/esm/utils/event-bus.mjs +124 -0
  85. package/dist/esm/utils/focus-tracker.mjs +135 -0
  86. package/dist/esm/utils/index.mjs +10 -0
  87. package/dist/esm/utils/unique-id.mjs +7 -0
  88. package/dist/esm/utils/vue.mjs +17 -0
  89. package/dist/style/base/_tokens-dark.scss +51 -0
  90. package/dist/style/base/_tokens.scss +56 -0
  91. package/dist/style/components/_bottom-area.scss +30 -0
  92. package/dist/style/components/_bottom-left-area.scss +8 -0
  93. package/dist/style/components/_bottom-right-area.scss +8 -0
  94. package/dist/style/components/_center-area.scss +162 -0
  95. package/dist/style/components/_corner-glow.scss +17 -0
  96. package/dist/style/components/_dropdown.scss +91 -0
  97. package/dist/style/components/_glass-pane.scss +6 -0
  98. package/dist/style/components/_layered-manager.scss +6 -0
  99. package/dist/style/components/_left-bottom-area.scss +8 -0
  100. package/dist/style/components/_left-top-area.scss +9 -0
  101. package/dist/style/components/_pane-view.scss +79 -0
  102. package/dist/style/components/_popup.scss +19 -0
  103. package/dist/style/components/_right-bottom-area.scss +8 -0
  104. package/dist/style/components/_right-top-area.scss +8 -0
  105. package/dist/style/components/_root-pane.scss +17 -0
  106. package/dist/style/components/_skeleton.scss +38 -0
  107. package/dist/style/components/_title-view.scss +176 -0
  108. package/dist/style/components/_tooltip.scss +65 -0
  109. package/dist/style/components/_top-area.scss +25 -0
  110. package/dist/style/index.css +768 -0
  111. package/dist/style/layplux.scss +21 -0
  112. package/dist/types/components/center-view/index.d.ts +16 -0
  113. package/dist/types/components/center-view/index.d.ts.map +1 -0
  114. package/dist/types/components/corner-glow/index.d.ts +2 -0
  115. package/dist/types/components/corner-glow/index.d.ts.map +1 -0
  116. package/dist/types/components/dropdown/index.d.ts +116 -0
  117. package/dist/types/components/dropdown/index.d.ts.map +1 -0
  118. package/dist/types/components/icon/index.d.ts +22 -0
  119. package/dist/types/components/icon/index.d.ts.map +1 -0
  120. package/dist/types/components/index.d.ts +9 -0
  121. package/dist/types/components/index.d.ts.map +1 -0
  122. package/dist/types/components/panel-view/index.d.ts +22 -0
  123. package/dist/types/components/panel-view/index.d.ts.map +1 -0
  124. package/dist/types/components/popup/index.d.ts +99 -0
  125. package/dist/types/components/popup/index.d.ts.map +1 -0
  126. package/dist/types/components/title/index.d.ts +57 -0
  127. package/dist/types/components/title/index.d.ts.map +1 -0
  128. package/dist/types/components/tooltip/index.d.ts +69 -0
  129. package/dist/types/components/tooltip/index.d.ts.map +1 -0
  130. package/dist/types/components/widget/index.d.ts +15 -0
  131. package/dist/types/components/widget/index.d.ts.map +1 -0
  132. package/dist/types/index.d.ts +10 -0
  133. package/dist/types/index.d.ts.map +1 -0
  134. package/dist/types/layout/glass-overlay.d.ts +2 -0
  135. package/dist/types/layout/glass-overlay.d.ts.map +1 -0
  136. package/dist/types/layout/layered-manager.d.ts +8 -0
  137. package/dist/types/layout/layered-manager.d.ts.map +1 -0
  138. package/dist/types/layout/layplux.d.ts +25 -0
  139. package/dist/types/layout/layplux.d.ts.map +1 -0
  140. package/dist/types/layout/root-pane.d.ts +8 -0
  141. package/dist/types/layout/root-pane.d.ts.map +1 -0
  142. package/dist/types/layout/skeleton/bottom-area.d.ts +9 -0
  143. package/dist/types/layout/skeleton/bottom-area.d.ts.map +1 -0
  144. package/dist/types/layout/skeleton/bottom-left-area.d.ts +9 -0
  145. package/dist/types/layout/skeleton/bottom-left-area.d.ts.map +1 -0
  146. package/dist/types/layout/skeleton/bottom-right-area.d.ts +9 -0
  147. package/dist/types/layout/skeleton/bottom-right-area.d.ts.map +1 -0
  148. package/dist/types/layout/skeleton/center-area.d.ts +11 -0
  149. package/dist/types/layout/skeleton/center-area.d.ts.map +1 -0
  150. package/dist/types/layout/skeleton/index.d.ts +2 -0
  151. package/dist/types/layout/skeleton/index.d.ts.map +1 -0
  152. package/dist/types/layout/skeleton/left-bottom-area.d.ts +9 -0
  153. package/dist/types/layout/skeleton/left-bottom-area.d.ts.map +1 -0
  154. package/dist/types/layout/skeleton/left-top-area.d.ts +9 -0
  155. package/dist/types/layout/skeleton/left-top-area.d.ts.map +1 -0
  156. package/dist/types/layout/skeleton/right-bottom-area.d.ts +9 -0
  157. package/dist/types/layout/skeleton/right-bottom-area.d.ts.map +1 -0
  158. package/dist/types/layout/skeleton/right-top-area.d.ts +9 -0
  159. package/dist/types/layout/skeleton/right-top-area.d.ts.map +1 -0
  160. package/dist/types/layout/skeleton/skeleton.d.ts +8 -0
  161. package/dist/types/layout/skeleton/skeleton.d.ts.map +1 -0
  162. package/dist/types/layout/skeleton/top-area.d.ts +9 -0
  163. package/dist/types/layout/skeleton/top-area.d.ts.map +1 -0
  164. package/dist/types/locales/en-US.d.ts +3 -0
  165. package/dist/types/locales/en-US.d.ts.map +1 -0
  166. package/dist/types/locales/index.d.ts +7 -0
  167. package/dist/types/locales/index.d.ts.map +1 -0
  168. package/dist/types/locales/zh-CN.d.ts +3 -0
  169. package/dist/types/locales/zh-CN.d.ts.map +1 -0
  170. package/dist/types/managers/area.d.ts +10 -0
  171. package/dist/types/managers/area.d.ts.map +1 -0
  172. package/dist/types/managers/index.d.ts +5 -0
  173. package/dist/types/managers/index.d.ts.map +1 -0
  174. package/dist/types/managers/pane.d.ts +8 -0
  175. package/dist/types/managers/pane.d.ts.map +1 -0
  176. package/dist/types/managers/skeleton.d.ts +38 -0
  177. package/dist/types/managers/skeleton.d.ts.map +1 -0
  178. package/dist/types/managers/theme.d.ts +2 -0
  179. package/dist/types/managers/theme.d.ts.map +1 -0
  180. package/dist/types/managers/widget-container.d.ts +21 -0
  181. package/dist/types/managers/widget-container.d.ts.map +1 -0
  182. package/dist/types/managers/widget.d.ts +26 -0
  183. package/dist/types/managers/widget.d.ts.map +1 -0
  184. package/dist/types/types/config.d.ts +54 -0
  185. package/dist/types/types/config.d.ts.map +1 -0
  186. package/dist/types/types/index.d.ts +2 -0
  187. package/dist/types/types/index.d.ts.map +1 -0
  188. package/dist/types/types/locale.d.ts +12 -0
  189. package/dist/types/types/locale.d.ts.map +1 -0
  190. package/dist/types/utils/event-bus.d.ts +18 -0
  191. package/dist/types/utils/event-bus.d.ts.map +1 -0
  192. package/dist/types/utils/focus-tracker.d.ts +37 -0
  193. package/dist/types/utils/focus-tracker.d.ts.map +1 -0
  194. package/dist/types/utils/index.d.ts +6 -0
  195. package/dist/types/utils/index.d.ts.map +1 -0
  196. package/dist/types/utils/unique-id.d.ts +2 -0
  197. package/dist/types/utils/unique-id.d.ts.map +1 -0
  198. package/dist/types/utils/vue.d.ts +5 -0
  199. package/dist/types/utils/vue.d.ts.map +1 -0
  200. package/dist/umd/index.js +4000 -0
  201. package/package.json +46 -0
@@ -0,0 +1,454 @@
1
+ import { jsx, jsxs } from "vue/jsx-runtime";
2
+ import {
3
+ computed,
4
+ defineComponent,
5
+ onMounted,
6
+ onUnmounted,
7
+ ref,
8
+ Teleport
9
+ } from "vue";
10
+ import { PanelView } from "../../components";
11
+ const CenterArea = defineComponent({
12
+ name: "CenterArea",
13
+ props: {
14
+ skeleton: Object,
15
+ centerArea: Object
16
+ },
17
+ setup(props) {
18
+ let unmountFocusTracker = null;
19
+ onMounted(() => {
20
+ unmountFocusTracker = props.skeleton?.focusTracker.mount(window) ?? null;
21
+ });
22
+ onUnmounted(() => {
23
+ unmountFocusTracker?.();
24
+ });
25
+ const leftWidth = ref(340);
26
+ const rightWidth = ref(340);
27
+ const bottomHeight = ref(300);
28
+ const leftSplitRatio = ref(0.5);
29
+ const rightSplitRatio = ref(0.5);
30
+ const bottomSplitRatio = ref(0.5);
31
+ function startDrag(e, axis, onMove) {
32
+ e.preventDefault();
33
+ const startPos = axis === "x" ? e.clientX : e.clientY;
34
+ const onMouseMove = (ev) => onMove((axis === "x" ? ev.clientX : ev.clientY) - startPos);
35
+ const onMouseUp = () => {
36
+ window.removeEventListener("mousemove", onMouseMove);
37
+ window.removeEventListener("mouseup", onMouseUp);
38
+ };
39
+ window.addEventListener("mousemove", onMouseMove);
40
+ window.addEventListener("mouseup", onMouseUp);
41
+ }
42
+ function dragLeftWidth(e) {
43
+ const base = leftWidth.value;
44
+ startDrag(e, "x", (d) => {
45
+ leftWidth.value = Math.max(160, Math.min(600, base + d));
46
+ });
47
+ }
48
+ function dragRightWidth(e) {
49
+ const base = rightWidth.value;
50
+ startDrag(e, "x", (d) => {
51
+ rightWidth.value = Math.max(160, Math.min(600, base - d));
52
+ });
53
+ }
54
+ function dragBottomHeight(e) {
55
+ const base = bottomHeight.value;
56
+ startDrag(e, "y", (d) => {
57
+ bottomHeight.value = Math.max(80, Math.min(600, base - d));
58
+ });
59
+ }
60
+ function dragLeftSplit(e, totalHeight) {
61
+ const base = leftSplitRatio.value;
62
+ startDrag(e, "y", (d) => {
63
+ leftSplitRatio.value = Math.max(0.15, Math.min(0.85, base + d / totalHeight));
64
+ });
65
+ }
66
+ function dragRightSplit(e, totalHeight) {
67
+ const base = rightSplitRatio.value;
68
+ startDrag(e, "y", (d) => {
69
+ rightSplitRatio.value = Math.max(0.15, Math.min(0.85, base + d / totalHeight));
70
+ });
71
+ }
72
+ function dragBottomSplit(e, totalWidth) {
73
+ const base = bottomSplitRatio.value;
74
+ startDrag(e, "x", (d) => {
75
+ bottomSplitRatio.value = Math.max(0.15, Math.min(0.85, base + d / totalWidth));
76
+ });
77
+ }
78
+ function getActiveWidget(activeId) {
79
+ if (!activeId) return null;
80
+ return props.skeleton?.widgets.find((w) => w.name === activeId) ?? null;
81
+ }
82
+ function isDocked(activeId) {
83
+ const mode = getActiveWidget(activeId)?.pane.viewMode.value;
84
+ return mode === "DockPinned" || mode === "DockUnpinned";
85
+ }
86
+ const leftTopWidget = computed(
87
+ () => getActiveWidget(props.skeleton?.leftTopArea.container.activeId.value ?? null)
88
+ );
89
+ const leftBottomWidget = computed(
90
+ () => getActiveWidget(props.skeleton?.leftBottomArea.container.activeId.value ?? null)
91
+ );
92
+ const rightTopWidget = computed(
93
+ () => getActiveWidget(props.skeleton?.rightTopArea.container.activeId.value ?? null)
94
+ );
95
+ const rightBottomWidget = computed(
96
+ () => getActiveWidget(props.skeleton?.rightBottomArea.container.activeId.value ?? null)
97
+ );
98
+ const bottomLeftWidget = computed(
99
+ () => getActiveWidget(props.skeleton?.bottomLeftArea.container.activeId.value ?? null)
100
+ );
101
+ const bottomRightWidget = computed(
102
+ () => getActiveWidget(props.skeleton?.bottomRightArea.container.activeId.value ?? null)
103
+ );
104
+ const isLeftTopVisible = computed(
105
+ () => isDocked(props.skeleton?.leftTopArea.container.activeId.value ?? null)
106
+ );
107
+ const isLeftBottomVisible = computed(
108
+ () => isDocked(props.skeleton?.leftBottomArea.container.activeId.value ?? null)
109
+ );
110
+ const isRightTopVisible = computed(
111
+ () => isDocked(props.skeleton?.rightTopArea.container.activeId.value ?? null)
112
+ );
113
+ const isRightBottomVisible = computed(
114
+ () => isDocked(props.skeleton?.rightBottomArea.container.activeId.value ?? null)
115
+ );
116
+ const isBottomLeftVisible = computed(
117
+ () => isDocked(props.skeleton?.bottomLeftArea.container.activeId.value ?? null)
118
+ );
119
+ const isBottomRightVisible = computed(
120
+ () => isDocked(props.skeleton?.bottomRightArea.container.activeId.value ?? null)
121
+ );
122
+ const isLeftVisible = computed(() => isLeftTopVisible.value || isLeftBottomVisible.value);
123
+ const isRightVisible = computed(() => isRightTopVisible.value || isRightBottomVisible.value);
124
+ const isBottomVisible = computed(() => isBottomLeftVisible.value || isBottomRightVisible.value);
125
+ function makeUndockedWidget(side) {
126
+ return computed(() => {
127
+ const sk = props.skeleton;
128
+ const w = getActiveWidget(sk?.focusedId.value ?? null);
129
+ if (!w || w.pane.viewMode.value !== "Undock") return null;
130
+ const areaMap = {
131
+ left: [sk?.leftTopArea, sk?.leftBottomArea],
132
+ right: [sk?.rightTopArea, sk?.rightBottomArea],
133
+ bottom: [sk?.bottomLeftArea, sk?.bottomRightArea]
134
+ };
135
+ const belongs = areaMap[side].some(
136
+ (a) => a?.container.items.value.some((i) => i.name === w.name)
137
+ );
138
+ return belongs ? w : null;
139
+ });
140
+ }
141
+ const leftUndockedWidget = makeUndockedWidget("left");
142
+ const rightUndockedWidget = makeUndockedWidget("right");
143
+ const bottomUndockedWidget = makeUndockedWidget("bottom");
144
+ const isLeftUndockedVisible = computed(() => leftUndockedWidget.value !== null);
145
+ const isRightUndockedVisible = computed(() => rightUndockedWidget.value !== null);
146
+ const isBottomUndockedVisible = computed(() => bottomUndockedWidget.value !== null);
147
+ const teleportTargets = computed(() => {
148
+ const sk = props.skeleton;
149
+ const map = {};
150
+ if (!sk) return map;
151
+ const sideIndex = /* @__PURE__ */ new Map();
152
+ sk.leftTopArea.container.items.value.forEach(
153
+ (w) => sideIndex.set(w.name, "#left-undocked-area")
154
+ );
155
+ sk.leftBottomArea.container.items.value.forEach(
156
+ (w) => sideIndex.set(w.name, "#left-undocked-area")
157
+ );
158
+ sk.rightTopArea.container.items.value.forEach(
159
+ (w) => sideIndex.set(w.name, "#right-undocked-area")
160
+ );
161
+ sk.rightBottomArea.container.items.value.forEach(
162
+ (w) => sideIndex.set(w.name, "#right-undocked-area")
163
+ );
164
+ sk.bottomLeftArea.container.items.value.forEach(
165
+ (w) => sideIndex.set(w.name, "#bottom-undocked-area")
166
+ );
167
+ sk.bottomRightArea.container.items.value.forEach(
168
+ (w) => sideIndex.set(w.name, "#bottom-undocked-area")
169
+ );
170
+ const focusedName = sk.focusedId.value;
171
+ const undockWinner = {
172
+ "#left-undocked-area": null,
173
+ "#right-undocked-area": null,
174
+ "#bottom-undocked-area": null
175
+ };
176
+ if (focusedName) {
177
+ const focusedWidget = sk.widgets.find((w) => w.name === focusedName);
178
+ if (focusedWidget?.pane.viewMode.value === "Undock") {
179
+ const anchor = sideIndex.get(focusedName);
180
+ if (anchor) undockWinner[anchor] = focusedName;
181
+ }
182
+ }
183
+ const dockTargets = {
184
+ [sk.leftTopArea.container.activeId.value ?? ""]: "#left-top-area",
185
+ [sk.leftBottomArea.container.activeId.value ?? ""]: "#left-bottom-area",
186
+ [sk.rightTopArea.container.activeId.value ?? ""]: "#right-top-area",
187
+ [sk.rightBottomArea.container.activeId.value ?? ""]: "#right-bottom-area",
188
+ [sk.bottomLeftArea.container.activeId.value ?? ""]: "#bottom-left-area",
189
+ [sk.bottomRightArea.container.activeId.value ?? ""]: "#bottom-right-area"
190
+ };
191
+ delete dockTargets[""];
192
+ sk.widgets.filter((w) => w.type === "panel").forEach((w) => {
193
+ if (w.pane.viewMode.value === "Undock") {
194
+ const anchor = sideIndex.get(w.name) ?? "#widget-offscreen";
195
+ map[w.name] = undockWinner[anchor] === w.name ? anchor : "#widget-offscreen";
196
+ } else {
197
+ map[w.name] = dockTargets[w.name] ?? "#widget-offscreen";
198
+ }
199
+ });
200
+ return map;
201
+ });
202
+ const centerWidgetNames = computed(() => {
203
+ const names = /* @__PURE__ */ new Set();
204
+ props.centerArea?.container.items.value.forEach((w) => names.add(w.name));
205
+ return names;
206
+ });
207
+ const centerTargets = computed(() => {
208
+ const activeId = props.centerArea?.container.activeId.value ?? null;
209
+ const map = {};
210
+ props.centerArea?.container.items.value.forEach((w) => {
211
+ map[w.name] = w.name === activeId ? "#center-area" : "#center-offscreen";
212
+ });
213
+ return map;
214
+ });
215
+ const leftTopHeight = computed(() => `calc((100% - 4px) * ${leftSplitRatio.value})`);
216
+ const leftBottomHeight = computed(() => `calc((100% - 4px) * ${1 - leftSplitRatio.value})`);
217
+ const rightTopHeight = computed(() => `calc((100% - 4px) * ${rightSplitRatio.value})`);
218
+ const rightBottomHeight = computed(() => `calc((100% - 4px) * ${1 - rightSplitRatio.value})`);
219
+ const bottomLeftWidth = computed(() => `calc((100% - 4px) * ${bottomSplitRatio.value})`);
220
+ const bottomRightWidth = computed(() => `calc((100% - 4px) * ${1 - bottomSplitRatio.value})`);
221
+ return () => {
222
+ if (!props.skeleton) return null;
223
+ const sk = props.skeleton;
224
+ const leftBoth = isLeftTopVisible.value && isLeftBottomVisible.value;
225
+ const rightBoth = isRightTopVisible.value && isRightBottomVisible.value;
226
+ const bottomBoth = isBottomLeftVisible.value && isBottomRightVisible.value;
227
+ return /* @__PURE__ */ jsxs("div", { class: "layplux-center-area", children: [
228
+ /* @__PURE__ */ jsx("div", { id: "widget-offscreen", style: "display:none;" }),
229
+ /* @__PURE__ */ jsx("div", { id: "center-offscreen", style: "display:none;" }),
230
+ sk.widgets.filter((w) => w.type === "panel" && !centerWidgetNames.value.has(w.name)).map((w) => /* @__PURE__ */ jsx(
231
+ Teleport,
232
+ {
233
+ defer: true,
234
+ to: teleportTargets.value[w.name] ?? "#widget-offscreen",
235
+ children: w.renderContent()
236
+ },
237
+ w.name
238
+ )),
239
+ props.centerArea?.container.items.value.map((w) => /* @__PURE__ */ jsx(Teleport, { defer: true, to: centerTargets.value[w.name] ?? "#center-offscreen", children: w.renderContent() }, w.name)),
240
+ /* @__PURE__ */ jsxs(
241
+ "div",
242
+ {
243
+ class: "layplux-panel--undocked layplux-panel--undocked-left",
244
+ "v-show": isLeftUndockedVisible.value,
245
+ style: { width: `${leftWidth.value}px` },
246
+ children: [
247
+ /* @__PURE__ */ jsx(PanelView, { anchor: "left-undocked-area", widget: leftUndockedWidget.value ?? void 0 }),
248
+ /* @__PURE__ */ jsx(
249
+ "div",
250
+ {
251
+ class: "layplux-resize-handle layplux-resize-handle--x layplux-resize-handle--edge-right",
252
+ onMousedown: dragLeftWidth
253
+ }
254
+ )
255
+ ]
256
+ }
257
+ ),
258
+ /* @__PURE__ */ jsxs(
259
+ "div",
260
+ {
261
+ class: "layplux-panel--undocked layplux-panel--undocked-right",
262
+ "v-show": isRightUndockedVisible.value,
263
+ style: { width: `${rightWidth.value}px` },
264
+ children: [
265
+ /* @__PURE__ */ jsx(
266
+ "div",
267
+ {
268
+ class: "layplux-resize-handle layplux-resize-handle--x layplux-resize-handle--edge-left",
269
+ onMousedown: dragRightWidth
270
+ }
271
+ ),
272
+ /* @__PURE__ */ jsx(
273
+ PanelView,
274
+ {
275
+ anchor: "right-undocked-area",
276
+ widget: rightUndockedWidget.value ?? void 0
277
+ }
278
+ )
279
+ ]
280
+ }
281
+ ),
282
+ /* @__PURE__ */ jsxs(
283
+ "div",
284
+ {
285
+ class: "layplux-panel--undocked layplux-panel--undocked-bottom",
286
+ "v-show": isBottomUndockedVisible.value,
287
+ style: { height: `${bottomHeight.value}px` },
288
+ children: [
289
+ /* @__PURE__ */ jsx(
290
+ "div",
291
+ {
292
+ class: "layplux-resize-handle layplux-resize-handle--y layplux-resize-handle--edge-top",
293
+ onMousedown: dragBottomHeight
294
+ }
295
+ ),
296
+ /* @__PURE__ */ jsx(
297
+ PanelView,
298
+ {
299
+ anchor: "bottom-undocked-area",
300
+ widget: bottomUndockedWidget.value ?? void 0
301
+ }
302
+ )
303
+ ]
304
+ }
305
+ ),
306
+ /* @__PURE__ */ jsxs("div", { class: "layplux-center-area__main", children: [
307
+ /* @__PURE__ */ jsx(
308
+ "div",
309
+ {
310
+ class: "layplux-center-area__left",
311
+ "v-show": isLeftVisible.value,
312
+ style: { width: `${leftWidth.value}px` },
313
+ children: /* @__PURE__ */ jsxs("div", { class: "layplux-center-area__docked-panels", children: [
314
+ /* @__PURE__ */ jsx(
315
+ PanelView,
316
+ {
317
+ anchor: "left-top-area",
318
+ widget: leftTopWidget.value ?? void 0,
319
+ "v-show": isLeftTopVisible.value,
320
+ style: leftBoth ? { height: leftTopHeight.value, flex: "none" } : {}
321
+ }
322
+ ),
323
+ leftBoth && /* @__PURE__ */ jsx(
324
+ "div",
325
+ {
326
+ class: "layplux-resize-handle layplux-resize-handle--y",
327
+ onMousedown: (e) => dragLeftSplit(
328
+ e,
329
+ e.currentTarget.closest(
330
+ ".layplux-center-area__docked-panels"
331
+ ).clientHeight
332
+ )
333
+ }
334
+ ),
335
+ /* @__PURE__ */ jsx(
336
+ PanelView,
337
+ {
338
+ anchor: "left-bottom-area",
339
+ widget: leftBottomWidget.value ?? void 0,
340
+ "v-show": isLeftBottomVisible.value,
341
+ style: leftBoth ? { height: leftBottomHeight.value, flex: "none" } : {}
342
+ }
343
+ )
344
+ ] })
345
+ }
346
+ ),
347
+ isLeftVisible.value && !isLeftUndockedVisible.value && /* @__PURE__ */ jsx(
348
+ "div",
349
+ {
350
+ class: "layplux-resize-handle layplux-resize-handle--x",
351
+ onMousedown: dragLeftWidth
352
+ }
353
+ ),
354
+ /* @__PURE__ */ jsx("div", { id: "center-area", class: "layplux-center-area__editor" }),
355
+ isRightVisible.value && !isRightUndockedVisible.value && /* @__PURE__ */ jsx(
356
+ "div",
357
+ {
358
+ class: "layplux-resize-handle layplux-resize-handle--x",
359
+ onMousedown: dragRightWidth
360
+ }
361
+ ),
362
+ /* @__PURE__ */ jsx(
363
+ "div",
364
+ {
365
+ class: "layplux-center-area__right",
366
+ "v-show": isRightVisible.value,
367
+ style: { width: `${rightWidth.value}px` },
368
+ children: /* @__PURE__ */ jsxs("div", { class: "layplux-center-area__docked-panels", children: [
369
+ /* @__PURE__ */ jsx(
370
+ PanelView,
371
+ {
372
+ anchor: "right-top-area",
373
+ widget: rightTopWidget.value ?? void 0,
374
+ "v-show": isRightTopVisible.value,
375
+ style: rightBoth ? { height: rightTopHeight.value, flex: "none" } : {}
376
+ }
377
+ ),
378
+ rightBoth && /* @__PURE__ */ jsx(
379
+ "div",
380
+ {
381
+ class: "layplux-resize-handle layplux-resize-handle--y",
382
+ onMousedown: (e) => dragRightSplit(
383
+ e,
384
+ e.currentTarget.closest(
385
+ ".layplux-center-area__docked-panels"
386
+ ).clientHeight
387
+ )
388
+ }
389
+ ),
390
+ /* @__PURE__ */ jsx(
391
+ PanelView,
392
+ {
393
+ anchor: "right-bottom-area",
394
+ widget: rightBottomWidget.value ?? void 0,
395
+ "v-show": isRightBottomVisible.value,
396
+ style: rightBoth ? { height: rightBottomHeight.value, flex: "none" } : {}
397
+ }
398
+ )
399
+ ] })
400
+ }
401
+ )
402
+ ] }),
403
+ isBottomVisible.value && !isBottomUndockedVisible.value && /* @__PURE__ */ jsx(
404
+ "div",
405
+ {
406
+ class: "layplux-resize-handle layplux-resize-handle--y layplux-resize-handle--bottom-edge",
407
+ onMousedown: dragBottomHeight
408
+ }
409
+ ),
410
+ /* @__PURE__ */ jsxs(
411
+ "div",
412
+ {
413
+ class: "layplux-center-area__bottom",
414
+ "v-show": isBottomVisible.value,
415
+ style: { height: `${bottomHeight.value}px` },
416
+ children: [
417
+ /* @__PURE__ */ jsx(
418
+ PanelView,
419
+ {
420
+ anchor: "bottom-left-area",
421
+ widget: bottomLeftWidget.value ?? void 0,
422
+ "v-show": isBottomLeftVisible.value,
423
+ style: bottomBoth ? { width: bottomLeftWidth.value, flex: "none" } : {}
424
+ }
425
+ ),
426
+ bottomBoth && /* @__PURE__ */ jsx(
427
+ "div",
428
+ {
429
+ class: "layplux-resize-handle layplux-resize-handle--x",
430
+ onMousedown: (e) => dragBottomSplit(
431
+ e,
432
+ e.currentTarget.closest(".layplux-center-area__bottom").clientWidth
433
+ )
434
+ }
435
+ ),
436
+ /* @__PURE__ */ jsx(
437
+ PanelView,
438
+ {
439
+ anchor: "bottom-right-area",
440
+ widget: bottomRightWidget.value ?? void 0,
441
+ "v-show": isBottomRightVisible.value,
442
+ style: bottomBoth ? { width: bottomRightWidth.value, flex: "none" } : {}
443
+ }
444
+ )
445
+ ]
446
+ }
447
+ )
448
+ ] });
449
+ };
450
+ }
451
+ });
452
+ export {
453
+ CenterArea
454
+ };
@@ -0,0 +1,4 @@
1
+ import { Skeleton } from "./skeleton";
2
+ export {
3
+ Skeleton
4
+ };
@@ -0,0 +1,22 @@
1
+ import { jsx } from "vue/jsx-runtime";
2
+ import { defineComponent } from "vue";
3
+ const LeftBottomArea = defineComponent({
4
+ name: "LeftBottomArea",
5
+ props: {
6
+ area: Object
7
+ },
8
+ setup(props) {
9
+ return () => {
10
+ const items = props.area?.container.items.value;
11
+ if (!items || items.length === 0) return null;
12
+ return /* @__PURE__ */ jsx("div", { class: "layplux-left-bottom-area", children: items.slice().toSorted((a, b) => {
13
+ const i1 = a.config?.index ?? 0;
14
+ const i2 = b.config?.index ?? 0;
15
+ return i1 === i2 ? 0 : i1 > i2 ? 1 : -1;
16
+ }).map((widget) => widget.renderTitle()) });
17
+ };
18
+ }
19
+ });
20
+ export {
21
+ LeftBottomArea
22
+ };
@@ -0,0 +1,22 @@
1
+ import { jsx } from "vue/jsx-runtime";
2
+ import { defineComponent } from "vue";
3
+ const LeftTopArea = defineComponent({
4
+ name: "LeftTopArea",
5
+ props: {
6
+ area: Object
7
+ },
8
+ setup(props) {
9
+ return () => {
10
+ const items = props.area?.container.items.value;
11
+ if (!items || items.length === 0) return null;
12
+ return /* @__PURE__ */ jsx("div", { class: "layplux-left-top-area", children: items.slice().toSorted((a, b) => {
13
+ const i1 = a.config?.index ?? 0;
14
+ const i2 = b.config?.index ?? 0;
15
+ return i1 === i2 ? 0 : i1 > i2 ? 1 : -1;
16
+ }).map((widget) => widget.renderTitle()) });
17
+ };
18
+ }
19
+ });
20
+ export {
21
+ LeftTopArea
22
+ };
@@ -0,0 +1,18 @@
1
+ import { jsx } from "vue/jsx-runtime";
2
+ import { defineComponent } from "vue";
3
+ const RightBottomArea = defineComponent({
4
+ name: "RightBottomArea",
5
+ props: {
6
+ area: Object
7
+ },
8
+ setup(props) {
9
+ return () => {
10
+ const items = props.area?.container.items.value;
11
+ if (!items || items.length === 0) return null;
12
+ return /* @__PURE__ */ jsx("div", { class: "layplux-right-bottom-area", children: items.slice().toSorted((a, b) => (a.config?.index ?? 0) - (b.config?.index ?? 0)).map((widget) => widget.renderTitle()) });
13
+ };
14
+ }
15
+ });
16
+ export {
17
+ RightBottomArea
18
+ };
@@ -0,0 +1,18 @@
1
+ import { jsx } from "vue/jsx-runtime";
2
+ import { defineComponent } from "vue";
3
+ const RightTopArea = defineComponent({
4
+ name: "RightTopArea",
5
+ props: {
6
+ area: Object
7
+ },
8
+ setup(props) {
9
+ return () => {
10
+ const items = props.area?.container.items.value;
11
+ if (!items || items.length === 0) return null;
12
+ return /* @__PURE__ */ jsx("div", { class: "layplux-right-top-area", children: items.slice().toSorted((a, b) => (a.config?.index ?? 0) - (b.config?.index ?? 0)).map((widget) => widget.renderTitle()) });
13
+ };
14
+ }
15
+ });
16
+ export {
17
+ RightTopArea
18
+ };
@@ -0,0 +1,46 @@
1
+ import { jsx, jsxs } from "vue/jsx-runtime";
2
+ import { defineComponent } from "vue";
3
+ import { TopArea } from "./top-area";
4
+ import { BottomArea } from "./bottom-area";
5
+ import { LeftTopArea } from "./left-top-area";
6
+ import { LeftBottomArea } from "./left-bottom-area";
7
+ import { BottomLeftArea } from "./bottom-left-area";
8
+ import { RightTopArea } from "./right-top-area";
9
+ import { RightBottomArea } from "./right-bottom-area";
10
+ import { BottomRightArea } from "./bottom-right-area";
11
+ import {} from "../../managers";
12
+ import { CenterArea } from "./center-area";
13
+ const Skeleton = defineComponent({
14
+ name: "Skeleton",
15
+ props: {
16
+ skeleton: Object
17
+ },
18
+ setup(props) {
19
+ return () => /* @__PURE__ */ jsxs("div", { class: "layplux-skeleton", children: [
20
+ /* @__PURE__ */ jsx(TopArea, { area: props.skeleton?.topArea }),
21
+ /* @__PURE__ */ jsxs("div", { class: "layplux-skeleton__body", children: [
22
+ /* @__PURE__ */ jsxs("div", { class: "layplux-skeleton__stripe", children: [
23
+ /* @__PURE__ */ jsxs("div", { class: "layplux-skeleton__stripe-top", children: [
24
+ /* @__PURE__ */ jsx(LeftTopArea, { area: props.skeleton?.leftTopArea }),
25
+ /* @__PURE__ */ jsx("div", { class: "layplux-skeleton__stripe-separator" }),
26
+ /* @__PURE__ */ jsx(LeftBottomArea, { area: props.skeleton?.leftBottomArea })
27
+ ] }),
28
+ /* @__PURE__ */ jsx(BottomLeftArea, { area: props.skeleton?.bottomLeftArea })
29
+ ] }),
30
+ /* @__PURE__ */ jsx("div", { class: "layplux-skeleton__center", children: /* @__PURE__ */ jsx(CenterArea, { skeleton: props.skeleton, centerArea: props.skeleton?.centerArea }) }),
31
+ /* @__PURE__ */ jsxs("div", { class: "layplux-skeleton__stripe", children: [
32
+ /* @__PURE__ */ jsxs("div", { class: "layplux-skeleton__stripe-top", children: [
33
+ /* @__PURE__ */ jsx(RightTopArea, { area: props.skeleton?.rightTopArea }),
34
+ /* @__PURE__ */ jsx("div", { class: "layplux-skeleton__stripe-separator" }),
35
+ /* @__PURE__ */ jsx(RightBottomArea, { area: props.skeleton?.rightBottomArea })
36
+ ] }),
37
+ /* @__PURE__ */ jsx(BottomRightArea, { area: props.skeleton?.bottomRightArea })
38
+ ] })
39
+ ] }),
40
+ /* @__PURE__ */ jsx(BottomArea, { area: props.skeleton?.bottomArea })
41
+ ] });
42
+ }
43
+ });
44
+ export {
45
+ Skeleton
46
+ };
@@ -0,0 +1,44 @@
1
+ import { jsx, jsxs } from "vue/jsx-runtime";
2
+ import { defineComponent } from "vue";
3
+ const TopArea = defineComponent({
4
+ name: "TopArea",
5
+ props: {
6
+ area: Object
7
+ },
8
+ setup(props) {
9
+ return () => {
10
+ const { area } = props;
11
+ const left = [];
12
+ const center = [];
13
+ const right = [];
14
+ area?.container.items.value.slice().toSorted((a, b) => {
15
+ const index1 = a.config?.index || 0;
16
+ const index2 = b.config?.index || 0;
17
+ return index1 === index2 ? 0 : index1 > index2 ? 1 : -1;
18
+ }).forEach((item) => {
19
+ const content = /* @__PURE__ */ jsx("div", { children: item.renderContent() }, `top-area-${item.name}`);
20
+ if (item.align === "left") {
21
+ left.push(content);
22
+ } else if (item.align === "center") {
23
+ center.push(content);
24
+ } else {
25
+ right.push(content);
26
+ }
27
+ });
28
+ return /* @__PURE__ */ jsxs("div", { class: "layplux-top-area", children: [
29
+ /* @__PURE__ */ jsxs("div", { class: "layplux-top-area__toolbar-left", children: [
30
+ ...left
31
+ ] }),
32
+ /* @__PURE__ */ jsxs("div", { class: "layplux-top-area__toolbar-center", children: [
33
+ ...center
34
+ ] }),
35
+ /* @__PURE__ */ jsxs("div", { class: "layplux-top-area__toolbar-right", children: [
36
+ ...right
37
+ ] })
38
+ ] });
39
+ };
40
+ }
41
+ });
42
+ export {
43
+ TopArea
44
+ };
@@ -0,0 +1,14 @@
1
+ const enUS = {
2
+ panel: {
3
+ viewMode: "View Mode",
4
+ dockPinned: "Dock Pinned",
5
+ dockUnpinned: "Dock Unpinned",
6
+ undock: "Undock",
7
+ help: "Help",
8
+ more: "More",
9
+ minimize: "Minimize"
10
+ }
11
+ };
12
+ export {
13
+ enUS
14
+ };
@@ -0,0 +1,19 @@
1
+ import { zhCN } from "./zh-CN";
2
+ import { enUS } from "./en-US";
3
+ const builtInLocales = {
4
+ "zh-CN": zhCN,
5
+ "en-US": enUS
6
+ };
7
+ function getBuiltInLocale(name) {
8
+ const locale = builtInLocales[name];
9
+ if (!locale) {
10
+ console.warn(`[Layplux] Unknown locale "${name}", falling back to zh-CN`);
11
+ return zhCN;
12
+ }
13
+ return locale;
14
+ }
15
+ export {
16
+ enUS,
17
+ getBuiltInLocale,
18
+ zhCN
19
+ };
@@ -0,0 +1,14 @@
1
+ const zhCN = {
2
+ panel: {
3
+ viewMode: "\u89C6\u56FE\u6A21\u5F0F",
4
+ dockPinned: "\u505C\u9760\u56FA\u5B9A",
5
+ dockUnpinned: "\u505C\u9760\u4E0D\u56FA\u5B9A",
6
+ undock: "\u53D6\u6D88\u505C\u9760",
7
+ help: "\u5E2E\u52A9",
8
+ more: "\u66F4\u591A",
9
+ minimize: "\u6700\u5C0F\u5316"
10
+ }
11
+ };
12
+ export {
13
+ zhCN
14
+ };