@tachybase/client 1.0.6 → 1.0.25

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.
Files changed (120) hide show
  1. package/es/application/Application.d.ts +2 -0
  2. package/es/application/Application.mjs +15 -0
  3. package/es/application/NoticesManager.d.ts +12 -3
  4. package/es/application/NoticesManager.mjs +27 -3
  5. package/es/application/TrackingManager.d.ts +13 -0
  6. package/es/application/TrackingManager.mjs +30 -0
  7. package/es/application/components/SharePage.d.ts +4 -0
  8. package/es/application/components/SharePage.mjs +113 -0
  9. package/es/application/components/ShareSchemaComponent.d.ts +1 -0
  10. package/es/application/components/ShareSchemaComponent.mjs +10 -0
  11. package/es/application/components/index.d.ts +2 -0
  12. package/es/application/components/index.mjs +2 -0
  13. package/es/built-in/admin-layout/index.d.ts +1 -0
  14. package/es/built-in/admin-layout/index.mjs +1 -0
  15. package/es/built-in/pm/PluginManager.mjs +45 -45
  16. package/es/collection-manager/interfaces/__tests__/json.mjs +2 -2
  17. package/es/collection-manager/interfaces/email.d.ts +0 -1
  18. package/es/collection-manager/interfaces/input.d.ts +0 -2
  19. package/es/collection-manager/interfaces/integer.d.ts +12 -2
  20. package/es/collection-manager/interfaces/integer.mjs +13 -1
  21. package/es/collection-manager/interfaces/number.d.ts +16 -1
  22. package/es/collection-manager/interfaces/number.mjs +22 -1
  23. package/es/collection-manager/interfaces/password.d.ts +0 -1
  24. package/es/collection-manager/interfaces/percent.d.ts +12 -1
  25. package/es/collection-manager/interfaces/percent.mjs +12 -0
  26. package/es/collection-manager/interfaces/phone.d.ts +0 -1
  27. package/es/collection-manager/interfaces/properties/index.d.ts +0 -2
  28. package/es/collection-manager/interfaces/properties/index.mjs +0 -2
  29. package/es/data-source/collection-fields-to-initializer-items/CollectionFieldsToFormInitializerItems.d.ts +3 -0
  30. package/es/data-source/collection-fields-to-initializer-items/CollectionFieldsToFormInitializerItems.mjs +67 -0
  31. package/es/data-source/collection-fields-to-initializer-items/CollectionFieldsToInitializerItems.d.ts +3 -0
  32. package/es/data-source/collection-fields-to-initializer-items/CollectionFieldsToInitializerItems.mjs +37 -0
  33. package/es/data-source/collection-fields-to-initializer-items/index.d.ts +1 -0
  34. package/es/data-source/collection-fields-to-initializer-items/index.mjs +1 -0
  35. package/es/data-source/collection-fields-to-initializer-items/items/AssociationCollectionFields.d.ts +3 -0
  36. package/es/data-source/collection-fields-to-initializer-items/items/AssociationCollectionFields.mjs +59 -0
  37. package/es/data-source/collection-fields-to-initializer-items/items/ParentCollectionFields.d.ts +3 -0
  38. package/es/data-source/collection-fields-to-initializer-items/items/ParentCollectionFields.mjs +34 -0
  39. package/es/data-source/collection-fields-to-initializer-items/items/SelfFields.d.ts +3 -0
  40. package/es/data-source/collection-fields-to-initializer-items/items/SelfFields.mjs +14 -0
  41. package/es/data-source/collection-fields-to-initializer-items/items/index.d.ts +3 -0
  42. package/es/data-source/collection-fields-to-initializer-items/items/index.mjs +7 -0
  43. package/es/data-source/collection-fields-to-initializer-items/utils/getInitializerItemsByFields.d.ts +5 -0
  44. package/es/data-source/collection-fields-to-initializer-items/utils/getInitializerItemsByFields.mjs +91 -0
  45. package/es/data-source/collection-fields-to-initializer-items/utils/index.d.ts +3 -0
  46. package/es/data-source/collection-fields-to-initializer-items/utils/index.mjs +3 -0
  47. package/es/data-source/collection-fields-to-initializer-items/utils/type.d.ts +108 -0
  48. package/es/data-source/collection-fields-to-initializer-items/utils/type.mjs +0 -0
  49. package/es/data-source/collection-fields-to-initializer-items/utils/useCollectionFieldContext.d.ts +21 -0
  50. package/es/data-source/collection-fields-to-initializer-items/utils/useCollectionFieldContext.mjs +31 -0
  51. package/es/data-source/index.d.ts +1 -0
  52. package/es/data-source/index.mjs +1 -0
  53. package/es/modules/blocks/data-blocks/form/fieldSettingsFormItem.mjs +0 -8
  54. package/es/modules/blocks/data-blocks/form/hooks/useEditFormBlockDecoratorProps.d.ts +1 -3
  55. package/es/modules/blocks/data-blocks/form/hooks/useEditFormBlockDecoratorProps.mjs +4 -1
  56. package/es/modules/fields/component/InputNumber/inputNumberComponentFieldSettings.mjs +91 -0
  57. package/es/schema-component/antd/index.d.ts +2 -0
  58. package/es/schema-component/antd/index.mjs +2 -0
  59. package/es/schema-component/antd/page/Page.Settings.mjs +33 -0
  60. package/es/schema-component/antd/page/Page.mjs +113 -18
  61. package/es/schema-component/antd/page/hooks/index.d.ts +1 -0
  62. package/es/schema-component/antd/page/hooks/index.mjs +1 -0
  63. package/es/schema-component/antd/page/hooks/useShareActions.d.ts +7 -0
  64. package/es/schema-component/antd/page/hooks/useShareActions.mjs +245 -0
  65. package/es/schema-component/antd/page/index.d.ts +1 -0
  66. package/es/schema-component/antd/page/index.mjs +1 -0
  67. package/es/schema-component/antd/page/style.d.ts +5 -0
  68. package/es/schema-component/antd/page/style.mjs +59 -2
  69. package/es/schema-component/antd/slider/index.d.ts +1 -0
  70. package/es/schema-component/antd/slider/index.mjs +1 -0
  71. package/es/schema-component/antd/slider/slider.d.ts +3 -0
  72. package/es/schema-component/antd/slider/slider.mjs +11 -0
  73. package/es/schema-component/antd/tracking-link/index.d.ts +10 -0
  74. package/es/schema-component/antd/tracking-link/index.mjs +25 -0
  75. package/es/schema-initializer/utils.d.ts +1 -0
  76. package/es/schema-initializer/utils.mjs +1 -1
  77. package/lib/application/Application.js +15 -0
  78. package/lib/application/NoticesManager.js +27 -3
  79. package/lib/application/TrackingManager.js +66 -0
  80. package/lib/application/components/SharePage.js +150 -0
  81. package/lib/application/components/ShareSchemaComponent.js +44 -0
  82. package/lib/application/components/index.js +18 -0
  83. package/lib/application/schema-initializer/hooks/index.js +2 -2
  84. package/lib/block-provider/hooks/index.js +2 -2
  85. package/lib/built-in/admin-layout/index.js +9 -0
  86. package/lib/built-in/pm/PluginManager.js +45 -45
  87. package/lib/collection-manager/interfaces/__tests__/json.js +4 -4
  88. package/lib/collection-manager/interfaces/integer.js +13 -1
  89. package/lib/collection-manager/interfaces/number.js +22 -1
  90. package/lib/collection-manager/interfaces/percent.js +12 -0
  91. package/lib/collection-manager/interfaces/properties/index.js +0 -2
  92. package/lib/data-source/collection-fields-to-initializer-items/CollectionFieldsToFormInitializerItems.js +102 -0
  93. package/lib/data-source/collection-fields-to-initializer-items/CollectionFieldsToInitializerItems.js +71 -0
  94. package/lib/data-source/collection-fields-to-initializer-items/index.js +65 -0
  95. package/lib/data-source/collection-fields-to-initializer-items/items/AssociationCollectionFields.js +93 -0
  96. package/lib/data-source/collection-fields-to-initializer-items/items/ParentCollectionFields.js +68 -0
  97. package/lib/data-source/collection-fields-to-initializer-items/items/SelfFields.js +48 -0
  98. package/lib/data-source/collection-fields-to-initializer-items/items/index.js +40 -0
  99. package/lib/data-source/collection-fields-to-initializer-items/utils/getInitializerItemsByFields.js +127 -0
  100. package/lib/data-source/collection-fields-to-initializer-items/utils/index.js +83 -0
  101. package/lib/data-source/collection-fields-to-initializer-items/utils/type.js +19 -0
  102. package/lib/data-source/collection-fields-to-initializer-items/utils/useCollectionFieldContext.js +65 -0
  103. package/lib/data-source/index.js +12 -3
  104. package/lib/locale/en_US.js +3 -0
  105. package/lib/locale/zh-CN.js +21 -0
  106. package/lib/modules/blocks/data-blocks/form/fieldSettingsFormItem.js +0 -8
  107. package/lib/modules/blocks/data-blocks/form/hooks/useEditFormBlockDecoratorProps.js +4 -1
  108. package/lib/modules/fields/component/InputNumber/inputNumberComponentFieldSettings.js +91 -0
  109. package/lib/schema-component/antd/index.js +161 -133
  110. package/lib/schema-component/antd/page/Page.Settings.js +33 -0
  111. package/lib/schema-component/antd/page/Page.js +113 -18
  112. package/lib/schema-component/antd/page/hooks/index.js +65 -0
  113. package/lib/schema-component/antd/page/hooks/useShareActions.js +293 -0
  114. package/lib/schema-component/antd/page/index.js +9 -0
  115. package/lib/schema-component/antd/page/style.js +60 -2
  116. package/lib/schema-component/antd/slider/index.js +65 -0
  117. package/lib/schema-component/antd/slider/slider.js +46 -0
  118. package/lib/schema-component/antd/tracking-link/index.js +59 -0
  119. package/lib/schema-initializer/utils.js +2 -1
  120. package/package.json +8 -7
