@oneflowui/ui 0.5.0 → 0.5.2

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 (41) hide show
  1. package/dist/components/Dashboard/charts/BarChart.vue.js +2 -2
  2. package/dist/components/Dashboard/charts/BarChart.vue2.js +11 -8
  3. package/dist/components/Dashboard/charts/PieChart.vue.js +2 -2
  4. package/dist/components/Dashboard/charts/PieChart.vue2.js +8 -5
  5. package/dist/components/Dashboard/index.vue.js +1 -1
  6. package/dist/components/Dashboard/index.vue2.js +20 -25
  7. package/dist/components/editor/RichTextEditor.vue2.js +1 -1
  8. package/dist/components/table/DataTable.vue.js +1 -1
  9. package/dist/components/table/DataTable.vue2.js +134 -135
  10. package/dist/components/table/FieldCell.vue.js +2 -2
  11. package/dist/components/table/FieldCell.vue2.js +16 -15
  12. package/dist/composables/useMarkdown.js +23 -23
  13. package/dist/composables/useWorkerSort.js +30 -29
  14. package/dist/index.d.ts +1 -5
  15. package/dist/index.js +250 -350
  16. package/dist/plugin.d.ts +5 -0
  17. package/dist/plugin.js +197 -0
  18. package/dist/style.css +1 -1
  19. package/dist/utils/echarts.d.ts +2 -0
  20. package/dist/utils/icon.d.ts +0 -5
  21. package/dist/utils/icon.js +72 -11
  22. package/dist/workers/tableWorkerSource.js +79 -0
  23. package/package.json +2 -3
  24. package/dist/_virtual/_commonjsHelpers.js +0 -6
  25. package/dist/assets/tableWorker-CTsbCPPP.js +0 -1
  26. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/core.js +0 -5
  27. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/bash.js +0 -377
  28. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/css.js +0 -923
  29. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/go.js +0 -151
  30. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/java.js +0 -240
  31. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/javascript.js +0 -658
  32. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/json.js +0 -38
  33. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/markdown.js +0 -216
  34. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/plaintext.js +0 -13
  35. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/python.js +0 -399
  36. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/rust.js +0 -305
  37. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/sql.js +0 -615
  38. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/typescript.js +0 -753
  39. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/xml.js +0 -219
  40. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/yaml.js +0 -183
  41. package/dist/node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/core.js +0 -1063
@@ -1,22 +1,22 @@
1
1
  import { marked as o } from "marked";
2
- import e from "../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/lib/core.js";
3
- import l from "../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/javascript.js";
4
- import p from "../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/typescript.js";
5
- import u from "../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/python.js";
6
- import n from "../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/bash.js";
7
- import j from "../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/json.js";
8
- import w from "../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/sql.js";
9
- import c from "../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/xml.js";
10
- import k from "../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/css.js";
11
- import f from "../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/markdown.js";
12
- import L from "../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/yaml.js";
13
- import $ from "../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/java.js";
14
- import q from "../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/go.js";
15
- import B from "../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/rust.js";
16
- import i from "../node_modules/.pnpm/highlight.js@11.11.1/node_modules/highlight.js/es/languages/plaintext.js";
17
- e.registerLanguage("plaintext", i);
18
- e.registerLanguage("text", i);
19
- e.registerLanguage("txt", i);
2
+ import e from "highlight.js/lib/core";
3
+ import l from "highlight.js/lib/languages/javascript";
4
+ import p from "highlight.js/lib/languages/typescript";
5
+ import u from "highlight.js/lib/languages/python";
6
+ import n from "highlight.js/lib/languages/bash";
7
+ import j from "highlight.js/lib/languages/json";
8
+ import w from "highlight.js/lib/languages/sql";
9
+ import c from "highlight.js/lib/languages/xml";
10
+ import k from "highlight.js/lib/languages/css";
11
+ import f from "highlight.js/lib/languages/markdown";
12
+ import L from "highlight.js/lib/languages/yaml";
13
+ import $ from "highlight.js/lib/languages/java";
14
+ import q from "highlight.js/lib/languages/go";
15
+ import B from "highlight.js/lib/languages/rust";
16
+ import s from "highlight.js/lib/languages/plaintext";
17
+ e.registerLanguage("plaintext", s);
18
+ e.registerLanguage("text", s);
19
+ e.registerLanguage("txt", s);
20
20
  e.registerLanguage("javascript", l);
