@tachybase/plugin-action-share 1.3.20 → 1.3.22

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.
@@ -0,0 +1 @@
1
+ export declare const ShareButton: import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<unknown>>;
@@ -0,0 +1,4 @@
1
+ export declare function useShareToken(): string;
2
+ export declare const ShareLayout: () => import("react/jsx-runtime").JSX.Element;
3
+ export declare const SharePage: () => import("react/jsx-runtime").JSX.Element;
4
+ export declare function NotAuthorityResult(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function ShareSchemaComponent(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ layout: import("antd-style").SerializedStyles;
3
+ header: import("antd-style").SerializedStyles;
4
+ headerA: import("antd-style").SerializedStyles;
5
+ headerB: import("antd-style").SerializedStyles;
6
+ titleContainer: import("antd-style").SerializedStyles;
7
+ logo: import("antd-style").SerializedStyles;
8
+ title: import("antd-style").SerializedStyles;
9
+ right: import("antd-style").SerializedStyles;
10
+ headerTabs: import("antd-style").SerializedStyles;
11
+ notice: import("antd-style").SerializedStyles;
12
+ sider: import("antd-style").SerializedStyles;
13
+ main: import("antd-style").SerializedStyles;
14
+ }>;
15
+ export declare const useModalStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
16
+ firstmodal: import("antd-style").SerializedStyles;
17
+ secondmodal: import("antd-style").SerializedStyles;
18
+ imageModal: import("antd-style").SerializedStyles;
19
+ }>;
@@ -0,0 +1,5 @@
1
+ export declare const useEnablePageShare: () => {
2
+ title: string;
3
+ checked: any;
4
+ onChange(v: any): void;
5
+ };
@@ -0,0 +1,7 @@
1
+ export declare const useShareActions: ({ title, uid }: {
2
+ title: any;
3
+ uid: any;
4
+ }) => {
5
+ copyLink: () => void;
6
+ imageAction: () => import("react/jsx-runtime").JSX.Element;
7
+ };
@@ -1,4 +1,5 @@
1
1
  import { Plugin } from '@tachybase/client';
2
2
  export declare class PluginShareClient extends Plugin {
3
+ load(): Promise<void>;
3
4
  }
4
5
  export default PluginShareClient;
