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