@@ -0,0 +1,245 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
4
+ import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
5
+ import * as __WEBPACK_EXTERNAL_MODULE_qrcode__ from "qrcode";
6
+ import * as __WEBPACK_EXTERNAL_MODULE_react_i18next__ from "react-i18next";
7
+ import * as __WEBPACK_EXTERNAL_MODULE_react_router__ from "react-router";
8
+ import * as __WEBPACK_EXTERNAL_MODULE__block_provider_index_mjs__ from "../../../../block-provider/index.mjs";
9
+ import * as __WEBPACK_EXTERNAL_MODULE__index_mjs__ from "../../../index.mjs";
10
+ import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_index_mjs__ from "../../../../schema-settings/index.mjs";
11
+ const useShareActions = (param)=>{
12
+ let { title, uid } = param;
13
+ var _currentRoute_params;
14
+ const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
15
+ const isAdmin = (0, __WEBPACK_EXTERNAL_MODULE_react_router__.useMatch)('/admin/:name');
16
+ const isShare = (0, __WEBPACK_EXTERNAL_MODULE_react_router__.useMatch)('/share/:name');
17
+ const isMobile = (0, __WEBPACK_EXTERNAL_MODULE_react_router__.useMatch)('/mobile/:name');
18
+ const isMobilePage = (0, __WEBPACK_EXTERNAL_MODULE__block_provider_index_mjs__.useIsMobile)();
19
+ const currentRoute = isAdmin || isShare || isMobile;
20
+ const replaceLink = isMobilePage ? window.location.href.replace('/mobile', '/share') : window.location.href.replace('/admin', '/share');
21
+ const link = replaceLink.replace(null == currentRoute ? void 0 : null === (_currentRoute_params = currentRoute.params) || void 0 === _currentRoute_params ? void 0 : _currentRoute_params.name, uid || fieldSchema['x-uid']).replace(window.location.search || '', '');
22
+ const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
23
+ const [qrLink, setQrLink] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)();
24
+ const compile = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useCompile)();
25
+ __WEBPACK_EXTERNAL_MODULE_qrcode__["default"].toDataURL(link, {
26
+ width: 170
27
+ }, (err, url)=>{
28
+ if (err) {
29
+ console.error(err);
30
+ return;
31
+ }
32
+ if (!qrLink) setQrLink(url);
33
+ });
34
+ const copyLink = ()=>{
35
+ navigator.clipboard.writeText(link).then((res)=>{
36
+ __WEBPACK_EXTERNAL_MODULE_antd__.message.open({
37
+ type: 'success',
38
+ content: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.Fragment, {
39
+ children: [
40
+ t('Replicated'),
41
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("span", {
42
+ style: {
43
+ color: '#3279FE'
44
+ },
45
+ children: compile(title || '')
46
+ }),
47
+ t('page link')
48
+ ]
49
+ })
50
+ });
51
+ });
52
+ };
53
+ const imageAction = ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(ImageModal, {
54
+ link: qrLink,
55
+ title: title
56
+ });
57
+ return {
58
+ copyLink,
59
+ imageAction
60
+ };
61
+ };
62
+ const ImageModal = (props)=>{
63
+ const { link, title } = props;
64
+ const canvasRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)(null);
65
+ const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
66
+ const { currentUserCtx } = (0, __WEBPACK_EXTERNAL_MODULE__schema_settings_index_mjs__.useCurrentUserVariable)();
67
+ const compile = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useCompile)();
68
+ (0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
69
+ canvasContent(canvasRef, link, currentUserCtx, t);
70
+ }, []);
71
+ const saveImage = ()=>{
72
+ const canvas = canvasRef.current;
73
+ if (canvas) {
74
+ const imageData = canvas.toDataURL('image/png');
75
+ const link = document.createElement('a');
76
+ link.href = imageData;
77
+ link.download = 'Tachybase-Share.png';
78
+ link.click();
79
+ __WEBPACK_EXTERNAL_MODULE_antd__.message.open({
80
+ type: 'success',
81
+ content: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.Fragment, {
82
+ children: [
83
+ t('Saved'),
84
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("span", {
85
+ style: {
86
+ color: '#3279FE'
87
+ },
88
+ children: compile(title || '')
89
+ }),
90
+ t('QR code')
91
+ ]
92
+ })
93
+ });
94
+ }
95
+ };
96
+ const copyImage = ()=>{
97
+ const canvas = canvasRef.current;
98
+ if (canvas && navigator.clipboard) canvas.toBlob(async (blob)=>{
99
+ if (!blob) return;
100
+ try {
101
+ const item = new ClipboardItem({
102
+ 'image/png': blob
103
+ });
104
+ await navigator.clipboard.write([
105
+ item
106
+ ]);
107
+ __WEBPACK_EXTERNAL_MODULE_antd__.message.open({
108
+ type: 'success',
109
+ content: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.Fragment, {
110
+ children: [
111
+ t('Replicated'),
112
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("span", {
113
+ style: {
114
+ color: '#3279FE'
115
+ },
116
+ children: compile(title || '')
117
+ }),
118
+ t('QR code')
119
+ ]
120
+ })
121
+ });
122
+ } catch (err) {
123
+ __WEBPACK_EXTERNAL_MODULE_antd__.message.error(t('Copy failed, please try again'));
124
+ }
125
+ }, 'image/png');
126
+ };
127
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
128
+ style: {
129
+ marginTop: '23px',
130
+ display: 'flex',
131
+ flexDirection: 'column',
132
+ justifyContent: 'center',
133
+ alignItems: 'center'
134
+ },
135
+ children: [
136
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("canvas", {
137
+ ref: canvasRef,
138
+ width: 240,
139
+ height: 260,
140
+ style: {
141
+ width: '240px',
142
+ height: '260px',
143
+ pointerEvents: 'none'
144
+ }
145
+ }),
146
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
147
+ style: {
148
+ width: '100%',
149
+ display: 'flex',
150
+ justifyContent: 'space-between',
151
+ marginTop: '10px',
152
+ gap: '15px'
153
+ },
154
+ children: [
155
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Button, {
156
+ onClick: saveImage,
157
+ style: {
158
+ flex: 1
159
+ },
160
+ children: t('Save Picture')
161
+ }),
162
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Button, {
163
+ onClick: copyImage,
164
+ style: {
165
+ flex: 1
166
+ },
167
+ children: t('Copy QR code')
168
+ })
169
+ ]
170
+ })
171
+ ]
172
+ });
173
+ };
174
+ const canvasContent = (canvasRef, link, currentUserCtx, t)=>{
175
+ const canvas = canvasRef.current;
176
+ const ctx = canvas.getContext('2d');
177
+ const dpr = window.devicePixelRatio;
178
+ const { width, height } = canvas;
179
+ canvas.width = Math.round(width * dpr);
180
+ canvas.height = Math.round(height * dpr);
181
+ canvas.style.width = width + 'px';
182
+ canvas.style.height = height + 'px';
183
+ ctx.scale(dpr, dpr);
184
+ ctx.filter = 'blur(20px)';
185
+ const backgroundGradient = ctx.createLinearGradient(0, 0, canvas.width, canvas.height);
186
+ backgroundGradient.addColorStop(0, 'rgba(255, 255, 255, 1)');
187
+ backgroundGradient.addColorStop(1, 'rgba(234, 238, 246, 0.80)');
188
+ ctx.fillStyle = backgroundGradient;
189
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
190
+ const drawGlow = (x, y)=>{
191
+ const radius = 100;
192
+ const gradient = ctx.createRadialGradient(x, y, 0, x, y, radius);
193
+ gradient.addColorStop(0, 'rgba(255, 255, 255, 1)');
194
+ gradient.addColorStop(1, 'rgba(217, 238, 255, 0.216)');
195
+ ctx.fillStyle = gradient;
196
+ ctx.beginPath();
197
+ ctx.arc(x, y, radius, 0, 2 * Math.PI);
198
+ ctx.fill();
199
+ };
200
+ drawGlow(60, 30);
201
+ drawGlow(190, 280);
202
+ ctx.filter = 'none';
203
+ ctx.fillStyle = '#AAAAAA';
204
+ ctx.font = '13px Arial';
205
+ ctx.textAlign = 'center';
206
+ ctx.fillText("".concat(currentUserCtx.nickname), canvas.width / 4, 30);
207
+ const img = new Image();
208
+ img.src = link;
209
+ img.onload = ()=>{
210
+ const imgWidth = img.width;
211
+ const imgHeight = img.height;
212
+ const x = (canvas.width - imgWidth) / 8;
213
+ const y = 40;
214
+ const borderWidth = 3;
215
+ const borderRadius = 20;
216
+ ctx.beginPath();
217
+ ctx.moveTo(x + borderRadius, y);
218
+ ctx.arcTo(x + imgWidth, y, x + imgWidth, y + imgHeight, borderRadius);
219
+ ctx.arcTo(x + imgWidth, y + imgHeight, x, y + imgHeight, borderRadius);
220
+ ctx.arcTo(x, y + imgHeight, x, y, borderRadius);
221
+ ctx.arcTo(x, y, x + imgWidth, y, borderRadius);
222
+ ctx.closePath();
223
+ ctx.clip();
224
+ ctx.drawImage(img, x + borderWidth, y + borderWidth, imgWidth - 2 * borderWidth, imgHeight - 2 * borderWidth);
225
+ ctx.lineWidth = borderWidth;
226
+ ctx.strokeStyle = '#000';
227
+ ctx.beginPath();
228
+ ctx.moveTo(x + borderRadius, y);
229
+ ctx.arcTo(x + imgWidth, y, x + imgWidth, y + imgHeight, borderRadius);
230
+ ctx.arcTo(x + imgWidth, y + imgHeight, x, y + imgHeight, borderRadius);
231
+ ctx.arcTo(x, y + imgHeight, x, y, borderRadius);
232
+ ctx.arcTo(x, y, x + imgWidth, y, borderRadius);
233
+ ctx.closePath();
234
+ ctx.stroke();
235
+ };
236
+ ctx.fillStyle = '#AAAAAA';
237
+ ctx.font = '13px Arial';
238
+ ctx.textAlign = 'center';
239
+ ctx.fillText(t('Scan the code to view the sharing'), canvas.width / 4, 230);
240
+ ctx.fillStyle = 'rgba(50, 121, 254, 1)';
241
+ ctx.font = '14px Arial';
242
+ ctx.textAlign = 'center';
243
+ ctx.fillText('灵矶(Tachybase)', canvas.width / 4, 250);
244
+ };
245
+ export { useShareActions };
@@ -3,3 +3,4 @@ export * from './FixedBlock';
3
3
  export * from './PageTab.Settings';
