layplux 1.0.1 → 2.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 (91) hide show
  1. package/dist/cjs/components/center-view/index.cjs +18 -28
  2. package/dist/cjs/components/corner-glow/index.cjs +11 -28
  3. package/dist/cjs/components/dropdown/index.cjs +136 -130
  4. package/dist/cjs/components/icon/index.cjs +29 -51
  5. package/dist/cjs/components/index.cjs +24 -25
  6. package/dist/cjs/components/panel-view/index.cjs +111 -114
  7. package/dist/cjs/components/popup/index.cjs +166 -151
  8. package/dist/cjs/components/title/index.cjs +34 -47
  9. package/dist/cjs/components/tooltip/index.cjs +70 -61
  10. package/dist/cjs/components/widget/index.cjs +52 -72
  11. package/dist/cjs/index.cjs +13 -40
  12. package/dist/cjs/layout/glass-overlay.cjs +15 -28
  13. package/dist/cjs/layout/layered-manager.cjs +20 -29
  14. package/dist/cjs/layout/layplux.cjs +19 -32
  15. package/dist/cjs/layout/root-pane.cjs +20 -38
  16. package/dist/cjs/layout/skeleton/bottom-area.cjs +26 -43
  17. package/dist/cjs/layout/skeleton/bottom-left-area.cjs +12 -29
  18. package/dist/cjs/layout/skeleton/bottom-right-area.cjs +11 -28
  19. package/dist/cjs/layout/skeleton/center-area.cjs +278 -371
  20. package/dist/cjs/layout/skeleton/index.cjs +7 -24
  21. package/dist/cjs/layout/skeleton/left-bottom-area.cjs +12 -29
  22. package/dist/cjs/layout/skeleton/left-top-area.cjs +12 -29
  23. package/dist/cjs/layout/skeleton/right-bottom-area.cjs +11 -28
  24. package/dist/cjs/layout/skeleton/right-top-area.cjs +11 -28
  25. package/dist/cjs/layout/skeleton/skeleton.cjs +55 -60
  26. package/dist/cjs/layout/skeleton/top-area.cjs +26 -43
  27. package/dist/cjs/locales/en-US.cjs +11 -30
  28. package/dist/cjs/locales/index.cjs +12 -30
  29. package/dist/cjs/locales/zh-CN.cjs +11 -30
  30. package/dist/cjs/managers/area.cjs +12 -25
  31. package/dist/cjs/managers/index.cjs +12 -20
  32. package/dist/cjs/managers/pane.cjs +12 -26
  33. package/dist/cjs/managers/skeleton.cjs +112 -124
  34. package/dist/cjs/managers/theme.cjs +8 -29
  35. package/dist/cjs/managers/widget-container.cjs +31 -31
  36. package/dist/cjs/managers/widget.cjs +63 -50
  37. package/dist/cjs/types/config.cjs +2 -16
  38. package/dist/cjs/types/index.cjs +2 -18
  39. package/dist/cjs/types/locale.cjs +2 -16
  40. package/dist/cjs/utils/event-bus.cjs +53 -49
  41. package/dist/cjs/utils/focus-tracker.cjs +66 -42
  42. package/dist/cjs/utils/index.cjs +23 -31
  43. package/dist/cjs/utils/unique-id.cjs +5 -24
  44. package/dist/cjs/utils/vue.cjs +20 -30
  45. package/dist/esm/components/center-view/index.mjs +15 -7
  46. package/dist/esm/components/corner-glow/index.mjs +8 -7
  47. package/dist/esm/components/dropdown/index.mjs +117 -101
  48. package/dist/esm/components/icon/index.mjs +24 -30
  49. package/dist/esm/components/index.mjs +7 -8
  50. package/dist/esm/components/panel-view/index.mjs +107 -98
  51. package/dist/esm/components/popup/index.mjs +155 -130
  52. package/dist/esm/components/title/index.mjs +29 -24
  53. package/dist/esm/components/tooltip/index.mjs +67 -40
  54. package/dist/esm/components/widget/index.mjs +45 -48
  55. package/dist/esm/index.mjs +4 -10
  56. package/dist/esm/layout/glass-overlay.mjs +12 -7
  57. package/dist/esm/layout/layered-manager.mjs +17 -8
  58. package/dist/esm/layout/layplux.mjs +14 -11
  59. package/dist/esm/layout/root-pane.mjs +16 -16
  60. package/dist/esm/layout/skeleton/bottom-area.mjs +23 -22
  61. package/dist/esm/layout/skeleton/bottom-left-area.mjs +9 -8
  62. package/dist/esm/layout/skeleton/bottom-right-area.mjs +8 -7
  63. package/dist/esm/layout/skeleton/center-area.mjs +251 -333
  64. package/dist/esm/layout/skeleton/index.mjs +1 -4
  65. package/dist/esm/layout/skeleton/left-bottom-area.mjs +9 -8
  66. package/dist/esm/layout/skeleton/left-top-area.mjs +9 -8
  67. package/dist/esm/layout/skeleton/right-bottom-area.mjs +8 -7
  68. package/dist/esm/layout/skeleton/right-top-area.mjs +8 -7
  69. package/dist/esm/layout/skeleton/skeleton.mjs +52 -39
  70. package/dist/esm/layout/skeleton/top-area.mjs +23 -22
  71. package/dist/esm/locales/en-US.mjs +9 -10
  72. package/dist/esm/locales/index.mjs +7 -9
  73. package/dist/esm/locales/zh-CN.mjs +9 -10
  74. package/dist/esm/managers/area.mjs +10 -5
  75. package/dist/esm/managers/index.mjs +3 -3
  76. package/dist/esm/managers/pane.mjs +9 -5
  77. package/dist/esm/managers/skeleton.mjs +97 -95
  78. package/dist/esm/managers/theme.mjs +6 -9
  79. package/dist/esm/managers/widget-container.mjs +28 -10
  80. package/dist/esm/managers/widget.mjs +55 -25
  81. package/dist/esm/types/config.mjs +1 -0
  82. package/dist/esm/types/index.mjs +1 -1
  83. package/dist/esm/types/locale.mjs +1 -0
  84. package/dist/esm/utils/event-bus.mjs +46 -17
  85. package/dist/esm/utils/focus-tracker.mjs +63 -23
  86. package/dist/esm/utils/index.mjs +7 -10
  87. package/dist/esm/utils/unique-id.mjs +3 -4
  88. package/dist/esm/utils/vue.mjs +13 -5
  89. package/dist/types/managers/skeleton.d.ts.map +1 -1
  90. package/dist/umd/index.js +2 -30
  91. package/package.json +18 -14