@@ -1 +1,317 @@
1
- (function(e,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("@tachybase/client")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client"],t):(e=typeof globalThis!="undefined"?globalThis:e||self,t(e["@tachybase/plugin-action-share"]={},e["@tachybase/client"]))})(this,function(e,t){"use strict";class i extends t.Plugin{}e.PluginShareClient=i,e.default=i,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(k,b){typeof exports=="object"&&typeof module!="undefined"?b(exports,require("@tachybase/client"),require("react-router"),require("react/jsx-runtime"),require("react"),require("@tachybase/schema"),require("@ant-design/icons"),require("antd"),require("antd-style"),require("@emotion/css"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","react-router","react/jsx-runtime","react","@tachybase/schema","@ant-design/icons","antd","antd-style","@emotion/css","react-router-dom"],b):(k=typeof globalThis!="undefined"?globalThis:k||self,b(k["@tachybase/plugin-action-share"]={},k["@tachybase/client"],k["react-router"],k.jsxRuntime,k.react,k["@tachybase/schema"],k["@ant-design/icons"],k.antd,k["antd-style"],k["@emotion/css"],k["react-router-dom"]))})(this,function(k,b,L,f,U,Q,K,q,R,$,mt){"use strict";var on=Object.defineProperty,an=Object.defineProperties;var sn=Object.getOwnPropertyDescriptors;var gt=Object.getOwnPropertySymbols;var ln=Object.prototype.hasOwnProperty,cn=Object.prototype.propertyIsEnumerable;var pt=(k,b,L)=>b in k?on(k,b,{enumerable:!0,configurable:!0,writable:!0,value:L}):k[b]=L,ve=(k,b)=>{for(var L in b||(b={}))ln.call(b,L)&&pt(k,L,b[L]);if(gt)for(var L of gt(b))cn.call(b,L)&&pt(k,L,b[L]);return k},Ne=(k,b)=>an(k,sn(b));var ee=(k,b,L)=>new Promise((f,U)=>{var Q=R=>{try{q(L.next(R))}catch($){U($)}},K=R=>{try{q(L.throw(R))}catch($){U($)}},q=R=>R.done?f(R.value):Promise.resolve(R.value).then(Q,K);q((L=L.apply(k,b)).next())});const wt=R.createStyles(({css:n,token:o})=>({layout:n`
2
+ display: flex;
3
+ flex-direction: column;
4
+ height: 100vh;
5
+ max-height: 100vh;
6
+ `,header:n`
7
+ .ant-menu.ant-menu-dark .ant-menu-item-selected,
8
+ .ant-menu-submenu-popup.ant-menu-dark .ant-menu-item-selected,
9
+ .ant-menu-submenu-horizontal.ant-menu-submenu-selected {
10
+ background-color: ${o.colorBgHeaderMenuActive} !important;
11
+ color: ${o.colorTextHeaderMenuActive} !important;
12
+ }
13
+ .ant-menu-submenu-horizontal.ant-menu-submenu-selected > .ant-menu-submenu-title {
14
+ color: ${o.colorTextHeaderMenuActive} !important;
15
+ }
16
+ .ant-menu-dark.ant-menu-horizontal > .ant-menu-item:hover {
17
+ background-color: ${o.colorBgHeaderMenuHover} !important;
18
+ color: ${o.colorTextHeaderMenuHover} !important;
19
+ }
20
+
21
+ height: var(--tb-header-height);
22
+ line-height: var(--tb-header-height);
23
+ padding: 0;
24
+ background-color: ${o.colorBgHeader} !important;
25
+
26
+ .ant-menu {
27
+ background-color: transparent;
28
+ }
29
+
30
+ .ant-menu-item,
31
+ .ant-menu-submenu-horizontal {
32
+ color: ${o.colorTextHeaderMenu} !important;
33
+ }
34
+ `,headerA:n`
35
+ position: relative;
36
+ width: 100%;
37
+ height: 100%;
38
+ display: flex;
39
+ `,headerB:n`
40
+ position: relative;
41
+ z-index: 1;
42
+ flex: 1 1 auto;
43
+ display: flex;
44
+ height: 100%;
45
+ `,titleContainer:n`
46
+ display: inline-flex;
47
+ flex-shrink: 0;
48
+ color: #fff;
49
+ padding: 0;
50
+ align-items: center;
51
+ padding: 0 12px 0 12px;
52
+ cursor: pointer;
53
+ `,logo:n`
54
+ object-fit: contain;
55
+ height: 28px;
56
+ `,title:n`
57
+ color: #fff;
58
+ height: 32px;
59
+ margin: 0 0 0 12px;
60
+ font-weight: 600;
61
+ font-size: 18px;
62
+ line-height: 32px;
63
+ `,right:n`
64
+ display: inline-flex;
65
+ position: relative;
66
+ flex-shrink: 0;
67
+ height: 100%;
68
+ z-index: 10;
69
+ `,headerTabs:n`
70
+ flex: 1 1 auto;
71
+ display: flex;
72
+ width: 0;
73
+ overflow: hidden;
74
+ white-space: nowrap;
75
+ margin: 0;
76
+ `,notice:n`
77
+ flex: 1;
78
+ `,sider:n`
79
+ height: 100%;
80
+ position: relative;
81
+ left: 0;
82
+ top: 0;
83
+ background: rgba(0, 0, 0, 0);
84
+ z-index: 100;
85
+ `,main:n`
86
+ display: flex;
87
+ flex-direction: column;
88
+ position: relative;
89
+ height: 100%;
90
+ > div {
91
+ position: relative;
92
+ }
93
+ .ant-layout-content {
94
+ height: calc(100vh - var(--tb-header-height));
95
+ overflow: auto;
96
+ }
97
+ .ant-layout-footer {
98
+ position: absolute;
99
+ bottom: 0;
100
+ text-align: center;
101
+ width: 100%;
102
+ z-index: 0;
103
+ padding: 0px 50px;
104
+ }
105
+ `})),yt=R.createStyles(({css:n,token:o})=>({firstmodal:n`
106
+ .ant-modal-content {
107
+ position: relative;
108
+ overflow: hidden;
109
+ border-radius: 16px;
110
+ &::before,
111
+ &::after {
112
+ content: '';
113
+ position: absolute;
114
+ width: 300px;
115
+ height: 300px;
116
+ background: radial-gradient(circle, rgba(0, 149, 255, 0.11) 0%, transparent 70%);
117
+ z-index: 0;
118
+ pointer-events: none;
119
+ }
120
+
121
+ &::before {
122
+ top: -165px;
123
+ left: -10px;
124
+ }
125
+
126
+ &::after {
127
+ bottom: -160px;
128
+ right: -150px;
129
+ }
130
+ .ant-modal-header {
131
+ text-align: center;
132
+ margin-bottom: 20px;
133
+ margin-top: 15px;
134
+ .ant-modal-title {
135
+ font-size: x-large;
136
+ font-weight: 400;
137
+ }
138
+ }
139
+ .ant-modal-body {
140
+ justify-items: center;
141
+ }
142
+ }
143
+ `,secondmodal:n`
144
+ display: flex;
145
+ justify-content: center;
146
+ align-items: center;
147
+ width: 100%;
148
+ margin-top: 20px;
149
+ margin-bottom: 40px;
150
+ position: relative;
151
+ gap: 20%;
152
+ padding-left: 10%;
153
+ padding-right: 10%;
154
+ .tb-header-modal-list {
155
+ width: 50%;
156
+ gap: 10px;
157
+ display: flex;
158
+ flex-direction: column;
159
+ justify-content: center;
160
+ text-align: center;
161
+ border: 1px solid transparent;
162
+ border-color: rgba(203, 227, 254, 0.62);
163
+ box-shadow: none;
164
+ border-radius: 12px;
165
+ padding: 16px;
166
+ transition:
167
+ box-shadow 0.2s ease,
168
+ transform 0.2s ease;
169
+ z-index: 1;
170
+ position: relative;
171
+ &:hover {
172
+ border-color: rgba(0, 120, 255, 0.3);
173
+ box-shadow: 0 4px 16px rgba(0, 120, 255, 0.15);
174
+ }
175
+ &:active {
176
+ box-shadow: none;
177
+ transform: translateY(2px);
178
+ }
179
+ .anticon {
180
+ width: 100%;
181
+ display: flex;
182
+ justify-content: center;
183
+ svg {
184
+ width: 30px;
185
+ height: 30px;
186
+ }
187
+ }
188
+ .tb-header-modal-list-text {
189
+ text-align: center;
190
+ }
191
+ }
192
+ `,imageModal:n`
193
+ display: flex;
194
+ justify-content: center;
195
+ .ant-modal-content {
196
+ width: 280px;
197
+ height: 360px;
198
+ }
199
+ `}));function Ct(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var J={},te,Ie;function bt(){return Ie||(Ie=1,te=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),te}var ne={},H={},ke;function j(){if(ke)return H;ke=1;let n;const o=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return H.getSymbolSize=function(r){if(!r)throw new Error('"version" cannot be null or undefined');if(r<1||r>40)throw new Error('"version" should be in range from 1 to 40');return r*4+17},H.getSymbolTotalCodewords=function(r){return o[r]},H.getBCHDigit=function(i){let r=0;for(;i!==0;)r++,i>>>=1;return r},H.setToSJISFunction=function(r){if(typeof r!="function")throw new Error('"toSJISFunc" is not a valid function.');n=r},H.isKanjiModeEnabled=function(){return typeof n!="undefined"},H.toSJIS=function(r){return n(r)},H}var re={},Le;function oe(){return Le||(Le=1,function(n){n.L={bit:1},n.M={bit:0},n.Q={bit:3},n.H={bit:2};function o(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return n.L;case"m":case"medium":return n.M;case"q":case"quartile":return n.Q;case"h":case"high":return n.H;default:throw new Error("Unknown EC Level: "+i)}}n.isValid=function(r){return r&&typeof r.bit!="undefined"&&r.bit>=0&&r.bit<4},n.from=function(r,t){if(n.isValid(r))return r;try{return o(r)}catch(e){return t}}}(re)),re}var ie,qe;function Et(){if(qe)return ie;qe=1;function n(){this.buffer=[],this.length=0}return n.prototype={get:function(o){const i=Math.floor(o/8);return(this.buffer[i]>>>7-o%8&1)===1},put:function(o,i){for(let r=0;r<i;r++)this.putBit((o>>>i-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(o){const i=Math.floor(this.length/8);this.buffer.length<=i&&this.buffer.push(0),o&&(this.buffer[i]|=128>>>this.length%8),this.length++}},ie=n,ie}var ae,De;function xt(){if(De)return ae;De=1;function n(o){if(!o||o<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=o,this.data=new Uint8Array(o*o),this.reservedBit=new Uint8Array(o*o)}return n.prototype.set=function(o,i,r,t){const e=o*this.size+i;this.data[e]=r,t&&(this.reservedBit[e]=!0)},n.prototype.get=function(o,i){return this.data[o*this.size+i]},n.prototype.xor=function(o,i,r){this.data[o*this.size+i]^=r},n.prototype.isReserved=function(o,i){return this.reservedBit[o*this.size+i]},ae=n,ae}var se={},Ue;function St(){return Ue||(Ue=1,function(n){const o=j().getSymbolSize;n.getRowColCoords=function(r){if(r===1)return[];const t=Math.floor(r/7)+2,e=o(r),a=e===145?26:Math.ceil((e-13)/(2*t-2))*2,s=[e-7];for(let l=1;l<t-1;l++)s[l]=s[l-1]-a;return s.push(6),s.reverse()},n.getPositions=function(r){const t=[],e=n.getRowColCoords(r),a=e.length;for(let s=0;s<a;s++)for(let l=0;l<a;l++)s===0&&l===0||s===0&&l===a-1||s===a-1&&l===0||t.push([e[s],e[l]]);return t}}(se)),se}var le={},Re;function Bt(){if(Re)return le;Re=1;const n=j().getSymbolSize,o=7;return le.getPositions=function(r){const t=n(r);return[[0,0],[t-o,0],[0,t-o]]},le}var ce={},Fe;function At(){return Fe||(Fe=1,function(n){n.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const o={N1:3,N2:3,N3:40,N4:10};n.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7},n.from=function(t){return n.isValid(t)?parseInt(t,10):void 0},n.getPenaltyN1=function(t){const e=t.size;let a=0,s=0,l=0,c=null,h=null;for(let p=0;p<e;p++){s=l=0,c=h=null;for(let d=0;d<e;d++){let u=t.get(p,d);u===c?s++:(s>=5&&(a+=o.N1+(s-5)),c=u,s=1),u=t.get(d,p),u===h?l++:(l>=5&&(a+=o.N1+(l-5)),h=u,l=1)}s>=5&&(a+=o.N1+(s-5)),l>=5&&(a+=o.N1+(l-5))}return a},n.getPenaltyN2=function(t){const e=t.size;let a=0;for(let s=0;s<e-1;s++)for(let l=0;l<e-1;l++){const c=t.get(s,l)+t.get(s,l+1)+t.get(s+1,l)+t.get(s+1,l+1);(c===4||c===0)&&a++}return a*o.N2},n.getPenaltyN3=function(t){const e=t.size;let a=0,s=0,l=0;for(let c=0;c<e;c++){s=l=0;for(let h=0;h<e;h++)s=s<<1&2047|t.get(c,h),h>=10&&(s===1488||s===93)&&a++,l=l<<1&2047|t.get(h,c),h>=10&&(l===1488||l===93)&&a++}return a*o.N3},n.getPenaltyN4=function(t){let e=0;const a=t.data.length;for(let l=0;l<a;l++)e+=t.data[l];return Math.abs(Math.ceil(e*100/a/5)-10)*o.N4};function i(r,t,e){switch(r){case n.Patterns.PATTERN000:return(t+e)%2===0;case n.Patterns.PATTERN001:return t%2===0;case n.Patterns.PATTERN010:return e%3===0;case n.Patterns.PATTERN011:return(t+e)%3===0;case n.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2===0;case n.Patterns.PATTERN101:return t*e%2+t*e%3===0;case n.Patterns.PATTERN110:return(t*e%2+t*e%3)%2===0;case n.Patterns.PATTERN111:return(t*e%3+(t+e)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}n.applyMask=function(t,e){const a=e.size;for(let s=0;s<a;s++)for(let l=0;l<a;l++)e.isReserved(l,s)||e.xor(l,s,i(t,l,s))},n.getBestMask=function(t,e){const a=Object.keys(n.Patterns).length;let s=0,l=1/0;for(let c=0;c<a;c++){e(c),n.applyMask(c,t);const h=n.getPenaltyN1(t)+n.getPenaltyN2(t)+n.getPenaltyN3(t)+n.getPenaltyN4(t);n.applyMask(c,t),h<l&&(l=h,s=c)}return s}}(ce)),ce}var Z={},_e;function ze(){if(_e)return Z;_e=1;const n=oe(),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Z.getBlocksCount=function(t,e){switch(e){case n.L:return o[(t-1)*4+0];case n.M:return o[(t-1)*4+1];case n.Q:return o[(t-1)*4+2];case n.H:return o[(t-1)*4+3];default:return}},Z.getTotalCodewordsCount=function(t,e){switch(e){case n.L:return i[(t-1)*4+0];case n.M:return i[(t-1)*4+1];case n.Q:return i[(t-1)*4+2];case n.H:return i[(t-1)*4+3];default:return}},Z}var ue={},G={},He;function Tt(){if(He)return G;He=1;const n=new Uint8Array(512),o=new Uint8Array(256);return function(){let r=1;for(let t=0;t<255;t++)n[t]=r,o[r]=t,r<<=1,r&256&&(r^=285);for(let t=255;t<512;t++)n[t]=n[t-255]}(),G.log=function(r){if(r<1)throw new Error("log("+r+")");return o[r]},G.exp=function(r){return n[r]},G.mul=function(r,t){return r===0||t===0?0:n[o[r]+o[t]]},G}var Oe;function Mt(){return Oe||(Oe=1,function(n){const o=Tt();n.mul=function(r,t){const e=new Uint8Array(r.length+t.length-1);for(let a=0;a<r.length;a++)for(let s=0;s<t.length;s++)e[a+s]^=o.mul(r[a],t[s]);return e},n.mod=function(r,t){let e=new Uint8Array(r);for(;e.length-t.length>=0;){const a=e[0];for(let l=0;l<t.length;l++)e[l]^=o.mul(t[l],a);let s=0;for(;s<e.length&&e[s]===0;)s++;e=e.slice(s)}return e},n.generateECPolynomial=function(r){let t=new Uint8Array([1]);for(let e=0;e<r;e++)t=n.mul(t,new Uint8Array([1,o.exp(e)]));return t}}(ue)),ue}var de,je;function Pt(){if(je)return de;je=1;const n=Mt();function o(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}return o.prototype.initialize=function(r){this.degree=r,this.genPoly=n.generateECPolynomial(this.degree)},o.prototype.encode=function(r){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(r.length+this.degree);t.set(r);const e=n.mod(t,this.genPoly),a=this.degree-e.length;if(a>0){const s=new Uint8Array(this.degree);return s.set(e,a),s}return e},de=o,de}var he={},fe={},ge={},Ve;function Ke(){return Ve||(Ve=1,ge.isValid=function(o){return!isNaN(o)&&o>=1&&o<=40}),ge}var F={},Je;function Ye(){if(Je)return F;Je=1;const n="[0-9]+",o="[A-Z $%*+\\-./:]+";let i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";i=i.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r
200
+ ]))+`;F.KANJI=new RegExp(i,"g"),F.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),F.BYTE=new RegExp(r,"g"),F.NUMERIC=new RegExp(n,"g"),F.ALPHANUMERIC=new RegExp(o,"g");const t=new RegExp("^"+i+"$"),e=new RegExp("^"+n+"$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return F.testKanji=function(l){return t.test(l)},F.testNumeric=function(l){return e.test(l)},F.testAlphanumeric=function(l){return a.test(l)},F}var Qe;function V(){return Qe||(Qe=1,function(n){const o=Ke(),i=Ye();n.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},n.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},n.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},n.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},n.MIXED={bit:-1},n.getCharCountIndicator=function(e,a){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!o.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?e.ccBits[0]:a<27?e.ccBits[1]:e.ccBits[2]},n.getBestModeForData=function(e){return i.testNumeric(e)?n.NUMERIC:i.testAlphanumeric(e)?n.ALPHANUMERIC:i.testKanji(e)?n.KANJI:n.BYTE},n.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},n.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return n.NUMERIC;case"alphanumeric":return n.ALPHANUMERIC;case"kanji":return n.KANJI;case"byte":return n.BYTE;default:throw new Error("Unknown mode: "+t)}}n.from=function(e,a){if(n.isValid(e))return e;try{return r(e)}catch(s){return a}}}(fe)),fe}var $e;function vt(){return $e||($e=1,function(n){const o=j(),i=ze(),r=oe(),t=V(),e=Ke(),a=7973,s=o.getBCHDigit(a);function l(d,u,g){for(let m=1;m<=40;m++)if(u<=n.getCapacity(m,g,d))return m}function c(d,u){return t.getCharCountIndicator(d,u)+4}function h(d,u){let g=0;return d.forEach(function(m){const I=c(m.mode,u);g+=I+m.getBitsLength()}),g}function p(d,u){for(let g=1;g<=40;g++)if(h(d,g)<=n.getCapacity(g,u,t.MIXED))return g}n.from=function(u,g){return e.isValid(u)?parseInt(u,10):g},n.getCapacity=function(u,g,m){if(!e.isValid(u))throw new Error("Invalid QR Code version");typeof m=="undefined"&&(m=t.BYTE);const I=o.getSymbolTotalCodewords(u),w=i.getTotalCodewordsCount(u,g),N=(I-w)*8;if(m===t.MIXED)return N;const T=N-c(m,u);switch(m){case t.NUMERIC:return Math.floor(T/10*3);case t.ALPHANUMERIC:return Math.floor(T/11*2);case t.KANJI:return Math.floor(T/13);case t.BYTE:default:return Math.floor(T/8)}},n.getBestVersionForData=function(u,g){let m;const I=r.from(g,r.M);if(Array.isArray(u)){if(u.length>1)return p(u,I);if(u.length===0)return 1;m=u[0]}else m=u;return l(m.mode,m.getLength(),I)},n.getEncodedBits=function(u){if(!e.isValid(u)||u<7)throw new Error("Invalid QR Code version");let g=u<<12;for(;o.getBCHDigit(g)-s>=0;)g^=a<<o.getBCHDigit(g)-s;return u<<12|g}}(he)),he}var pe={},Ge;function Nt(){if(Ge)return pe;Ge=1;const n=j(),o=1335,i=21522,r=n.getBCHDigit(o);return pe.getEncodedBits=function(e,a){const s=e.bit<<3|a;let l=s<<10;for(;n.getBCHDigit(l)-r>=0;)l^=o<<n.getBCHDigit(l)-r;return(s<<10|l)^i},pe}var me={},we,We;function It(){if(We)return we;We=1;const n=V();function o(i){this.mode=n.NUMERIC,this.data=i.toString()}return o.getBitsLength=function(r){return 10*Math.floor(r/3)+(r%3?r%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(r){let t,e,a;for(t=0;t+3<=this.data.length;t+=3)e=this.data.substr(t,3),a=parseInt(e,10),r.put(a,10);const s=this.data.length-t;s>0&&(e=this.data.substr(t),a=parseInt(e,10),r.put(a,s*3+1))},we=o,we}var ye,Ze;function kt(){if(Ze)return ye;Ze=1;const n=V(),o=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(r){this.mode=n.ALPHANUMERIC,this.data=r}return i.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let a=o.indexOf(this.data[e])*45;a+=o.indexOf(this.data[e+1]),t.put(a,11)}this.data.length%2&&t.put(o.indexOf(this.data[e]),6)},ye=i,ye}var Ce,Xe;function Lt(){if(Xe)return Ce;Xe=1;const n=V();function o(i){this.mode=n.BYTE,typeof i=="string"?this.data=new TextEncoder().encode(i):this.data=new Uint8Array(i)}return o.getBitsLength=function(r){return r*8},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(i){for(let r=0,t=this.data.length;r<t;r++)i.put(this.data[r],8)},Ce=o,Ce}var be,et;function qt(){if(et)return be;et=1;const n=V(),o=j();function i(r){this.mode=n.KANJI,this.data=r}return i.getBitsLength=function(t){return t*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(r){let t;for(t=0;t<this.data.length;t++){let e=o.toSJIS(this.data[t]);if(e>=33088&&e<=40956)e-=33088;else if(e>=57408&&e<=60351)e-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
201
+ Make sure your charset is UTF-8`);e=(e>>>8&255)*192+(e&255),r.put(e,13)}},be=i,be}var Ee={exports:{}},tt;function Dt(){return tt||(tt=1,function(n){var o={single_source_shortest_paths:function(i,r,t){var e={},a={};a[r]=0;var s=o.PriorityQueue.make();s.push(r,0);for(var l,c,h,p,d,u,g,m,I;!s.empty();){l=s.pop(),c=l.value,p=l.cost,d=i[c]||{};for(h in d)d.hasOwnProperty(h)&&(u=d[h],g=p+u,m=a[h],I=typeof a[h]=="undefined",(I||m>g)&&(a[h]=g,s.push(h,g),e[h]=c))}if(typeof t!="undefined"&&typeof a[t]=="undefined"){var w=["Could not find a path from ",r," to ",t,"."].join("");throw new Error(w)}return e},extract_shortest_path_from_predecessor_list:function(i,r){for(var t=[],e=r;e;)t.push(e),i[e],e=i[e];return t.reverse(),t},find_path:function(i,r,t){var e=o.single_source_shortest_paths(i,r,t);return o.extract_shortest_path_from_predecessor_list(e,t)},PriorityQueue:{make:function(i){var r=o.PriorityQueue,t={},e;i=i||{};for(e in r)r.hasOwnProperty(e)&&(t[e]=r[e]);return t.queue=[],t.sorter=i.sorter||r.default_sorter,t},default_sorter:function(i,r){return i.cost-r.cost},push:function(i,r){var t={value:i,cost:r};this.queue.push(t),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};n.exports=o}(Ee)),Ee.exports}var nt;function Ut(){return nt||(nt=1,function(n){const o=V(),i=It(),r=kt(),t=Lt(),e=qt(),a=Ye(),s=j(),l=Dt();function c(w){return unescape(encodeURIComponent(w)).length}function h(w,N,T){const M=[];let D;for(;(D=w.exec(T))!==null;)M.push({data:D[0],index:D.index,mode:N,length:D[0].length});return M}function p(w){const N=h(a.NUMERIC,o.NUMERIC,w),T=h(a.ALPHANUMERIC,o.ALPHANUMERIC,w);let M,D;return s.isKanjiModeEnabled()?(M=h(a.BYTE,o.BYTE,w),D=h(a.KANJI,o.KANJI,w)):(M=h(a.BYTE_KANJI,o.BYTE,w),D=[]),N.concat(T,M,D).sort(function(B,S){return B.index-S.index}).map(function(B){return{data:B.data,mode:B.mode,length:B.length}})}function d(w,N){switch(N){case o.NUMERIC:return i.getBitsLength(w);case o.ALPHANUMERIC:return r.getBitsLength(w);case o.KANJI:return e.getBitsLength(w);case o.BYTE:return t.getBitsLength(w)}}function u(w){return w.reduce(function(N,T){const M=N.length-1>=0?N[N.length-1]:null;return M&&M.mode===T.mode?(N[N.length-1].data+=T.data,N):(N.push(T),N)},[])}function g(w){const N=[];for(let T=0;T<w.length;T++){const M=w[T];switch(M.mode){case o.NUMERIC:N.push([M,{data:M.data,mode:o.ALPHANUMERIC,length:M.length},{data:M.data,mode:o.BYTE,length:M.length}]);break;case o.ALPHANUMERIC:N.push([M,{data:M.data,mode:o.BYTE,length:M.length}]);break;case o.KANJI:N.push([M,{data:M.data,mode:o.BYTE,length:c(M.data)}]);break;case o.BYTE:N.push([{data:M.data,mode:o.BYTE,length:c(M.data)}])}}return N}function m(w,N){const T={},M={start:{}};let D=["start"];for(let C=0;C<w.length;C++){const B=w[C],S=[];for(let y=0;y<B.length;y++){const P=B[y],E=""+C+y;S.push(E),T[E]={node:P,lastCount:0},M[E]={};for(let A=0;A<D.length;A++){const x=D[A];T[x]&&T[x].node.mode===P.mode?(M[x][E]=d(T[x].lastCount+P.length,P.mode)-d(T[x].lastCount,P.mode),T[x].lastCount+=P.length):(T[x]&&(T[x].lastCount=P.length),M[x][E]=d(P.length,P.mode)+4+o.getCharCountIndicator(P.mode,N))}}D=S}for(let C=0;C<D.length;C++)M[D[C]].end=0;return{map:M,table:T}}function I(w,N){let T;const M=o.getBestModeForData(w);if(T=o.from(N,M),T!==o.BYTE&&T.bit<M.bit)throw new Error('"'+w+'" cannot be encoded with mode '+o.toString(T)+`.
202
+ Suggested mode is: `+o.toString(M));switch(T===o.KANJI&&!s.isKanjiModeEnabled()&&(T=o.BYTE),T){case o.NUMERIC:return new i(w);case o.ALPHANUMERIC:return new r(w);case o.KANJI:return new e(w);case o.BYTE:return new t(w)}}n.fromArray=function(N){return N.reduce(function(T,M){return typeof M=="string"?T.push(I(M,null)):M.data&&T.push(I(M.data,M.mode)),T},[])},n.fromString=function(N,T){const M=p(N,s.isKanjiModeEnabled()),D=g(M),C=m(D,T),B=l.find_path(C.map,"start","end"),S=[];for(let y=1;y<B.length-1;y++)S.push(C.table[B[y]].node);return n.fromArray(u(S))},n.rawSplit=function(N){return n.fromArray(p(N,s.isKanjiModeEnabled()))}}(me)),me}var rt;function Rt(){if(rt)return ne;rt=1;const n=j(),o=oe(),i=Et(),r=xt(),t=St(),e=Bt(),a=At(),s=ze(),l=Pt(),c=vt(),h=Nt(),p=V(),d=Ut();function u(C,B){const S=C.size,y=e.getPositions(B);for(let P=0;P<y.length;P++){const E=y[P][0],A=y[P][1];for(let x=-1;x<=7;x++)if(!(E+x<=-1||S<=E+x))for(let v=-1;v<=7;v++)A+v<=-1||S<=A+v||(x>=0&&x<=6&&(v===0||v===6)||v>=0&&v<=6&&(x===0||x===6)||x>=2&&x<=4&&v>=2&&v<=4?C.set(E+x,A+v,!0,!0):C.set(E+x,A+v,!1,!0))}}function g(C){const B=C.size;for(let S=8;S<B-8;S++){const y=S%2===0;C.set(S,6,y,!0),C.set(6,S,y,!0)}}function m(C,B){const S=t.getPositions(B);for(let y=0;y<S.length;y++){const P=S[y][0],E=S[y][1];for(let A=-2;A<=2;A++)for(let x=-2;x<=2;x++)A===-2||A===2||x===-2||x===2||A===0&&x===0?C.set(P+A,E+x,!0,!0):C.set(P+A,E+x,!1,!0)}}function I(C,B){const S=C.size,y=c.getEncodedBits(B);let P,E,A;for(let x=0;x<18;x++)P=Math.floor(x/3),E=x%3+S-8-3,A=(y>>x&1)===1,C.set(P,E,A,!0),C.set(E,P,A,!0)}function w(C,B,S){const y=C.size,P=h.getEncodedBits(B,S);let E,A;for(E=0;E<15;E++)A=(P>>E&1)===1,E<6?C.set(E,8,A,!0):E<8?C.set(E+1,8,A,!0):C.set(y-15+E,8,A,!0),E<8?C.set(8,y-E-1,A,!0):E<9?C.set(8,15-E-1+1,A,!0):C.set(8,15-E-1,A,!0);C.set(y-8,8,1,!0)}function N(C,B){const S=C.size;let y=-1,P=S-1,E=7,A=0;for(let x=S-1;x>0;x-=2)for(x===6&&x--;;){for(let v=0;v<2;v++)if(!C.isReserved(P,x-v)){let O=!1;A<B.length&&(O=(B[A]>>>E&1)===1),C.set(P,x-v,O),E--,E===-1&&(A++,E=7)}if(P+=y,P<0||S<=P){P-=y,y=-y;break}}}function T(C,B,S){const y=new i;S.forEach(function(v){y.put(v.mode.bit,4),y.put(v.getLength(),p.getCharCountIndicator(v.mode,C)),v.write(y)});const P=n.getSymbolTotalCodewords(C),E=s.getTotalCodewordsCount(C,B),A=(P-E)*8;for(y.getLengthInBits()+4<=A&&y.put(0,4);y.getLengthInBits()%8!==0;)y.putBit(0);const x=(A-y.getLengthInBits())/8;for(let v=0;v<x;v++)y.put(v%2?17:236,8);return M(y,C,B)}function M(C,B,S){const y=n.getSymbolTotalCodewords(B),P=s.getTotalCodewordsCount(B,S),E=y-P,A=s.getBlocksCount(B,S),x=y%A,v=A-x,O=Math.floor(y/A),W=Math.floor(E/A),tn=W+1,dt=O-W,nn=new l(dt);let Ae=0;const X=new Array(A),ht=new Array(A);let Te=0;const rn=new Uint8Array(C.buffer);for(let Y=0;Y<A;Y++){const Pe=Y<v?W:tn;X[Y]=rn.slice(Ae,Ae+Pe),ht[Y]=nn.encode(X[Y]),Ae+=Pe,Te=Math.max(Te,Pe)}const Me=new Uint8Array(y);let ft=0,_,z;for(_=0;_<Te;_++)for(z=0;z<A;z++)_<X[z].length&&(Me[ft++]=X[z][_]);for(_=0;_<dt;_++)for(z=0;z<A;z++)Me[ft++]=ht[z][_];return Me}function D(C,B,S,y){let P;if(Array.isArray(C))P=d.fromArray(C);else if(typeof C=="string"){let O=B;if(!O){const W=d.rawSplit(C);O=c.getBestVersionForData(W,S)}P=d.fromString(C,O||40)}else throw new Error("Invalid data");const E=c.getBestVersionForData(P,S);if(!E)throw new Error("The amount of data is too big to be stored in a QR Code");if(!B)B=E;else if(B<E)throw new Error(`
203
+ The chosen QR Code version cannot contain this amount of data.
204
+ Minimum version required to store current data is: `+E+`.
205
+ `);const A=T(B,S,P),x=n.getSymbolSize(B),v=new r(x);return u(v,B),g(v),m(v,B),w(v,S,0),B>=7&&I(v,B),N(v,A),isNaN(y)&&(y=a.getBestMask(v,w.bind(null,v,S))),a.applyMask(y,v),w(v,S,y),{modules:v,version:B,errorCorrectionLevel:S,maskPattern:y,segments:P}}return ne.create=function(B,S){if(typeof B=="undefined"||B==="")throw new Error("No input text");let y=o.M,P,E;return typeof S!="undefined"&&(y=o.from(S.errorCorrectionLevel,o.M),P=c.from(S.version),E=a.from(S.maskPattern),S.toSJISFunc&&n.setToSJISFunction(S.toSJISFunc)),D(B,P,y,E)},ne}var xe={},Se={},ot;function it(){return ot||(ot=1,function(n){function o(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let r=i.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+i);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(e){return[e,e]}))),r.length===6&&r.push("F","F");const t=parseInt(r.join(""),16);return{r:t>>24&255,g:t>>16&255,b:t>>8&255,a:t&255,hex:"#"+r.slice(0,6).join("")}}n.getOptions=function(r){r||(r={}),r.color||(r.color={});const t=typeof r.margin=="undefined"||r.margin===null||r.margin<0?4:r.margin,e=r.width&&r.width>=21?r.width:void 0,a=r.scale||4;return{width:e,scale:e?4:a,margin:t,color:{dark:o(r.color.dark||"#000000ff"),light:o(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},n.getScale=function(r,t){return t.width&&t.width>=r+t.margin*2?t.width/(r+t.margin*2):t.scale},n.getImageWidth=function(r,t){const e=n.getScale(r,t);return Math.floor((r+t.margin*2)*e)},n.qrToImageData=function(r,t,e){const a=t.modules.size,s=t.modules.data,l=n.getScale(a,e),c=Math.floor((a+e.margin*2)*l),h=e.margin*l,p=[e.color.light,e.color.dark];for(let d=0;d<c;d++)for(let u=0;u<c;u++){let g=(d*c+u)*4,m=e.color.light;if(d>=h&&u>=h&&d<c-h&&u<c-h){const I=Math.floor((d-h)/l),w=Math.floor((u-h)/l);m=p[s[I*a+w]?1:0]}r[g++]=m.r,r[g++]=m.g,r[g++]=m.b,r[g]=m.a}}}(Se)),Se}var at;function Ft(){return at||(at=1,function(n){const o=it();function i(t,e,a){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=a,e.width=a,e.style.height=a+"px",e.style.width=a+"px"}function r(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}n.render=function(e,a,s){let l=s,c=a;typeof l=="undefined"&&(!a||!a.getContext)&&(l=a,a=void 0),a||(c=r()),l=o.getOptions(l);const h=o.getImageWidth(e.modules.size,l),p=c.getContext("2d"),d=p.createImageData(h,h);return o.qrToImageData(d.data,e,l),i(p,c,h),p.putImageData(d,0,0),c},n.renderToDataURL=function(e,a,s){let l=s;typeof l=="undefined"&&(!a||!a.getContext)&&(l=a,a=void 0),l||(l={});const c=n.render(e,a,l),h=l.type||"image/png",p=l.rendererOpts||{};return c.toDataURL(h,p.quality)}}(xe)),xe}var Be={},st;function _t(){if(st)return Be;st=1;const n=it();function o(t,e){const a=t.a/255,s=e+'="'+t.hex+'"';return a<1?s+" "+e+'-opacity="'+a.toFixed(2).slice(1)+'"':s}function i(t,e,a){let s=t+e;return typeof a!="undefined"&&(s+=" "+a),s}function r(t,e,a){let s="",l=0,c=!1,h=0;for(let p=0;p<t.length;p++){const d=Math.floor(p%e),u=Math.floor(p/e);!d&&!c&&(c=!0),t[p]?(h++,p>0&&d>0&&t[p-1]||(s+=c?i("M",d+a,.5+u+a):i("m",l,0),l=0,c=!1),d+1<e&&t[p+1]||(s+=i("h",h),h=0)):l++}return s}return Be.render=function(e,a,s){const l=n.getOptions(a),c=e.modules.size,h=e.modules.data,p=c+l.margin*2,d=l.color.light.a?"<path "+o(l.color.light,"fill")+' d="M0 0h'+p+"v"+p+'H0z"/>':"",u="<path "+o(l.color.dark,"stroke")+' d="'+r(h,c,l.margin)+'"/>',g='viewBox="0 0 '+p+" "+p+'"',I='<svg xmlns="http://www.w3.org/2000/svg" '+(l.width?'width="'+l.width+'" height="'+l.width+'" ':"")+g+' shape-rendering="crispEdges">'+d+u+`</svg>
206
+ `;return typeof s=="function"&&s(null,I),I},Be}var lt;function zt(){if(lt)return J;lt=1;const n=bt(),o=Rt(),i=Ft(),r=_t();function t(e,a,s,l,c){const h=[].slice.call(arguments,1),p=h.length,d=typeof h[p-1]=="function";if(!d&&!n())throw new Error("Callback required as last argument");if(d){if(p<2)throw new Error("Too few arguments provided");p===2?(c=s,s=a,a=l=void 0):p===3&&(a.getContext&&typeof c=="undefined"?(c=l,l=void 0):(c=l,l=s,s=a,a=void 0))}else{if(p<1)throw new Error("Too few arguments provided");return p===1?(s=a,a=l=void 0):p===2&&!a.getContext&&(l=s,s=a,a=void 0),new Promise(function(u,g){try{const m=o.create(s,l);u(e(m,a,l))}catch(m){g(m)}})}try{const u=o.create(s,l);c(null,e(u,a,l))}catch(u){c(u)}}return J.create=o.create,J.toCanvas=t.bind(null,i.render),J.toDataURL=t.bind(null,i.renderToDataURL),J.toString=t.bind(null,function(e,a,s){return r.render(e,s)}),J}var Ht=zt();const Ot=Ct(Ht),ct=({title:n,uid:o})=>{var I;const i=Q.useFieldSchema(),r=L.useMatch("/admin/:name"),t=L.useMatch("/share/:name"),e=L.useMatch("/mobile/:name"),a=b.useIsMobile(),s=r||t||e,c=(a?window.location.href.replace("/mobile","/share"):window.location.href.replace("/admin","/share")).replace((I=s==null?void 0:s.params)==null?void 0:I.name,o||i["x-uid"]).replace(window.location.search||"",""),{t:h}=b.useTranslation(),[p,d]=U.useState(),u=b.useCompile();return Ot.toDataURL(c,{width:170},(w,N)=>{if(w){console.error(w);return}p||d(N)}),{copyLink:()=>{navigator.clipboard.writeText(c).then(w=>{q.message.open({type:"success",content:f.jsxs(f.Fragment,{children:[h("Replicated"),f.jsx("span",{style:{color:"#3279FE"},children:u(n||"")}),h("page link")]})})})},imageAction:()=>f.jsx(jt,{link:p,title:n})}},jt=n=>{const{link:o,title:i}=n,r=U.useRef(null),{t}=b.useTranslation(),{currentUserCtx:e}=b.useCurrentUserVariable(),a=b.useCompile();U.useEffect(()=>{Vt(r,o,e,t)},[]);const s=()=>{const c=r.current;if(c){const h=c.toDataURL("image/png"),p=document.createElement("a");p.href=h,p.download="Tachybase-Share.png",p.click(),q.message.open({type:"success",content:f.jsxs(f.Fragment,{children:[t("Saved"),f.jsx("span",{style:{color:"#3279FE"},children:a(i||"")}),t("QR code")]})})}},l=()=>{const c=r.current;c&&navigator.clipboard&&c.toBlob(h=>ee(null,null,function*(){if(h)try{const p=new ClipboardItem({"image/png":h});yield navigator.clipboard.write([p]),q.message.open({type:"success",content:f.jsxs(f.Fragment,{children:[t("Replicated"),f.jsx("span",{style:{color:"#3279FE"},children:a(i||"")}),t("QR code")]})})}catch(p){q.message.error(t("Copy failed, please try again"))}}),"image/png")};return f.jsxs("div",{style:{marginTop:"23px",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[f.jsx("canvas",{ref:r,width:240,height:260,style:{width:"240px",height:"260px",pointerEvents:"none"}}),f.jsxs("div",{style:{width:"100%",display:"flex",justifyContent:"space-between",marginTop:"10px"},children:[f.jsx(q.Button,{onClick:s,style:{width:"49%"},children:t("Save Picture")}),f.jsx(q.Button,{onClick:l,style:{width:"49%"},children:t("Copy QR code")})]})]})},Vt=(n,o,i,r)=>{const t=n.current,e=t.getContext("2d"),a=window.devicePixelRatio,{width:s,height:l}=t;t.width=Math.round(s*a),t.height=Math.round(l*a),t.style.width=s+"px",t.style.height=l+"px",e.scale(a,a),e.filter="blur(20px)";const c=e.createLinearGradient(0,0,t.width,t.height);c.addColorStop(0,"rgba(255, 255, 255, 1)"),c.addColorStop(1,"rgba(234, 238, 246, 0.80)"),e.fillStyle=c,e.fillRect(0,0,t.width,t.height);const h=(d,u)=>{const m=e.createRadialGradient(d,u,0,d,u,100);m.addColorStop(0,"rgba(255, 255, 255, 1)"),m.addColorStop(1,"rgba(217, 238, 255, 0.216)"),e.fillStyle=m,e.beginPath(),e.arc(d,u,100,0,Math.PI*2),e.fill()};h(60,30),h(190,280),e.filter="none",e.fillStyle="#AAAAAA",e.font="13px Arial",e.textAlign="center",e.fillText(`${i.nickname}`,t.width/4,30);const p=new Image;p.src=o,p.onload=()=>{const d=p.width,u=p.height,g=(t.width-d)/8,m=40,I=3,w=20;e.beginPath(),e.moveTo(g+w,m),e.arcTo(g+d,m,g+d,m+u,w),e.arcTo(g+d,m+u,g,m+u,w),e.arcTo(g,m+u,g,m,w),e.arcTo(g,m,g+d,m,w),e.closePath(),e.clip(),e.drawImage(p,g+I,m+I,d-2*I,u-2*I),e.lineWidth=I,e.strokeStyle="#000",e.beginPath(),e.moveTo(g+w,m),e.arcTo(g+d,m,g+d,m+u,w),e.arcTo(g+d,m+u,g,m+u,w),e.arcTo(g,m+u,g,m,w),e.arcTo(g,m,g+d,m,w),e.closePath(),e.stroke()},e.fillStyle="#AAAAAA",e.font="13px Arial",e.textAlign="center",e.fillText(r("Scan the code to view the sharing"),t.width/4,230),e.fillStyle="rgba(50, 121, 254, 1)",e.font="14px Arial",e.textAlign="center",e.fillText("灵矶(Tachybase)",t.width/4,250)},Kt=Q.connect(n=>{var T;const o=b.usePageExtendComponentContext(),{disablePageHeader:i,fieldSchema:r={},title:t="",enableSharePage:e,isExtra:a}=o,s=L.useMatch("/share/:name"),l=(T=r==null?void 0:r["x-component-props"])==null?void 0:T.hidePageTitle,[c,h]=U.useState(!1),[p,d]=U.useState(!1),u=b.useCompile(),{t:g}=b.useTranslation(),m=l?void 0:r.title||u(t),{styles:I}=yt(),{copyLink:w,imageAction:N}=ct({title:m,uid:r["x-uid"]});return f.jsxs(f.Fragment,{children:[!s&&a&&f.jsx(q.Button,{icon:f.jsx(K.ShareAltOutlined,{}),onClick:()=>{h(!0)},style:{visibility:`${e?"visible":"hidden"}`}}),!a&&i&&e&&!s&&f.jsx("div",{className:"tb-page-header-button",children:f.jsx(q.Button,{icon:f.jsx(K.ShareAltOutlined,{}),onClick:()=>{h(!0)},children:g("Share")})}),f.jsxs(q.Modal,{open:c,className:I.firstmodal,title:g("Share"),footer:null,width:500,onCancel:()=>{h(!1)},children:[f.jsxs("div",{className:I.secondmodal,children:[f.jsxs("div",{className:"tb-header-modal-list",onClick:w,children:[f.jsx(b.Icon,{type:"PaperClipOutlined"}),g("Copy link")]}),f.jsxs("div",{className:"tb-header-modal-list",onClick:()=>{d(!0)},children:[f.jsx(b.Icon,{type:"QrcodeOutlined"}),g("Generate QR code")]})]}),f.jsx(q.Modal,{className:I.imageModal,open:p,footer:null,onCancel:()=>{d(!1)},children:N()})]})]})});function Jt(){const n=new URL(window.location.href),o=b.useAPIClient(),i=n.searchParams.get("token");return i&&o.auth.setToken(i),o.auth.getToken()}const Yt=()=>{var t,e,a,s,l;const{styles:n}=wt(),o=b.useApp(),i=b.useSystemSettings(),r=U.useRef();return f.jsx(q.Layout,{style:{height:"100%"},children:f.jsxs(q.Layout.Content,{className:$.css`
207
+ display: flex;
208
+ flex-direction: column;
209
+ position: relative;
210
+ overflow-y: auto;
211
+ > div {
212
+ position: relative;
213
+ }
214
+ .ant-layout-footer {
215
+ position: absolute;
216
+ bottom: 0;
217
+ text-align: center;
218
+ width: 100%;
219
+ z-index: 0;
220
+ padding: 0px 50px;
221
+ }
222
+ `,children:[f.jsx(q.Layout.Header,{className:n.header,children:f.jsxs("div",{className:n.headerA,children:[f.jsxs("div",{className:n.headerB,children:[f.jsxs("div",{className:n.titleContainer,onClick:()=>{location.href=o.adminUrl},children:[f.jsx("img",{className:n.logo,src:(a=(e=(t=i==null?void 0:i.data)==null?void 0:t.data)==null?void 0:e.logo)==null?void 0:a.url}),f.jsx("h1",{className:n.title,children:(l=(s=i==null?void 0:i.data)==null?void 0:s.data)==null?void 0:l.title})]}),f.jsx(b.MenuEditor,{sideMenuRef:r}),f.jsx("div",{className:n.headerTabs,children:f.jsx(b.AdminTabs,{})})]}),f.jsxs("div",{className:n.right,children:[f.jsx(b.PinnedPluginList,{belongToFilter:"pinnedmenu"}),f.jsx(b.CurrentUser,{})]})]})}),f.jsx(mt.Outlet,{})]})})},Qt=()=>Jt()?f.jsx(b.AdminProvider,{children:f.jsx(Yt,{})}):f.jsx($t,{});function $t(){const{pathname:n,search:o}=L.useLocation(),i=`?redirect=${n}${o}`;return f.jsx(L.Navigate,{replace:!0,to:`/signin${i}`})}function Gt(){const n=L.useParams();return f.jsx(b.RemoteSchemaComponent,{uid:n.name})}const Wt=()=>{var t;const{dn:n}=b.useDesignable(),{t:o}=b.useTranslation(),i=Q.useFieldSchema(),{title:r}=b.useSchemaToolbar();return{title:o("Enable Share page"),checked:(t=i["x-component-props"])==null?void 0:t.enableSharePage,onChange(e){i["x-component-props"]=i["x-component-props"]||{},i["x-component-props"].enableSharePage=e,i["x-extend-components"]=Ne(ve({},i["x-extend-components"]),{ShareButton:{name:"ShareButton",component:"ShareButton"}}),i.title||(i.title=r),n.emit("patch",{schema:{"x-uid":i["x-uid"],"x-component-props":i["x-component-props"],"x-extend-components":i["x-extend-components"],title:i.title}}),n.refresh()}}},Zt=({fieldSchema:n})=>{var t;const{t:o}=b.useTranslation(),{title:i}=b.useSchemaToolbar(),{dn:r}=b.useDesignable();return f.jsx(b.SchemaSettingsSwitchItem,{checked:(t=n["x-component-props"])==null?void 0:t.enableSharePage,title:o("Enable Share page"),onChange:e=>ee(null,null,function*(){n["x-component-props"]=n["x-component-props"]||{},n["x-component-props"].enableSharePage=e,n["x-extend-components"]=Ne(ve({},n["x-extend-components"]),{sharePage:{name:"sharePage",component:"MShareModal"}}),n.title||(n.title=i),r.emit("patch",{schema:{"x-uid":n["x-uid"],"x-component-props":n["x-component-props"],"x-extend-components":n["x-extend-components"],title:n.title}}),r.refresh()})})},Xt=R.createStyles(({css:n,token:o})=>({firstmodal:n`
223
+ .ant-modal-content {
224
+ position: relative;
225
+ overflow: hidden;
226
+ border-radius: 16px;
227
+ padding: 0;
228
+ &::before,
229
+ &::after {
230
+ content: '';
231
+ position: absolute;
232
+ width: 300px;
233
+ height: 300px;
234
+ background: radial-gradient(circle, rgba(0, 149, 255, 0.11) 0%, transparent 70%);
235
+ z-index: 0;
236
+ pointer-events: none;
237
+ }
238
+
239
+ &::before {
240
+ top: -165px;
241
+ left: -10px;
242
+ }
243
+
244
+ &::after {
245
+ bottom: -160px;
246
+ right: -150px;
247
+ }
248
+ .ant-modal-header {
249
+ text-align: center;
250
+ margin-bottom: 20px;
251
+ margin-top: 30px;
252
+ .ant-modal-title {
253
+ font-size: x-large;
254
+ font-weight: 400;
255
+ }
256
+ }
257
+ .ant-modal-body {
258
+ justify-items: center;
259
+ }
260
+ }
261
+ `,secondmodal:n`
262
+ display: flex;
263
+ justify-content: center;
264
+ align-items: center;
265
+ width: 100%;
266
+ margin-top: 20px;
267
+ margin-bottom: 40px;
268
+ position: relative;
269
+ gap: 15%;
270
+ padding-left: 8%;
271
+ padding-right: 8%;
272
+ .tb-header-modal-list {
273
+ width: 50%;
274
+ gap: 10px;
275
+ display: flex;
276
+ flex-direction: column;
277
+ justify-content: center;
278
+ text-align: center;
279
+ border: 1px solid transparent;
280
+ border-color: rgba(203, 227, 254, 0.62);
281
+ box-shadow: none;
282
+ border-radius: 12px;
283
+ padding: 16px;
284
+ transition:
285
+ box-shadow 0.2s ease,
286
+ transform 0.2s ease;
287
+ z-index: 1;
288
+ position: relative;
289
+ &:hover {
290
+ border-color: rgba(0, 120, 255, 0.3);
291
+ box-shadow: 0 4px 16px rgba(0, 120, 255, 0.15);
292
+ }
293
+ &:active {
294
+ box-shadow: none;
295
+ transform: translateY(2px);
296
+ }
297
+ .anticon {
298
+ width: 100%;
299
+ display: flex;
300
+ justify-content: center;
301
+ svg {
302
+ width: 30px;
303
+ height: 30px;
304
+ }
305
+ }
306
+ .tb-header-modal-list-text {
307
+ text-align: center;
308
+ }
309
+ }
310
+ `,imageModal:n`
311
+ display: flex;
312
+ justify-content: center;
313
+ .ant-modal-content {
314
+ width: 280px;
315
+ height: 360px;
316
+ }
317
+ `})),en=()=>{const{fieldSchema:n,isHeaderEnabled:o,title:i,enabledSharePage:r}=b.usePageExtendComponentContext(),t=n==null?void 0:n["x-uid"],[e,a]=U.useState(!1),{styles:s}=Xt(),{t:l}=b.useTranslation(),{copyLink:c,imageAction:h}=ct({title:i,uid:t}),[p,d]=U.useState(!1);return f.jsxs(f.Fragment,{children:[o&&r&&f.jsx(q.Button,{icon:f.jsx(K.ShareAltOutlined,{}),onClick:()=>{d(!0)}}),!o&&r&&f.jsx("div",{style:{display:"flex",justifyContent:"end",backgroundColor:"#ffffff",paddingRight:"20px"},children:f.jsx(q.Button,{icon:f.jsx(K.ShareAltOutlined,{}),style:{border:"none"},onClick:()=>{d(!0)}})}),f.jsxs(q.Modal,{open:p,className:s.firstmodal,title:l("Share"),footer:null,width:300,onCancel:()=>{d(!1)},children:[f.jsxs("div",{className:s.secondmodal,children:[f.jsxs("div",{className:"tb-header-modal-list",onClick:c,children:[f.jsx(b.Icon,{type:"PaperClipOutlined"}),l("Copy link")]}),f.jsxs("div",{className:"tb-header-modal-list",onClick:()=>{a(!0)},children:[f.jsx(b.Icon,{type:"QrcodeOutlined"}),l("Generate QR code")]})]}),f.jsx(q.Modal,{className:s.imageModal,open:e,footer:null,onCancel:()=>{a(!1)},children:h()})]})]})};class ut extends b.Plugin{load(){return ee(this,null,function*(){this.app.addComponents({ShareButton:Kt,MEnableSharePage:Zt,MShareModal:en}),this.router.add("share",{path:"/share",Component:Qt}),this.router.add("share.page",{path:"/share/:name",Component:Gt}),this.schemaSettingsManager.addItem("MPage:Dropdown","Menablesharepage",{type:"item",useVisible(){return!L.useMatch("/share/:name")},Component:"MEnableSharePage"}),this.schemaSettingsManager.addItem("PageSettings","enablesharepage",{type:"switch",useVisible(){return!L.useMatch("/share/:name")},useComponentProps:Wt})})}}k.PluginShareClient=ut,k.default=ut,Object.defineProperties(k,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -0,0 +1 @@
1
+ export declare const MShareModal: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const MEnableSharePage: ({ fieldSchema }: {
2
+ fieldSchema: any;
3
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export declare const useModalStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ firstmodal: import("antd-style").SerializedStyles;
3
+ secondmodal: import("antd-style").SerializedStyles;
4
+ imageModal: import("antd-style").SerializedStyles;
5
+ }>;
@@ -1,6 +1,12 @@
1
1
  module.exports = {
2
- "@tachybase/client": "1.3.20",
3
- "@tachybase/actions": "1.3.20",
4
- "@tachybase/auth": "1.3.20",
5
- "@tachybase/server": "1.3.20"
2
+ "@tachybase/client": "1.3.22",
3
+ "react-router": "6.28.1",
4
+ "@tego/server": "1.3.39",
5
+ "react": "18.3.1",
6
+ "@tachybase/schema": "1.3.39",
7
+ "@ant-design/icons": "5.6.1",
8
+ "antd": "5.22.5",
9
+ "@emotion/css": "11.13.5",
10
+ "react-router-dom": "6.28.1",
11
+ "antd-style": "3.7.1"
6
12
  };
@@ -1,6 +1,14 @@
1
1
  {
2
+ "Copy QR code": "复制二维码",
3
+ "Enable Share page": "启用分享功能",
2
4
  "Guest": "访客",
3
5
  "Guest user not found.": "访客用户未找到。",
4
6
  "Not allowed to modify login information of guest user.": "不允许修改访客用户的登录信息。",
5
- "Unauthorized": "未授权"
7
+ "QR code": "二维码",
8
+ "Replicated": "已复制",
9
+ "Save Picture": "保存图片",
10
+ "Saved": "已保存",
11
+ "Scan the code to view the sharing": "扫码查看分享",
12
+ "Unauthorized": "未授权",
13
+ "page link": "页面链接"
6
14
  }
@@ -1,3 +1,3 @@
1
- import { Context, Next } from '@tachybase/actions';
1
+ import { Context, Next } from '@tego/server';
2
2
  export declare function update(ctx: Context, next: Next): Promise<void>;
3
3
  export declare function updateProfile(ctx: Context, next: Next): Promise<void>;
@@ -1,3 +1,3 @@
1
- import { Context } from '@tachybase/actions';
1
+ import { Context } from '@tego/server';
2
2
  declare function banGuestActionMiddleware(): (ctx: Context, next: any) => Promise<void>;
3
3
  export { banGuestActionMiddleware };
@@ -1,4 +1,4 @@
1
- import { Migration } from '@tachybase/server';
1
+ import { Migration } from '@tego/server';
2
2
  export default class AddGuestSpecialRoleMigration extends Migration {
3
3
  on: string;
4
4
  appVersion: string;
@@ -20,7 +20,7 @@ __export(add_guest_specialRole_exports, {
20
20
  default: () => AddGuestSpecialRoleMigration
21
21
  });
22
22
  module.exports = __toCommonJS(add_guest_specialRole_exports);
23
- var import_server = require("@tachybase/server");
23
+ var import_server = require("@tego/server");
24
24
  class AddGuestSpecialRoleMigration extends import_server.Migration {
25
25
  constructor() {
26
26
  super(...arguments);
@@ -1,4 +1,4 @@
1
- import { Plugin } from '@tachybase/server';
1
+ import { Plugin } from '@tego/server';
2
2
  export declare class PluginShareServer extends Plugin {
3
3
  beforeLoad(): Promise<void>;
4
4
  load(): Promise<void>;
@@ -31,8 +31,7 @@ __export(plugin_exports, {
31
31
  default: () => plugin_default
32
32
  });
33
33
  module.exports = __toCommonJS(plugin_exports);
34
- var import_auth = require("@tachybase/auth");
35
- var import_server = require("@tachybase/server");
34
+ var import_server = require("@tego/server");
36
35
  var actions = __toESM(require("./actions/users"));
37
36
  var import_ban_guest_action = require("./middlewares/ban-guest-action");
38
37
  class PluginShareServer extends import_server.Plugin {
@@ -60,7 +59,7 @@ class PluginShareServer extends import_server.Plugin {
60
59
  });
61
60
  }
62
61
  async load() {
63
- import_auth.BaseAuth.prototype.check = async function() {
62
+ import_server.BaseAuth.prototype.check = async function() {
64
63
  let token = this.ctx.getBearerToken();
65
64
  if (!token) {
66
65
  const user = await this.userRepository.findOne({
package/package.json CHANGED
@@ -1,26 +1,29 @@
1
1
  {
2
2
  "name": "@tachybase/plugin-action-share",
3
3
  "displayName": "Action: Share Externally",
4
- "version": "1.3.20",
4
+ "version": "1.3.22",
5
5
  "description": "Share pages with external users.",
6
6
  "keywords": [
7
7
  "Users & permissions"
8
8
  ],
9
9
  "license": "Apache-2.0",
10
10
  "main": "dist/server/index.js",
11
- "dependencies": {},
12
- "devDependencies": {},
13
- "peerDependencies": {
14
- "@tachybase/actions": "1.3.20",
15
- "@tachybase/client": "1.3.20",
16
- "@tachybase/auth": "1.3.20",
17
- "@tachybase/server": "1.3.20",
18
- "@tachybase/database": "1.3.20",
19
- "@tachybase/test": "1.3.20"
11
+ "devDependencies": {
12
+ "@ant-design/icons": "^5.6.1",
13
+ "@emotion/css": "^11.13.5",
14
+ "@tachybase/schema": "^1.3.39",
15
+ "@tachybase/test": "^1.3.39",
16
+ "@tego/client": "^1.3.39",
17
+ "@tego/server": "^1.3.39",
18
+ "antd": "5.22.5",
19
+ "antd-style": "3.7.1",
20
+ "qrcode": "^1.5.4",
21
+ "react-i18next": "15.2.0",
22
+ "react-router": "6.28.1",
23
+ "react-router-dom": "6.28.1",
24
+ "@tachybase/client": "1.3.22"
20
25
  },
21
26
  "description.zh-CN": "与外部用户分享页面。",
22
27
  "displayName.zh-CN": "动作:对外分享",
23
- "scripts": {
24
- "build": "tachybase-build --no-dts @tachybase/plugin-action-share"
25
- }
28
+ "scripts": {}
26
29
  }