@opentiny/tiny-engine-toolbar-breadcrumb 2.0.0-alpha.2 → 2.0.0-alpha.3

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.
package/dist/index.js CHANGED
@@ -1,126 +1,140 @@
1
1
  import "./style.css";
2
- import { reactive as C, computed as N, resolveComponent as l, openBlock as i, createElementBlock as D, Fragment as f, createElementVNode as k, normalizeClass as O, createVNode as v, withCtx as d, renderList as x, createBlock as E, createTextVNode as S, toDisplayString as I, createCommentVNode as A, ref as L } from "vue";
2
+ import { reactive as E, computed as S, resolveComponent as c, openBlock as i, createBlock as B, withCtx as m, createElementVNode as D, normalizeClass as C, createVNode as k, createElementBlock as N, Fragment as O, renderList as I, createTextVNode as v, toDisplayString as x, createCommentVNode as A, ref as L } from "vue";
3
3
  import { Breadcrumb as V, BreadcrumbItem as K, Button as P } from "@opentiny/vue";
4
4
  import { useLayout as X, useBreadcrumb as w, HOOK_NAME as G } from "@opentiny/tiny-engine-meta-register";
5
- import { BlockDeployDialog as h } from "@opentiny/tiny-engine-common";
5
+ import { BlockDeployDialog as h, ToolbarBase as z } from "@opentiny/tiny-engine-common";
6
6
  const M = (o, t) => {
7
7
  const n = o.__vccOpts || o;
8
8
  for (const [e, a] of t)
9
9
  n[e] = a;
10
10
  return n;
11
- }, z = {
11
+ }, U = {
12
12
  components: {
13
13
  TinyBreadcrumb: V,
14
14
  TinyBreadcrumbItem: K,
15
15
  BlockDeployDialog: h,
16
- TinyButton: P
16
+ TinyButton: P,
17
+ ToolbarBase: z
18
+ },
19
+ props: {
20
+ options: {
21
+ type: Object,
22
+ default: () => ({})
23
+ }
17
24
  },
18
25
  setup() {
19
26
  const o = {
20
27
  PAGEID: "engine.plugins.appmanage",
21
28
  BLOCKID: "engine.plugins.blockmanage"
22
- }, { layoutState: t } = X(), { plugins: n } = t || {}, e = C({
29
+ }, { layoutState: t } = X(), { plugins: n } = t || {}, e = E({
23
30
  showDeployBlock: !1
24
- }), { CONSTANTS: a, getBreadcrumbData: m } = w(), c = m(), u = () => {
31
+ }), { CONSTANTS: a, getBreadcrumbData: b } = w(), s = b(), d = () => {
25
32
  e.showDeployBlock = !0;
26
- }, b = N(() => {
27
- const r = m().value[2] || [];
28
- let y = "1.0.0", T = 0;
29
- return r.forEach((s) => {
30
- const g = new Date(s.created_at).getTime();
31
- g > T && (T = g, y = s.version);
32
- }), y.replace(/\d+$/, (s) => Number(s) + 1);
33
+ }, u = S(() => {
34
+ const p = b().value[2] || [];
35
+ let r = "1.0.0", f = 0;
36
+ return p.forEach((l) => {
37
+ const g = new Date(l.created_at).getTime();
38
+ g > f && (f = g, r = l.version);
39
+ }), r.replace(/\d+$/, (l) => Number(l) + 1);
33
40
  });
34
41
  return {
35
- breadcrumbData: c,
36
- publishBlock: u,
42
+ breadcrumbData: s,
43
+ publishBlock: d,
37
44
  state: e,
38
- nextVersion: b,
45
+ nextVersion: u,
39
46
  CONSTANTS: a,
40
47
  open: () => {
41
- n && (n.render = c.value[0] === a.PAGETEXT ? o.PAGEID : o.BLOCKID);
48
+ n && (n.render = s.value[0] === a.PAGETEXT ? o.PAGEID : o.BLOCKID);
42
49
  }
43
50
  };
44
51
  }
45
- }, U = { class: "top-panel-breadcrumb" };
46
- function F(o, t, n, e, a, m) {
47
- const c = l("tiny-breadcrumb-item"), u = l("tiny-breadcrumb"), b = l("tiny-button"), B = l("block-deploy-dialog");
48
- return i(), D(f, null, [
49
- k("div", U, [
50
- k("div", {
51
- class: O([
52
- "top-panel-breadcrumb-title",
53
- { "top-panel-breadcrumb-title-block": e.breadcrumbData[0] === e.CONSTANTS.BLOCKTEXT }
54
- ])
55
- }, [
56
- v(u, {
57
- separator: ":",
58
- onSelect: e.open
52
+ }, j = { class: "top-panel-breadcrumb" };
53
+ function F(o, t, n, e, a, b) {
54
+ const s = c("tiny-breadcrumb-item"), d = c("tiny-breadcrumb"), u = c("tiny-button"), y = c("block-deploy-dialog"), p = c("toolbar-base");
55
+ return i(), B(p, { options: n.options }, {
56
+ default: m(() => [
57
+ D("div", j, [
58
+ D("div", {
59
+ class: C([
60
+ "top-panel-breadcrumb-title",
61
+ { "top-panel-breadcrumb-title-block": e.breadcrumbData[0] === e.CONSTANTS.BLOCKTEXT }
62
+ ])
63
+ }, [
64
+ k(d, {
65
+ separator: ":",
66
+ onSelect: e.open
67
+ }, {
68
+ default: m(() => [
69
+ (i(!0), N(O, null, I(e.breadcrumbData.slice(0, 2), (r) => (i(), B(s, { key: r }, {
70
+ default: m(() => [
71
+ v(x(r), 1)
72
+ ]),
73
+ _: 2
74
+ }, 1024))), 128))
75
+ ]),
76
+ _: 1
77
+ }, 8, ["onSelect"])
78
+ ], 2),
79
+ e.breadcrumbData[0] === e.CONSTANTS.BLOCKTEXT ? (i(), B(u, {
80
+ key: 0,
81
+ class: "publish",
82
+ onClick: t[0] || (t[0] = (r) => e.publishBlock()),
83
+ type: "primary",
84
+ size: "small"
59
85
  }, {
60
- default: d(() => [
61
- (i(!0), D(f, null, x(e.breadcrumbData.slice(0, 2), (r) => (i(), E(c, { key: r }, {
62
- default: d(() => [
63
- S(I(r), 1)
64
- ]),
65
- _: 2
66
- }, 1024))), 128))
67
- ]),
86
+ default: m(() => t[2] || (t[2] = [
87
+ v("发布区块 ")
88
+ ])),
68
89
  _: 1
69
- }, 8, ["onSelect"])
70
- ], 2),
71
- e.breadcrumbData[0] === e.CONSTANTS.BLOCKTEXT ? (i(), E(b, {
72
- key: 0,
73
- class: "publish",
74
- onClick: t[0] || (t[0] = (r) => e.publishBlock()),
75
- type: "primary",
76
- size: "small"
77
- }, {
78
- default: d(() => t[2] || (t[2] = [
79
- S("区块")
80
- ])),
81
- _: 1
82
- })) : A("", !0)
90
+ })) : A("", !0)
91
+ ]),
92
+ k(y, {
93
+ visible: e.state.showDeployBlock,
94
+ "onUpdate:visible": t[1] || (t[1] = (r) => e.state.showDeployBlock = r),
95
+ nextVersion: e.nextVersion
96
+ }, null, 8, ["visible", "nextVersion"])
83
97
  ]),
84
- v(B, {
85
- visible: e.state.showDeployBlock,
86
- "onUpdate:visible": t[1] || (t[1] = (r) => e.state.showDeployBlock = r),
87
- nextVersion: e.nextVersion
88
- }, null, 8, ["visible", "nextVersion"])
89
- ], 64);
98
+ _: 1
99
+ }, 8, ["options"]);
90
100
  }
91
- const H = /* @__PURE__ */ M(z, [["render", F], ["__scopeId", "data-v-b19c2214"]]), j = {
101
+ const H = /* @__PURE__ */ M(U, [["render", F], ["__scopeId", "data-v-ef2dd37f"]]), q = {
92
102
  id: "engine.toolbars.breadcrumb",
93
103
  type: "toolbars",
94
104
  title: "breadcrumb",
95
- icon: "",
96
- align: "left"
105
+ options: {
106
+ icon: {
107
+ default: ""
108
+ },
109
+ renderType: "slot"
110
+ }
97
111
  };
98
- let p = L([]);
99
- const _ = {
112
+ let _ = L([]);
113
+ const T = {
100
114
  PAGETEXT: "页面",
101
115
  BLOCKTEXT: "区块"
102
- }, q = (o) => {
103
- p.value = [_.PAGETEXT, ...o], sessionStorage.setItem("pageInfo", o);
104
- }, J = (o, t = []) => {
105
- p.value = [_.BLOCKTEXT, ...o, t];
106
- }, Q = () => p, R = () => ({
107
- CONSTANTS: _,
108
- setBreadcrumbPage: q,
109
- setBreadcrumbBlock: J,
110
- getBreadcrumbData: Q
111
- }), W = {
116
+ }, J = (o) => {
117
+ _.value = [T.PAGETEXT, ...o], sessionStorage.setItem("pageInfo", o);
118
+ }, Q = (o, t = []) => {
119
+ _.value = [T.BLOCKTEXT, ...o, t];
120
+ }, R = () => _, W = () => ({
121
+ CONSTANTS: T,
122
+ setBreadcrumbPage: J,
123
+ setBreadcrumbBlock: Q,
124
+ getBreadcrumbData: R
125
+ }), Y = {
112
126
  id: "engine.service.breadcrumb",
113
127
  type: "MetaService",
114
- apis: R(),
128
+ apis: W(),
115
129
  composable: {
116
130
  name: G.useBreadcrumb
117
131
  }
118
- }, oe = {
119
- ...j,
132
+ }, re = {
133
+ ...q,
120
134
  entry: H,
121
- metas: [W]
135
+ metas: [Y]
122
136
  };
123
137
  export {
124
- W as BreadcrumbService,
125
- oe as default
138
+ Y as BreadcrumbService,
139
+ re as default
126
140
  };
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .top-panel-breadcrumb[data-v-b19c2214]{padding-left:12px;box-sizing:border-box;display:flex;justify-content:flex-start;align-items:center;width:auto;height:100%;margin-right:3px;cursor:pointer}.top-panel-breadcrumb-title[data-v-b19c2214]{height:28px;padding:0 8px;background-color:var(--ti-lowcode-toolbar-button-bg);display:flex;border-radius:4px}.top-panel-breadcrumb-title[data-v-b19c2214] .reference-wrapper{line-height:22px}.top-panel-breadcrumb .tiny-breadcrumb[data-v-b19c2214]{line-height:var(--base-top-panel-breadcrumb-line-height);padding-right:4px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:12px;cursor:inherit}.top-panel-breadcrumb .tiny-breadcrumb__item[data-v-b19c2214]{cursor:inherit;-webkit-user-select:none;user-select:none}.top-panel-breadcrumb .tiny-breadcrumb__item[data-v-b19c2214] .tiny-breadcrumb__inner{color:var(--ti-lowcode-media-popover-title-color);text-decoration:none;cursor:pointer}.top-panel-breadcrumb .tiny-breadcrumb__item[data-v-b19c2214] .tiny-breadcrumb__separator{padding:0;margin:0 4px 0 0}.top-panel-breadcrumb .tiny-breadcrumb__item[data-v-b19c2214]:last-child .tiny-breadcrumb__inner{font-weight:400;color:var(--ti-lowcode-media-popover-title-color)}.top-panel-breadcrumb-title-block[data-v-b19c2214]{background-color:var(--ti-lowcode-toolbar-breadcrumb-bg)}.top-panel-breadcrumb-title-block .tiny-breadcrumb__item[data-v-b19c2214] .tiny-breadcrumb__inner{color:var(--ti-lowcode-toolbar-breadcrumb-left-color)}.top-panel-breadcrumb-title-block .tiny-breadcrumb__item[data-v-b19c2214]:last-child .tiny-breadcrumb__inner{color:var(--ti-lowcode-toolbar-breadcrumb-left-color)}.top-panel-breadcrumb-title-block[data-v-b19c2214]:hover{background-color:var(--ti-lowcode-toolbar-breadcrumb-bg-hover)}.top-panel-breadcrumb .publish[data-v-b19c2214]{margin-left:8px;height:28px;line-height:28px}
1
+ .top-panel-breadcrumb[data-v-ef2dd37f]{padding-left:12px;box-sizing:border-box;display:flex;justify-content:flex-start;align-items:center;width:auto;height:100%;margin-right:3px;cursor:pointer}.top-panel-breadcrumb-title[data-v-ef2dd37f]{height:28px;padding:0 8px;background-color:var(--ti-lowcode-toolbar-button-bg);display:flex;border-radius:4px}.top-panel-breadcrumb-title[data-v-ef2dd37f] .reference-wrapper{line-height:22px}.top-panel-breadcrumb .tiny-breadcrumb[data-v-ef2dd37f]{line-height:var(--base-top-panel-breadcrumb-line-height);padding-right:4px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;font-size:12px;cursor:inherit}.top-panel-breadcrumb .tiny-breadcrumb__item[data-v-ef2dd37f]{cursor:inherit;-webkit-user-select:none;user-select:none}.top-panel-breadcrumb .tiny-breadcrumb__item[data-v-ef2dd37f] .tiny-breadcrumb__inner{color:var(--ti-lowcode-media-popover-title-color);text-decoration:none;cursor:pointer}.top-panel-breadcrumb .tiny-breadcrumb__item[data-v-ef2dd37f] .tiny-breadcrumb__separator{padding:0;margin:0 4px 0 0}.top-panel-breadcrumb .tiny-breadcrumb__item[data-v-ef2dd37f]:last-child .tiny-breadcrumb__inner{font-weight:400;color:var(--ti-lowcode-media-popover-title-color)}.top-panel-breadcrumb-title-block[data-v-ef2dd37f]{background-color:var(--ti-lowcode-toolbar-breadcrumb-bg)}.top-panel-breadcrumb-title-block .tiny-breadcrumb__item[data-v-ef2dd37f] .tiny-breadcrumb__inner{color:var(--ti-lowcode-toolbar-breadcrumb-left-color)}.top-panel-breadcrumb-title-block .tiny-breadcrumb__item[data-v-ef2dd37f]:last-child .tiny-breadcrumb__inner{color:var(--ti-lowcode-toolbar-breadcrumb-left-color)}.top-panel-breadcrumb-title-block[data-v-ef2dd37f]:hover{background-color:var(--ti-lowcode-toolbar-breadcrumb-bg-hover)}.top-panel-breadcrumb .publish[data-v-ef2dd37f]{margin-left:8px;height:28px;line-height:28px}
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@opentiny/tiny-engine-toolbar-breadcrumb",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
7
  "scripts": {
8
8
  "build": "vite build"
9
9
  },
10
+ "type": "module",
10
11
  "main": "dist/index.js",
11
12
  "module": "dist/index.js",
12
13
  "files": [
@@ -24,20 +25,20 @@
24
25
  "license": "MIT",
25
26
  "homepage": "https://opentiny.design/tiny-engine",
26
27
  "dependencies": {
27
- "@opentiny/tiny-engine-common": "2.0.0-alpha.2",
28
- "@opentiny/tiny-engine-http": "2.0.0-alpha.2",
29
- "@opentiny/tiny-engine-meta-register": "2.0.0-alpha.2",
30
- "@opentiny/tiny-engine-utils": "2.0.0-alpha.2"
28
+ "@opentiny/tiny-engine-common": "2.0.0-alpha.3",
29
+ "@opentiny/tiny-engine-http": "2.0.0-alpha.3",
30
+ "@opentiny/tiny-engine-meta-register": "2.0.0-alpha.3",
31
+ "@opentiny/tiny-engine-utils": "2.0.0-alpha.3"
31
32
  },
32
33
  "devDependencies": {
33
- "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.2",
34
- "@vitejs/plugin-vue": "^4.2.3",
35
- "@vitejs/plugin-vue-jsx": "^3.1.0",
36
- "vite": "^4.3.7"
34
+ "@opentiny/tiny-engine-vite-plugin-meta-comments": "2.0.0-alpha.3",
35
+ "@vitejs/plugin-vue": "^5.1.2",
36
+ "@vitejs/plugin-vue-jsx": "^4.0.1",
37
+ "vite": "^5.4.2"
37
38
  },
38
39
  "peerDependencies": {
39
40
  "@opentiny/vue": "^3.14.0",
40
41
  "vue": "^3.4.15"
41
42
  },
42
- "gitHead": "695ecd00f21aa39965a9ddb02590ae274f92cd8e"
43
+ "gitHead": "20aba1ffa81a1633feec954e3146586193c18f22"
43
44
  }