4
4
  export * from './Page.Settings';
5
5
  export * from './FixedBlockDesignerItem';
6
+ export * from './hooks';
@@ -3,3 +3,4 @@ export * from "./FixedBlock.mjs";
3
3
  export * from "./PageTab.Settings.mjs";
4
4
  export * from "./Page.Settings.mjs";
5
5
  export * from "./FixedBlockDesignerItem.mjs";
6
+ export * from "./hooks/index.mjs";
@@ -1 +1,6 @@
1
1
  export declare const getStyles: (props?: any) => import("./../__builtins__").UseComponentStyleResult;
2
+ export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
3
+ firstmodal: import("antd-style").SerializedStyles;
4
+ secondmodal: import("antd-style").SerializedStyles;
5
+ imageModal: import("antd-style").SerializedStyles;
6
+ }>;
@@ -1,4 +1,40 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_antd_style__ from "antd-style";
1
2
  import * as __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__ from "../__builtins__/index.mjs";
3
+ function _tagged_template_literal(strings, raw) {
4
+ if (!raw) raw = strings.slice(0);
5
+ return Object.freeze(Object.defineProperties(strings, {
6
+ raw: {
7
+ value: Object.freeze(raw)
8
+ }
9
+ }));
10
+ }
11
+ function _templateObject() {
12
+ const data = _tagged_template_literal([
13
+ "\n .ant-modal-content {\n position: relative;\n overflow: hidden;\n border-radius: 16px;\n &::before,\n &::after {\n content: '';\n position: absolute;\n width: 300px;\n height: 300px;\n background: radial-gradient(circle, rgba(0, 149, 255, 0.11) 0%, transparent 70%);\n z-index: 0;\n pointer-events: none;\n }\n\n &::before {\n top: -165px;\n left: -10px;\n }\n\n &::after {\n bottom: -160px;\n right: -150px;\n }\n .ant-modal-header {\n text-align: center;\n margin-bottom: 20px;\n margin-top: 15px;\n .ant-modal-title {\n font-size: x-large;\n font-weight: 400;\n }\n }\n .ant-modal-body {\n justify-items: center;\n }\n }\n "
14
+ ]);
15
+ _templateObject = function() {
16
+ return data;
17
+ };
18
+ return data;
19
+ }
20
+ function _templateObject1() {
21
+ const data = _tagged_template_literal([
22
+ "\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n margin-top: 20px;\n margin-bottom: 40px;\n position: relative;\n gap: 20%;\n padding-left: 10%;\n padding-right: 10%;\n .tb-header-modal-list {\n width: 50%;\n gap: 10px;\n display: flex;\n flex-direction: column;\n justify-content: center;\n text-align: center;\n border: 1px solid transparent;\n border-color: rgba(203, 227, 254, 0.62);\n box-shadow: none;\n border-radius: 12px;\n padding: 16px;\n transition:\n box-shadow 0.2s ease,\n transform 0.2s ease;\n z-index: 1;\n position: relative;\n &:hover {\n border-color: rgba(0, 120, 255, 0.3);\n box-shadow: 0 4px 16px rgba(0, 120, 255, 0.15);\n }\n &:active {\n box-shadow: none;\n transform: translateY(2px);\n }\n .anticon {\n width: 100%;\n display: flex;\n justify-content: center;\n svg {\n width: 30px;\n height: 30px;\n }\n }\n .tb-header-modal-list-text {\n text-align: center;\n }\n }\n "
23
+ ]);
24
+ _templateObject1 = function() {
25
+ return data;
26
+ };
27
+ return data;
28
+ }
29
+ function _templateObject2() {
30
+ const data = _tagged_template_literal([
31
+ "\n display: flex;\n justify-content: center;\n .ant-modal-content {\n width: 280px;\n height: 360px;\n }\n "
32
+ ]);
33
+ _templateObject2 = function() {
34
+ return data;
35
+ };
36
+ return data;
37
+ }
2
38
  const getStyles = (0, __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__.genStyleHook)('tb-page', (token)=>{
3
39
  const { componentCls } = token;
4
40
  return {
@@ -46,7 +82,14 @@ const getStyles = (0, __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__.genStyleHo
46
82
  }
47
83
  },
48
84
  '.tb-page-header-wrapper': {
49
- zIndex: 10
85
+ zIndex: 10,
86
+ '.ant-page-header-heading': {
87
+ justifyContent: 'start',
88
+ '.ant-btn': {
89
+ border: 'none',
90
+ boxShadow: 'none'
91
+ }
92
+ }
50
93
  },
51
94
  '.pageHeaderCss': {
52
95
  backgroundColor: token.colorBgContainer,
@@ -126,8 +169,22 @@ const getStyles = (0, __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__.genStyleHo
126
169
  paddingBottom: 0,
127
170
  overflowX: 'hidden',
128
171
  overflowY: 'scroll'
172
+ },
173
+ '.tb-page-header-button': {
174
+ flex: 1,
175
+ paddingTop: token.paddingMD,
176
+ paddingLeft: token.paddingMD,
177
+ border: 'none'
129
178
  }
130
179
  }
131
180
  };
132
181
  });
