@tqc-solution/design-system 0.1.73
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 +207 -0
- package/dist/assets/icon/IconAi.d.ts +3 -0
- package/dist/assets/icon/IconAlertTriangleSolid.d.ts +3 -0
- package/dist/assets/icon/IconAudio.d.ts +3 -0
- package/dist/assets/icon/IconCalendar.d.ts +3 -0
- package/dist/assets/icon/IconCaretDown.d.ts +3 -0
- package/dist/assets/icon/IconCheck.d.ts +3 -0
- package/dist/assets/icon/IconCheckCircleSolid.d.ts +3 -0
- package/dist/assets/icon/IconChevronLeft.d.ts +3 -0
- package/dist/assets/icon/IconChevronRight.d.ts +3 -0
- package/dist/assets/icon/IconCircleArrowLeftSolid.d.ts +3 -0
- package/dist/assets/icon/IconCircleArrowRightSolid.d.ts +3 -0
- package/dist/assets/icon/IconClock.d.ts +3 -0
- package/dist/assets/icon/IconClose.d.ts +3 -0
- package/dist/assets/icon/IconCloseCircleSolid.d.ts +3 -0
- package/dist/assets/icon/IconColumns.d.ts +3 -0
- package/dist/assets/icon/IconCopy.d.ts +3 -0
- package/dist/assets/icon/IconDelete.d.ts +3 -0
- package/dist/assets/icon/IconDocument.d.ts +3 -0
- package/dist/assets/icon/IconExcel.d.ts +3 -0
- package/dist/assets/icon/IconEye.d.ts +3 -0
- package/dist/assets/icon/IconEyeSlash.d.ts +3 -0
- package/dist/assets/icon/IconFile.d.ts +3 -0
- package/dist/assets/icon/IconFolder.d.ts +3 -0
- package/dist/assets/icon/IconImg.d.ts +3 -0
- package/dist/assets/icon/IconInfoSolid.d.ts +3 -0
- package/dist/assets/icon/IconPdf.d.ts +3 -0
- package/dist/assets/icon/IconPowerPoint.d.ts +3 -0
- package/dist/assets/icon/IconPts.d.ts +3 -0
- package/dist/assets/icon/IconSearch.d.ts +3 -0
- package/dist/assets/icon/IconSmallCaretRightSolid.d.ts +3 -0
- package/dist/assets/icon/IconTemplate.d.ts +3 -0
- package/dist/assets/icon/IconTxt.d.ts +3 -0
- package/dist/assets/icon/IconUpload.d.ts +3 -0
- package/dist/assets/icon/IconVideo.d.ts +3 -0
- package/dist/assets/icon/IconWord.d.ts +3 -0
- package/dist/assets/icon/IconZip.d.ts +3 -0
- package/dist/components/Alert/Alert.d.ts +13 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.d.ts +37 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Badge/Badge.d.ts +37 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +19 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/CardTable/CardTable.d.ts +87 -0
- package/dist/components/CardTable/index.d.ts +2 -0
- package/dist/components/Chart/BarChart/BarChart.d.ts +40 -0
- package/dist/components/Chart/BarChart/index.d.ts +2 -0
- package/dist/components/Chart/HorizontalBarChart/HorizontalBarChart.d.ts +32 -0
- package/dist/components/Chart/HorizontalBarChart/index.d.ts +2 -0
- package/dist/components/Chart/LineChart/LineChart.d.ts +48 -0
- package/dist/components/Chart/LineChart/index.d.ts +2 -0
- package/dist/components/Chart/MultiLineAndBarChart/MultiLineAndBarChart.d.ts +57 -0
- package/dist/components/Chart/MultiLineAndBarChart/index.d.ts +2 -0
- package/dist/components/Chart/MultilineChart/MultilineChart.d.ts +25 -0
- package/dist/components/Chart/MultilineChart/index.d.ts +2 -0
- package/dist/components/Chart/PieChart/PieChart.d.ts +20 -0
- package/dist/components/Chart/PieChart/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +21 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/DatePicker/DatePicker/DatePicker.d.ts +24 -0
- package/dist/components/DatePicker/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/DateRangePicker/DateRangePicker.d.ts +34 -0
- package/dist/components/DatePicker/DateRangePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/MonthPicker/MonthPicker.d.ts +20 -0
- package/dist/components/DatePicker/MonthPicker/index.d.ts +2 -0
- package/dist/components/DatePicker/TimePicker/TimePicker.d.ts +20 -0
- package/dist/components/DatePicker/TimePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/YearPicker/YearPicker.d.ts +20 -0
- package/dist/components/DatePicker/YearPicker/index.d.ts +2 -0
- package/dist/components/Editor/Editor.d.ts +16 -0
- package/dist/components/Editor/index.d.ts +2 -0
- package/dist/components/EditorHtml/EditorHtml.d.ts +35 -0
- package/dist/components/EditorHtml/index.d.ts +2 -0
- package/dist/components/EditorJs/EditorJs.d.ts +35 -0
- package/dist/components/EditorJs/index.d.ts +2 -0
- package/dist/components/Input/InputForm/InputForm.d.ts +42 -0
- package/dist/components/Input/InputForm/index.d.ts +2 -0
- package/dist/components/Input/InputFormSpecial/InputFormSpecial.d.ts +110 -0
- package/dist/components/Input/InputFormSpecial/index.d.ts +2 -0
- package/dist/components/Input/InputOTP/InputOTP.d.ts +29 -0
- package/dist/components/Input/InputOTP/index.d.ts +2 -0
- package/dist/components/Input/InputSearch/InputSearch.d.ts +34 -0
- package/dist/components/Input/InputSearch/index.d.ts +2 -0
- package/dist/components/InputText/InputText.d.ts +56 -0
- package/dist/components/InputText/index.d.ts +2 -0
- package/dist/components/Loading/Loading.d.ts +19 -0
- package/dist/components/Loading/index.d.ts +2 -0
- package/dist/components/Modal/Modal.d.ts +49 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/Pagination/Pagination.d.ts +24 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +21 -0
- package/dist/components/ProgressBar/index.d.ts +2 -0
- package/dist/components/RadioButton/RadioButton.d.ts +17 -0
- package/dist/components/RadioButton/index.d.ts +2 -0
- package/dist/components/Slider/Slider.d.ts +37 -0
- package/dist/components/Slider/index.d.ts +1 -0
- package/dist/components/TabBar/TabBar.d.ts +18 -0
- package/dist/components/TabBar/index.d.ts +2 -0
- package/dist/components/TabBarGroup/TabBarGroup.d.ts +32 -0
- package/dist/components/TabBarGroup/index.d.ts +2 -0
- package/dist/components/Tag/Tag.d.ts +45 -0
- package/dist/components/Tag/index.d.ts +2 -0
- package/dist/components/Toast/Toast.d.ts +9 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toggle/Toggle.d.ts +17 -0
- package/dist/components/Toggle/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +10 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/Typography/Typography.d.ts +16 -0
- package/dist/components/Typography/index.d.ts +2 -0
- package/dist/components/Upload/Upload.d.ts +49 -0
- package/dist/components/Upload/index.d.ts +2 -0
- package/dist/index-BcEf-eHA.js +228 -0
- package/dist/index-BhBGF4B7.cjs +11 -0
- package/dist/index-DU1rSsif.js +548 -0
- package/dist/index-b5gz6Ifp.cjs +1 -0
- package/dist/index.cjs.js +58 -0
- package/dist/index.d.ts +74 -0
- package/dist/index.es.js +8045 -0
- package/dist/pubfuture.css +188 -0
- package/dist/quill-CqfsVyV-.js +7529 -0
- package/dist/quill-DqFubOCp.cjs +49 -0
- package/dist/tailwind/index.d.ts +4 -0
- package/dist/tailwind/index.js +2 -0
- package/dist/tailwind/pubfuture.preset.d.ts +4 -0
- package/dist/tailwind/pubfuture.preset.js +217 -0
- package/dist/types.d.ts +6 -0
- package/package.json +100 -0
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
import T, { memo as oe, useState as F, useRef as h, useCallback as ne, useEffect as j } from "react";
|
|
2
|
+
function ae(e, t) {
|
|
3
|
+
(t == null || t > e.length) && (t = e.length);
|
|
4
|
+
for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
|
|
5
|
+
return n;
|
|
6
|
+
}
|
|
7
|
+
function Oe(e) {
|
|
8
|
+
if (Array.isArray(e)) return e;
|
|
9
|
+
}
|
|
10
|
+
function je(e, t, r) {
|
|
11
|
+
return (t = Ce(t)) in e ? Object.defineProperty(e, t, {
|
|
12
|
+
value: r,
|
|
13
|
+
enumerable: !0,
|
|
14
|
+
configurable: !0,
|
|
15
|
+
writable: !0
|
|
16
|
+
}) : e[t] = r, e;
|
|
17
|
+
}
|
|
18
|
+
function Me(e, t) {
|
|
19
|
+
var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
20
|
+
if (r != null) {
|
|
21
|
+
var n, o, i, u, l = [], s = !0, p = !1;
|
|
22
|
+
try {
|
|
23
|
+
if (i = (r = r.call(e)).next, t !== 0) for (; !(s = (n = i.call(r)).done) && (l.push(n.value), l.length !== t); s = !0) ;
|
|
24
|
+
} catch (M) {
|
|
25
|
+
p = !0, o = M;
|
|
26
|
+
} finally {
|
|
27
|
+
try {
|
|
28
|
+
if (!s && r.return != null && (u = r.return(), Object(u) !== u)) return;
|
|
29
|
+
} finally {
|
|
30
|
+
if (p) throw o;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return l;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function Pe() {
|
|
37
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
38
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
39
|
+
}
|
|
40
|
+
function ue(e, t) {
|
|
41
|
+
var r = Object.keys(e);
|
|
42
|
+
if (Object.getOwnPropertySymbols) {
|
|
43
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
44
|
+
t && (n = n.filter(function(o) {
|
|
45
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
46
|
+
})), r.push.apply(r, n);
|
|
47
|
+
}
|
|
48
|
+
return r;
|
|
49
|
+
}
|
|
50
|
+
function ce(e) {
|
|
51
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
52
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
53
|
+
t % 2 ? ue(Object(r), !0).forEach(function(n) {
|
|
54
|
+
je(e, n, r[n]);
|
|
55
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : ue(Object(r)).forEach(function(n) {
|
|
56
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return e;
|
|
60
|
+
}
|
|
61
|
+
function Se(e, t) {
|
|
62
|
+
if (e == null) return {};
|
|
63
|
+
var r, n, o = Ee(e, t);
|
|
64
|
+
if (Object.getOwnPropertySymbols) {
|
|
65
|
+
var i = Object.getOwnPropertySymbols(e);
|
|
66
|
+
for (n = 0; n < i.length; n++) r = i[n], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (o[r] = e[r]);
|
|
67
|
+
}
|
|
68
|
+
return o;
|
|
69
|
+
}
|
|
70
|
+
function Ee(e, t) {
|
|
71
|
+
if (e == null) return {};
|
|
72
|
+
var r = {};
|
|
73
|
+
for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
|
|
74
|
+
if (t.indexOf(n) !== -1) continue;
|
|
75
|
+
r[n] = e[n];
|
|
76
|
+
}
|
|
77
|
+
return r;
|
|
78
|
+
}
|
|
79
|
+
function Ie(e, t) {
|
|
80
|
+
return Oe(e) || Me(e, t) || Le(e, t) || Pe();
|
|
81
|
+
}
|
|
82
|
+
function Te(e, t) {
|
|
83
|
+
if (typeof e != "object" || !e) return e;
|
|
84
|
+
var r = e[Symbol.toPrimitive];
|
|
85
|
+
if (r !== void 0) {
|
|
86
|
+
var n = r.call(e, t);
|
|
87
|
+
if (typeof n != "object") return n;
|
|
88
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
89
|
+
}
|
|
90
|
+
return (t === "string" ? String : Number)(e);
|
|
91
|
+
}
|
|
92
|
+
function Ce(e) {
|
|
93
|
+
var t = Te(e, "string");
|
|
94
|
+
return typeof t == "symbol" ? t : t + "";
|
|
95
|
+
}
|
|
96
|
+
function Le(e, t) {
|
|
97
|
+
if (e) {
|
|
98
|
+
if (typeof e == "string") return ae(e, t);
|
|
99
|
+
var r = {}.toString.call(e).slice(8, -1);
|
|
100
|
+
return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? ae(e, t) : void 0;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
function Ae(e, t, r) {
|
|
104
|
+
return t in e ? Object.defineProperty(e, t, {
|
|
105
|
+
value: r,
|
|
106
|
+
enumerable: !0,
|
|
107
|
+
configurable: !0,
|
|
108
|
+
writable: !0
|
|
109
|
+
}) : e[t] = r, e;
|
|
110
|
+
}
|
|
111
|
+
function le(e, t) {
|
|
112
|
+
var r = Object.keys(e);
|
|
113
|
+
if (Object.getOwnPropertySymbols) {
|
|
114
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
115
|
+
t && (n = n.filter(function(o) {
|
|
116
|
+
return Object.getOwnPropertyDescriptor(e, o).enumerable;
|
|
117
|
+
})), r.push.apply(r, n);
|
|
118
|
+
}
|
|
119
|
+
return r;
|
|
120
|
+
}
|
|
121
|
+
function se(e) {
|
|
122
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
123
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
124
|
+
t % 2 ? le(Object(r), !0).forEach(function(n) {
|
|
125
|
+
Ae(e, n, r[n]);
|
|
126
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : le(Object(r)).forEach(function(n) {
|
|
127
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return e;
|
|
131
|
+
}
|
|
132
|
+
function $e() {
|
|
133
|
+
for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
|
|
134
|
+
t[r] = arguments[r];
|
|
135
|
+
return function(n) {
|
|
136
|
+
return t.reduceRight(function(o, i) {
|
|
137
|
+
return i(o);
|
|
138
|
+
}, n);
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function D(e) {
|
|
142
|
+
return function t() {
|
|
143
|
+
for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
|
|
144
|
+
o[i] = arguments[i];
|
|
145
|
+
return o.length >= e.length ? e.apply(this, o) : function() {
|
|
146
|
+
for (var u = arguments.length, l = new Array(u), s = 0; s < u; s++)
|
|
147
|
+
l[s] = arguments[s];
|
|
148
|
+
return t.apply(r, [].concat(o, l));
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
function H(e) {
|
|
153
|
+
return {}.toString.call(e).includes("Object");
|
|
154
|
+
}
|
|
155
|
+
function De(e) {
|
|
156
|
+
return !Object.keys(e).length;
|
|
157
|
+
}
|
|
158
|
+
function V(e) {
|
|
159
|
+
return typeof e == "function";
|
|
160
|
+
}
|
|
161
|
+
function Re(e, t) {
|
|
162
|
+
return Object.prototype.hasOwnProperty.call(e, t);
|
|
163
|
+
}
|
|
164
|
+
function Ve(e, t) {
|
|
165
|
+
return H(t) || S("changeType"), Object.keys(t).some(function(r) {
|
|
166
|
+
return !Re(e, r);
|
|
167
|
+
}) && S("changeField"), t;
|
|
168
|
+
}
|
|
169
|
+
function xe(e) {
|
|
170
|
+
V(e) || S("selectorType");
|
|
171
|
+
}
|
|
172
|
+
function Ne(e) {
|
|
173
|
+
V(e) || H(e) || S("handlerType"), H(e) && Object.values(e).some(function(t) {
|
|
174
|
+
return !V(t);
|
|
175
|
+
}) && S("handlersType");
|
|
176
|
+
}
|
|
177
|
+
function qe(e) {
|
|
178
|
+
e || S("initialIsRequired"), H(e) || S("initialType"), De(e) && S("initialContent");
|
|
179
|
+
}
|
|
180
|
+
function ze(e, t) {
|
|
181
|
+
throw new Error(e[t] || e.default);
|
|
182
|
+
}
|
|
183
|
+
var Ue = {
|
|
184
|
+
initialIsRequired: "initial state is required",
|
|
185
|
+
initialType: "initial state should be an object",
|
|
186
|
+
initialContent: "initial state shouldn't be an empty object",
|
|
187
|
+
handlerType: "handler should be an object or a function",
|
|
188
|
+
handlersType: "all handlers should be a functions",
|
|
189
|
+
selectorType: "selector should be a function",
|
|
190
|
+
changeType: "provided value of changes should be an object",
|
|
191
|
+
changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
|
|
192
|
+
default: "an unknown error accured in `state-local` package"
|
|
193
|
+
}, S = D(ze)(Ue), z = {
|
|
194
|
+
changes: Ve,
|
|
195
|
+
selector: xe,
|
|
196
|
+
handler: Ne,
|
|
197
|
+
initial: qe
|
|
198
|
+
};
|
|
199
|
+
function Fe(e) {
|
|
200
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
201
|
+
z.initial(e), z.handler(t);
|
|
202
|
+
var r = {
|
|
203
|
+
current: e
|
|
204
|
+
}, n = D(Ke)(r, t), o = D(We)(r), i = D(z.changes)(e), u = D(He)(r);
|
|
205
|
+
function l() {
|
|
206
|
+
var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(M) {
|
|
207
|
+
return M;
|
|
208
|
+
};
|
|
209
|
+
return z.selector(p), p(r.current);
|
|
210
|
+
}
|
|
211
|
+
function s(p) {
|
|
212
|
+
$e(n, o, i, u)(p);
|
|
213
|
+
}
|
|
214
|
+
return [l, s];
|
|
215
|
+
}
|
|
216
|
+
function He(e, t) {
|
|
217
|
+
return V(t) ? t(e.current) : t;
|
|
218
|
+
}
|
|
219
|
+
function We(e, t) {
|
|
220
|
+
return e.current = se(se({}, e.current), t), t;
|
|
221
|
+
}
|
|
222
|
+
function Ke(e, t, r) {
|
|
223
|
+
return V(t) ? t(e.current) : Object.keys(r).forEach(function(n) {
|
|
224
|
+
var o;
|
|
225
|
+
return (o = t[n]) === null || o === void 0 ? void 0 : o.call(t, e.current[n]);
|
|
226
|
+
}), r;
|
|
227
|
+
}
|
|
228
|
+
var Be = {
|
|
229
|
+
create: Fe
|
|
230
|
+
}, Ge = {
|
|
231
|
+
paths: {
|
|
232
|
+
vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
function Ye(e) {
|
|
236
|
+
return function t() {
|
|
237
|
+
for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++)
|
|
238
|
+
o[i] = arguments[i];
|
|
239
|
+
return o.length >= e.length ? e.apply(this, o) : function() {
|
|
240
|
+
for (var u = arguments.length, l = new Array(u), s = 0; s < u; s++)
|
|
241
|
+
l[s] = arguments[s];
|
|
242
|
+
return t.apply(r, [].concat(o, l));
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
function _e(e) {
|
|
247
|
+
return {}.toString.call(e).includes("Object");
|
|
248
|
+
}
|
|
249
|
+
function Je(e) {
|
|
250
|
+
return e || fe("configIsRequired"), _e(e) || fe("configType"), e.urls ? (Xe(), {
|
|
251
|
+
paths: {
|
|
252
|
+
vs: e.urls.monacoBase
|
|
253
|
+
}
|
|
254
|
+
}) : e;
|
|
255
|
+
}
|
|
256
|
+
function Xe() {
|
|
257
|
+
console.warn(de.deprecation);
|
|
258
|
+
}
|
|
259
|
+
function Ze(e, t) {
|
|
260
|
+
throw new Error(e[t] || e.default);
|
|
261
|
+
}
|
|
262
|
+
var de = {
|
|
263
|
+
configIsRequired: "the configuration object is required",
|
|
264
|
+
configType: "the configuration object should be an object",
|
|
265
|
+
default: "an unknown error accured in `@monaco-editor/loader` package",
|
|
266
|
+
deprecation: `Deprecation warning!
|
|
267
|
+
You are using deprecated way of configuration.
|
|
268
|
+
|
|
269
|
+
Instead of using
|
|
270
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
271
|
+
use
|
|
272
|
+
monaco.config({ paths: { vs: '...' } })
|
|
273
|
+
|
|
274
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
275
|
+
`
|
|
276
|
+
}, fe = Ye(Ze)(de), Qe = {
|
|
277
|
+
config: Je
|
|
278
|
+
}, ke = function() {
|
|
279
|
+
for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
|
280
|
+
r[n] = arguments[n];
|
|
281
|
+
return function(o) {
|
|
282
|
+
return r.reduceRight(function(i, u) {
|
|
283
|
+
return u(i);
|
|
284
|
+
}, o);
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
function pe(e, t) {
|
|
288
|
+
return Object.keys(t).forEach(function(r) {
|
|
289
|
+
t[r] instanceof Object && e[r] && Object.assign(t[r], pe(e[r], t[r]));
|
|
290
|
+
}), ce(ce({}, e), t);
|
|
291
|
+
}
|
|
292
|
+
var et = {
|
|
293
|
+
type: "cancelation",
|
|
294
|
+
msg: "operation is manually canceled"
|
|
295
|
+
};
|
|
296
|
+
function ee(e) {
|
|
297
|
+
var t = !1, r = new Promise(function(n, o) {
|
|
298
|
+
e.then(function(i) {
|
|
299
|
+
return t ? o(et) : n(i);
|
|
300
|
+
}), e.catch(o);
|
|
301
|
+
});
|
|
302
|
+
return r.cancel = function() {
|
|
303
|
+
return t = !0;
|
|
304
|
+
}, r;
|
|
305
|
+
}
|
|
306
|
+
var tt = ["monaco"], rt = Be.create({
|
|
307
|
+
config: Ge,
|
|
308
|
+
isInitialized: !1,
|
|
309
|
+
resolve: null,
|
|
310
|
+
reject: null,
|
|
311
|
+
monaco: null
|
|
312
|
+
}), ge = Ie(rt, 2), x = ge[0], W = ge[1];
|
|
313
|
+
function nt(e) {
|
|
314
|
+
var t = Qe.config(e), r = t.monaco, n = Se(t, tt);
|
|
315
|
+
W(function(o) {
|
|
316
|
+
return {
|
|
317
|
+
config: pe(o.config, n),
|
|
318
|
+
monaco: r
|
|
319
|
+
};
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
function ot() {
|
|
323
|
+
var e = x(function(t) {
|
|
324
|
+
var r = t.monaco, n = t.isInitialized, o = t.resolve;
|
|
325
|
+
return {
|
|
326
|
+
monaco: r,
|
|
327
|
+
isInitialized: n,
|
|
328
|
+
resolve: o
|
|
329
|
+
};
|
|
330
|
+
});
|
|
331
|
+
if (!e.isInitialized) {
|
|
332
|
+
if (W({
|
|
333
|
+
isInitialized: !0
|
|
334
|
+
}), e.monaco)
|
|
335
|
+
return e.resolve(e.monaco), ee(te);
|
|
336
|
+
if (window.monaco && window.monaco.editor)
|
|
337
|
+
return he(window.monaco), e.resolve(window.monaco), ee(te);
|
|
338
|
+
ke(it, ut)(ct);
|
|
339
|
+
}
|
|
340
|
+
return ee(te);
|
|
341
|
+
}
|
|
342
|
+
function it(e) {
|
|
343
|
+
return document.body.appendChild(e);
|
|
344
|
+
}
|
|
345
|
+
function at(e) {
|
|
346
|
+
var t = document.createElement("script");
|
|
347
|
+
return e && (t.src = e), t;
|
|
348
|
+
}
|
|
349
|
+
function ut(e) {
|
|
350
|
+
var t = x(function(n) {
|
|
351
|
+
var o = n.config, i = n.reject;
|
|
352
|
+
return {
|
|
353
|
+
config: o,
|
|
354
|
+
reject: i
|
|
355
|
+
};
|
|
356
|
+
}), r = at("".concat(t.config.paths.vs, "/loader.js"));
|
|
357
|
+
return r.onload = function() {
|
|
358
|
+
return e();
|
|
359
|
+
}, r.onerror = t.reject, r;
|
|
360
|
+
}
|
|
361
|
+
function ct() {
|
|
362
|
+
var e = x(function(r) {
|
|
363
|
+
var n = r.config, o = r.resolve, i = r.reject;
|
|
364
|
+
return {
|
|
365
|
+
config: n,
|
|
366
|
+
resolve: o,
|
|
367
|
+
reject: i
|
|
368
|
+
};
|
|
369
|
+
}), t = window.require;
|
|
370
|
+
t.config(e.config), t(["vs/editor/editor.main"], function(r) {
|
|
371
|
+
var n = r.m || r;
|
|
372
|
+
he(n), e.resolve(n);
|
|
373
|
+
}, function(r) {
|
|
374
|
+
e.reject(r);
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
function he(e) {
|
|
378
|
+
x().monaco || W({
|
|
379
|
+
monaco: e
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
function lt() {
|
|
383
|
+
return x(function(e) {
|
|
384
|
+
var t = e.monaco;
|
|
385
|
+
return t;
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
var te = new Promise(function(e, t) {
|
|
389
|
+
return W({
|
|
390
|
+
resolve: e,
|
|
391
|
+
reject: t
|
|
392
|
+
});
|
|
393
|
+
}), ve = {
|
|
394
|
+
config: nt,
|
|
395
|
+
init: ot,
|
|
396
|
+
__getMonacoInstance: lt
|
|
397
|
+
}, st = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, re = st, ft = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, dt = ft;
|
|
398
|
+
function pt({ children: e }) {
|
|
399
|
+
return T.createElement("div", { style: dt.container }, e);
|
|
400
|
+
}
|
|
401
|
+
var gt = pt, ht = gt;
|
|
402
|
+
function vt({ width: e, height: t, isEditorReady: r, loading: n, _ref: o, className: i, wrapperProps: u }) {
|
|
403
|
+
return T.createElement("section", { style: { ...re.wrapper, width: e, height: t }, ...u }, !r && T.createElement(ht, null, n), T.createElement("div", { ref: o, style: { ...re.fullWidth, ...!r && re.hide }, className: i }));
|
|
404
|
+
}
|
|
405
|
+
var mt = vt, me = oe(mt);
|
|
406
|
+
function bt(e) {
|
|
407
|
+
j(e, []);
|
|
408
|
+
}
|
|
409
|
+
var be = bt;
|
|
410
|
+
function yt(e, t, r = !0) {
|
|
411
|
+
let n = h(!0);
|
|
412
|
+
j(n.current || !r ? () => {
|
|
413
|
+
n.current = !1;
|
|
414
|
+
} : e, t);
|
|
415
|
+
}
|
|
416
|
+
var w = yt;
|
|
417
|
+
function R() {
|
|
418
|
+
}
|
|
419
|
+
function I(e, t, r, n) {
|
|
420
|
+
return wt(e, n) || Ot(e, t, r, n);
|
|
421
|
+
}
|
|
422
|
+
function wt(e, t) {
|
|
423
|
+
return e.editor.getModel(ye(e, t));
|
|
424
|
+
}
|
|
425
|
+
function Ot(e, t, r, n) {
|
|
426
|
+
return e.editor.createModel(t, r, n ? ye(e, n) : void 0);
|
|
427
|
+
}
|
|
428
|
+
function ye(e, t) {
|
|
429
|
+
return e.Uri.parse(t);
|
|
430
|
+
}
|
|
431
|
+
function jt({ original: e, modified: t, language: r, originalLanguage: n, modifiedLanguage: o, originalModelPath: i, modifiedModelPath: u, keepCurrentOriginalModel: l = !1, keepCurrentModifiedModel: s = !1, theme: p = "light", loading: M = "Loading...", options: O = {}, height: K = "100%", width: B = "100%", className: G, wrapperProps: Y = {}, beforeMount: _ = R, onMount: J = R }) {
|
|
432
|
+
let [y, C] = F(!1), [L, f] = F(!0), g = h(null), d = h(null), A = h(null), m = h(J), a = h(_), E = h(!1);
|
|
433
|
+
be(() => {
|
|
434
|
+
let c = ve.init();
|
|
435
|
+
return c.then((v) => (d.current = v) && f(!1)).catch((v) => v?.type !== "cancelation" && console.error("Monaco initialization: error:", v)), () => g.current ? $() : c.cancel();
|
|
436
|
+
}), w(() => {
|
|
437
|
+
if (g.current && d.current) {
|
|
438
|
+
let c = g.current.getOriginalEditor(), v = I(d.current, e || "", n || r || "text", i || "");
|
|
439
|
+
v !== c.getModel() && c.setModel(v);
|
|
440
|
+
}
|
|
441
|
+
}, [i], y), w(() => {
|
|
442
|
+
if (g.current && d.current) {
|
|
443
|
+
let c = g.current.getModifiedEditor(), v = I(d.current, t || "", o || r || "text", u || "");
|
|
444
|
+
v !== c.getModel() && c.setModel(v);
|
|
445
|
+
}
|
|
446
|
+
}, [u], y), w(() => {
|
|
447
|
+
let c = g.current.getModifiedEditor();
|
|
448
|
+
c.getOption(d.current.editor.EditorOption.readOnly) ? c.setValue(t || "") : t !== c.getValue() && (c.executeEdits("", [{ range: c.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 }]), c.pushUndoStop());
|
|
449
|
+
}, [t], y), w(() => {
|
|
450
|
+
g.current?.getModel()?.original.setValue(e || "");
|
|
451
|
+
}, [e], y), w(() => {
|
|
452
|
+
let { original: c, modified: v } = g.current.getModel();
|
|
453
|
+
d.current.editor.setModelLanguage(c, n || r || "text"), d.current.editor.setModelLanguage(v, o || r || "text");
|
|
454
|
+
}, [r, n, o], y), w(() => {
|
|
455
|
+
d.current?.editor.setTheme(p);
|
|
456
|
+
}, [p], y), w(() => {
|
|
457
|
+
g.current?.updateOptions(O);
|
|
458
|
+
}, [O], y);
|
|
459
|
+
let N = ne(() => {
|
|
460
|
+
if (!d.current) return;
|
|
461
|
+
a.current(d.current);
|
|
462
|
+
let c = I(d.current, e || "", n || r || "text", i || ""), v = I(d.current, t || "", o || r || "text", u || "");
|
|
463
|
+
g.current?.setModel({ original: c, modified: v });
|
|
464
|
+
}, [r, t, o, e, n, i, u]), q = ne(() => {
|
|
465
|
+
!E.current && A.current && (g.current = d.current.editor.createDiffEditor(A.current, { automaticLayout: !0, ...O }), N(), d.current?.editor.setTheme(p), C(!0), E.current = !0);
|
|
466
|
+
}, [O, p, N]);
|
|
467
|
+
j(() => {
|
|
468
|
+
y && m.current(g.current, d.current);
|
|
469
|
+
}, [y]), j(() => {
|
|
470
|
+
!L && !y && q();
|
|
471
|
+
}, [L, y, q]);
|
|
472
|
+
function $() {
|
|
473
|
+
let c = g.current?.getModel();
|
|
474
|
+
l || c?.original?.dispose(), s || c?.modified?.dispose(), g.current?.dispose();
|
|
475
|
+
}
|
|
476
|
+
return T.createElement(me, { width: B, height: K, isEditorReady: y, loading: M, _ref: A, className: G, wrapperProps: Y });
|
|
477
|
+
}
|
|
478
|
+
var Mt = jt;
|
|
479
|
+
oe(Mt);
|
|
480
|
+
function Pt(e) {
|
|
481
|
+
let t = h();
|
|
482
|
+
return j(() => {
|
|
483
|
+
t.current = e;
|
|
484
|
+
}, [e]), t.current;
|
|
485
|
+
}
|
|
486
|
+
var St = Pt, U = /* @__PURE__ */ new Map();
|
|
487
|
+
function Et({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: n, language: o, path: i, theme: u = "light", line: l, loading: s = "Loading...", options: p = {}, overrideServices: M = {}, saveViewState: O = !0, keepCurrentModel: K = !1, width: B = "100%", height: G = "100%", className: Y, wrapperProps: _ = {}, beforeMount: J = R, onMount: y = R, onChange: C, onValidate: L = R }) {
|
|
488
|
+
let [f, g] = F(!1), [d, A] = F(!0), m = h(null), a = h(null), E = h(null), N = h(y), q = h(J), $ = h(void 0), c = h(n), v = St(i), X = h(!1), Z = h(!1);
|
|
489
|
+
be(() => {
|
|
490
|
+
let b = ve.init();
|
|
491
|
+
return b.then((P) => (m.current = P) && A(!1)).catch((P) => P?.type !== "cancelation" && console.error("Monaco initialization: error:", P)), () => a.current ? we() : b.cancel();
|
|
492
|
+
}), w(() => {
|
|
493
|
+
let b = I(m.current, e || n || "", t || o || "", i || r || "");
|
|
494
|
+
b !== a.current?.getModel() && (O && U.set(v, a.current?.saveViewState()), a.current?.setModel(b), O && a.current?.restoreViewState(U.get(i)));
|
|
495
|
+
}, [i], f), w(() => {
|
|
496
|
+
a.current?.updateOptions(p);
|
|
497
|
+
}, [p], f), w(() => {
|
|
498
|
+
!a.current || n === void 0 || (a.current.getOption(m.current.editor.EditorOption.readOnly) ? a.current.setValue(n) : n !== a.current.getValue() && (Z.current = !0, a.current.executeEdits("", [{ range: a.current.getModel().getFullModelRange(), text: n, forceMoveMarkers: !0 }]), a.current.pushUndoStop(), Z.current = !1));
|
|
499
|
+
}, [n], f), w(() => {
|
|
500
|
+
let b = a.current?.getModel();
|
|
501
|
+
f && b && o && m.current?.editor.setModelLanguage(b, o);
|
|
502
|
+
}, [o, f], f), w(() => {
|
|
503
|
+
l !== void 0 && a.current?.revealLine(l);
|
|
504
|
+
}, [l], f), w(() => {
|
|
505
|
+
m.current?.editor.setTheme(u);
|
|
506
|
+
}, [u], f);
|
|
507
|
+
let ie = ne(() => {
|
|
508
|
+
if (!(!E.current || !m.current) && !X.current) {
|
|
509
|
+
q.current(m.current);
|
|
510
|
+
let b = i || r, P = I(m.current, n || e || "", t || o || "", b || "");
|
|
511
|
+
a.current = m.current?.editor.create(E.current, { model: P, automaticLayout: !0, ...p }, M), O && a.current.restoreViewState(U.get(b)), m.current.editor.setTheme(u), l !== void 0 && a.current.revealLine(l), g(!0), X.current = !0;
|
|
512
|
+
}
|
|
513
|
+
}, [e, t, r, n, o, i, p, M, O, u, l]);
|
|
514
|
+
j(() => {
|
|
515
|
+
f && N.current(a.current, m.current);
|
|
516
|
+
}, [f]), j(() => {
|
|
517
|
+
!d && !f && ie();
|
|
518
|
+
}, [d, f, ie]), c.current = n, j(() => {
|
|
519
|
+
f && C && ($.current?.dispose(), $.current = a.current?.onDidChangeModelContent((b) => {
|
|
520
|
+
Z.current || C(a.current.getValue(), b);
|
|
521
|
+
}));
|
|
522
|
+
}, [f, C]), j(() => {
|
|
523
|
+
if (f) {
|
|
524
|
+
let b = m.current.editor.onDidChangeMarkers((P) => {
|
|
525
|
+
let Q = a.current.getModel()?.uri;
|
|
526
|
+
if (Q && P.find((k) => k.path === Q.path)) {
|
|
527
|
+
let k = m.current.editor.getModelMarkers({ resource: Q });
|
|
528
|
+
L?.(k);
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
return () => {
|
|
532
|
+
b?.dispose();
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
return () => {
|
|
536
|
+
};
|
|
537
|
+
}, [f, L]);
|
|
538
|
+
function we() {
|
|
539
|
+
$.current?.dispose(), K ? O && U.set(i, a.current.saveViewState()) : a.current.getModel()?.dispose(), a.current.dispose(), a.current = null, X.current = !1, g(!1);
|
|
540
|
+
}
|
|
541
|
+
return T.createElement(me, { width: B, height: G, isEditorReady: f, loading: s, _ref: E, className: Y, wrapperProps: _ });
|
|
542
|
+
}
|
|
543
|
+
var It = Et, Tt = oe(It), Lt = Tt;
|
|
544
|
+
export {
|
|
545
|
+
Tt as Editor,
|
|
546
|
+
Lt as default,
|
|
547
|
+
ve as loader
|
|
548
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),r=require("./quill-DqFubOCp.cjs");class a extends o.Component{constructor(t){super(t),this.editingAreaRef=o.createRef(),this.containerRef=o.createRef(),this.dirtyProps=["modules","formats","bounds","theme","children"],this.cleanProps=["id","className","style","placeholder","tabIndex","onChange","onChangeSelection","onFocus","onBlur","onKeyPress","onKeyDown","onKeyUp"],this.state={generation:0},this.selection=null,this.onEditorChange=(i,n,s,h)=>{i==="text-change"?this.onEditorChangeText?.(this.editor.getSemanticHTML(),n,h,this.unprivilegedEditor):i==="selection-change"&&this.onEditorChangeSelection?.(n,h,this.unprivilegedEditor)};const e=this.isControlled()?t.value:t.defaultValue;this.value=e??""}validateProps(t){if(o.Children.count(t.children)>1)throw new Error("The Quill editing area can only be composed of a single React element.");if(o.Children.count(t.children)&&o.Children.only(t.children)?.type==="textarea")throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.");if(this.lastDeltaChangeSet&&t.value===this.lastDeltaChangeSet)throw new Error("You are passing the `delta` object from the `onChange` event back as `value`. You most probably want `editor.getContents()` instead. See: https://github.com/zenoamaro/react-quill#using-deltas")}shouldComponentUpdate(t,e){if(this.validateProps(t),!this.editor||this.state.generation!==e.generation)return!0;if("value"in t){const i=this.getEditorContents(),n=t.value??"";this.isEqualValue(n,i)||this.setEditorContents(this.editor,n)}return t.readOnly!==this.props.readOnly&&this.setEditorReadOnly(this.editor,t.readOnly),[...this.cleanProps,...this.dirtyProps].some(i=>!r.isEqual(t[i],this.props[i]))}shouldComponentRegenerate(t){return this.dirtyProps.some(e=>!r.isEqual(t[e],this.props[e]))}componentDidMount(){this.instantiateEditor(),this.setEditorContents(this.editor,this.getEditorContents())}componentWillUnmount(){this.destroyEditor()}componentDidUpdate(t,e){if(this.editor&&this.shouldComponentRegenerate(t)){const i=this.editor.getContents(),n=this.editor.getSelection();this.regenerationSnapshot={delta:i,selection:n},this.setState({generation:this.state.generation+1}),this.destroyEditor()}if(this.editor&&t.placeholder!==this.props.placeholder&&(this.editor.root.dataset.placeholder=this.props.placeholder||""),this.state.generation!==e.generation){const{delta:i,selection:n}=this.regenerationSnapshot;delete this.regenerationSnapshot,this.instantiateEditor();const s=this.editor;s.setContents(i),d(()=>this.setEditorSelection(s,n))}}instantiateEditor(){this.editor?this.hookEditor(this.editor):this.editor=this.createEditor(this.getEditingArea(),this.getEditorConfig())}destroyEditor(){if(!this.editor)return;this.unhookEditor(this.editor);const t=this.props.modules?.toolbar;if(!(typeof t=="object"&&t&&"container"in t&&typeof t.container=="string"||typeof t=="string")){const i=this.containerRef.current?.querySelector(".ql-toolbar");i&&i.remove()}delete this.editor}isControlled(){return"value"in this.props}getEditorConfig(){return{bounds:this.props.bounds,formats:this.props.formats,modules:this.props.modules,placeholder:this.props.placeholder,readOnly:this.props.readOnly,tabIndex:this.props.tabIndex,theme:this.props.theme}}getEditor(){if(!this.editor)throw new Error("Accessing non-instantiated editor");return this.editor}createEditor(t,e){const i=new r.Quill(t,e);return e.tabIndex!=null&&this.setEditorTabIndex(i,e.tabIndex),this.hookEditor(i),i}hookEditor(t){this.unprivilegedEditor=this.makeUnprivilegedEditor(t),t.on("editor-change",this.onEditorChange)}unhookEditor(t){t.off("editor-change",this.onEditorChange)}getEditorContents(){return this.value}getEditorSelection(){return this.selection}isDelta(t){return t&&t.ops}isEqualValue(t,e){return this.isDelta(t)&&this.isDelta(e)?r.isEqual(t.ops,e.ops):r.isEqual(t,e)}setEditorContents(t,e){this.value=e;const i=this.getEditorSelection();typeof e=="string"?t.setContents(t.clipboard.convert({html:e})):t.setContents(e),d(()=>this.setEditorSelection(t,i))}setEditorSelection(t,e){if(this.selection=e,e){const i=t.getLength();e.index=Math.max(0,Math.min(e.index,i-1)),e.length=Math.max(0,Math.min(e.length,i-1-e.index)),t.setSelection(e)}}setEditorTabIndex(t,e){t?.scroll?.domNode&&(t.scroll.domNode.tabIndex=e)}setEditorReadOnly(t,e){e?t.disable():t.enable()}makeUnprivilegedEditor(t){const e=t;return{getHTML:()=>e.root.innerHTML,getSemanticHTML:e.getSemanticHTML.bind(e),getLength:e.getLength.bind(e),getText:e.getText.bind(e),getContents:e.getContents.bind(e),getSelection:e.getSelection.bind(e),getBounds:e.getBounds.bind(e)}}getEditingArea(){const t=this.editingAreaRef.current;if(!t)throw new Error("Cannot find element for editing area");if(t.nodeType===3)throw new Error("Editing area cannot be a text node");return t}renderEditingArea(){const{children:t,preserveWhitespace:e}=this.props,{generation:i}=this.state,n={key:i,ref:this.editingAreaRef};return o.Children.count(t)?o.cloneElement(o.Children.only(t),n):e?o.createElement("pre",{...n}):o.createElement("div",{...n})}render(){return o.createElement("div",{ref:this.containerRef,id:this.props.id,style:this.props.style,key:this.state.generation,className:`quill ${this.props.className??""}`,onKeyPress:this.props.onKeyPress,onKeyDown:this.props.onKeyDown,onKeyUp:this.props.onKeyUp},this.renderEditingArea())}onEditorChangeText(t,e,i,n){if(!this.editor)return;const s=this.isDelta(this.value)?n.getContents():n.getSemanticHTML();s!==this.getEditorContents()&&(this.lastDeltaChangeSet=e,this.value=s,this.props.onChange?.(t,e,i,n))}onEditorChangeSelection(t,e,i){if(!this.editor)return;const n=this.getEditorSelection(),s=!n&&t,h=n&&!t;r.isEqual(t,n)||(this.selection=t,this.props.onChangeSelection?.(t,e,i),s?this.props.onFocus?.(t,e,i):h&&this.props.onBlur?.(n,e,i))}focus(){this.editor&&this.editor.focus()}blur(){this.editor&&(this.selection=null,this.editor.blur())}}a.displayName="React Quill";a.Quill=r.Quill;a.defaultProps={theme:"snow",modules:{},readOnly:!1};function d(l){Promise.resolve().then(l)}exports.Quill=r.Quill;exports.default=a;
|