vlite3 1.5.17 → 1.5.18

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 (29) hide show
  1. package/components/CategoryManager/CategoryManager2.vue.js +3 -3
  2. package/components/CommandPalette/CommandPaletteContent2.vue.js +1 -1
  3. package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem2.vue.js} +1 -1
  4. package/components/EditableTitle/EditableTitle.vue.d.ts +182 -2
  5. package/components/EditableTitle/EditableTitle.vue.js +2 -2
  6. package/components/EditableTitle/EditableTitle2.vue.js +221 -193
  7. package/components/Form/{AccordionView.vue.js → AccordionView2.vue.js} +1 -1
  8. package/components/Form/index2.vue.js +1 -1
  9. package/components/NavbarCommandPalette.vue.js +1 -1
  10. package/components/RichTextEditor/RichTextEditor.vue.js +4 -4
  11. package/components/RichTextEditor/RichTextLinkPopover3.vue.js +2 -2
  12. package/components/RichTextEditor/RichTextToolbar3.vue.js +2 -2
  13. package/components/Screen/ScreenFilter.vue.js +3 -3
  14. package/components/Workbook/Sheet.vue.d.ts +29 -2
  15. package/components/Workbook/Sheet.vue.js +93 -69
  16. package/components/Workbook/Workbook.vue.d.ts +9 -0
  17. package/components/Workbook/Workbook.vue.js +1 -1
  18. package/components/Workbook/Workbook2.vue.js +134 -105
  19. package/components/Workbook/types.d.ts +24 -0
  20. package/docs/README.md +1 -0
  21. package/docs/component-index.md +5 -2
  22. package/docs/components/editable-title.md +51 -6
  23. package/docs/components/workbook.md +87 -0
  24. package/docs/design.md +220 -0
  25. package/docs-manifest.json +9 -6
  26. package/package.json +1 -1
  27. package/style.css +1 -1
  28. /package/components/RichTextEditor/{RichTextLinkPopover.vue.js → RichTextLinkPopover2.vue.js} +0 -0
  29. /package/components/RichTextEditor/{RichTextToolbar.vue.js → RichTextToolbar2.vue.js} +0 -0
@@ -23,11 +23,11 @@ import "iconify-icon-picker/style.css";
23
23
  import "../../icons/IconRegistry.js";
24
24
  /* empty css */
25
25
  /* empty css */
26
- /* empty css */
26
+ /* empty css */
27
27
  /* empty css */
28
28
  /* empty css */
29
- /* empty css */
30
- /* empty css */
29
+ /* empty css */
30
+ /* empty css */
31
31
  import "../../core/config.js";
32
32
  /* empty css */
33
33
  /* empty css */
@@ -1,9 +1,12 @@
1
- import { WorkbookSheet } from './types';
1
+ import { WorkbookCustomOption, WorkbookSheet } from './types';
2
2
  interface Props {
3
3
  sheet: WorkbookSheet;
4
4
  isActive: boolean;
5
5
  isEditing?: boolean;
6
+ canRename?: boolean;
7
+ canDuplicate?: boolean;
6
8
  canDelete?: boolean;
9
+ customOptions?: WorkbookCustomOption[];
7
10
  confirmDelete?: boolean;
8
11
  confirmDeleteTexts?: {
9
12
  title?: string;
@@ -12,11 +15,25 @@ interface Props {
12
15
  cancel?: string;
13
16
  };
14
17
  allowIconChange?: boolean;
18
+ canChangeIcon?: boolean;
15
19
  itemClass?: string;
16
20
  activeItemClass?: string;
17
21
  inactiveItemClass?: string;
18
22
  }
19
- declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
23
+ declare function __VLS_template(): {
24
+ attrs: Partial<{}>;
25
+ slots: {
26
+ 'sheet-actions'?(_: {
27
+ sheet: WorkbookSheet;
28
+ }): any;
29
+ };
30
+ refs: {
31
+ inputRef: HTMLInputElement;
32
+ };
33
+ rootEl: HTMLDivElement;
34
+ };
35
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
36
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
20
37
  select: (id: string) => any;
21
38
  delete: (id: string) => any;
22
39
  "update:title": (id: string, newTitle: string) => any;
@@ -36,11 +53,21 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
36
53
  itemClass: string;
37
54
  isEditing: boolean;
38
55
  confirmDelete: boolean;
56
+ canRename: boolean;
57
+ canDuplicate: boolean;
39
58
  canDelete: boolean;
59
+ canChangeIcon: boolean;
60
+ customOptions: WorkbookCustomOption[];
40
61
  allowIconChange: boolean;
41
62
  activeItemClass: string;
42
63
  inactiveItemClass: string;
43
64
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
44
65
  inputRef: HTMLInputElement;
45
66
  }, HTMLDivElement>;
