@opentiny/tiny-engine-toolbar-breadcrumb 2.0.0 → 2.1.0

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