21
21
  e.registerLanguage("js", l);
22
22
  e.registerLanguage("typescript", p);
@@ -38,9 +38,9 @@ e.registerLanguage("yml", L);
38
38
  e.registerLanguage("java", $);
39
39
  e.registerLanguage("go", q);
40
40
  e.registerLanguage("rust", B);
41
- function Q(h = {}) {
42
- const { showCopyButton: d = !1, t: y = (r) => r } = h, s = new o.Renderer();
43
- s.code = function(r, x) {
41
+ function Q(d = {}) {
42
+ const { showCopyButton: h = !1, t: y = (r) => r } = d, i = new o.Renderer();
43
+ i.code = function(r, x) {
44
44
  const m = typeof r == "object" ? r.text || "" : r, t = typeof r == "object" ? r.lang || "" : x || "", a = t && e.getLanguage(t) ? t : "plaintext";
45
45
  let g = "";
46
46
  try {
@@ -48,7 +48,7 @@ function Q(h = {}) {
48
48
  } catch {
49
49
  g = e.highlight(m, { language: "plaintext" }).value;
50
50
  }
51
- const v = d ? `<button onclick="navigator.clipboard.writeText(this.parentElement.nextElementSibling.innerText)" class="of-markdown-copy-btn">${y("common.copy")}</button>` : "";
51
+ const v = h ? `<button onclick="navigator.clipboard.writeText(this.parentElement.nextElementSibling.innerText)" class="of-markdown-copy-btn">${y("common.copy")}</button>` : "";
52
52
  return `<div class="of-code-block-wrapper">
53
53
  <div class="of-code-block-header">
54
54
  <span class="of-code-block-lang">${a}</span>
@@ -56,7 +56,7 @@ function Q(h = {}) {
56
56
  </div>
57
57
  <pre class="of-code-block-pre"><code class="hljs language-${a}">${g}</code></pre>
58
58
  </div>`;
59
- }, o.use({ renderer: s });
59
+ }, o.use({ renderer: i });
60
60
  function b(r) {
61
61
  return o.parse(r);
62
62
  }
@@ -1,16 +1,17 @@
1
- import { ref as v, onUnmounted as y, readonly as P } from "vue";
2
- const S = 5e3;
3
- function d(c = {}) {
4
- const i = v(!1);
5
- let n = null;
6
- function f() {
1
+ import { ref as y, onUnmounted as L, readonly as b } from "vue";
2
+ import S from "../workers/tableWorkerSource.js";
3
+ const h = 5e3;
4
+ function d(p = {}) {
5
+ const i = y(!1);
6
+ let n = null, a = null;
7
+ function c() {
7
8
  if (n) return n;
8
9
  try {
9
- return n = new Worker(new URL(
10
- /* @vite-ignore */
11
- "/assets/tableWorker-CTsbCPPP.js",
12
- import.meta.url
13
- ), {
10
+ return a = URL.createObjectURL(
11
+ new Blob([S], {
12
+ type: "text/javascript;charset=utf-8"
13
+ })
14
+ ), n = new Worker(a, {
14
15
  type: "module"
15
16
  }), n;
16
17
  } catch {
@@ -19,41 +20,41 @@ function d(c = {}) {
19
20
  }
20
21
  function m(e) {
21
22
  var s;
22
- return ((s = c.enabled) == null ? void 0 : s.value) === !1 ? !1 : e >= S;
23
+ return ((s = p.enabled) == null ? void 0 : s.value) === !1 ? !1 : e >= h;
23
24
  }
24
- function p(e, s, a) {
25
+ function v(e, s, f) {
25
26
  if (!m(e.length))
26
27
  return Promise.resolve(
27
- [...e].sort((o, u) => {
28
- const r = o[s], l = u[s];
29
- return r == null && l == null ? 0 : r == null ? 1 : l == null ? -1 : typeof r == "number" && typeof l == "number" ? a === "asc" ? r - l : l - r : a === "asc" ? String(r).localeCompare(String(l)) : String(l).localeCompare(String(r));
28
+ [...e].sort((o, l) => {
29
+ const r = o[s], u = l[s];
30
+ return r == null && u == null ? 0 : r == null ? 1 : u == null ? -1 : typeof r == "number" && typeof u == "number" ? f === "asc" ? r - u : u - r : f === "asc" ? String(r).localeCompare(String(u)) : String(u).localeCompare(String(r));
30
31
  })
31
32
  );
32
- const t = f();
33
+ const t = c();
33
34
  return t ? (i.value = !0, new Promise((o) => {
34
- const u = (r) => {
35
- t.removeEventListener("message", u), i.value = !1, r.data.type === "sort-result" ? o(r.data.data) : o([...e]);
35
+ const l = (r) => {
36
+ t.removeEventListener("message", l), i.value = !1, r.data.type === "sort-result" ? o(r.data.data) : o([...e]);
36
37
  };
37
- t.addEventListener("message", u), t.postMessage({ type: "sort", data: e, field: s, order: a });
38
+ t.addEventListener("message", l), t.postMessage({ type: "sort", data: e, field: s, order: f });
38
39
  })) : Promise.resolve([...e]);
39
40
  }
40
- function g(e, s, a = "and") {
41
+ function g(e, s, f = "and") {
41
42
  if (!m(e.length))
42
43
  return Promise.resolve(e);
43
- const t = f();
44
+ const t = c();
44
45
  return t ? (i.value = !0, new Promise((o) => {
45
- const u = (r) => {
46
- t.removeEventListener("message", u), i.value = !1, r.data.type === "filter-result" ? o(r.data.data) : o(e);
46
+ const l = (r) => {
47
+ t.removeEventListener("message", l), i.value = !1, r.data.type === "filter-result" ? o(r.data.data) : o(e);
47
48
  };
48
- t.addEventListener("message", u), t.postMessage({ type: "filter", data: e, conditions: s, logic: a });
49
+ t.addEventListener("message", l), t.postMessage({ type: "filter", data: e, conditions: s, logic: f });
49
50
  })) : Promise.resolve(e);
50
51
  }
51
- return y(() => {
52
- n == null || n.terminate(), n = null;
52
+ return L(() => {
53
+ n == null || n.terminate(), n = null, a && (URL.revokeObjectURL(a), a = null);
53
54
  }), {
54
- requestSort: p,
55
+ requestSort: v,
55
56
  requestFilter: g,
56
- processing: P(i)
57
+ processing: b(i)
57
58
  };
58
59
  }
59
60
  export {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { App } from 'vue';
2
1
  export { ViewTab, ToolbarBtn, AddViewBtn, Badge, RangeSlider, ProgressBar, ButtonGroup, EmptyState, StatisticCard, DropdownMenu, StatusIndicator, Switch, Stepper, Accordion, Avatar, RefTag, DescBlock, ViewModeGroup, ViewSwitcher, SelectBadge, ChainItem, SectionBlock, MonitorItem, StatusSummary, InfoCard, PersonaCard, SearchHighlight, } from './components/base';
3
2
  export type { ButtonOption, EmptyStateAction, MenuItem, StepItem, StepperProps, StepStatus, AvatarProps, RefTagProps, ViewModeOption, ViewModeGroupProps, ViewSwitcherTab, ViewSwitcherProps, SelectBadgeProps, ChainItemProps, SectionBlockProps, MonitorItemProps, StatusSummaryProps, StatusSummaryItem, InfoCardProps, PersonaCardProps, } from './components/base';
4
3
  export { AppLayout, Navbar, Sidebar, StatusBar } from './components/layout';
@@ -72,7 +71,4 @@ export { useDatabaseView } from './composables/useDatabaseView';
72
71
  export type { DatabaseViewMode, DatabaseViewFetchParams, DatabaseViewFetchResult, DatabaseViewProvider, DatabaseSchemaEvent, DatabaseViewActions, UseDatabaseViewOptions, UseDatabaseViewResult, } from './composables/useDatabaseView';
73
72
  export { useSearch } from './composables/useSearch';
74
73
  export type { UseSearchOptions, SearchHighlight as SearchHighlightSegment, } from './composables/useSearch';
75
- export declare const OneflowUI: {
76
- install(app: App): void;
77
- };
78
- export default OneflowUI;
74
+ export { OneflowUI, default } from './plugin';