67
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
46
68
  export default _default;
69
+ type __VLS_WithTemplateSlots<T, S> = T & {
70
+ new (): {
71
+ $slots: S;
72
+ };
73
+ };
@@ -1,157 +1,173 @@
1
- import { defineComponent as I, ref as b, computed as v, openBlock as r, createElementBlock as d, normalizeClass as S, createElementVNode as u, withModifiers as a, createBlock as $, withCtx as x, createVNode as m, createCommentVNode as V, withDirectives as j, withKeys as g, vModelText as z, toDisplayString as K, unref as M, nextTick as N } from "vue";
2
- import y from "../Icon.vue.js";
3
- import O from "../Dropdown/Dropdown.vue.js";
1
+ import { defineComponent as $, useSlots as R, ref as y, computed as d, openBlock as a, createElementBlock as c, normalizeClass as M, createElementVNode as v, withModifiers as r, createBlock as V, withCtx as h, createVNode as m, createCommentVNode as x, withDirectives as j, withKeys as w, vModelText as z, toDisplayString as A, unref as K, createSlots as N, renderSlot as P, nextTick as U } from "vue";
2
+ import C from "../Icon.vue.js";
3
+ import q from "../Dropdown/Dropdown.vue.js";
4
4
  import { $t as l } from "../../utils/i18n.js";
5
5
  /* empty css */
6
6
  /* empty css */
7
7
  /* empty css */