@@ -1,4 +1 @@
1
- import { Skeleton } from "./skeleton.mjs";
2
- export {
3
- Skeleton
4
- };
1
+ export { Skeleton } from './skeleton.mjs';
@@ -1,7 +1,7 @@
1
- import { jsx } from "vue/jsx-runtime";
2
- import { defineComponent } from "vue";
1
+ import { defineComponent, createVNode } from 'vue';
2
+
3
3
  const LeftBottomArea = defineComponent({
4
- name: "LeftBottomArea",
4
+ name: 'LeftBottomArea',
5
5
  props: {
6
6
  area: Object
7
7
  },
@@ -9,14 +9,15 @@ const LeftBottomArea = defineComponent({
9
9
  return () => {
10
10
  const items = props.area?.container.items.value;
11
11
  if (!items || items.length === 0) return null;
12
- return /* @__PURE__ */ jsx("div", { class: "layplux-left-bottom-area", children: items.slice().toSorted((a, b) => {
12
+ return createVNode("div", {
13
+ "class": "layplux-left-bottom-area"
14
+ }, [items.slice().toSorted((a, b) => {
13
15
  const i1 = a.config?.index ?? 0;
14
16
  const i2 = b.config?.index ?? 0;
15
17
  return i1 === i2 ? 0 : i1 > i2 ? 1 : -1;
16
- }).map((widget) => widget.renderTitle()) });
18
+ }).map(widget => widget.renderTitle())]);
17
19
  };
18
20
  }
19
21
  });
20
- export {
21
- LeftBottomArea
22
- };
22
+
23
+ export { LeftBottomArea };
@@ -1,7 +1,7 @@
1
- import { jsx } from "vue/jsx-runtime";
2
- import { defineComponent } from "vue";
1
+ import { defineComponent, createVNode } from 'vue';
2
+
3
3
  const LeftTopArea = defineComponent({
4
- name: "LeftTopArea",
4
+ name: 'LeftTopArea',
5
5
  props: {
6
6
  area: Object
7
7
  },
@@ -9,14 +9,15 @@ const LeftTopArea = defineComponent({
9
9
  return () => {
10
10
  const items = props.area?.container.items.value;
11
11
  if (!items || items.length === 0) return null;
12
- return /* @__PURE__ */ jsx("div", { class: "layplux-left-top-area", children: items.slice().toSorted((a, b) => {
12
+ return createVNode("div", {
13
+ "class": "layplux-left-top-area"
14
+ }, [items.slice().toSorted((a, b) => {
13
15
  const i1 = a.config?.index ?? 0;
14
16
  const i2 = b.config?.index ?? 0;
15
17
  return i1 === i2 ? 0 : i1 > i2 ? 1 : -1;
16
- }).map((widget) => widget.renderTitle()) });
18
+ }).map(widget => widget.renderTitle())]);
17
19
  };
18
20
  }
19
21
  });
20
- export {
21
- LeftTopArea
22
- };
22
+
23
+ export { LeftTopArea };
@@ -1,7 +1,7 @@
1
- import { jsx } from "vue/jsx-runtime";
2
- import { defineComponent } from "vue";
1
+ import { defineComponent, createVNode } from 'vue';
2
+
3
3
  const RightBottomArea = defineComponent({
4
- name: "RightBottomArea",
4
+ name: 'RightBottomArea',
5
5
  props: {
6
6
  area: Object
7
7
  },
@@ -9,10 +9,11 @@ const RightBottomArea = defineComponent({
9
9
  return () => {
10
10
  const items = props.area?.container.items.value;
11
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()) });
12
+ return createVNode("div", {
13
+ "class": "layplux-right-bottom-area"
14
+ }, [items.slice().toSorted((a, b) => (a.config?.index ?? 0) - (b.config?.index ?? 0)).map(widget => widget.renderTitle())]);
13
15
  };
14
16
  }
15
17
  });