133
- export { getStyles };
182
+ const useStyles = (0, __WEBPACK_EXTERNAL_MODULE_antd_style__.createStyles)((param)=>{
183
+ let { css, token } = param;
184
+ return {
185
+ firstmodal: css(_templateObject()),
186
+ secondmodal: css(_templateObject1()),
187
+ imageModal: css(_templateObject2())
188
+ };
189
+ });
190
+ export { getStyles, useStyles };
@@ -0,0 +1 @@
1
+ export * from './slider';
@@ -0,0 +1 @@
1
+ export * from "./slider.mjs";
@@ -0,0 +1,3 @@
1
+ type SliderProps = {};
2
+ export declare const Slider: SliderProps;
3
+ export default Slider;
@@ -0,0 +1,11 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
3
+ import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__input_number_ReadPretty_mjs__ from "../input-number/ReadPretty.mjs";
5
+ const Slider = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.connect)((props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Slider, {
6
+ ...props
7
+ }), (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.mapProps)((props)=>({
8
+ ...props
9
+ })), (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.mapReadPretty)(__WEBPACK_EXTERNAL_MODULE__input_number_ReadPretty_mjs__.ReadPretty));
10
+ const slider_rslib_entry_ = Slider;
11
+ export { Slider, slider_rslib_entry_ as default };
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ type TrackedLinkProps = {
3
+ href: string;
4
+ trackingKey?: string;
5
+ children: React.ReactNode;
6
+ target?: React.HTMLAttributeAnchorTarget;
7
+ rel?: string;
8
+ };
9
+ export declare const TrackingLink: React.FC<TrackedLinkProps>;
10
+ export {};
@@ -0,0 +1,25 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
2
+ import "react";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__application_index_mjs__ from "../../../application/index.mjs";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__user_index_mjs__ from "../../../user/index.mjs";
5
+ const TrackingLink = (param)=>{
6
+ let { href, trackingKey = 'link', children, target = '_blank', rel = 'noreferrer' } = param;
7
+ var _currentUserContext_data;
8
+ const app = (0, __WEBPACK_EXTERNAL_MODULE__application_index_mjs__.useApp)();
9
+ const currentUserContext = (0, __WEBPACK_EXTERNAL_MODULE__user_index_mjs__.useCurrentUserContext)();
10
+ const currentUser = null == currentUserContext ? void 0 : null === (_currentUserContext_data = currentUserContext.data) || void 0 === _currentUserContext_data ? void 0 : _currentUserContext_data.data;
11
+ const handleClick = ()=>{
12
+ app.trackingManager.logEvent('click', trackingKey, {
13
+ href,
14
+ UserId: null == currentUser ? void 0 : currentUser.id
15
+ });
16
+ };
17
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("a", {
18
+ href: href,
19
+ target: target,
20
+ rel: rel,
21
+ onClick: handleClick,
22
+ children: children
23
+ });
24
+ };
25
+ export { TrackingLink };
@@ -91,6 +91,7 @@ export declare const useFilterInheritsFormItemInitializerFields: (options?: any)
91
91
  [x: string]: SchemaInitializerItemType[];