8
- import R from "../Button.vue.js";
9
- import A from "../IconPicker.vue.js";
10
- const P = {
8
+ import F from "../Button.vue.js";
9
+ import G from "../IconPicker.vue.js";
10
+ const H = {
11
11
  type: "button",
12
12
  class: "flex items-center justify-center rounded hover:bg-accent transition-colors p-0.5 outline-none focus-visible:ring-2 focus-visible:ring-primary/20 mt-1"
13
- }, U = {
13
+ }, J = {
14
14
  key: 1,
15
15
  class: "flex items-center justify-center p-0.5"
16
- }, q = { class: "flex-1 min-w-0 pr-1" }, F = ["onKeydown"], G = {
16
+ }, L = { class: "flex-1 min-w-0 pr-1" }, Q = ["onKeydown"], W = {
17
17
  key: 1,
18
18
  class: "block truncate text-sm font-medium leading-normal"
19
- }, ee = /* @__PURE__ */ I({
19
+ }, le = /* @__PURE__ */ $({
20
20
  __name: "Sheet",
21
21
  props: {
22
22
  sheet: {},
23
23
  isActive: { type: Boolean },
24
24
  isEditing: { type: Boolean, default: !1 },
25
+ canRename: { type: Boolean, default: !0 },
26
+ canDuplicate: { type: Boolean, default: !0 },
25
27
  canDelete: { type: Boolean, default: !0 },
28
+ customOptions: { default: () => [] },
26
29
  confirmDelete: { type: Boolean, default: !1 },
27
30
  confirmDeleteTexts: {},
28
31
  allowIconChange: { type: Boolean, default: !0 },
32
+ canChangeIcon: { type: Boolean, default: !0 },
29
33
  itemClass: { default: "" },
30
34
  activeItemClass: { default: "" },
31
35
  inactiveItemClass: { default: "" }
32
36
  },
33
37
  emits: ["select", "update:title", "update:icon", "edit-start", "edit-end", "duplicate", "delete"],
34
- setup(i, { emit: w }) {
35
- const e = i, o = w, f = b(null), s = b(e.sheet.title), C = v(
38
+ setup(i, { emit: D }) {
39
+ const e = i, n = D, B = R(), f = y(null), s = y(e.sheet.title), I = d(
36
40
  () => e.sheet.titleI18n ? l(e.sheet.titleI18n) : e.sheet.title
37
- ), h = () => {
38
- s.value = e.sheet.title, o("edit-start", e.sheet.id), N(() => {
41
+ ), k = () => {
42
+ e.canRename && (s.value = e.sheet.title, n("edit-start", e.sheet.id), U(() => {
39
43
  f.value?.focus(), f.value?.select();
40
- });
44
+ }));
41
45
  };
42
46
  let p = !1;
43
- const k = () => {
47
+ const b = () => {
44
48
  if (!e.isEditing || p) return;
45
49
  p = !0;
46
- const n = s.value.trim();
47
- n ? o("update:title", e.sheet.id, n) : s.value = e.sheet.title, o("edit-end", e.sheet.id), setTimeout(() => {
50
+ const o = s.value.trim();
51
+ o ? n("update:title", e.sheet.id, o) : s.value = e.sheet.title, n("edit-end", e.sheet.id), setTimeout(() => {
48
52
  p = !1;
49
53
  }, 100);
50
- }, D = () => {
51
- s.value = e.sheet.title, o("edit-end", e.sheet.id);
52
- }, T = v(() => [
53
- {
54
+ }, T = () => {
55
+ s.value = e.sheet.title, n("edit-end", e.sheet.id);
56
+ }, g = d(() => {
57
+ const o = [];
58
+ e.canRename && o.push({
54
59
  label: l("vlite.workbook.rename") !== "vlite.workbook.rename" ? l("vlite.workbook.rename") : "Rename",
55
60
  value: "rename",
56
61
  icon: "lucide:pencil"
57
- },
58
- {
62
+ }), e.canDuplicate && o.push({
59
63
  label: l("vlite.workbook.duplicate") !== "vlite.workbook.duplicate" ? l("vlite.workbook.duplicate") : "Duplicate",
60
64
  value: "duplicate",
61
65
  icon: "lucide:copy"
62
- },
63
- {
66
+ }), e.canDelete && o.push({
64
67
  label: l("vlite.workbook.delete") !== "vlite.workbook.delete" ? l("vlite.workbook.delete") : "Delete",
65
68
  value: "delete",
66
69
  icon: "lucide:trash-2",
67
- disabled: !e.canDelete,
68
70
  confirmation: e.confirmDelete ? {
69
71
  title: e.confirmDeleteTexts?.title,
70
72
  description: e.confirmDeleteTexts?.description,
71
73
  confirmText: e.confirmDeleteTexts?.confirm,
72
74
  cancelText: e.confirmDeleteTexts?.cancel,
73
- variant: "danger",
74
- onConfirm: () => {
75
- e.canDelete && o("delete", e.sheet.id);
76
- }
75
+ variant: "danger"
77
76
  } : void 0
77
+ });
78
+ for (const t of e.customOptions)
79
+ o.push({
80
+ label: t.label,
81
+ value: t.action,
82
+ icon: t.icon,
83
+ disabled: t.disabled,
84
+ data: { workbookCustomOption: t }
85
+ });
86
+ return o;
87
+ }), E = d(
88
+ () => g.value.length > 0 || !!B["sheet-actions"]
89
+ ), O = (o) => {
90
+ const t = o.option?.data?.workbookCustomOption;
91
+ if (t) {
92
+ t.onClick(e.sheet);
93
+ return;
78
94
  }
79
- ]), B = (n) => {
80
- if (n.value === "rename" && h(), n.value === "duplicate" && o("duplicate", e.sheet.id), n.value === "delete") {
95
+ if (o.value === "rename" && k(), o.value === "duplicate" && e.canDuplicate && n("duplicate", e.sheet.id), o.value === "delete") {
81
96
  if (!e.canDelete) return;
82
- o("delete", e.sheet.id);
97
+ n("delete", e.sheet.id);
83
98
  }
84
- }, E = v(() => [
99
+ }, S = d(() => [
85
100
  "group relative flex items-center min-w-[120px] max-w-[240px] h-9 px-3 border-r border-border select-none cursor-pointer transition-all duration-200 ease-out",
86
101
  e.itemClass,
87
102
  e.isActive ? `bg-secondary text-foreground ring-1 ring-border ring-b-0 z-10 ${e.activeItemClass}` : `text-muted-foreground hover:bg-accent/50 ${e.inactiveItemClass}`,
88
103
  e.isEditing ? "cursor-text" : ""
89
104
  ].filter(Boolean).join(" "));
90
- return (n, t) => (r(), d("div", {
91
- class: S(E.value),
92
- onClick: t[5] || (t[5] = (c) => o("select", i.sheet.id)),
93
- onDblclick: h
105
+ return (o, t) => (a(), c("div", {
106
+ class: M(S.value),
107
+ onClick: t[5] || (t[5] = (u) => n("select", i.sheet.id)),
108
+ onDblclick: k
94
109
  }, [
95
- u("div", {
96
- onClick: t[1] || (t[1] = a(() => {
110
+ v("div", {
111
+ onClick: t[1] || (t[1] = r(() => {
97
112
  }, ["stop"])),
98
113
  class: "mr-2 flex items-center shrink-0"
99
114
  }, [
100
- (i.sheet.icon || i.isEditing) && i.allowIconChange ? (r(), $(A, {
115
+ (i.sheet.icon || i.isEditing) && i.allowIconChange && i.canChangeIcon ? (a(), V(G, {
101
116
  key: 0,
102
117
  value: i.sheet.icon || "lucide:file",
103
118
  position: "bottom-start",
104
- onOnSelect: t[0] || (t[0] = (c) => o("update:icon", i.sheet.id, c))
119
+ onOnSelect: t[0] || (t[0] = (u) => i.canChangeIcon && n("update:icon", i.sheet.id, u))
105
120
  }, {
106
- default: x(() => [
107
- u("button", P, [
108
- m(y, {
121
+ default: h(() => [
122
+ v("button", H, [
123
+ m(C, {
109
124
  icon: i.sheet.icon || "lucide:file",
110
125
  class: "w-4 h-4 opacity-70 hover:opacity-100 transition-opacity"
111
126
  }, null, 8, ["icon"])
112
127
  ])
113
128
  ]),
114
129
  _: 1
115
- }, 8, ["value"])) : i.sheet.icon ? (r(), d("div", U, [
116
- m(y, {
130
+ }, 8, ["value"])) : i.sheet.icon ? (a(), c("div", J, [
131
+ m(C, {
117
132
  icon: i.sheet.icon,
118
133
  class: "w-4 h-4 opacity-70"
119
134
  }, null, 8, ["icon"])
120
- ])) : V("", !0)
135
+ ])) : x("", !0)
121
136
  ]),
122
- u("div", q, [
123
- i.isEditing ? j((r(), d("input", {
137
+ v("div", L, [
138
+ i.isEditing ? j((a(), c("input", {
124
139
  key: 0,
125
140
  ref_key: "inputRef",
126
141
  ref: f,
127
- "onUpdate:modelValue": t[2] || (t[2] = (c) => s.value = c),
142
+ "onUpdate:modelValue": t[2] || (t[2] = (u) => s.value = u),
128
143
  type: "text",
129
144
  class: "w-full bg-transparent border-none outline-none p-0 text-sm font-medium text-foreground placeholder-muted-foreground focus:ring-0",
130
- onBlur: k,
145
+ onBlur: b,
131
146
  onKeydown: [
132
- g(a(k, ["prevent"]), ["enter"]),
133
- g(a(D, ["prevent"]), ["esc"])
147
+ w(r(b, ["prevent"]), ["enter"]),
148
+ w(r(T, ["prevent"]), ["esc"])
134
149
  ],
135
- onClick: t[3] || (t[3] = a(() => {
150
+ onClick: t[3] || (t[3] = r(() => {
136
151
  }, ["stop"]))
137
- }, null, 40, F)), [
152
+ }, null, 40, Q)), [
138
153
  [z, s.value]
139
- ]) : (r(), d("span", G, K(C.value), 1))
154
+ ]) : (a(), c("span", W, A(I.value), 1))
140
155
  ]),
141
- u("div", {
156
+ E.value ? (a(), c("div", {
157
+ key: 0,
142
158
  class: "opacity-0 group-hover:opacity-100 transition-opacity ml-auto pl-1 -mr-2 flex items-center",
143
- onClick: t[4] || (t[4] = a(() => {
159
+ onClick: t[4] || (t[4] = r(() => {
144
160
  }, ["stop"]))
145
161
  }, [
146
- m(M(O), {
147
- options: T.value,
162
+ m(K(q), {
163
+ options: g.value,
148
164
  position: "bottom-end",
149
165
  width: "140px",
150
166
  teleport: !0,
151
- onOnSelect: B
152
- }, {
153
- trigger: x(() => [
154
- m(R, {
167
+ onOnSelect: O
168
+ }, N({
169
+ trigger: h(() => [
170
+ m(F, {
155
171
  icon: "lucide:more-vertical",
156
172
  asIcon: "",
157
173
  size: "xs",
@@ -159,12 +175,20 @@ const P = {
159
175
  variant: "ghost"
160
176
  })
161
177
  ]),
162
- _: 1
163
- }, 8, ["options"])
164
- ])
178
+ _: 2
179
+ }, [
180
+ o.$slots["sheet-actions"] ? {
181
+ name: "menu",
182
+ fn: h(() => [
183
+ P(o.$slots, "sheet-actions", { sheet: i.sheet })
184
+ ]),
185
+ key: "0"
186
+ } : void 0
187
+ ]), 1032, ["options"])
188
+ ])) : x("", !0)
165
189
  ], 34));
166
190
  }
167
191
  });
168
192
  export {
169
- ee as default
193
+ le as default
170
194
  };
@@ -3,6 +3,9 @@ declare function __VLS_template(): {
3
3
  attrs: Partial<{}>;
4
4
  slots: {
5
5
  'left-addons'?(_: {}): any;
6
+ 'sheet-actions'?(_: {
7
+ sheet: WorkbookSheet;
8
+ }): any;
6
9
  'right-addons'?(_: {}): any;
7
10
  default?(_: {}): any;
8
11
  };
@@ -37,10 +40,16 @@ declare const __VLS_component: import('vue').DefineComponent<WorkbookProps, {},
37
40
  modelValue: string;
38
41
  editable: boolean;
39
42
  confirmDelete: boolean;
43
+ canRename: boolean;
44
+ canDuplicate: boolean;
45
+ canDelete: boolean;
46
+ canChangeIcon: boolean;
47
+ customOptions: import('./types').WorkbookCustomOption[];
40
48
  allowIconChange: boolean;
41
49
  activeItemClass: string;
42
50
  inactiveItemClass: string;
43
51
  sheets: WorkbookSheet[];
52
+ autoDelete: boolean;
44
53
  addable: boolean;
45
54
  addButtonPosition: AddButtonPosition;
46
55
  maxSheets: number;
@@ -1,7 +1,7 @@
1
1
  import o from "./Workbook2.vue.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e674bcbc"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-539da423"]]);
5
5
  export {
6
6
  p as default
7
7
  };