16
- export {
17
- RightBottomArea
18
- };
18
+
19
+ export { RightBottomArea };
@@ -1,7 +1,7 @@
1
- import { jsx } from "vue/jsx-runtime";
2
- import { defineComponent } from "vue";
1
+ import { defineComponent, createVNode } from 'vue';
2
+
3
3
  const RightTopArea = defineComponent({
4
- name: "RightTopArea",
4
+ name: 'RightTopArea',
5
5
  props: {
6
6
  area: Object
7
7
  },
@@ -9,10 +9,11 @@ const RightTopArea = defineComponent({
9
9
  return () => {
10
10
  const items = props.area?.container.items.value;
11
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()) });
12
+ return createVNode("div", {
13
+ "class": "layplux-right-top-area"
14
+ }, [items.slice().toSorted((a, b) => (a.config?.index ?? 0) - (b.config?.index ?? 0)).map(widget => widget.renderTitle())]);
13
15
  };
14
16
  }
15
17
  });
16
- export {
17
- RightTopArea
18
- };
18
+
19
+ export { RightTopArea };
@@ -1,46 +1,59 @@
1
- import { jsx, jsxs } from "vue/jsx-runtime";
2
- import { defineComponent } from "vue";
3
- import { TopArea } from "./top-area.mjs";
4
- import { BottomArea } from "./bottom-area.mjs";
5
- import { LeftTopArea } from "./left-top-area.mjs";
6
- import { LeftBottomArea } from "./left-bottom-area.mjs";
7
- import { BottomLeftArea } from "./bottom-left-area.mjs";
8
- import { RightTopArea } from "./right-top-area.mjs";
9
- import { RightBottomArea } from "./right-bottom-area.mjs";
10
- import { BottomRightArea } from "./bottom-right-area.mjs";
11
- import {} from "../../managers/index.mjs";
12
- import { CenterArea } from "./center-area.mjs";
1
+ import { defineComponent, createVNode } from 'vue';
2
+ import { TopArea } from './top-area.mjs';
3
+ import { BottomArea } from './bottom-area.mjs';
4
+ import { LeftTopArea } from './left-top-area.mjs';
5
+ import { LeftBottomArea } from './left-bottom-area.mjs';
6
+ import { BottomLeftArea } from './bottom-left-area.mjs';
7
+ import { RightTopArea } from './right-top-area.mjs';
8
+ import { RightBottomArea } from './right-bottom-area.mjs';
9
+ import { BottomRightArea } from './bottom-right-area.mjs';
10
+ import { CenterArea } from './center-area.mjs';
11
+
13
12
  const Skeleton = defineComponent({
14
- name: "Skeleton",
13
+ name: 'Skeleton',
15
14
  props: {
16
15
  skeleton: Object
17
16
  },
18
17
  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
- ] });
18
+ return () => createVNode("div", {
19
+ "class": "layplux-skeleton"
20
+ }, [createVNode(TopArea, {
21
+ "area": props.skeleton?.topArea
22
+ }, null), createVNode("div", {
23
+ "class": "layplux-skeleton__body"
24
+ }, [createVNode("div", {
25
+ "class": "layplux-skeleton__stripe"
26
+ }, [createVNode("div", {
27
+ "class": "layplux-skeleton__stripe-top"
28
+ }, [createVNode(LeftTopArea, {
29
+ "area": props.skeleton?.leftTopArea
30
+ }, null), createVNode("div", {
31
+ "class": "layplux-skeleton__stripe-separator"
32
+ }, null), createVNode(LeftBottomArea, {
33
+ "area": props.skeleton?.leftBottomArea
34
+ }, null)]), createVNode(BottomLeftArea, {
35
+ "area": props.skeleton?.bottomLeftArea
36
+ }, null)]), createVNode("div", {
37
+ "class": "layplux-skeleton__center"
38
+ }, [createVNode(CenterArea, {
39
+ "skeleton": props.skeleton,
40
+ "centerArea": props.skeleton?.centerArea
41
+ }, null)]), createVNode("div", {
42
+ "class": "layplux-skeleton__stripe"
43
+ }, [createVNode("div", {
44
+ "class": "layplux-skeleton__stripe-top"
45
+ }, [createVNode(RightTopArea, {
46
+ "area": props.skeleton?.rightTopArea
47
+ }, null), createVNode("div", {
48
+ "class": "layplux-skeleton__stripe-separator"
49
+ }, null), createVNode(RightBottomArea, {
50
+ "area": props.skeleton?.rightBottomArea
51
+ }, null)]), createVNode(BottomRightArea, {
52
+ "area": props.skeleton?.bottomRightArea
53
+ }, null)])]), createVNode(BottomArea, {
54
+ "area": props.skeleton?.bottomArea
55
+ }, null)]);
42
56
  }
