@yuku123/z-ext-frontend-component 0.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/README.md +25 -0
- package/dist/z-ext-frontend-component.es.js +288 -0
- package/dist/z-ext-frontend-component.umd.js +22 -0
- package/package.json +41 -0
- package/src/ExtensionPointTag.jsx +27 -0
- package/src/dev.jsx +11 -0
- package/src/index.js +1 -0
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @yuku123/z-ext-frontend-component
|
|
2
|
+
|
|
3
|
+
> ��抽自 z-opc 对应 _frontend)
|
|
4
|
+
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @yuku123/z-ext-frontend-component
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 使用
|
|
12
|
+
|
|
13
|
+
```jsx
|
|
14
|
+
import { ExtensionPointTag } from '@yuku123/z-ext-frontend-component'
|
|
15
|
+
|
|
16
|
+
<ExtensionPointTag prop="value"/>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 仓库
|
|
20
|
+
|
|
21
|
+
https://github.com/yuku123/z-opc-frontend/tree/main/packages/z-ext-frontend-component
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
MIT
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import ee from "react";
|
|
2
|
+
import { Tooltip as re, Tag as te } from "antd";
|
|
3
|
+
import { ApiOutlined as ne, ExperimentOutlined as oe } from "@ant-design/icons";
|
|
4
|
+
var b = { exports: {} }, E = {};
|
|
5
|
+
/**
|
|
6
|
+
* @license React
|
|
7
|
+
* react-jsx-runtime.production.js
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the MIT license found in the
|
|
12
|
+
* LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
var I;
|
|
15
|
+
function ae() {
|
|
16
|
+
if (I) return E;
|
|
17
|
+
I = 1;
|
|
18
|
+
var l = Symbol.for("react.transitional.element"), i = Symbol.for("react.fragment");
|
|
19
|
+
function c(u, a, s) {
|
|
20
|
+
var f = null;
|
|
21
|
+
if (s !== void 0 && (f = "" + s), a.key !== void 0 && (f = "" + a.key), "key" in a) {
|
|
22
|
+
s = {};
|
|
23
|
+
for (var d in a)
|
|
24
|
+
d !== "key" && (s[d] = a[d]);
|
|
25
|
+
} else s = a;
|
|
26
|
+
return a = s.ref, {
|
|
27
|
+
$$typeof: l,
|
|
28
|
+
type: u,
|
|
29
|
+
key: f,
|
|
30
|
+
ref: a !== void 0 ? a : null,
|
|
31
|
+
props: s
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return E.Fragment = i, E.jsx = c, E.jsxs = c, E;
|
|
35
|
+
}
|
|
36
|
+
var _ = {};
|
|
37
|
+
/**
|
|
38
|
+
* @license React
|
|
39
|
+
* react-jsx-runtime.development.js
|
|
40
|
+
*
|
|
41
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the MIT license found in the
|
|
44
|
+
* LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/
|
|
46
|
+
var F;
|
|
47
|
+
function se() {
|
|
48
|
+
return F || (F = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
49
|
+
function l(e) {
|
|
50
|
+
if (e == null) return null;
|
|
51
|
+
if (typeof e == "function")
|
|
52
|
+
return e.$$typeof === Z ? null : e.displayName || e.name || null;
|
|
53
|
+
if (typeof e == "string") return e;
|
|
54
|
+
switch (e) {
|
|
55
|
+
case T:
|
|
56
|
+
return "Fragment";
|
|
57
|
+
case q:
|
|
58
|
+
return "Profiler";
|
|
59
|
+
case U:
|
|
60
|
+
return "StrictMode";
|
|
61
|
+
case G:
|
|
62
|
+
return "Suspense";
|
|
63
|
+
case X:
|
|
64
|
+
return "SuspenseList";
|
|
65
|
+
case H:
|
|
66
|
+
return "Activity";
|
|
67
|
+
}
|
|
68
|
+
if (typeof e == "object")
|
|
69
|
+
switch (typeof e.tag == "number" && console.error(
|
|
70
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
71
|
+
), e.$$typeof) {
|
|
72
|
+
case W:
|
|
73
|
+
return "Portal";
|
|
74
|
+
case V:
|
|
75
|
+
return e.displayName || "Context";
|
|
76
|
+
case J:
|
|
77
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
78
|
+
case z:
|
|
79
|
+
var r = e.render;
|
|
80
|
+
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
81
|
+
case B:
|
|
82
|
+
return r = e.displayName || null, r !== null ? r : l(e.type) || "Memo";
|
|
83
|
+
case k:
|
|
84
|
+
r = e._payload, e = e._init;
|
|
85
|
+
try {
|
|
86
|
+
return l(e(r));
|
|
87
|
+
} catch {
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
function i(e) {
|
|
93
|
+
return "" + e;
|
|
94
|
+
}
|
|
95
|
+
function c(e) {
|
|
96
|
+
try {
|
|
97
|
+
i(e);
|
|
98
|
+
var r = !1;
|
|
99
|
+
} catch {
|
|
100
|
+
r = !0;
|
|
101
|
+
}
|
|
102
|
+
if (r) {
|
|
103
|
+
r = console;
|
|
104
|
+
var t = r.error, n = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
105
|
+
return t.call(
|
|
106
|
+
r,
|
|
107
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
108
|
+
n
|
|
109
|
+
), i(e);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function u(e) {
|
|
113
|
+
if (e === T) return "<>";
|
|
114
|
+
if (typeof e == "object" && e !== null && e.$$typeof === k)
|
|
115
|
+
return "<...>";
|
|
116
|
+
try {
|
|
117
|
+
var r = l(e);
|
|
118
|
+
return r ? "<" + r + ">" : "<...>";
|
|
119
|
+
} catch {
|
|
120
|
+
return "<...>";
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function a() {
|
|
124
|
+
var e = O.A;
|
|
125
|
+
return e === null ? null : e.getOwner();
|
|
126
|
+
}
|
|
127
|
+
function s() {
|
|
128
|
+
return Error("react-stack-top-frame");
|
|
129
|
+
}
|
|
130
|
+
function f(e) {
|
|
131
|
+
if (y.call(e, "key")) {
|
|
132
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
133
|
+
if (r && r.isReactWarning) return !1;
|
|
134
|
+
}
|
|
135
|
+
return e.key !== void 0;
|
|
136
|
+
}
|
|
137
|
+
function d(e, r) {
|
|
138
|
+
function t() {
|
|
139
|
+
h || (h = !0, console.error(
|
|
140
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
141
|
+
r
|
|
142
|
+
));
|
|
143
|
+
}
|
|
144
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
145
|
+
get: t,
|
|
146
|
+
configurable: !0
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function L() {
|
|
150
|
+
var e = l(this.type);
|
|
151
|
+
return N[e] || (N[e] = !0, console.error(
|
|
152
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
153
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
154
|
+
}
|
|
155
|
+
function M(e, r, t, n, p, x) {
|
|
156
|
+
var o = t.ref;
|
|
157
|
+
return e = {
|
|
158
|
+
$$typeof: w,
|
|
159
|
+
type: e,
|
|
160
|
+
key: r,
|
|
161
|
+
props: t,
|
|
162
|
+
_owner: n
|
|
163
|
+
}, (o !== void 0 ? o : null) !== null ? Object.defineProperty(e, "ref", {
|
|
164
|
+
enumerable: !1,
|
|
165
|
+
get: L
|
|
166
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
167
|
+
configurable: !1,
|
|
168
|
+
enumerable: !1,
|
|
169
|
+
writable: !0,
|
|
170
|
+
value: 0
|
|
171
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
172
|
+
configurable: !1,
|
|
173
|
+
enumerable: !1,
|
|
174
|
+
writable: !0,
|
|
175
|
+
value: null
|
|
176
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
177
|
+
configurable: !1,
|
|
178
|
+
enumerable: !1,
|
|
179
|
+
writable: !0,
|
|
180
|
+
value: p
|
|
181
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
182
|
+
configurable: !1,
|
|
183
|
+
enumerable: !1,
|
|
184
|
+
writable: !0,
|
|
185
|
+
value: x
|
|
186
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
187
|
+
}
|
|
188
|
+
function S(e, r, t, n, p, x) {
|
|
189
|
+
var o = r.children;
|
|
190
|
+
if (o !== void 0)
|
|
191
|
+
if (n)
|
|
192
|
+
if (Q(o)) {
|
|
193
|
+
for (n = 0; n < o.length; n++)
|
|
194
|
+
j(o[n]);
|
|
195
|
+
Object.freeze && Object.freeze(o);
|
|
196
|
+
} else
|
|
197
|
+
console.error(
|
|
198
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
199
|
+
);
|
|
200
|
+
else j(o);
|
|
201
|
+
if (y.call(r, "key")) {
|
|
202
|
+
o = l(e);
|
|
203
|
+
var m = Object.keys(r).filter(function(K) {
|
|
204
|
+
return K !== "key";
|
|
205
|
+
});
|
|
206
|
+
n = 0 < m.length ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}", $[o + n] || (m = 0 < m.length ? "{" + m.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
207
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
208
|
+
let props = %s;
|
|
209
|
+
<%s {...props} />
|
|
210
|
+
React keys must be passed directly to JSX without using spread:
|
|
211
|
+
let props = %s;
|
|
212
|
+
<%s key={someKey} {...props} />`,
|
|
213
|
+
n,
|
|
214
|
+
o,
|
|
215
|
+
m,
|
|
216
|
+
o
|
|
217
|
+
), $[o + n] = !0);
|
|
218
|
+
}
|
|
219
|
+
if (o = null, t !== void 0 && (c(t), o = "" + t), f(r) && (c(r.key), o = "" + r.key), "key" in r) {
|
|
220
|
+
t = {};
|
|
221
|
+
for (var A in r)
|
|
222
|
+
A !== "key" && (t[A] = r[A]);
|
|
223
|
+
} else t = r;
|
|
224
|
+
return o && d(
|
|
225
|
+
t,
|
|
226
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
227
|
+
), M(
|
|
228
|
+
e,
|
|
229
|
+
o,
|
|
230
|
+
t,
|
|
231
|
+
a(),
|
|
232
|
+
p,
|
|
233
|
+
x
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
function j(e) {
|
|
237
|
+
g(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === k && (e._payload.status === "fulfilled" ? g(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
238
|
+
}
|
|
239
|
+
function g(e) {
|
|
240
|
+
return typeof e == "object" && e !== null && e.$$typeof === w;
|
|
241
|
+
}
|
|
242
|
+
var R = ee, w = Symbol.for("react.transitional.element"), W = Symbol.for("react.portal"), T = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), J = Symbol.for("react.consumer"), V = Symbol.for("react.context"), z = Symbol.for("react.forward_ref"), G = Symbol.for("react.suspense"), X = Symbol.for("react.suspense_list"), B = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), H = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), O = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, y = Object.prototype.hasOwnProperty, Q = Array.isArray, P = console.createTask ? console.createTask : function() {
|
|
243
|
+
return null;
|
|
244
|
+
};
|
|
245
|
+
R = {
|
|
246
|
+
react_stack_bottom_frame: function(e) {
|
|
247
|
+
return e();
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
var h, N = {}, C = R.react_stack_bottom_frame.bind(
|
|
251
|
+
R,
|
|
252
|
+
s
|
|
253
|
+
)(), Y = P(u(s)), $ = {};
|
|
254
|
+
_.Fragment = T, _.jsx = function(e, r, t) {
|
|
255
|
+
var n = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
256
|
+
return S(
|
|
257
|
+
e,
|
|
258
|
+
r,
|
|
259
|
+
t,
|
|
260
|
+
!1,
|
|
261
|
+
n ? Error("react-stack-top-frame") : C,
|
|
262
|
+
n ? P(u(e)) : Y
|
|
263
|
+
);
|
|
264
|
+
}, _.jsxs = function(e, r, t) {
|
|
265
|
+
var n = 1e4 > O.recentlyCreatedOwnerStacks++;
|
|
266
|
+
return S(
|
|
267
|
+
e,
|
|
268
|
+
r,
|
|
269
|
+
t,
|
|
270
|
+
!0,
|
|
271
|
+
n ? Error("react-stack-top-frame") : C,
|
|
272
|
+
n ? P(u(e)) : Y
|
|
273
|
+
);
|
|
274
|
+
};
|
|
275
|
+
})()), _;
|
|
276
|
+
}
|
|
277
|
+
var D;
|
|
278
|
+
function le() {
|
|
279
|
+
return D || (D = 1, process.env.NODE_ENV === "production" ? b.exports = ae() : b.exports = se()), b.exports;
|
|
280
|
+
}
|
|
281
|
+
var v = le();
|
|
282
|
+
function fe({ type: l, name: i, bizType: c }) {
|
|
283
|
+
const u = l === "POINT", a = u ? "blue" : "green", s = u ? /* @__PURE__ */ v.jsx(ne, {}) : /* @__PURE__ */ v.jsx(oe, {}), f = u ? `Point · ${i}` : `Impl · ${i}`;
|
|
284
|
+
return /* @__PURE__ */ v.jsx(re, { title: c ? `业务类型: ${c}` : "", children: /* @__PURE__ */ v.jsx(te, { color: a, icon: s, children: f }) });
|
|
285
|
+
}
|
|
286
|
+
export {
|
|
287
|
+
fe as ExtensionPointTag
|
|
288
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
(function(u,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("react"),require("antd"),require("@ant-design/icons")):typeof define=="function"&&define.amd?define(["exports","react","antd","@ant-design/icons"],_):(u=typeof globalThis<"u"?globalThis:u||self,_(u.z_ext_frontend_component={},u.React,u.antd,u.icons))})(this,(function(u,_,y,g){"use strict";var T={exports:{}},E={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var h;function U(){if(h)return E;h=1;var l=Symbol.for("react.transitional.element"),f=Symbol.for("react.fragment");function c(i,a,s){var d=null;if(s!==void 0&&(d=""+s),a.key!==void 0&&(d=""+a.key),"key"in a){s={};for(var R in a)R!=="key"&&(s[R]=a[R])}else s=a;return a=s.ref,{$$typeof:l,type:i,key:d,ref:a!==void 0?a:null,props:s}}return E.Fragment=f,E.jsx=c,E.jsxs=c,E}var p={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var w;function J(){return w||(w=1,process.env.NODE_ENV!=="production"&&(function(){function l(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case Z:return"Profiler";case H:return"StrictMode";case re:return"Suspense";case te:return"SuspenseList";case oe:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case B:return"Portal";case K:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case ee:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ne:return r=e.displayName||null,r!==null?r:l(e.type)||"Memo";case x:r=e._payload,e=e._init;try{return l(e(r))}catch{}}return null}function f(e){return""+e}function c(e){try{f(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),f(e)}}function i(e){if(e===O)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===x)return"<...>";try{var r=l(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function a(){var e=P.A;return e===null?null:e.getOwner()}function s(){return Error("react-stack-top-frame")}function d(e){if(F.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function R(e,r){function t(){D||(D=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function G(){var e=l(this.type);return M[e]||(M[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function X(e,r,t,n,k,S){var o=t.ref;return e={$$typeof:I,type:e,key:r,props:t,_owner:n},(o!==void 0?o:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:G}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:k}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:S}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function C(e,r,t,n,k,S){var o=r.children;if(o!==void 0)if(n)if(se(o)){for(n=0;n<o.length;n++)Y(o[n]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Y(o);if(F.call(r,"key")){o=l(e);var m=Object.keys(r).filter(function(ue){return ue!=="key"});n=0<m.length?"{key: someKey, "+m.join(": ..., ")+": ...}":"{key: someKey}",q[o+n]||(m=0<m.length?"{"+m.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
|
+
let props = %s;
|
|
19
|
+
<%s {...props} />
|
|
20
|
+
React keys must be passed directly to JSX without using spread:
|
|
21
|
+
let props = %s;
|
|
22
|
+
<%s key={someKey} {...props} />`,n,o,m,o),q[o+n]=!0)}if(o=null,t!==void 0&&(c(t),o=""+t),d(r)&&(c(r.key),o=""+r.key),"key"in r){t={};for(var j in r)j!=="key"&&(t[j]=r[j])}else t=r;return o&&R(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),X(e,o,t,a(),k,S)}function Y(e){$(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===x&&(e._payload.status==="fulfilled"?$(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function $(e){return typeof e=="object"&&e!==null&&e.$$typeof===I}var v=_,I=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),K=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),ae=Symbol.for("react.client.reference"),P=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,se=Array.isArray,A=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(e){return e()}};var D,M={},L=v.react_stack_bottom_frame.bind(v,s)(),W=A(i(s)),q={};p.Fragment=O,p.jsx=function(e,r,t){var n=1e4>P.recentlyCreatedOwnerStacks++;return C(e,r,t,!1,n?Error("react-stack-top-frame"):L,n?A(i(e)):W)},p.jsxs=function(e,r,t){var n=1e4>P.recentlyCreatedOwnerStacks++;return C(e,r,t,!0,n?Error("react-stack-top-frame"):L,n?A(i(e)):W)}})()),p}var N;function V(){return N||(N=1,process.env.NODE_ENV==="production"?T.exports=U():T.exports=J()),T.exports}var b=V();function z({type:l,name:f,bizType:c}){const i=l==="POINT",a=i?"blue":"green",s=i?b.jsx(g.ApiOutlined,{}):b.jsx(g.ExperimentOutlined,{}),d=i?`Point · ${f}`:`Impl · ${f}`;return b.jsx(y.Tooltip,{title:c?`业务类型: ${c}`:"",children:b.jsx(y.Tag,{color:a,icon:s,children:d})})}u.ExtensionPointTag=z,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yuku123/z-ext-frontend-component",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "z-ext 模块共享前端组件(抽自 z-opc/z-ext/_frontend)",
|
|
6
|
+
"keywords": ["react", "antd", "ext", "z-opc"],
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": { "name": "zifang", "email": "1340947819@qq.com" },
|
|
9
|
+
"homepage": "https://github.com/yuku123/z-opc-frontend/tree/main/packages/z-ext-frontend-component#readme",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/yuku123/z-opc-frontend.git",
|
|
13
|
+
"directory": "packages/z-ext-frontend-component"
|
|
14
|
+
},
|
|
15
|
+
"bugs": { "url": "https://github.com/yuku123/z-opc-frontend/issues" },
|
|
16
|
+
"main": "./dist/z-ext-frontend-component.umd.js",
|
|
17
|
+
"module": "./dist/z-ext-frontend-component.es.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"import": "./dist/z-ext-frontend-component.es.js",
|
|
22
|
+
"require": "./dist/z-ext-frontend-component.umd.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"files": ["dist", "src", "README.md"],
|
|
26
|
+
"publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" },
|
|
27
|
+
"scripts": {
|
|
28
|
+
"dev": "vite --port 3091",
|
|
29
|
+
"build": "vite build",
|
|
30
|
+
"preview": "vite preview"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"react": "^19.2.0",
|
|
34
|
+
"react-dom": "^19.2.0",
|
|
35
|
+
"antd": "^6.3.3"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
39
|
+
"vite": "^6.2.0"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {Tag, Tooltip} from 'antd'
|
|
3
|
+
import {ApiOutlined, ExperimentOutlined} from '@ant-design/icons'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 扩展点/实现标签
|
|
7
|
+
* <p>
|
|
8
|
+
* 抽自 z-ext/_frontend/src/pages/extension/ExtensionList.jsx
|
|
9
|
+
*
|
|
10
|
+
* @param {string} type - POINT | IMPL
|
|
11
|
+
* @param {string} name - 扩展名
|
|
12
|
+
* @param {string} bizType - 业务类型
|
|
13
|
+
*/
|
|
14
|
+
export default function ExtensionPointTag({type, name, bizType}) {
|
|
15
|
+
const isPoint = type === 'POINT'
|
|
16
|
+
const color = isPoint ? 'blue' : 'green'
|
|
17
|
+
const icon = isPoint ? <ApiOutlined/> : <ExperimentOutlined/>
|
|
18
|
+
const label = isPoint ? `Point · ${name}` : `Impl · ${name}`
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Tooltip title={bizType ? `业务类型: ${bizType}` : ''}>
|
|
22
|
+
<Tag color={color} icon={icon}>
|
|
23
|
+
{label}
|
|
24
|
+
</Tag>
|
|
25
|
+
</Tooltip>
|
|
26
|
+
)
|
|
27
|
+
}
|
package/src/dev.jsx
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import ReactDOM from 'react-dom/client'
|
|
3
|
+
import ExtensionPointTag from './ExtensionPointTag'
|
|
4
|
+
|
|
5
|
+
const root = ReactDOM.createRoot(document.getElementById('root'))
|
|
6
|
+
root.render(
|
|
7
|
+
<div style={{padding: 40, display: 'flex', flexDirection: 'column', gap: 12}}>
|
|
8
|
+
<ExtensionPointTag type="POINT" name="OrderPay" bizType="order"/>
|
|
9
|
+
<ExtensionPointTag type="IMPL" name="AlipayPay" bizType="order"/>
|
|
10
|
+
</div>
|
|
11
|
+
)
|
package/src/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default as ExtensionPointTag} from './ExtensionPointTag'
|