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,46 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var root_pane_exports = {};
20
+ __export(root_pane_exports, {
21
+ RootPane: () => RootPane
22
+ });
23
+ module.exports = __toCommonJS(root_pane_exports);
24
+ var import_jsx_runtime = require("vue/jsx-runtime");
25
+ var import_vue = require("vue");
26
+ var import_layered_manager = require("./layered-manager");
27
+ var import_glass_overlay = require("./glass-overlay");
28
+ var import_components = require("../components");
29
+ const RootPane = (0, import_vue.defineComponent)({
30
+ name: "RootPane",
31
+ props: {
32
+ skeleton: Object
33
+ },
34
+ setup(props) {
35
+ (0, import_vue.provide)("layplux-locale", props.skeleton?.locale);
36
+ const rootClass = (0, import_vue.computed)(() => {
37
+ const dark = props.skeleton?.isDark();
38
+ return ["layplux-root", dark ? "dark" : ""].filter(Boolean);
39
+ });
40
+ return () => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { class: rootClass.value, "data-theme": props.skeleton?.themeName?.value, children: [
41
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.CornerGlow, {}),
42
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_layered_manager.LayeredManager, { skeleton: props.skeleton }),
43
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_glass_overlay.GlassOverlay, {})
44
+ ] });
45
+ }
46
+ });
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var bottom_area_exports = {};
20
+ __export(bottom_area_exports, {
21
+ BottomArea: () => BottomArea
22
+ });
23
+ module.exports = __toCommonJS(bottom_area_exports);
24
+ var import_jsx_runtime = require("vue/jsx-runtime");
25
+ var import_vue = require("vue");
26
+ const BottomArea = (0, import_vue.defineComponent)({
27
+ name: "BottomArea",
28
+ props: {
29
+ area: Object
30
+ },
31
+ setup(props) {
32
+ return () => {
33
+ const { area } = props;
34
+ const left = [];
35
+ const center = [];
36
+ const right = [];
37
+ area?.container.items.value.slice().toSorted((a, b) => {
38
+ const index1 = a.config?.index || 0;
39
+ const index2 = b.config?.index || 0;
40
+ return index1 === index2 ? 0 : index1 > index2 ? 1 : -1;
41
+ }).forEach((item) => {
42
+ const content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: item.renderContent() }, `bottom-area-${item.name}`);
43
+ if (item.align === "left") {
44
+ left.push(content);
45
+ } else if (item.align === "center") {
46
+ center.push(content);
47
+ } else {
48
+ right.push(content);
49
+ }
50
+ });
51
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { class: "layplux-bottom-area", children: [
52
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { class: "layplux-bottom-area__left", children: [
53
+ ...left
54
+ ] }),
55
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { class: "layplux-bottom-area__center", children: [
56
+ ...center
57
+ ] }),
58
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { class: "layplux-bottom-area__right", children: [
59
+ ...right
60
+ ] })
61
+ ] });
62
+ };
63
+ }
64
+ });
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var bottom_left_area_exports = {};
20
+ __export(bottom_left_area_exports, {
21
+ BottomLeftArea: () => BottomLeftArea
22
+ });
23
+ module.exports = __toCommonJS(bottom_left_area_exports);
24
+ var import_jsx_runtime = require("vue/jsx-runtime");
25
+ var import_vue = require("vue");
26
+ const BottomLeftArea = (0, import_vue.defineComponent)({
27
+ name: "BottomLeftArea",
28
+ props: {
29
+ area: Object
30
+ },
31
+ setup(props) {
32
+ return () => {
33
+ const items = props.area?.container.items.value;
34
+ if (!items || items.length === 0) return null;
35
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { class: "layplux-bottom-left-area", children: items.slice().toSorted((a, b) => {
36
+ const i1 = a.config?.index ?? 0;
37
+ const i2 = b.config?.index ?? 0;
38
+ return i1 === i2 ? 0 : i1 > i2 ? 1 : -1;
39
+ }).map((widget) => widget.renderTitle()) });
40
+ };
41
+ }
42
+ });
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var bottom_right_area_exports = {};
20
+ __export(bottom_right_area_exports, {
21
+ BottomRightArea: () => BottomRightArea
22
+ });
23
+ module.exports = __toCommonJS(bottom_right_area_exports);
24
+ var import_jsx_runtime = require("vue/jsx-runtime");
25
+ var import_vue = require("vue");
26
+ const BottomRightArea = (0, import_vue.defineComponent)({
27
+ name: "BottomRightArea",
28
+ props: {
29
+ area: Object
30
+ },
31
+ setup(props) {
32
+ return () => {
33
+ const items = props.area?.container.items.value;
34
+ if (!items || items.length === 0) return null;
35
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { class: "layplux-bottom-right-area", children: items.slice().toSorted((a, b) => (a.config?.index ?? 0) - (b.config?.index ?? 0)).map((widget) => widget.renderTitle()) });
36
+ };
37
+ }
38
+ });
@@ -0,0 +1,467 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var center_area_exports = {};
20
+ __export(center_area_exports, {
21
+ CenterArea: () => CenterArea
22
+ });
23
+ module.exports = __toCommonJS(center_area_exports);
24
+ var import_jsx_runtime = require("vue/jsx-runtime");
25
+ var import_vue = require("vue");
26
+ var import_components = require("../../components");
27
+ const CenterArea = (0, import_vue.defineComponent)({
28
+ name: "CenterArea",
29
+ props: {
30
+ skeleton: Object,
31
+ centerArea: Object
32
+ },
33
+ setup(props) {
34
+ let unmountFocusTracker = null;
35
+ (0, import_vue.onMounted)(() => {
36
+ unmountFocusTracker = props.skeleton?.focusTracker.mount(window) ?? null;
37
+ });
38
+ (0, import_vue.onUnmounted)(() => {
39
+ unmountFocusTracker?.();
40
+ });
41
+ const leftWidth = (0, import_vue.ref)(340);
42
+ const rightWidth = (0, import_vue.ref)(340);
43
+ const bottomHeight = (0, import_vue.ref)(300);
44
+ const leftSplitRatio = (0, import_vue.ref)(0.5);
45
+ const rightSplitRatio = (0, import_vue.ref)(0.5);
46
+ const bottomSplitRatio = (0, import_vue.ref)(0.5);
47
+ function startDrag(e, axis, onMove) {
48
+ e.preventDefault();
49
+ const startPos = axis === "x" ? e.clientX : e.clientY;
50
+ const onMouseMove = (ev) => onMove((axis === "x" ? ev.clientX : ev.clientY) - startPos);
51
+ const onMouseUp = () => {
52
+ window.removeEventListener("mousemove", onMouseMove);
53
+ window.removeEventListener("mouseup", onMouseUp);
54
+ };
55
+ window.addEventListener("mousemove", onMouseMove);
56
+ window.addEventListener("mouseup", onMouseUp);
57
+ }
58
+ function dragLeftWidth(e) {
59
+ const base = leftWidth.value;
60
+ startDrag(e, "x", (d) => {
61
+ leftWidth.value = Math.max(160, Math.min(600, base + d));
62
+ });
63
+ }
64
+ function dragRightWidth(e) {
65
+ const base = rightWidth.value;
66
+ startDrag(e, "x", (d) => {
67
+ rightWidth.value = Math.max(160, Math.min(600, base - d));
68
+ });
69
+ }
70
+ function dragBottomHeight(e) {
71
+ const base = bottomHeight.value;
72
+ startDrag(e, "y", (d) => {
73
+ bottomHeight.value = Math.max(80, Math.min(600, base - d));
74
+ });
75
+ }
76
+ function dragLeftSplit(e, totalHeight) {
77
+ const base = leftSplitRatio.value;
78
+ startDrag(e, "y", (d) => {
79
+ leftSplitRatio.value = Math.max(0.15, Math.min(0.85, base + d / totalHeight));
80
+ });
81
+ }
82
+ function dragRightSplit(e, totalHeight) {
83
+ const base = rightSplitRatio.value;
84
+ startDrag(e, "y", (d) => {
85
+ rightSplitRatio.value = Math.max(0.15, Math.min(0.85, base + d / totalHeight));
86
+ });
87
+ }
88
+ function dragBottomSplit(e, totalWidth) {
89
+ const base = bottomSplitRatio.value;
90
+ startDrag(e, "x", (d) => {
91
+ bottomSplitRatio.value = Math.max(0.15, Math.min(0.85, base + d / totalWidth));
92
+ });
93
+ }
94
+ function getActiveWidget(activeId) {
95
+ if (!activeId) return null;
96
+ return props.skeleton?.widgets.find((w) => w.name === activeId) ?? null;
97
+ }
98
+ function isDocked(activeId) {
99
+ const mode = getActiveWidget(activeId)?.pane.viewMode.value;
100
+ return mode === "DockPinned" || mode === "DockUnpinned";
101
+ }
102
+ const leftTopWidget = (0, import_vue.computed)(
103
+ () => getActiveWidget(props.skeleton?.leftTopArea.container.activeId.value ?? null)
104
+ );
105
+ const leftBottomWidget = (0, import_vue.computed)(
106
+ () => getActiveWidget(props.skeleton?.leftBottomArea.container.activeId.value ?? null)
107
+ );
108
+ const rightTopWidget = (0, import_vue.computed)(
109
+ () => getActiveWidget(props.skeleton?.rightTopArea.container.activeId.value ?? null)
110
+ );
111
+ const rightBottomWidget = (0, import_vue.computed)(
112
+ () => getActiveWidget(props.skeleton?.rightBottomArea.container.activeId.value ?? null)
113
+ );
114
+ const bottomLeftWidget = (0, import_vue.computed)(
115
+ () => getActiveWidget(props.skeleton?.bottomLeftArea.container.activeId.value ?? null)
116
+ );
117
+ const bottomRightWidget = (0, import_vue.computed)(
118
+ () => getActiveWidget(props.skeleton?.bottomRightArea.container.activeId.value ?? null)
119
+ );
120
+ const isLeftTopVisible = (0, import_vue.computed)(
121
+ () => isDocked(props.skeleton?.leftTopArea.container.activeId.value ?? null)
122
+ );
123
+ const isLeftBottomVisible = (0, import_vue.computed)(
124
+ () => isDocked(props.skeleton?.leftBottomArea.container.activeId.value ?? null)
125
+ );
126
+ const isRightTopVisible = (0, import_vue.computed)(
127
+ () => isDocked(props.skeleton?.rightTopArea.container.activeId.value ?? null)
128
+ );
129
+ const isRightBottomVisible = (0, import_vue.computed)(
130
+ () => isDocked(props.skeleton?.rightBottomArea.container.activeId.value ?? null)
131
+ );
132
+ const isBottomLeftVisible = (0, import_vue.computed)(
133
+ () => isDocked(props.skeleton?.bottomLeftArea.container.activeId.value ?? null)
134
+ );
135
+ const isBottomRightVisible = (0, import_vue.computed)(
136
+ () => isDocked(props.skeleton?.bottomRightArea.container.activeId.value ?? null)
137
+ );
138
+ const isLeftVisible = (0, import_vue.computed)(() => isLeftTopVisible.value || isLeftBottomVisible.value);
139
+ const isRightVisible = (0, import_vue.computed)(() => isRightTopVisible.value || isRightBottomVisible.value);
140
+ const isBottomVisible = (0, import_vue.computed)(() => isBottomLeftVisible.value || isBottomRightVisible.value);
141
+ function makeUndockedWidget(side) {
142
+ return (0, import_vue.computed)(() => {
143
+ const sk = props.skeleton;
144
+ const w = getActiveWidget(sk?.focusedId.value ?? null);
145
+ if (!w || w.pane.viewMode.value !== "Undock") return null;
146
+ const areaMap = {
147
+ left: [sk?.leftTopArea, sk?.leftBottomArea],
148
+ right: [sk?.rightTopArea, sk?.rightBottomArea],
149
+ bottom: [sk?.bottomLeftArea, sk?.bottomRightArea]
150
+ };
151
+ const belongs = areaMap[side].some(
152
+ (a) => a?.container.items.value.some((i) => i.name === w.name)
153
+ );
154
+ return belongs ? w : null;
155
+ });
156
+ }
157
+ const leftUndockedWidget = makeUndockedWidget("left");
158
+ const rightUndockedWidget = makeUndockedWidget("right");
159
+ const bottomUndockedWidget = makeUndockedWidget("bottom");
160
+ const isLeftUndockedVisible = (0, import_vue.computed)(() => leftUndockedWidget.value !== null);
161
+ const isRightUndockedVisible = (0, import_vue.computed)(() => rightUndockedWidget.value !== null);
162
+ const isBottomUndockedVisible = (0, import_vue.computed)(() => bottomUndockedWidget.value !== null);
163
+ const teleportTargets = (0, import_vue.computed)(() => {
164
+ const sk = props.skeleton;
165
+ const map = {};
166
+ if (!sk) return map;
167
+ const sideIndex = /* @__PURE__ */ new Map();
168
+ sk.leftTopArea.container.items.value.forEach(
169
+ (w) => sideIndex.set(w.name, "#left-undocked-area")
170
+ );
171
+ sk.leftBottomArea.container.items.value.forEach(
172
+ (w) => sideIndex.set(w.name, "#left-undocked-area")
173
+ );
174
+ sk.rightTopArea.container.items.value.forEach(
175
+ (w) => sideIndex.set(w.name, "#right-undocked-area")
176
+ );
177
+ sk.rightBottomArea.container.items.value.forEach(
178
+ (w) => sideIndex.set(w.name, "#right-undocked-area")
179
+ );
180
+ sk.bottomLeftArea.container.items.value.forEach(
181
+ (w) => sideIndex.set(w.name, "#bottom-undocked-area")
182
+ );
183
+ sk.bottomRightArea.container.items.value.forEach(
184
+ (w) => sideIndex.set(w.name, "#bottom-undocked-area")
185
+ );
186
+ const focusedName = sk.focusedId.value;
187
+ const undockWinner = {
188
+ "#left-undocked-area": null,
189
+ "#right-undocked-area": null,
190
+ "#bottom-undocked-area": null
191
+ };
192
+ if (focusedName) {
193
+ const focusedWidget = sk.widgets.find((w) => w.name === focusedName);
194
+ if (focusedWidget?.pane.viewMode.value === "Undock") {
195
+ const anchor = sideIndex.get(focusedName);
196
+ if (anchor) undockWinner[anchor] = focusedName;
197
+ }
198
+ }
199
+ const dockTargets = {
200
+ [sk.leftTopArea.container.activeId.value ?? ""]: "#left-top-area",
201
+ [sk.leftBottomArea.container.activeId.value ?? ""]: "#left-bottom-area",
202
+ [sk.rightTopArea.container.activeId.value ?? ""]: "#right-top-area",
203
+ [sk.rightBottomArea.container.activeId.value ?? ""]: "#right-bottom-area",
204
+ [sk.bottomLeftArea.container.activeId.value ?? ""]: "#bottom-left-area",
205
+ [sk.bottomRightArea.container.activeId.value ?? ""]: "#bottom-right-area"
206
+ };
207
+ delete dockTargets[""];
208
+ sk.widgets.filter((w) => w.type === "panel").forEach((w) => {
209
+ if (w.pane.viewMode.value === "Undock") {
210
+ const anchor = sideIndex.get(w.name) ?? "#widget-offscreen";
211
+ map[w.name] = undockWinner[anchor] === w.name ? anchor : "#widget-offscreen";
212
+ } else {
213
+ map[w.name] = dockTargets[w.name] ?? "#widget-offscreen";
214
+ }
215
+ });
216
+ return map;
217
+ });
218
+ const centerWidgetNames = (0, import_vue.computed)(() => {
219
+ const names = /* @__PURE__ */ new Set();
220
+ props.centerArea?.container.items.value.forEach((w) => names.add(w.name));
221
+ return names;
222
+ });
223
+ const centerTargets = (0, import_vue.computed)(() => {
224
+ const activeId = props.centerArea?.container.activeId.value ?? null;
225
+ const map = {};
226
+ props.centerArea?.container.items.value.forEach((w) => {
227
+ map[w.name] = w.name === activeId ? "#center-area" : "#center-offscreen";
228
+ });
229
+ return map;
230
+ });
231
+ const leftTopHeight = (0, import_vue.computed)(() => `calc((100% - 4px) * ${leftSplitRatio.value})`);
232
+ const leftBottomHeight = (0, import_vue.computed)(() => `calc((100% - 4px) * ${1 - leftSplitRatio.value})`);
233
+ const rightTopHeight = (0, import_vue.computed)(() => `calc((100% - 4px) * ${rightSplitRatio.value})`);
234
+ const rightBottomHeight = (0, import_vue.computed)(() => `calc((100% - 4px) * ${1 - rightSplitRatio.value})`);
235
+ const bottomLeftWidth = (0, import_vue.computed)(() => `calc((100% - 4px) * ${bottomSplitRatio.value})`);
236
+ const bottomRightWidth = (0, import_vue.computed)(() => `calc((100% - 4px) * ${1 - bottomSplitRatio.value})`);
237
+ return () => {
238
+ if (!props.skeleton) return null;
239
+ const sk = props.skeleton;
240
+ const leftBoth = isLeftTopVisible.value && isLeftBottomVisible.value;
241
+ const rightBoth = isRightTopVisible.value && isRightBottomVisible.value;
242
+ const bottomBoth = isBottomLeftVisible.value && isBottomRightVisible.value;
243
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { class: "layplux-center-area", children: [
244
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { id: "widget-offscreen", style: "display:none;" }),
245
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { id: "center-offscreen", style: "display:none;" }),
246
+ sk.widgets.filter((w) => w.type === "panel" && !centerWidgetNames.value.has(w.name)).map((w) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
247
+ import_vue.Teleport,
248
+ {
249
+ defer: true,
250
+ to: teleportTargets.value[w.name] ?? "#widget-offscreen",
251
+ children: w.renderContent()
252
+ },
253
+ w.name
254
+ )),
255
+ props.centerArea?.container.items.value.map((w) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_vue.Teleport, { defer: true, to: centerTargets.value[w.name] ?? "#center-offscreen", children: w.renderContent() }, w.name)),
256
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
257
+ "div",
258
+ {
259
+ class: "layplux-panel--undocked layplux-panel--undocked-left",
260
+ "v-show": isLeftUndockedVisible.value,
261
+ style: { width: `${leftWidth.value}px` },
262
+ children: [
263
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.PanelView, { anchor: "left-undocked-area", widget: leftUndockedWidget.value ?? void 0 }),
264
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
265
+ "div",
266
+ {
267
+ class: "layplux-resize-handle layplux-resize-handle--x layplux-resize-handle--edge-right",
268
+ onMousedown: dragLeftWidth
269
+ }
270
+ )
271
+ ]
272
+ }
273
+ ),
274
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
275
+ "div",
276
+ {
277
+ class: "layplux-panel--undocked layplux-panel--undocked-right",
278
+ "v-show": isRightUndockedVisible.value,
279
+ style: { width: `${rightWidth.value}px` },
280
+ children: [
281
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
282
+ "div",
283
+ {
284
+ class: "layplux-resize-handle layplux-resize-handle--x layplux-resize-handle--edge-left",
285
+ onMousedown: dragRightWidth
286
+ }
287
+ ),
288
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
289
+ import_components.PanelView,
290
+ {
291
+ anchor: "right-undocked-area",
292
+ widget: rightUndockedWidget.value ?? void 0
293
+ }
294
+ )
295
+ ]
296
+ }
297
+ ),
298
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
299
+ "div",
300
+ {
301
+ class: "layplux-panel--undocked layplux-panel--undocked-bottom",
302
+ "v-show": isBottomUndockedVisible.value,
303
+ style: { height: `${bottomHeight.value}px` },
304
+ children: [
305
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
306
+ "div",
307
+ {
308
+ class: "layplux-resize-handle layplux-resize-handle--y layplux-resize-handle--edge-top",
309
+ onMousedown: dragBottomHeight
310
+ }
311
+ ),
312
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
313
+ import_components.PanelView,
314
+ {
315
+ anchor: "bottom-undocked-area",
316
+ widget: bottomUndockedWidget.value ?? void 0
317
+ }
318
+ )
319
+ ]
320
+ }
321
+ ),
322
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { class: "layplux-center-area__main", children: [
323
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
324
+ "div",
325
+ {
326
+ class: "layplux-center-area__left",
327
+ "v-show": isLeftVisible.value,
328
+ style: { width: `${leftWidth.value}px` },
329
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { class: "layplux-center-area__docked-panels", children: [
330
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
331
+ import_components.PanelView,
332
+ {
333
+ anchor: "left-top-area",
334
+ widget: leftTopWidget.value ?? void 0,
335
+ "v-show": isLeftTopVisible.value,
336
+ style: leftBoth ? { height: leftTopHeight.value, flex: "none" } : {}
337
+ }
338
+ ),
339
+ leftBoth && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
340
+ "div",
341
+ {
342
+ class: "layplux-resize-handle layplux-resize-handle--y",
343
+ onMousedown: (e) => dragLeftSplit(
344
+ e,
345
+ e.currentTarget.closest(
346
+ ".layplux-center-area__docked-panels"
347
+ ).clientHeight
348
+ )
349
+ }
350
+ ),
351
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
352
+ import_components.PanelView,
353
+ {
354
+ anchor: "left-bottom-area",
355
+ widget: leftBottomWidget.value ?? void 0,
356
+ "v-show": isLeftBottomVisible.value,
357
+ style: leftBoth ? { height: leftBottomHeight.value, flex: "none" } : {}
358
+ }
359
+ )
360
+ ] })
361
+ }
362
+ ),
363
+ isLeftVisible.value && !isLeftUndockedVisible.value && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
364
+ "div",
365
+ {
366
+ class: "layplux-resize-handle layplux-resize-handle--x",
367
+ onMousedown: dragLeftWidth
368
+ }
369
+ ),
370
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { id: "center-area", class: "layplux-center-area__editor" }),
371
+ isRightVisible.value && !isRightUndockedVisible.value && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
372
+ "div",
373
+ {
374
+ class: "layplux-resize-handle layplux-resize-handle--x",
375
+ onMousedown: dragRightWidth
376
+ }
377
+ ),
378
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
379
+ "div",
380
+ {
381
+ class: "layplux-center-area__right",
382
+ "v-show": isRightVisible.value,
383
+ style: { width: `${rightWidth.value}px` },
384
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { class: "layplux-center-area__docked-panels", children: [
385
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
386
+ import_components.PanelView,
387
+ {
388
+ anchor: "right-top-area",
389
+ widget: rightTopWidget.value ?? void 0,
390
+ "v-show": isRightTopVisible.value,
391
+ style: rightBoth ? { height: rightTopHeight.value, flex: "none" } : {}
392
+ }
393
+ ),
394
+ rightBoth && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
395
+ "div",
396
+ {
397
+ class: "layplux-resize-handle layplux-resize-handle--y",
398
+ onMousedown: (e) => dragRightSplit(
399
+ e,
400
+ e.currentTarget.closest(
401
+ ".layplux-center-area__docked-panels"
402
+ ).clientHeight
403
+ )
404
+ }
405
+ ),
406
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
407
+ import_components.PanelView,
408
+ {
409
+ anchor: "right-bottom-area",
410
+ widget: rightBottomWidget.value ?? void 0,
411
+ "v-show": isRightBottomVisible.value,
412
+ style: rightBoth ? { height: rightBottomHeight.value, flex: "none" } : {}
413
+ }
414
+ )
415
+ ] })
416
+ }
417
+ )
418
+ ] }),
419
+ isBottomVisible.value && !isBottomUndockedVisible.value && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
420
+ "div",
421
+ {
422
+ class: "layplux-resize-handle layplux-resize-handle--y layplux-resize-handle--bottom-edge",
423
+ onMousedown: dragBottomHeight
424
+ }
425
+ ),
426
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
427
+ "div",
428
+ {
429
+ class: "layplux-center-area__bottom",
430
+ "v-show": isBottomVisible.value,
431
+ style: { height: `${bottomHeight.value}px` },
432
+ children: [
433
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
434
+ import_components.PanelView,
435
+ {
436
+ anchor: "bottom-left-area",
437
+ widget: bottomLeftWidget.value ?? void 0,
438
+ "v-show": isBottomLeftVisible.value,
439
+ style: bottomBoth ? { width: bottomLeftWidth.value, flex: "none" } : {}
440
+ }
441
+ ),
442
+ bottomBoth && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
443
+ "div",
444
+ {
445
+ class: "layplux-resize-handle layplux-resize-handle--x",
446
+ onMousedown: (e) => dragBottomSplit(
447
+ e,
448
+ e.currentTarget.closest(".layplux-center-area__bottom").clientWidth
449
+ )
450
+ }
451
+ ),
452
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
453
+ import_components.PanelView,
454
+ {
455
+ anchor: "bottom-right-area",
456
+ widget: bottomRightWidget.value ?? void 0,
457
+ "v-show": isBottomRightVisible.value,
458
+ style: bottomBoth ? { width: bottomRightWidth.value, flex: "none" } : {}
459
+ }
460
+ )
461
+ ]
462
+ }
463
+ )
464
+ ] });
465
+ };
466
+ }
467
+ });
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var skeleton_exports = {};
20
+ __export(skeleton_exports, {
21
+ Skeleton: () => import_skeleton.Skeleton
22
+ });
23
+ module.exports = __toCommonJS(skeleton_exports);
24
+ var import_skeleton = require("./skeleton");