43
57
  });
44
- export {
45
- Skeleton
46
- };
58
+
59
+ export { Skeleton };
@@ -1,13 +1,15 @@
1
- import { jsx, jsxs } from "vue/jsx-runtime";
2
- import { defineComponent } from "vue";
1
+ import { defineComponent, createVNode } from 'vue';
2
+
3
3
  const TopArea = defineComponent({
4
- name: "TopArea",
4
+ name: 'TopArea',
5
5
  props: {
6
6
  area: Object
7
7
  },
8
8
  setup(props) {
9
9
  return () => {
10
- const { area } = props;
10
+ const {
11
+ area
12
+ } = props;
11
13
  const left = [];
12
14
  const center = [];
13
15
  const right = [];
@@ -15,30 +17,29 @@ const TopArea = defineComponent({
15
17
  const index1 = a.config?.index || 0;
16
18
  const index2 = b.config?.index || 0;
17
19
  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") {
20
+ }).forEach(item => {
21
+ const content = createVNode("div", {
22
+ "key": `top-area-${item.name}`
23
+ }, [item.renderContent()]);
24
+ if (item.align === 'left') {
21
25
  left.push(content);
22
- } else if (item.align === "center") {
26
+ } else if (item.align === 'center') {
23
27
  center.push(content);
24
28
  } else {
25
29
  right.push(content);
26
30
  }
27
31
  });
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
- ] });
32
+ return createVNode("div", {
33
+ "class": "layplux-top-area"
34
+ }, [createVNode("div", {
35
+ "class": "layplux-top-area__toolbar-left"
36
+ }, [...left]), createVNode("div", {
37
+ "class": "layplux-top-area__toolbar-center"
38
+ }, [...center]), createVNode("div", {
39
+ "class": "layplux-top-area__toolbar-right"
40
+ }, [...right])]);
39
41
  };
