@tatamicks/text 0.0.1
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/LICENSE +21 -0
- package/README.md +31 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +775 -0
- package/dist/index.mjs.map +1 -0
- package/dist/src/TextPlugin.d.ts +5 -0
- package/dist/src/TextPlugin.d.ts.map +1 -0
- package/dist/src/TextRenderer.d.ts +4 -0
- package/dist/src/TextRenderer.d.ts.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/types.d.ts +8 -0
- package/dist/src/types.d.ts.map +1 -0
- package/package.json +64 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,775 @@
|
|
|
1
|
+
import { HorizontalAlign as z, VerticalAlign as Ce, toPx as A, DEFAULT_FONT_FAMILY as mr, Select as yr, validationDefinition as br, multilineDefinition as pr, fontStyleDefinition as Rr, placeholderDefinition as Er, universalProperties as _r } from "@tatamicks/core";
|
|
2
|
+
import ke, { forwardRef as xr, useRef as Tr, useImperativeHandle as Sr, useMemo as Oe } from "react";
|
|
3
|
+
var J = { exports: {} }, Y = {};
|
|
4
|
+
/**
|
|
5
|
+
* @license React
|
|
6
|
+
* react-jsx-runtime.production.min.js
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the MIT license found in the
|
|
11
|
+
* LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
var we;
|
|
14
|
+
function Cr() {
|
|
15
|
+
if (we) return Y;
|
|
16
|
+
we = 1;
|
|
17
|
+
var a = ke, v = Symbol.for("react.element"), I = Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, P = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, j = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
+
function T(_, d, S) {
|
|
19
|
+
var g, b = {}, p = null, o = null;
|
|
20
|
+
S !== void 0 && (p = "" + S), d.key !== void 0 && (p = "" + d.key), d.ref !== void 0 && (o = d.ref);
|
|
21
|
+
for (g in d) E.call(d, g) && !j.hasOwnProperty(g) && (b[g] = d[g]);
|
|
22
|
+
if (_ && _.defaultProps) for (g in d = _.defaultProps, d) b[g] === void 0 && (b[g] = d[g]);
|
|
23
|
+
return { $$typeof: v, type: _, key: p, ref: o, props: b, _owner: P.current };
|
|
24
|
+
}
|
|
25
|
+
return Y.Fragment = I, Y.jsx = T, Y.jsxs = T, Y;
|
|
26
|
+
}
|
|
27
|
+
var L = {};
|
|
28
|
+
/**
|
|
29
|
+
* @license React
|
|
30
|
+
* react-jsx-runtime.development.js
|
|
31
|
+
*
|
|
32
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the MIT license found in the
|
|
35
|
+
* LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/
|
|
37
|
+
var Pe;
|
|
38
|
+
function Or() {
|
|
39
|
+
return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
40
|
+
var a = ke, v = Symbol.for("react.element"), I = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), P = Symbol.for("react.strict_mode"), j = Symbol.for("react.profiler"), T = Symbol.for("react.provider"), _ = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), S = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), o = Symbol.for("react.offscreen"), x = Symbol.iterator, Fe = "@@iterator";
|
|
41
|
+
function Ae(e) {
|
|
42
|
+
if (e === null || typeof e != "object")
|
|
43
|
+
return null;
|
|
44
|
+
var r = x && e[x] || e[Fe];
|
|
45
|
+
return typeof r == "function" ? r : null;
|
|
46
|
+
}
|
|
47
|
+
var k = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
48
|
+
function h(e) {
|
|
49
|
+
{
|
|
50
|
+
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
51
|
+
t[n - 1] = arguments[n];
|
|
52
|
+
Ie("error", e, t);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function Ie(e, r, t) {
|
|
56
|
+
{
|
|
57
|
+
var n = k.ReactDebugCurrentFrame, l = n.getStackAddendum();
|
|
58
|
+
l !== "" && (r += "%s", t = t.concat([l]));
|
|
59
|
+
var f = t.map(function(u) {
|
|
60
|
+
return String(u);
|
|
61
|
+
});
|
|
62
|
+
f.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, f);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
var $e = !1, We = !1, Ye = !1, Le = !1, Ve = !1, re;
|
|
66
|
+
re = Symbol.for("react.module.reference");
|
|
67
|
+
function Me(e) {
|
|
68
|
+
return !!(typeof e == "string" || typeof e == "function" || e === E || e === j || Ve || e === P || e === S || e === g || Le || e === o || $e || We || Ye || typeof e == "object" && e !== null && (e.$$typeof === p || e.$$typeof === b || e.$$typeof === T || e.$$typeof === _ || e.$$typeof === d || // This needs to include all possible module reference object
|
|
69
|
+
// types supported by any Flight configuration anywhere since
|
|
70
|
+
// we don't know which Flight build this will end up being used
|
|
71
|
+
// with.
|
|
72
|
+
e.$$typeof === re || e.getModuleId !== void 0));
|
|
73
|
+
}
|
|
74
|
+
function Ue(e, r, t) {
|
|
75
|
+
var n = e.displayName;
|
|
76
|
+
if (n)
|
|
77
|
+
return n;
|
|
78
|
+
var l = r.displayName || r.name || "";
|
|
79
|
+
return l !== "" ? t + "(" + l + ")" : t;
|
|
80
|
+
}
|
|
81
|
+
function te(e) {
|
|
82
|
+
return e.displayName || "Context";
|
|
83
|
+
}
|
|
84
|
+
function C(e) {
|
|
85
|
+
if (e == null)
|
|
86
|
+
return null;
|
|
87
|
+
if (typeof e.tag == "number" && h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
88
|
+
return e.displayName || e.name || null;
|
|
89
|
+
if (typeof e == "string")
|
|
90
|
+
return e;
|
|
91
|
+
switch (e) {
|
|
92
|
+
case E:
|
|
93
|
+
return "Fragment";
|
|
94
|
+
case I:
|
|
95
|
+
return "Portal";
|
|
96
|
+
case j:
|
|
97
|
+
return "Profiler";
|
|
98
|
+
case P:
|
|
99
|
+
return "StrictMode";
|
|
100
|
+
case S:
|
|
101
|
+
return "Suspense";
|
|
102
|
+
case g:
|
|
103
|
+
return "SuspenseList";
|
|
104
|
+
}
|
|
105
|
+
if (typeof e == "object")
|
|
106
|
+
switch (e.$$typeof) {
|
|
107
|
+
case _:
|
|
108
|
+
var r = e;
|
|
109
|
+
return te(r) + ".Consumer";
|
|
110
|
+
case T:
|
|
111
|
+
var t = e;
|
|
112
|
+
return te(t._context) + ".Provider";
|
|
113
|
+
case d:
|
|
114
|
+
return Ue(e, e.render, "ForwardRef");
|
|
115
|
+
case b:
|
|
116
|
+
var n = e.displayName || null;
|
|
117
|
+
return n !== null ? n : C(e.type) || "Memo";
|
|
118
|
+
case p: {
|
|
119
|
+
var l = e, f = l._payload, u = l._init;
|
|
120
|
+
try {
|
|
121
|
+
return C(u(f));
|
|
122
|
+
} catch {
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
var O = Object.assign, $ = 0, ne, ae, ie, oe, ue, le, fe;
|
|
130
|
+
function se() {
|
|
131
|
+
}
|
|
132
|
+
se.__reactDisabledLog = !0;
|
|
133
|
+
function Ne() {
|
|
134
|
+
{
|
|
135
|
+
if ($ === 0) {
|
|
136
|
+
ne = console.log, ae = console.info, ie = console.warn, oe = console.error, ue = console.group, le = console.groupCollapsed, fe = console.groupEnd;
|
|
137
|
+
var e = {
|
|
138
|
+
configurable: !0,
|
|
139
|
+
enumerable: !0,
|
|
140
|
+
value: se,
|
|
141
|
+
writable: !0
|
|
142
|
+
};
|
|
143
|
+
Object.defineProperties(console, {
|
|
144
|
+
info: e,
|
|
145
|
+
log: e,
|
|
146
|
+
warn: e,
|
|
147
|
+
error: e,
|
|
148
|
+
group: e,
|
|
149
|
+
groupCollapsed: e,
|
|
150
|
+
groupEnd: e
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
$++;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function ze() {
|
|
157
|
+
{
|
|
158
|
+
if ($--, $ === 0) {
|
|
159
|
+
var e = {
|
|
160
|
+
configurable: !0,
|
|
161
|
+
enumerable: !0,
|
|
162
|
+
writable: !0
|
|
163
|
+
};
|
|
164
|
+
Object.defineProperties(console, {
|
|
165
|
+
log: O({}, e, {
|
|
166
|
+
value: ne
|
|
167
|
+
}),
|
|
168
|
+
info: O({}, e, {
|
|
169
|
+
value: ae
|
|
170
|
+
}),
|
|
171
|
+
warn: O({}, e, {
|
|
172
|
+
value: ie
|
|
173
|
+
}),
|
|
174
|
+
error: O({}, e, {
|
|
175
|
+
value: oe
|
|
176
|
+
}),
|
|
177
|
+
group: O({}, e, {
|
|
178
|
+
value: ue
|
|
179
|
+
}),
|
|
180
|
+
groupCollapsed: O({}, e, {
|
|
181
|
+
value: le
|
|
182
|
+
}),
|
|
183
|
+
groupEnd: O({}, e, {
|
|
184
|
+
value: fe
|
|
185
|
+
})
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
$ < 0 && h("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
var B = k.ReactCurrentDispatcher, H;
|
|
192
|
+
function V(e, r, t) {
|
|
193
|
+
{
|
|
194
|
+
if (H === void 0)
|
|
195
|
+
try {
|
|
196
|
+
throw Error();
|
|
197
|
+
} catch (l) {
|
|
198
|
+
var n = l.stack.trim().match(/\n( *(at )?)/);
|
|
199
|
+
H = n && n[1] || "";
|
|
200
|
+
}
|
|
201
|
+
return `
|
|
202
|
+
` + H + e;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
var K = !1, M;
|
|
206
|
+
{
|
|
207
|
+
var Je = typeof WeakMap == "function" ? WeakMap : Map;
|
|
208
|
+
M = new Je();
|
|
209
|
+
}
|
|
210
|
+
function ce(e, r) {
|
|
211
|
+
if (!e || K)
|
|
212
|
+
return "";
|
|
213
|
+
{
|
|
214
|
+
var t = M.get(e);
|
|
215
|
+
if (t !== void 0)
|
|
216
|
+
return t;
|
|
217
|
+
}
|
|
218
|
+
var n;
|
|
219
|
+
K = !0;
|
|
220
|
+
var l = Error.prepareStackTrace;
|
|
221
|
+
Error.prepareStackTrace = void 0;
|
|
222
|
+
var f;
|
|
223
|
+
f = B.current, B.current = null, Ne();
|
|
224
|
+
try {
|
|
225
|
+
if (r) {
|
|
226
|
+
var u = function() {
|
|
227
|
+
throw Error();
|
|
228
|
+
};
|
|
229
|
+
if (Object.defineProperty(u.prototype, "props", {
|
|
230
|
+
set: function() {
|
|
231
|
+
throw Error();
|
|
232
|
+
}
|
|
233
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
234
|
+
try {
|
|
235
|
+
Reflect.construct(u, []);
|
|
236
|
+
} catch (y) {
|
|
237
|
+
n = y;
|
|
238
|
+
}
|
|
239
|
+
Reflect.construct(e, [], u);
|
|
240
|
+
} else {
|
|
241
|
+
try {
|
|
242
|
+
u.call();
|
|
243
|
+
} catch (y) {
|
|
244
|
+
n = y;
|
|
245
|
+
}
|
|
246
|
+
e.call(u.prototype);
|
|
247
|
+
}
|
|
248
|
+
} else {
|
|
249
|
+
try {
|
|
250
|
+
throw Error();
|
|
251
|
+
} catch (y) {
|
|
252
|
+
n = y;
|
|
253
|
+
}
|
|
254
|
+
e();
|
|
255
|
+
}
|
|
256
|
+
} catch (y) {
|
|
257
|
+
if (y && n && typeof y.stack == "string") {
|
|
258
|
+
for (var i = y.stack.split(`
|
|
259
|
+
`), m = n.stack.split(`
|
|
260
|
+
`), s = i.length - 1, c = m.length - 1; s >= 1 && c >= 0 && i[s] !== m[c]; )
|
|
261
|
+
c--;
|
|
262
|
+
for (; s >= 1 && c >= 0; s--, c--)
|
|
263
|
+
if (i[s] !== m[c]) {
|
|
264
|
+
if (s !== 1 || c !== 1)
|
|
265
|
+
do
|
|
266
|
+
if (s--, c--, c < 0 || i[s] !== m[c]) {
|
|
267
|
+
var R = `
|
|
268
|
+
` + i[s].replace(" at new ", " at ");
|
|
269
|
+
return e.displayName && R.includes("<anonymous>") && (R = R.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, R), R;
|
|
270
|
+
}
|
|
271
|
+
while (s >= 1 && c >= 0);
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
} finally {
|
|
276
|
+
K = !1, B.current = f, ze(), Error.prepareStackTrace = l;
|
|
277
|
+
}
|
|
278
|
+
var F = e ? e.displayName || e.name : "", w = F ? V(F) : "";
|
|
279
|
+
return typeof e == "function" && M.set(e, w), w;
|
|
280
|
+
}
|
|
281
|
+
function qe(e, r, t) {
|
|
282
|
+
return ce(e, !1);
|
|
283
|
+
}
|
|
284
|
+
function Be(e) {
|
|
285
|
+
var r = e.prototype;
|
|
286
|
+
return !!(r && r.isReactComponent);
|
|
287
|
+
}
|
|
288
|
+
function U(e, r, t) {
|
|
289
|
+
if (e == null)
|
|
290
|
+
return "";
|
|
291
|
+
if (typeof e == "function")
|
|
292
|
+
return ce(e, Be(e));
|
|
293
|
+
if (typeof e == "string")
|
|
294
|
+
return V(e);
|
|
295
|
+
switch (e) {
|
|
296
|
+
case S:
|
|
297
|
+
return V("Suspense");
|
|
298
|
+
case g:
|
|
299
|
+
return V("SuspenseList");
|
|
300
|
+
}
|
|
301
|
+
if (typeof e == "object")
|
|
302
|
+
switch (e.$$typeof) {
|
|
303
|
+
case d:
|
|
304
|
+
return qe(e.render);
|
|
305
|
+
case b:
|
|
306
|
+
return U(e.type, r, t);
|
|
307
|
+
case p: {
|
|
308
|
+
var n = e, l = n._payload, f = n._init;
|
|
309
|
+
try {
|
|
310
|
+
return U(f(l), r, t);
|
|
311
|
+
} catch {
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return "";
|
|
316
|
+
}
|
|
317
|
+
var W = Object.prototype.hasOwnProperty, de = {}, ve = k.ReactDebugCurrentFrame;
|
|
318
|
+
function N(e) {
|
|
319
|
+
if (e) {
|
|
320
|
+
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
|
|
321
|
+
ve.setExtraStackFrame(t);
|
|
322
|
+
} else
|
|
323
|
+
ve.setExtraStackFrame(null);
|
|
324
|
+
}
|
|
325
|
+
function He(e, r, t, n, l) {
|
|
326
|
+
{
|
|
327
|
+
var f = Function.call.bind(W);
|
|
328
|
+
for (var u in e)
|
|
329
|
+
if (f(e, u)) {
|
|
330
|
+
var i = void 0;
|
|
331
|
+
try {
|
|
332
|
+
if (typeof e[u] != "function") {
|
|
333
|
+
var m = Error((n || "React class") + ": " + t + " type `" + u + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[u] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
334
|
+
throw m.name = "Invariant Violation", m;
|
|
335
|
+
}
|
|
336
|
+
i = e[u](r, u, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
337
|
+
} catch (s) {
|
|
338
|
+
i = s;
|
|
339
|
+
}
|
|
340
|
+
i && !(i instanceof Error) && (N(l), h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, u, typeof i), N(null)), i instanceof Error && !(i.message in de) && (de[i.message] = !0, N(l), h("Failed %s type: %s", t, i.message), N(null));
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
var Ke = Array.isArray;
|
|
345
|
+
function G(e) {
|
|
346
|
+
return Ke(e);
|
|
347
|
+
}
|
|
348
|
+
function Ge(e) {
|
|
349
|
+
{
|
|
350
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
351
|
+
return t;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
function Xe(e) {
|
|
355
|
+
try {
|
|
356
|
+
return ge(e), !1;
|
|
357
|
+
} catch {
|
|
358
|
+
return !0;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
function ge(e) {
|
|
362
|
+
return "" + e;
|
|
363
|
+
}
|
|
364
|
+
function he(e) {
|
|
365
|
+
if (Xe(e))
|
|
366
|
+
return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ge(e)), ge(e);
|
|
367
|
+
}
|
|
368
|
+
var me = k.ReactCurrentOwner, Ze = {
|
|
369
|
+
key: !0,
|
|
370
|
+
ref: !0,
|
|
371
|
+
__self: !0,
|
|
372
|
+
__source: !0
|
|
373
|
+
}, ye, be;
|
|
374
|
+
function Qe(e) {
|
|
375
|
+
if (W.call(e, "ref")) {
|
|
376
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
377
|
+
if (r && r.isReactWarning)
|
|
378
|
+
return !1;
|
|
379
|
+
}
|
|
380
|
+
return e.ref !== void 0;
|
|
381
|
+
}
|
|
382
|
+
function er(e) {
|
|
383
|
+
if (W.call(e, "key")) {
|
|
384
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
385
|
+
if (r && r.isReactWarning)
|
|
386
|
+
return !1;
|
|
387
|
+
}
|
|
388
|
+
return e.key !== void 0;
|
|
389
|
+
}
|
|
390
|
+
function rr(e, r) {
|
|
391
|
+
typeof e.ref == "string" && me.current;
|
|
392
|
+
}
|
|
393
|
+
function tr(e, r) {
|
|
394
|
+
{
|
|
395
|
+
var t = function() {
|
|
396
|
+
ye || (ye = !0, h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
397
|
+
};
|
|
398
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
399
|
+
get: t,
|
|
400
|
+
configurable: !0
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
function nr(e, r) {
|
|
405
|
+
{
|
|
406
|
+
var t = function() {
|
|
407
|
+
be || (be = !0, h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
408
|
+
};
|
|
409
|
+
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
410
|
+
get: t,
|
|
411
|
+
configurable: !0
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
var ar = function(e, r, t, n, l, f, u) {
|
|
416
|
+
var i = {
|
|
417
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
418
|
+
$$typeof: v,
|
|
419
|
+
// Built-in properties that belong on the element
|
|
420
|
+
type: e,
|
|
421
|
+
key: r,
|
|
422
|
+
ref: t,
|
|
423
|
+
props: u,
|
|
424
|
+
// Record the component responsible for creating this element.
|
|
425
|
+
_owner: f
|
|
426
|
+
};
|
|
427
|
+
return i._store = {}, Object.defineProperty(i._store, "validated", {
|
|
428
|
+
configurable: !1,
|
|
429
|
+
enumerable: !1,
|
|
430
|
+
writable: !0,
|
|
431
|
+
value: !1
|
|
432
|
+
}), Object.defineProperty(i, "_self", {
|
|
433
|
+
configurable: !1,
|
|
434
|
+
enumerable: !1,
|
|
435
|
+
writable: !1,
|
|
436
|
+
value: n
|
|
437
|
+
}), Object.defineProperty(i, "_source", {
|
|
438
|
+
configurable: !1,
|
|
439
|
+
enumerable: !1,
|
|
440
|
+
writable: !1,
|
|
441
|
+
value: l
|
|
442
|
+
}), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
|
|
443
|
+
};
|
|
444
|
+
function ir(e, r, t, n, l) {
|
|
445
|
+
{
|
|
446
|
+
var f, u = {}, i = null, m = null;
|
|
447
|
+
t !== void 0 && (he(t), i = "" + t), er(r) && (he(r.key), i = "" + r.key), Qe(r) && (m = r.ref, rr(r, l));
|
|
448
|
+
for (f in r)
|
|
449
|
+
W.call(r, f) && !Ze.hasOwnProperty(f) && (u[f] = r[f]);
|
|
450
|
+
if (e && e.defaultProps) {
|
|
451
|
+
var s = e.defaultProps;
|
|
452
|
+
for (f in s)
|
|
453
|
+
u[f] === void 0 && (u[f] = s[f]);
|
|
454
|
+
}
|
|
455
|
+
if (i || m) {
|
|
456
|
+
var c = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
457
|
+
i && tr(u, c), m && nr(u, c);
|
|
458
|
+
}
|
|
459
|
+
return ar(e, i, m, l, n, me.current, u);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
var X = k.ReactCurrentOwner, pe = k.ReactDebugCurrentFrame;
|
|
463
|
+
function D(e) {
|
|
464
|
+
if (e) {
|
|
465
|
+
var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
|
|
466
|
+
pe.setExtraStackFrame(t);
|
|
467
|
+
} else
|
|
468
|
+
pe.setExtraStackFrame(null);
|
|
469
|
+
}
|
|
470
|
+
var Z;
|
|
471
|
+
Z = !1;
|
|
472
|
+
function Q(e) {
|
|
473
|
+
return typeof e == "object" && e !== null && e.$$typeof === v;
|
|
474
|
+
}
|
|
475
|
+
function Re() {
|
|
476
|
+
{
|
|
477
|
+
if (X.current) {
|
|
478
|
+
var e = C(X.current.type);
|
|
479
|
+
if (e)
|
|
480
|
+
return `
|
|
481
|
+
|
|
482
|
+
Check the render method of \`` + e + "`.";
|
|
483
|
+
}
|
|
484
|
+
return "";
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
function or(e) {
|
|
488
|
+
return "";
|
|
489
|
+
}
|
|
490
|
+
var Ee = {};
|
|
491
|
+
function ur(e) {
|
|
492
|
+
{
|
|
493
|
+
var r = Re();
|
|
494
|
+
if (!r) {
|
|
495
|
+
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
496
|
+
t && (r = `
|
|
497
|
+
|
|
498
|
+
Check the top-level render call using <` + t + ">.");
|
|
499
|
+
}
|
|
500
|
+
return r;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
function _e(e, r) {
|
|
504
|
+
{
|
|
505
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
506
|
+
return;
|
|
507
|
+
e._store.validated = !0;
|
|
508
|
+
var t = ur(r);
|
|
509
|
+
if (Ee[t])
|
|
510
|
+
return;
|
|
511
|
+
Ee[t] = !0;
|
|
512
|
+
var n = "";
|
|
513
|
+
e && e._owner && e._owner !== X.current && (n = " It was passed a child from " + C(e._owner.type) + "."), D(e), h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), D(null);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
function xe(e, r) {
|
|
517
|
+
{
|
|
518
|
+
if (typeof e != "object")
|
|
519
|
+
return;
|
|
520
|
+
if (G(e))
|
|
521
|
+
for (var t = 0; t < e.length; t++) {
|
|
522
|
+
var n = e[t];
|
|
523
|
+
Q(n) && _e(n, r);
|
|
524
|
+
}
|
|
525
|
+
else if (Q(e))
|
|
526
|
+
e._store && (e._store.validated = !0);
|
|
527
|
+
else if (e) {
|
|
528
|
+
var l = Ae(e);
|
|
529
|
+
if (typeof l == "function" && l !== e.entries)
|
|
530
|
+
for (var f = l.call(e), u; !(u = f.next()).done; )
|
|
531
|
+
Q(u.value) && _e(u.value, r);
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
function lr(e) {
|
|
536
|
+
{
|
|
537
|
+
var r = e.type;
|
|
538
|
+
if (r == null || typeof r == "string")
|
|
539
|
+
return;
|
|
540
|
+
var t;
|
|
541
|
+
if (typeof r == "function")
|
|
542
|
+
t = r.propTypes;
|
|
543
|
+
else if (typeof r == "object" && (r.$$typeof === d || // Note: Memo only checks outer props here.
|
|
544
|
+
// Inner props are checked in the reconciler.
|
|
545
|
+
r.$$typeof === b))
|
|
546
|
+
t = r.propTypes;
|
|
547
|
+
else
|
|
548
|
+
return;
|
|
549
|
+
if (t) {
|
|
550
|
+
var n = C(r);
|
|
551
|
+
He(t, e.props, "prop", n, e);
|
|
552
|
+
} else if (r.PropTypes !== void 0 && !Z) {
|
|
553
|
+
Z = !0;
|
|
554
|
+
var l = C(r);
|
|
555
|
+
h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", l || "Unknown");
|
|
556
|
+
}
|
|
557
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
function fr(e) {
|
|
561
|
+
{
|
|
562
|
+
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
563
|
+
var n = r[t];
|
|
564
|
+
if (n !== "children" && n !== "key") {
|
|
565
|
+
D(e), h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), D(null);
|
|
566
|
+
break;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
e.ref !== null && (D(e), h("Invalid attribute `ref` supplied to `React.Fragment`."), D(null));
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
var Te = {};
|
|
573
|
+
function Se(e, r, t, n, l, f) {
|
|
574
|
+
{
|
|
575
|
+
var u = Me(e);
|
|
576
|
+
if (!u) {
|
|
577
|
+
var i = "";
|
|
578
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
579
|
+
var m = or();
|
|
580
|
+
m ? i += m : i += Re();
|
|
581
|
+
var s;
|
|
582
|
+
e === null ? s = "null" : G(e) ? s = "array" : e !== void 0 && e.$$typeof === v ? (s = "<" + (C(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : s = typeof e, h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", s, i);
|
|
583
|
+
}
|
|
584
|
+
var c = ir(e, r, t, l, f);
|
|
585
|
+
if (c == null)
|
|
586
|
+
return c;
|
|
587
|
+
if (u) {
|
|
588
|
+
var R = r.children;
|
|
589
|
+
if (R !== void 0)
|
|
590
|
+
if (n)
|
|
591
|
+
if (G(R)) {
|
|
592
|
+
for (var F = 0; F < R.length; F++)
|
|
593
|
+
xe(R[F], e);
|
|
594
|
+
Object.freeze && Object.freeze(R);
|
|
595
|
+
} else
|
|
596
|
+
h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
597
|
+
else
|
|
598
|
+
xe(R, e);
|
|
599
|
+
}
|
|
600
|
+
if (W.call(r, "key")) {
|
|
601
|
+
var w = C(e), y = Object.keys(r).filter(function(hr) {
|
|
602
|
+
return hr !== "key";
|
|
603
|
+
}), ee = y.length > 0 ? "{key: someKey, " + y.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
604
|
+
if (!Te[w + ee]) {
|
|
605
|
+
var gr = y.length > 0 ? "{" + y.join(": ..., ") + ": ...}" : "{}";
|
|
606
|
+
h(`A props object containing a "key" prop is being spread into JSX:
|
|
607
|
+
let props = %s;
|
|
608
|
+
<%s {...props} />
|
|
609
|
+
React keys must be passed directly to JSX without using spread:
|
|
610
|
+
let props = %s;
|
|
611
|
+
<%s key={someKey} {...props} />`, ee, w, gr, w), Te[w + ee] = !0;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
return e === E ? fr(c) : lr(c), c;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
function sr(e, r, t) {
|
|
618
|
+
return Se(e, r, t, !0);
|
|
619
|
+
}
|
|
620
|
+
function cr(e, r, t) {
|
|
621
|
+
return Se(e, r, t, !1);
|
|
622
|
+
}
|
|
623
|
+
var dr = cr, vr = sr;
|
|
624
|
+
L.Fragment = E, L.jsx = dr, L.jsxs = vr;
|
|
625
|
+
})()), L;
|
|
626
|
+
}
|
|
627
|
+
var je;
|
|
628
|
+
function wr() {
|
|
629
|
+
return je || (je = 1, process.env.NODE_ENV === "production" ? J.exports = Cr() : J.exports = Or()), J.exports;
|
|
630
|
+
}
|
|
631
|
+
var q = wr();
|
|
632
|
+
const De = xr(({ props: a, value: v, onChange: I, onBlur: E, readOnly: P }, j) => {
|
|
633
|
+
const T = Tr(null);
|
|
634
|
+
Sr(
|
|
635
|
+
j,
|
|
636
|
+
() => ({
|
|
637
|
+
focus: () => {
|
|
638
|
+
var o;
|
|
639
|
+
(o = T.current) == null || o.focus();
|
|
640
|
+
}
|
|
641
|
+
}),
|
|
642
|
+
[]
|
|
643
|
+
);
|
|
644
|
+
const _ = Oe(() => {
|
|
645
|
+
const o = {
|
|
646
|
+
width: "100%",
|
|
647
|
+
height: "100%",
|
|
648
|
+
display: "flex",
|
|
649
|
+
// ★ Flexboxを使用
|
|
650
|
+
boxSizing: "border-box",
|
|
651
|
+
overflow: "hidden"
|
|
652
|
+
// コンテンツが溢れないように
|
|
653
|
+
};
|
|
654
|
+
switch (a.justifyContent) {
|
|
655
|
+
case z.center:
|
|
656
|
+
o.justifyContent = "center";
|
|
657
|
+
break;
|
|
658
|
+
case z.right:
|
|
659
|
+
o.justifyContent = "flex-end";
|
|
660
|
+
break;
|
|
661
|
+
default:
|
|
662
|
+
o.justifyContent = "flex-start";
|
|
663
|
+
break;
|
|
664
|
+
}
|
|
665
|
+
switch (a.alignItems) {
|
|
666
|
+
case Ce.top:
|
|
667
|
+
o.alignItems = "flex-start";
|
|
668
|
+
break;
|
|
669
|
+
case Ce.bottom:
|
|
670
|
+
o.alignItems = "flex-end";
|
|
671
|
+
break;
|
|
672
|
+
default:
|
|
673
|
+
o.alignItems = "center";
|
|
674
|
+
break;
|
|
675
|
+
}
|
|
676
|
+
if (a.isIndividual)
|
|
677
|
+
a.top && (o.paddingTop = A.fromDim(a.top)), a.right && (o.paddingRight = A.fromDim(a.right)), a.bottom && (o.paddingBottom = A.fromDim(a.bottom)), a.left && (o.paddingLeft = A.fromDim(a.left));
|
|
678
|
+
else if (a.all) {
|
|
679
|
+
const x = A.fromDim(a.all);
|
|
680
|
+
o.padding = `${x}px`;
|
|
681
|
+
}
|
|
682
|
+
return o;
|
|
683
|
+
}, [a]), d = Oe(() => {
|
|
684
|
+
const o = {
|
|
685
|
+
background: "transparent",
|
|
686
|
+
border: "none",
|
|
687
|
+
outline: "none",
|
|
688
|
+
resize: "none",
|
|
689
|
+
padding: 0,
|
|
690
|
+
// Paddingはコンテナで管理するため0
|
|
691
|
+
margin: 0,
|
|
692
|
+
width: "100%",
|
|
693
|
+
// Flexアイテムとして伸長
|
|
694
|
+
height: "100%",
|
|
695
|
+
// 必要に応じて調整(Textareaなら100%でも良い)
|
|
696
|
+
boxSizing: "border-box",
|
|
697
|
+
fontFamily: "inherit",
|
|
698
|
+
// 親(設定)のフォントを継承させるか、個別指定するか
|
|
699
|
+
color: "inherit"
|
|
700
|
+
};
|
|
701
|
+
a.fontSize && (o.fontSize = `${A.fromDim(a.fontSize)}px`), a.fontFamily && (o.fontFamily = a.fontFamily), a.color && (o.color = a.color), o.fontWeight = a.fontWeight ? "bold" : "normal", o.fontStyle = a.italic ? "italic" : "normal";
|
|
702
|
+
const x = [];
|
|
703
|
+
switch (a.underline && x.push("underline"), a.lineThrough && x.push("line-through"), o.textDecoration = x.length > 0 ? x.join(" ") : "none", a.lineHeight && (o.lineHeight = a.lineHeight), a.justifyContent) {
|
|
704
|
+
case z.center:
|
|
705
|
+
o.textAlign = "center";
|
|
706
|
+
break;
|
|
707
|
+
case z.right:
|
|
708
|
+
o.textAlign = "right";
|
|
709
|
+
break;
|
|
710
|
+
default:
|
|
711
|
+
o.textAlign = "left";
|
|
712
|
+
break;
|
|
713
|
+
}
|
|
714
|
+
return o;
|
|
715
|
+
}, [a]), S = (o) => {
|
|
716
|
+
I(o.target.value);
|
|
717
|
+
}, g = () => {
|
|
718
|
+
E == null || E(v);
|
|
719
|
+
}, b = !P, p = {
|
|
720
|
+
ref: T,
|
|
721
|
+
value: v ?? "",
|
|
722
|
+
onChange: S,
|
|
723
|
+
onBlur: g,
|
|
724
|
+
style: d,
|
|
725
|
+
placeholder: a.placeholder,
|
|
726
|
+
readOnly: !b,
|
|
727
|
+
tabIndex: b ? 0 : -1
|
|
728
|
+
};
|
|
729
|
+
return a.multiline ? (p.style = {
|
|
730
|
+
...p.style,
|
|
731
|
+
height: "100%",
|
|
732
|
+
flex: 1
|
|
733
|
+
}, /* @__PURE__ */ q.jsx("div", { style: _, children: /* @__PURE__ */ q.jsx("textarea", { ...p }) })) : /* @__PURE__ */ q.jsx("div", { style: _, children: /* @__PURE__ */ q.jsx("input", { type: "text", ...p }) });
|
|
734
|
+
});
|
|
735
|
+
De.displayName = "TextRenderer";
|
|
736
|
+
function Pr(a = mr) {
|
|
737
|
+
return {
|
|
738
|
+
kind: "text",
|
|
739
|
+
meta: {
|
|
740
|
+
displayName: "テキスト",
|
|
741
|
+
description: "リッチなテキスト編集ブロック",
|
|
742
|
+
defaultSize: { w: 4, h: 2 }
|
|
743
|
+
// デフォルトサイズ
|
|
744
|
+
},
|
|
745
|
+
Renderer: De,
|
|
746
|
+
properties: {
|
|
747
|
+
..._r,
|
|
748
|
+
...Er,
|
|
749
|
+
...Rr,
|
|
750
|
+
...pr,
|
|
751
|
+
...br,
|
|
752
|
+
fontFamily: {
|
|
753
|
+
defaultValue: "sans-serif",
|
|
754
|
+
label: "フォント",
|
|
755
|
+
group: "フォント",
|
|
756
|
+
Component: yr,
|
|
757
|
+
config: {
|
|
758
|
+
placeholder: "フォントを選択",
|
|
759
|
+
options: a
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
},
|
|
763
|
+
// バリデーション (Propsの型チェックと初期化)
|
|
764
|
+
validateProps: (v) => v,
|
|
765
|
+
// 値のバリデーション
|
|
766
|
+
validateValue: (v) => typeof v == "string" ? v : typeof v == "number" ? String(v) : null
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
const Dr = Pr();
|
|
770
|
+
export {
|
|
771
|
+
Dr as TextPlugin,
|
|
772
|
+
De as TextRenderer,
|
|
773
|
+
Pr as createTextPlugin
|
|
774
|
+
};
|
|
775
|
+
//# sourceMappingURL=index.mjs.map
|