92
92
  }[];
93
93
  export declare const useCustomFormItemInitializerFields: (options?: any) => SchemaInitializerItemType[];
94
+ export declare const findSchema: (schema: Schema, key: string, action: string) => any;
94
95
  export declare const useCurrentSchema: (action: string, key: string, find?: (schema: Schema, key: string, action: string) => any, rm?: (schema: any, cb: any) => any) => {
95
96
  schema: any;
96
97
  exists: boolean;
@@ -1377,4 +1377,4 @@ function useAssociationFields(param) {
1377
1377
  t
1378
1378
  ]);
1379
1379
  }
1380
- export { createDetailsBlockSchema, createFormBlockSchema, createReadPrettyFormBlockSchema, createTableBlockSchema, findTableColumn, gridRowColWrap, itemsMerge, removeGridFormItem, removeTableColumn, useAssociatedFormItemInitializerFields, useAssociatedTableColumnInitializerFields, useCollectionDataSourceItems, useCurrentSchema, useCustomFormItemInitializerFields, useFilterAssociatedFormItemInitializerFields, useFilterFormItemInitializerFields, useFilterInheritsFormItemInitializerFields, useFormItemInitializerFields, useInheritsFormItemInitializerFields, useInheritsTableColumnInitializerFields, useRecordCollectionDataSourceItems, useRemoveGridFormItem, useTableColumnInitializerFields };
1380
+ export { createDetailsBlockSchema, createFormBlockSchema, createReadPrettyFormBlockSchema, createTableBlockSchema, findSchema, findTableColumn, gridRowColWrap, itemsMerge, removeGridFormItem, removeTableColumn, useAssociatedFormItemInitializerFields, useAssociatedTableColumnInitializerFields, useCollectionDataSourceItems, useCurrentSchema, useCustomFormItemInitializerFields, useFilterAssociatedFormItemInitializerFields, useFilterFormItemInitializerFields, useFilterInheritsFormItemInitializerFields, useFormItemInitializerFields, useInheritsFormItemInitializerFields, useInheritsTableColumnInitializerFields, useRecordCollectionDataSourceItems, useRemoveGridFormItem, useTableColumnInitializerFields };
@@ -70,6 +70,7 @@ const external_schema_initializer_index_js_namespaceObject = require("./schema-i
70
70
  const components_index_js_namespaceObject = require("./schema-initializer/components/index.js");
71
71
  const external_schema_settings_index_js_namespaceObject = require("./schema-settings/index.js");
72
72
  const external_SystemSettingsManager_js_namespaceObject = require("./SystemSettingsManager.js");
73
+ const external_TrackingManager_js_namespaceObject = require("./TrackingManager.js");
73
74
  const external_UserSettingsManager_js_namespaceObject = require("./UserSettingsManager.js");
74
75
  const external_utils_index_js_namespaceObject = require("./utils/index.js");
75
76
  const globalDeps_js_namespaceObject = require("./utils/globalDeps.js");
@@ -130,6 +131,18 @@ class Application {
130
131
  path: '*',
131
132
  Component: this.components['AppNotFound']
132
133
  });