40
42
  }
41
43
  });
42
- export {
43
- TopArea
44
- };
44
+
45
+ export { TopArea };
@@ -1,14 +1,13 @@
1
1
  const enUS = {
2
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"
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
10
  }
11
11
  };
12
- export {
13
- enUS
14
- };
12
+
13
+ export { enUS };
@@ -1,8 +1,9 @@
1
- import { zhCN } from "./zh-CN.mjs";
2
- import { enUS } from "./en-US.mjs";
1
+ import { zhCN } from './zh-CN.mjs';
2
+ import { enUS } from './en-US.mjs';
3
+
3
4
  const builtInLocales = {
4
- "zh-CN": zhCN,
5
- "en-US": enUS
5
+ 'zh-CN': zhCN,
6
+ 'en-US': enUS
6
7
  };
7
8
  function getBuiltInLocale(name) {
8
9
  const locale = builtInLocales[name];
@@ -12,8 +13,5 @@ function getBuiltInLocale(name) {
12
13
  }
13
14
  return locale;
14
15
  }
15
- export {
16
- enUS,
17
- getBuiltInLocale,
18
- zhCN
19
- };
16
+
17
+ export { enUS, getBuiltInLocale, zhCN };
@@ -1,14 +1,13 @@
1
1
  const zhCN = {
2
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"
3
+ viewMode: '视图模式',
4
+ dockPinned: '停靠固定',
5
+ dockUnpinned: '停靠不固定',
6
+ undock: '取消停靠',
7
+ help: '帮助',
8
+ more: '更多',
9
+ minimize: '最小化'
10
10
  }
11
11
  };
12
- export {
13
- zhCN
14
- };
12
+
13
+ export { zhCN };
@@ -1,12 +1,17 @@
1
- import {} from "./widget-container.mjs";
1
+ /**
2
+ * `useArea` 只需要 skeleton 的 `createContainer` 能力,
3
+ * 不依赖完整的 ISkeleton(避免创建时的循环依赖)。
4
+ */
2
5
  function useArea(skeleton, name, handle) {
3
6
  const container = skeleton.createContainer(name, handle);
4
7
  function add(config) {
5
8
  const item = container.add(config);
6
9
  return item;
7
10
  }
8
- return { add, container };
11
+ return {
12
+ add,
13
+ container
14
+ };
9
15
  }
10
- export {
11
- useArea
12
- };
16
+
17
+ export { useArea };
@@ -1,3 +1,3 @@
1
- export * from "./skeleton.mjs";
2
- export * from "./area.mjs";
3
- export * from "./widget.mjs";
1
+ export { useSkeleton } from './skeleton.mjs';
2
+ export { useArea } from './area.mjs';
3
+ export { isWidget, useWidget } from './widget.mjs';
@@ -1,5 +1,10 @@
1
- import { ref } from "vue";
2
- function usePane(defaultViewMode = "DockPinned") {
1
+ import { ref } from 'vue';
2
+
3
+ /**
4
+ * 没个widget都会对应自己的pane的状态
5
+ */
6
+
7
+ function usePane(defaultViewMode = 'DockPinned') {
3
8
  const viewMode = ref(defaultViewMode);
4
9
  function setViewMode(mode) {
5
10
  viewMode.value = mode;
@@ -9,6 +14,5 @@ function usePane(defaultViewMode = "DockPinned") {
9
14
  setViewMode
10
15
  };
11
16
  }
12
- export {
13
- usePane
14
- };
17
+
18
+ export { usePane };