134
+ this.router.add('share', {
135
+ path: '/share',
136
+ Component: external_components_index_js_namespaceObject.SharePage
137
+ });
138
+ this.router.add('share.page', {
139
+ path: '/share/:name',
140
+ Component: external_components_index_js_namespaceObject.ShareSchemaComponent
141
+ });
142
+ this.router.add('share.notAuthorized', {
143
+ path: '/share/not-authorized',
144
+ element: null
145
+ });
133
146
  }
134
147
  getOptions() {
135
148
  return this.options;
@@ -316,6 +329,7 @@ class Application {
316
329
  _define_property(this, "schemaSettingsManager", void 0);
317
330
  _define_property(this, "dataSourceManager", void 0);
318
331
  _define_property(this, "noticeManager", void 0);
332
+ _define_property(this, "trackingManager", void 0);
319
333
  _define_property(this, "pluginContextMenu", void 0);
320
334
  _define_property(this, "AttachmentPreviewManager", void 0);
321
335
  _define_property(this, "name", void 0);
@@ -357,6 +371,7 @@ class Application {
357
371
  this.schemaInitializerManager = new external_schema_initializer_index_js_namespaceObject.SchemaInitializerManager(options.schemaInitializers, this);
358
372
  this.dataSourceManager = new DataSourceManager_js_namespaceObject.DataSourceManager(options.dataSourceManager, this);
359
373
  this.noticeManager = new external_NoticesManager_js_namespaceObject.NoticeManager(this);
374
+ this.trackingManager = new external_TrackingManager_js_namespaceObject.TrackingManager(this);
360
375
  this.addDefaultProviders();
361
376
  this.addReactRouterComponents();
362
377
  this.addProviders(options.providers || []);
@@ -77,6 +77,7 @@ var NoticesManager_rslib_entry_NoticeType = /*#__PURE__*/ function(NoticeType) {
77
77
  NoticeType["TOAST"] = "toast";
78
78
  NoticeType["NOTIFICATION"] = "notification";
79
79
  NoticeType["CUSTOM"] = "custom";
80
+ NoticeType["MODAL"] = "modal";
80
81
  return NoticeType;
81
82
  }({});
82
83
  var NoticesManager_rslib_entry_NoticeDuration = /*#__PURE__*/ function(NoticeDuration) {
@@ -110,7 +111,9 @@ const useNoticeSub = (name, handler)=>{
110
111
  };
111
112
  class NoticeManager {
112
113
  on(data) {
113
- if ("notification" === data.type) this[data.type](data.title, data.content, data.level);
114
+ if ("notification" === data.type) this.notification(data.title, data.content, data.level, data.duration);
115
+ else if ("modal" === data.type) this.modal(data.title, data.content, data.level, data.duration);
116
+ else if ("toast" === data.type) this.toast(data.content, data.level, data.duration);
114
117
  else if ("custom" === data.type) this.emitter.emit(data.eventType, data.event);
115
118
  else this[data.type](data.content, data.level);
116
119
  }
@@ -119,13 +122,34 @@ class NoticeManager {
119
122
  this.currentStatusUpdatedAt = Date.now();
120
123
  }
121
124
  toast(content, level) {
122
- external_antd_namespaceObject.message[level](content);
125
+ let duration = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 3;
126
+ external_antd_namespaceObject.message[level]({
127
+ content,
128
+ duration
129
+ });
123
130
  }
124
131
  notification(title, content, level) {
132
+ let duration = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null, placement = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 'topRight';
125
133
  external_antd_namespaceObject.notification[level]({
126
134
  message: title,
127
- description: content
135
+ description: content,
136
+ placement,
137
+ duration
138
+ });
139
+ }
140
+ modal(title, content, level) {
141
+ let duration = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : null, options = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : {};
142
+ const modal = external_antd_namespaceObject.Modal[level]({
143
+ title,
144
+ content,
145
+ destroyOnClose: true,
146
+ maskClosable: false,
147
+ ...options
128
148
  });
149
+ if (!duration) duration = 30;
150
+ setTimeout(()=>{
151
+ null == modal || modal.destroy();
152
+ }, 1000 * duration);
129
153
  }
130
154
  constructor(app){
131
155
  _define_property(this, "app", void 0);
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = function(exports1, definition) {
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = function(obj, prop) {
13
+ return Object.prototype.hasOwnProperty.call(obj, prop);
14
+ };
15
+ })();
16
+ (()=>{
17
+ __webpack_require__.r = function(exports1) {
18
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
19
+ value: 'Module'
20
+ });
21
+ Object.defineProperty(exports1, '__esModule', {
22
+ value: true
23
+ });
24
+ };
25
+ })();
26
+ var __webpack_exports__ = {};
27
+ __webpack_require__.r(__webpack_exports__);
28
+ __webpack_require__.d(__webpack_exports__, {
29
+ TrackingManager: function() {
30
+ return TrackingManager;
31
+ }
32
+ });
33
+ function _define_property(obj, key, value) {
34
+ if (key in obj) Object.defineProperty(obj, key, {
35
+ value: value,
36
+ enumerable: true,
37
+ configurable: true,
38
+ writable: true
39
+ });
40
+ else obj[key] = value;
41
+ return obj;
42
+ }
43
+ class TrackingManager {
44
+ async logEvent(type, key, values) {
45
+ const data = {
46
+ type,
47
+ key,
48
+ values
49
+ };
50
+ this.api.resource('instrumentation').create({
51
+ values: {
52
+ ...data
53
+ }
54
+ });
55
+ }
56
+ constructor(app){
57
+ _define_property(this, "app", void 0);
58
+ _define_property(this, "api", void 0);
59
+ this.app = app;
60
+ }
61
+ }
62
+ var __webpack_export_target__ = exports;
63
+ for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
64
+ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
65
+ value: true
66
+ });