@wp-playground/components 0.9.45 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,902 +1,159 @@
1
- import u, { useState as gr, useEffect as yr } from "react";
2
- import { __experimentalTreeGrid as Er, __experimentalTreeGridRow as $e, __experimentalTreeGridCell as J, Button as br, SelectControl as Rr, __experimentalInputControl as _r } from "@wordpress/components";
3
- import { forwardRef as Ie, cloneElement as wr, createElement as Pr } from "@wordpress/element";
4
- import Tr from "clsx";
5
- function Cr({
6
- icon: s,
7
- size: v = 24,
8
- ...b
9
- }, h) {
10
- return wr(s, {
11
- width: v,
12
- height: v,
13
- ...b,
14
- ref: h
15
- });
16
- }
17
- const Or = Ie(Cr);
18
- var le = { exports: {} }, Y = {};
19
- /**
20
- * @license React
21
- * react-jsx-runtime.production.min.js
22
- *
23
- * Copyright (c) Facebook, Inc. and its affiliates.
24
- *
25
- * This source code is licensed under the MIT license found in the
26
- * LICENSE file in the root directory of this source tree.
27
- */
28
- var Fe;
29
- function Sr() {
30
- if (Fe)
31
- return Y;
32
- Fe = 1;
33
- var s = u, v = Symbol.for("react.element"), b = Symbol.for("react.fragment"), h = Object.prototype.hasOwnProperty, w = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, P = { key: !0, ref: !0, __self: !0, __source: !0 };
34
- function S(d, i, g) {
35
- var f, C = {}, x = null, F = null;
36
- g !== void 0 && (x = "" + g), i.key !== void 0 && (x = "" + i.key), i.ref !== void 0 && (F = i.ref);
37
- for (f in i)
38
- h.call(i, f) && !P.hasOwnProperty(f) && (C[f] = i[f]);
39
- if (d && d.defaultProps)
40
- for (f in i = d.defaultProps, i)
41
- C[f] === void 0 && (C[f] = i[f]);
42
- return { $$typeof: v, type: d, key: x, ref: F, props: C, _owner: w.current };
43
- }
44
- return Y.Fragment = b, Y.jsx = S, Y.jsxs = S, Y;
45
- }
46
- var M = {};
47
- /**
48
- * @license React
49
- * react-jsx-runtime.development.js
50
- *
51
- * Copyright (c) Facebook, Inc. and its affiliates.
52
- *
53
- * This source code is licensed under the MIT license found in the
54
- * LICENSE file in the root directory of this source tree.
55
- */
56
- var Ae;
57
- function xr() {
58
- return Ae || (Ae = 1, process.env.NODE_ENV !== "production" && function() {
59
- var s = u, v = Symbol.for("react.element"), b = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), S = Symbol.for("react.provider"), d = Symbol.for("react.context"), i = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), x = Symbol.for("react.lazy"), F = Symbol.for("react.offscreen"), N = Symbol.iterator, X = "@@iterator";
60
- function p(e) {
61
- if (e === null || typeof e != "object")
62
- return null;
63
- var r = N && e[N] || e[X];
64
- return typeof r == "function" ? r : null;
65
- }
66
- var R = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
67
- function E(e) {
68
- {
69
- for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
70
- t[n - 1] = arguments[n];
71
- U("error", e, t);
72
- }
73
- }
74
- function U(e, r, t) {
75
- {
76
- var n = R.ReactDebugCurrentFrame, l = n.getStackAddendum();
77
- l !== "" && (r += "%s", t = t.concat([l]));
78
- var c = t.map(function(o) {
79
- return String(o);
80
- });
81
- c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
82
- }
83
- }
84
- var B = !1, H = !1, Ye = !1, Me = !1, Ve = !1, ue;
85
- ue = Symbol.for("react.module.reference");
86
- function Ne(e) {
87
- return !!(typeof e == "string" || typeof e == "function" || e === h || e === P || Ve || e === w || e === g || e === f || Me || e === F || B || H || Ye || typeof e == "object" && e !== null && (e.$$typeof === x || e.$$typeof === C || e.$$typeof === S || e.$$typeof === d || e.$$typeof === i || // This needs to include all possible module reference object
88
- // types supported by any Flight configuration anywhere since
89
- // we don't know which Flight build this will end up being used
90
- // with.
91
- e.$$typeof === ue || e.getModuleId !== void 0));
92
- }
93
- function Ue(e, r, t) {
94
- var n = e.displayName;
95
- if (n)
96
- return n;
97
- var l = r.displayName || r.name || "";
98
- return l !== "" ? t + "(" + l + ")" : t;
99
- }
100
- function ce(e) {
101
- return e.displayName || "Context";
102
- }
103
- function k(e) {
104
- if (e == null)
105
- return null;
106
- if (typeof e.tag == "number" && E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
107
- return e.displayName || e.name || null;
108
- if (typeof e == "string")
109
- return e;
110
- switch (e) {
111
- case h:
112
- return "Fragment";
113
- case b:
114
- return "Portal";
115
- case P:
116
- return "Profiler";
117
- case w:
118
- return "StrictMode";
119
- case g:
120
- return "Suspense";
121
- case f:
122
- return "SuspenseList";
123
- }
124
- if (typeof e == "object")
125
- switch (e.$$typeof) {
126
- case d:
127
- var r = e;
128
- return ce(r) + ".Consumer";
129
- case S:
130
- var t = e;
131
- return ce(t._context) + ".Provider";
132
- case i:
133
- return Ue(e, e.render, "ForwardRef");
134
- case C:
135
- var n = e.displayName || null;
136
- return n !== null ? n : k(e.type) || "Memo";
137
- case x: {
138
- var l = e, c = l._payload, o = l._init;
139
- try {
140
- return k(o(c));
141
- } catch {
142
- return null;
143
- }
144
- }
145
- }
146
- return null;
147
- }
148
- var j = Object.assign, I = 0, fe, de, pe, ve, he, me, ge;
149
- function ye() {
150
- }
151
- ye.__reactDisabledLog = !0;
152
- function Be() {
153
- {
154
- if (I === 0) {
155
- fe = console.log, de = console.info, pe = console.warn, ve = console.error, he = console.group, me = console.groupCollapsed, ge = console.groupEnd;
156
- var e = {
157
- configurable: !0,
158
- enumerable: !0,
159
- value: ye,
160
- writable: !0
161
- };
162
- Object.defineProperties(console, {
163
- info: e,
164
- log: e,
165
- warn: e,
166
- error: e,
167
- group: e,
168
- groupCollapsed: e,
169
- groupEnd: e
170
- });
171
- }
172
- I++;
173
- }
174
- }
175
- function Ge() {
176
- {
177
- if (I--, I === 0) {
178
- var e = {
179
- configurable: !0,
180
- enumerable: !0,
181
- writable: !0
182
- };
183
- Object.defineProperties(console, {
184
- log: j({}, e, {
185
- value: fe
186
- }),
187
- info: j({}, e, {
188
- value: de
189
- }),
190
- warn: j({}, e, {
191
- value: pe
192
- }),
193
- error: j({}, e, {
194
- value: ve
195
- }),
196
- group: j({}, e, {
197
- value: he
198
- }),
199
- groupCollapsed: j({}, e, {
200
- value: me
201
- }),
202
- groupEnd: j({}, e, {
203
- value: ge
204
- })
205
- });
206
- }
207
- I < 0 && E("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
208
- }
209
- }
210
- var Z = R.ReactCurrentDispatcher, Q;
211
- function G(e, r, t) {
212
- {
213
- if (Q === void 0)
214
- try {
215
- throw Error();
216
- } catch (l) {
217
- var n = l.stack.trim().match(/\n( *(at )?)/);
218
- Q = n && n[1] || "";
219
- }
220
- return `
221
- ` + Q + e;
222
- }
223
- }
224
- var ee = !1, K;
1
+ import e from "react";
2
+ const r = (t) => /* @__PURE__ */ e.createElement(
3
+ "svg",
4
+ {
5
+ width: "32",
6
+ height: "32",
7
+ viewBox: "0 0 32 32",
8
+ fill: "none",
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ ...t
11
+ },
12
+ /* @__PURE__ */ e.createElement(
13
+ "rect",
225
14
  {
226
- var Ke = typeof WeakMap == "function" ? WeakMap : Map;
227
- K = new Ke();
228
- }
229
- function Ee(e, r) {
230
- if (!e || ee)
231
- return "";
232
- {
233
- var t = K.get(e);
234
- if (t !== void 0)
235
- return t;
236
- }
237
- var n;
238
- ee = !0;
239
- var l = Error.prepareStackTrace;
240
- Error.prepareStackTrace = void 0;
241
- var c;
242
- c = Z.current, Z.current = null, Be();
243
- try {
244
- if (r) {
245
- var o = function() {
246
- throw Error();
247
- };
248
- if (Object.defineProperty(o.prototype, "props", {
249
- set: function() {
250
- throw Error();
251
- }
252
- }), typeof Reflect == "object" && Reflect.construct) {
253
- try {
254
- Reflect.construct(o, []);
255
- } catch (T) {
256
- n = T;
257
- }
258
- Reflect.construct(e, [], o);
259
- } else {
260
- try {
261
- o.call();
262
- } catch (T) {
263
- n = T;
264
- }
265
- e.call(o.prototype);
266
- }
267
- } else {
268
- try {
269
- throw Error();
270
- } catch (T) {
271
- n = T;
272
- }
273
- e();
274
- }
275
- } catch (T) {
276
- if (T && n && typeof T.stack == "string") {
277
- for (var a = T.stack.split(`
278
- `), _ = n.stack.split(`
279
- `), m = a.length - 1, y = _.length - 1; m >= 1 && y >= 0 && a[m] !== _[y]; )
280
- y--;
281
- for (; m >= 1 && y >= 0; m--, y--)
282
- if (a[m] !== _[y]) {
283
- if (m !== 1 || y !== 1)
284
- do
285
- if (m--, y--, y < 0 || a[m] !== _[y]) {
286
- var O = `
287
- ` + a[m].replace(" at new ", " at ");
288
- return e.displayName && O.includes("<anonymous>") && (O = O.replace("<anonymous>", e.displayName)), typeof e == "function" && K.set(e, O), O;
289
- }
290
- while (m >= 1 && y >= 0);
291
- break;
292
- }
293
- }
294
- } finally {
295
- ee = !1, Z.current = c, Ge(), Error.prepareStackTrace = l;
296
- }
297
- var $ = e ? e.displayName || e.name : "", D = $ ? G($) : "";
298
- return typeof e == "function" && K.set(e, D), D;
299
- }
300
- function qe(e, r, t) {
301
- return Ee(e, !1);
302
- }
303
- function ze(e) {
304
- var r = e.prototype;
305
- return !!(r && r.isReactComponent);
306
- }
307
- function q(e, r, t) {
308
- if (e == null)
309
- return "";
310
- if (typeof e == "function")
311
- return Ee(e, ze(e));
312
- if (typeof e == "string")
313
- return G(e);
314
- switch (e) {
315
- case g:
316
- return G("Suspense");
317
- case f:
318
- return G("SuspenseList");
319
- }
320
- if (typeof e == "object")
321
- switch (e.$$typeof) {
322
- case i:
323
- return qe(e.render);
324
- case C:
325
- return q(e.type, r, t);
326
- case x: {
327
- var n = e, l = n._payload, c = n._init;
328
- try {
329
- return q(c(l), r, t);
330
- } catch {
331
- }
332
- }
333
- }
334
- return "";
335
- }
336
- var W = Object.prototype.hasOwnProperty, be = {}, Re = R.ReactDebugCurrentFrame;
337
- function z(e) {
338
- if (e) {
339
- var r = e._owner, t = q(e.type, e._source, r ? r.type : null);
340
- Re.setExtraStackFrame(t);
341
- } else
342
- Re.setExtraStackFrame(null);
343
- }
344
- function Je(e, r, t, n, l) {
345
- {
346
- var c = Function.call.bind(W);
347
- for (var o in e)
348
- if (c(e, o)) {
349
- var a = void 0;
350
- try {
351
- if (typeof e[o] != "function") {
352
- var _ = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
353
- throw _.name = "Invariant Violation", _;
354
- }
355
- a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
356
- } catch (m) {
357
- a = m;
358
- }
359
- a && !(a instanceof Error) && (z(l), E("%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, o, typeof a), z(null)), a instanceof Error && !(a.message in be) && (be[a.message] = !0, z(l), E("Failed %s type: %s", t, a.message), z(null));
360
- }
361
- }
362
- }
363
- var Xe = Array.isArray;
364
- function re(e) {
365
- return Xe(e);
366
- }
367
- function He(e) {
368
- {
369
- var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
370
- return t;
371
- }
372
- }
373
- function Ze(e) {
374
- try {
375
- return _e(e), !1;
376
- } catch {
377
- return !0;
378
- }
379
- }
380
- function _e(e) {
381
- return "" + e;
382
- }
383
- function we(e) {
384
- if (Ze(e))
385
- return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", He(e)), _e(e);
386
- }
387
- var L = R.ReactCurrentOwner, Qe = {
388
- key: !0,
389
- ref: !0,
390
- __self: !0,
391
- __source: !0
392
- }, Pe, Te, te;
393
- te = {};
394
- function er(e) {
395
- if (W.call(e, "ref")) {
396
- var r = Object.getOwnPropertyDescriptor(e, "ref").get;
397
- if (r && r.isReactWarning)
398
- return !1;
399
- }
400
- return e.ref !== void 0;
401
- }
402
- function rr(e) {
403
- if (W.call(e, "key")) {
404
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
405
- if (r && r.isReactWarning)
406
- return !1;
407
- }
408
- return e.key !== void 0;
409
- }
410
- function tr(e, r) {
411
- if (typeof e.ref == "string" && L.current && r && L.current.stateNode !== r) {
412
- var t = k(L.current.type);
413
- te[t] || (E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', k(L.current.type), e.ref), te[t] = !0);
414
- }
415
- }
416
- function nr(e, r) {
417
- {
418
- var t = function() {
419
- Pe || (Pe = !0, E("%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));
420
- };
421
- t.isReactWarning = !0, Object.defineProperty(e, "key", {
422
- get: t,
423
- configurable: !0
424
- });
425
- }
426
- }
427
- function ar(e, r) {
428
- {
429
- var t = function() {
430
- Te || (Te = !0, E("%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));
431
- };
432
- t.isReactWarning = !0, Object.defineProperty(e, "ref", {
433
- get: t,
434
- configurable: !0
435
- });
436
- }
437
- }
438
- var or = function(e, r, t, n, l, c, o) {
439
- var a = {
440
- // This tag allows us to uniquely identify this as a React Element
441
- $$typeof: v,
442
- // Built-in properties that belong on the element
443
- type: e,
444
- key: r,
445
- ref: t,
446
- props: o,
447
- // Record the component responsible for creating this element.
448
- _owner: c
449
- };
450
- return a._store = {}, Object.defineProperty(a._store, "validated", {
451
- configurable: !1,
452
- enumerable: !1,
453
- writable: !0,
454
- value: !1
455
- }), Object.defineProperty(a, "_self", {
456
- configurable: !1,
457
- enumerable: !1,
458
- writable: !1,
459
- value: n
460
- }), Object.defineProperty(a, "_source", {
461
- configurable: !1,
462
- enumerable: !1,
463
- writable: !1,
464
- value: l
465
- }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
466
- };
467
- function ir(e, r, t, n, l) {
468
- {
469
- var c, o = {}, a = null, _ = null;
470
- t !== void 0 && (we(t), a = "" + t), rr(r) && (we(r.key), a = "" + r.key), er(r) && (_ = r.ref, tr(r, l));
471
- for (c in r)
472
- W.call(r, c) && !Qe.hasOwnProperty(c) && (o[c] = r[c]);
473
- if (e && e.defaultProps) {
474
- var m = e.defaultProps;
475
- for (c in m)
476
- o[c] === void 0 && (o[c] = m[c]);
477
- }
478
- if (a || _) {
479
- var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
480
- a && nr(o, y), _ && ar(o, y);
481
- }
482
- return or(e, a, _, l, n, L.current, o);
483
- }
484
- }
485
- var ne = R.ReactCurrentOwner, Ce = R.ReactDebugCurrentFrame;
486
- function A(e) {
487
- if (e) {
488
- var r = e._owner, t = q(e.type, e._source, r ? r.type : null);
489
- Ce.setExtraStackFrame(t);
490
- } else
491
- Ce.setExtraStackFrame(null);
492
- }
493
- var ae;
494
- ae = !1;
495
- function oe(e) {
496
- return typeof e == "object" && e !== null && e.$$typeof === v;
497
- }
498
- function Oe() {
499
- {
500
- if (ne.current) {
501
- var e = k(ne.current.type);
502
- if (e)
503
- return `
504
-
505
- Check the render method of \`` + e + "`.";
506
- }
507
- return "";
508
- }
509
- }
510
- function lr(e) {
511
- {
512
- if (e !== void 0) {
513
- var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
514
- return `
515
-
516
- Check your code at ` + r + ":" + t + ".";
517
- }
518
- return "";
519
- }
520
- }
521
- var Se = {};
522
- function sr(e) {
523
- {
524
- var r = Oe();
525
- if (!r) {
526
- var t = typeof e == "string" ? e : e.displayName || e.name;
527
- t && (r = `
528
-
529
- Check the top-level render call using <` + t + ">.");
530
- }
531
- return r;
532
- }
533
- }
534
- function xe(e, r) {
535
- {
536
- if (!e._store || e._store.validated || e.key != null)
537
- return;
538
- e._store.validated = !0;
539
- var t = sr(r);
540
- if (Se[t])
541
- return;
542
- Se[t] = !0;
543
- var n = "";
544
- e && e._owner && e._owner !== ne.current && (n = " It was passed a child from " + k(e._owner.type) + "."), A(e), E('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), A(null);
545
- }
546
- }
547
- function ke(e, r) {
548
- {
549
- if (typeof e != "object")
550
- return;
551
- if (re(e))
552
- for (var t = 0; t < e.length; t++) {
553
- var n = e[t];
554
- oe(n) && xe(n, r);
555
- }
556
- else if (oe(e))
557
- e._store && (e._store.validated = !0);
558
- else if (e) {
559
- var l = p(e);
560
- if (typeof l == "function" && l !== e.entries)
561
- for (var c = l.call(e), o; !(o = c.next()).done; )
562
- oe(o.value) && xe(o.value, r);
563
- }
564
- }
565
- }
566
- function ur(e) {
567
- {
568
- var r = e.type;
569
- if (r == null || typeof r == "string")
570
- return;
571
- var t;
572
- if (typeof r == "function")
573
- t = r.propTypes;
574
- else if (typeof r == "object" && (r.$$typeof === i || // Note: Memo only checks outer props here.
575
- // Inner props are checked in the reconciler.
576
- r.$$typeof === C))
577
- t = r.propTypes;
578
- else
579
- return;
580
- if (t) {
581
- var n = k(r);
582
- Je(t, e.props, "prop", n, e);
583
- } else if (r.PropTypes !== void 0 && !ae) {
584
- ae = !0;
585
- var l = k(r);
586
- E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", l || "Unknown");
587
- }
588
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
589
- }
590
- }
591
- function cr(e) {
592
- {
593
- for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
594
- var n = r[t];
595
- if (n !== "children" && n !== "key") {
596
- A(e), E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), A(null);
597
- break;
598
- }
599
- }
600
- e.ref !== null && (A(e), E("Invalid attribute `ref` supplied to `React.Fragment`."), A(null));
601
- }
602
- }
603
- var je = {};
604
- function De(e, r, t, n, l, c) {
605
- {
606
- var o = Ne(e);
607
- if (!o) {
608
- var a = "";
609
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
610
- var _ = lr(l);
611
- _ ? a += _ : a += Oe();
612
- var m;
613
- e === null ? m = "null" : re(e) ? m = "array" : e !== void 0 && e.$$typeof === v ? (m = "<" + (k(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : m = typeof e, E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", m, a);
614
- }
615
- var y = ir(e, r, t, l, c);
616
- if (y == null)
617
- return y;
618
- if (o) {
619
- var O = r.children;
620
- if (O !== void 0)
621
- if (n)
622
- if (re(O)) {
623
- for (var $ = 0; $ < O.length; $++)
624
- ke(O[$], e);
625
- Object.freeze && Object.freeze(O);
626
- } else
627
- E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
628
- else
629
- ke(O, e);
630
- }
631
- if (W.call(r, "key")) {
632
- var D = k(e), T = Object.keys(r).filter(function(mr) {
633
- return mr !== "key";
634
- }), ie = T.length > 0 ? "{key: someKey, " + T.join(": ..., ") + ": ...}" : "{key: someKey}";
635
- if (!je[D + ie]) {
636
- var hr = T.length > 0 ? "{" + T.join(": ..., ") + ": ...}" : "{}";
637
- E(`A props object containing a "key" prop is being spread into JSX:
638
- let props = %s;
639
- <%s {...props} />
640
- React keys must be passed directly to JSX without using spread:
641
- let props = %s;
642
- <%s key={someKey} {...props} />`, ie, D, hr, D), je[D + ie] = !0;
643
- }
644
- }
645
- return e === h ? cr(y) : ur(y), y;
646
- }
647
- }
648
- function fr(e, r, t) {
649
- return De(e, r, t, !0);
650
- }
651
- function dr(e, r, t) {
652
- return De(e, r, t, !1);
653
- }
654
- var pr = dr, vr = fr;
655
- M.Fragment = h, M.jsx = pr, M.jsxs = vr;
656
- }()), M;
657
- }
658
- process.env.NODE_ENV === "production" ? le.exports = Sr() : le.exports = xr();
659
- var V = le.exports;
660
- const We = (s) => Pr("path", s), se = Ie(
661
- /**
662
- * @param {SVGProps} props isPressed indicates whether the SVG should appear as pressed.
663
- * Other props will be passed through to svg component.
664
- * @param {import('react').ForwardedRef<SVGSVGElement>} ref The forwarded ref to the SVG element.
665
- *
666
- * @return {JSX.Element} Stop component
667
- */
668
- ({
669
- className: s,
670
- isPressed: v,
671
- ...b
672
- }, h) => {
673
- const w = {
674
- ...b,
675
- className: Tr(s, {
676
- "is-pressed": v
677
- }) || void 0,
678
- "aria-hidden": !0,
679
- focusable: !1
680
- };
681
- return /* @__PURE__ */ V.jsx("svg", {
682
- ...w,
683
- ref: h
684
- });
685
- }
686
- );
687
- se.displayName = "SVG";
688
- const kr = /* @__PURE__ */ V.jsx(se, {
689
- viewBox: "0 0 24 24",
690
- xmlns: "http://www.w3.org/2000/svg",
691
- children: /* @__PURE__ */ V.jsx(We, {
692
- d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"
693
- })
694
- }), jr = kr, Dr = /* @__PURE__ */ V.jsx(se, {
695
- xmlns: "http://www.w3.org/2000/svg",
696
- viewBox: "0 0 24 24",
697
- children: /* @__PURE__ */ V.jsx(We, {
698
- d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
699
- })
700
- }), Fr = Dr;
701
- const Mr = ({
702
- files: s,
703
- initialState: v = {},
704
- onMappingChange: b = () => {
705
- }
706
- }) => {
707
- const [h, w] = gr(v), P = (d, i) => {
708
- w((g) => ({
709
- ...g,
710
- [d]: {
711
- ...g[d],
712
- ...i
713
- }
714
- }));
715
- };
716
- yr(() => {
717
- const d = {};
718
- Object.keys(h).forEach((i) => {
719
- h[i].playgroundPath && (d[i] = h[i].playgroundPath);
720
- }), b(d);
721
- }, [h]);
722
- const S = (d, i = "") => i ? `${i}/${d.name}`.replaceAll(/\/+/g, "/") : d.name;
723
- return /* @__PURE__ */ u.createElement(Er, { className: "path-mapping-control" }, /* @__PURE__ */ u.createElement($e, { level: 0, positionInSet: 0, setSize: 1 }, /* @__PURE__ */ u.createElement(J, null, () => /* @__PURE__ */ u.createElement(u.Fragment, null, "File/Folder")), /* @__PURE__ */ u.createElement(J, null, () => /* @__PURE__ */ u.createElement(u.Fragment, null, "Absolute path in Playground"))), s.map((d, i) => /* @__PURE__ */ u.createElement(
724
- Le,
15
+ width: "10.4176",
16
+ height: "10.4176",
17
+ rx: "3.86258",
18
+ transform: "matrix(0.829038 -0.559193 0.838671 0.544639 7.45703 24.1775)",
19
+ stroke: "white",
20
+ strokeWidth: "0.965644"
21
+ }
22
+ ),
23
+ /* @__PURE__ */ e.createElement(
24
+ "rect",
725
25
  {
726
- key: d.name,
727
- node: d,
728
- level: 0,
729
- position: i + 1,
730
- setSize: s.length,
731
- nodeStates: h,
732
- updateNodeState: P,
733
- generatePath: S
734
- }
735
- )));
736
- }, Le = ({
737
- node: s,
738
- level: v,
739
- position: b,
740
- setSize: h,
741
- nodeStates: w,
742
- updateNodeState: P,
743
- generatePath: S,
744
- parentPath: d = "",
745
- parentMapping: i = ""
746
- }) => {
747
- const g = S(s, d), f = w[g] || {
748
- isOpen: !1,
749
- playgroundPath: "",
750
- pathType: ""
751
- }, C = Ar({
752
- node: s,
753
- nodeState: f,
754
- parentMapping: i
755
- }), x = () => {
756
- P(g, { isOpen: !f.isOpen });
757
- }, F = (p) => {
758
- P(g, { playgroundPath: p });
759
- }, N = (p) => {
760
- switch (p) {
761
- case "plugin":
762
- P(g, {
763
- pathType: p,
764
- playgroundPath: "/wordpress/wp-content/plugins/" + s.name
765
- });
766
- break;
767
- case "theme":
768
- P(g, {
769
- pathType: p,
770
- playgroundPath: "/wordpress/wp-content/themes/" + s.name
771
- });
772
- break;
773
- case "wp-content":
774
- P(g, {
775
- pathType: p,
776
- playgroundPath: "/wordpress/wp-content"
777
- });
778
- break;
779
- default:
780
- P(g, { pathType: p, playgroundPath: "" });
781
- break;
782
- }
783
- }, X = (p) => {
784
- var R, E, U, B;
785
- if (p.key === "ArrowLeft")
786
- f.isOpen ? x() : (R = s.children) != null && R.length && ((E = document.querySelector(
787
- `[data-path="${d}"]`
788
- )) == null || E.focus()), p.preventDefault(), p.stopPropagation();
789
- else if (p.key === "ArrowRight") {
790
- if (f.isOpen) {
791
- if ((U = s.children) != null && U.length) {
792
- const H = S(s.children[0], g);
793
- (B = document.querySelector(
794
- `[data-path="${H}"]`
795
- )) == null || B.focus();
796
- }
797
- } else
798
- x();
799
- p.preventDefault(), p.stopPropagation();
800
- }
801
- };
802
- return /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement(
803
- $e,
26
+ width: "13.2346",
27
+ height: "13.2346",
28
+ rx: "3.86258",
29
+ transform: "matrix(0.829038 -0.559193 0.838671 0.544639 5.0918 18.9934)",
30
+ stroke: "white",
31
+ strokeWidth: "1.44847"
32
+ }
33
+ ),
34
+ /* @__PURE__ */ e.createElement(
35
+ "rect",
804
36
  {
805
- level: v,
806
- positionInSet: b,
807
- setSize: h
808
- },
809
- /* @__PURE__ */ u.createElement(J, null, () => /* @__PURE__ */ u.createElement(
810
- br,
811
- {
812
- onClick: x,
813
- onKeyDown: X,
814
- className: "file-node-button",
815
- "data-path": g
816
- },
817
- /* @__PURE__ */ u.createElement(
818
- $r,
819
- {
820
- node: s,
821
- isOpen: s.type === "folder" && f.isOpen,
822
- level: v
823
- }
824
- )
825
- )),
826
- /* @__PURE__ */ u.createElement(J, null, () => {
827
- var p;
828
- return /* @__PURE__ */ u.createElement(u.Fragment, null, !i && /* @__PURE__ */ u.createElement(
829
- Rr,
830
- {
831
- label: "Path",
832
- value: f.pathType,
833
- onChange: N,
834
- options: [
835
- { label: "Select a path", value: "" },
836
- { label: "Plugin", value: "plugin" },
837
- { label: "Theme", value: "theme" },
838
- {
839
- label: "wp-content",
840
- value: "wp-content"
841
- },
842
- {
843
- label: "Custom path",
844
- value: "custom-path"
845
- }
846
- ]
847
- }
848
- ), (i || f.pathType !== "") && /* @__PURE__ */ u.createElement(
849
- _r,
850
- {
851
- disabled: !!i || ((p = f.pathType) == null ? void 0 : p.trim()) !== "" && f.pathType !== "custom-path",
852
- value: C,
853
- onChange: F,
854
- onDrag: function() {
855
- },
856
- onDragEnd: function() {
857
- },
858
- onDragStart: function() {
859
- },
860
- onValidate: function() {
861
- }
862
- }
863
- ));
864
- })
865
- ), f.isOpen && s.children && s.children.map((p, R) => /* @__PURE__ */ u.createElement(
866
- Le,
37
+ width: "17.451",
38
+ height: "17.451",
39
+ rx: "3.86258",
40
+ transform: "matrix(0.829038 -0.559193 0.838671 0.544639 1.55371 11.6099)",
41
+ stroke: "white",
42
+ strokeWidth: "1.93129"
43
+ }
44
+ )
45
+ ), C = (t) => /* @__PURE__ */ e.createElement(
46
+ "svg",
47
+ {
48
+ width: "16",
49
+ height: "17",
50
+ viewBox: "0 0 16 17",
51
+ fill: "none",
52
+ xmlns: "http://www.w3.org/2000/svg",
53
+ ...t
54
+ },
55
+ /* @__PURE__ */ e.createElement(
56
+ "path",
867
57
  {
868
- key: p.name,
869
- node: p,
870
- level: v + 1,
871
- position: R + 1,
872
- setSize: s.children.length,
873
- nodeStates: w,
874
- updateNodeState: P,
875
- generatePath: S,
876
- parentPath: g,
877
- parentMapping: C
878
- }
879
- )));
880
- };
881
- function Ar({
882
- node: s,
883
- nodeState: v,
884
- parentMapping: b
885
- }) {
886
- return b ? `${b}/${s.name}`.replace(/\/+/g, "/") : v.playgroundPath ? v.playgroundPath : "";
887
- }
888
- const $r = ({ node: s, level: v, isOpen: b }) => {
889
- const h = [];
890
- for (let w = 0; w < v; w++)
891
- h.push("&nbsp;&nbsp;&nbsp;&nbsp;");
892
- return /* @__PURE__ */ u.createElement(u.Fragment, null, /* @__PURE__ */ u.createElement(
893
- "span",
58
+ fillRule: "evenodd",
59
+ clipRule: "evenodd",
60
+ d: "M8 15C4.41015 15 1.5 12.0899 1.5 8.5C1.5 4.91015 4.41015 2 8 2C11.5899 2 14.5 4.91015 14.5 8.5C14.5 12.0899 11.5899 15 8 15ZM0 8.5C0 4.08172 3.58172 0.5 8 0.5C12.4183 0.5 16 4.08172 16 8.5C16 12.9183 12.4183 16.5 8 16.5C3.58172 16.5 0 12.9183 0 8.5ZM9 9.5V4.5H7.5V8H5.5V9.5H9Z",
61
+ fill: "#949494"
62
+ }
63
+ )
64
+ ), n = (t) => /* @__PURE__ */ e.createElement(
65
+ "svg",
66
+ {
67
+ width: "20",
68
+ height: "21",
69
+ viewBox: "0 0 20 21",
70
+ fill: "none",
71
+ xmlns: "http://www.w3.org/2000/svg",
72
+ ...t
73
+ },
74
+ /* @__PURE__ */ e.createElement(
75
+ "path",
76
+ {
77
+ d: "M20 10.5C20 4.99 15.51 0.5 10 0.5C4.48 0.5 0 4.99 0 10.5C0 16.02 4.48 20.5 10 20.5C15.51 20.5 20 16.02 20 10.5ZM7.78 15.87L4.37 6.72C4.92 6.7 5.54 6.64 5.54 6.64C6.04 6.58 5.98 5.51 5.48 5.53C5.48 5.53 4.03 5.64 3.11 5.64C2.93 5.64 2.74 5.64 2.53 5.63C4.12 3.19 6.87 1.61 10 1.61C12.33 1.61 14.45 2.48 16.05 3.95C15.37 3.84 14.4 4.34 14.4 5.53C14.4 6.27 14.85 6.89 15.3 7.63C15.65 8.24 15.85 8.99 15.85 10.09C15.85 11.58 14.45 15.09 14.45 15.09L11.42 6.72C11.96 6.7 12.24 6.55 12.24 6.55C12.74 6.5 12.68 5.3 12.18 5.33C12.18 5.33 10.74 5.45 9.8 5.45C8.93 5.45 7.47 5.33 7.47 5.33C6.97 5.3 6.91 6.53 7.41 6.55L8.33 6.63L9.59 10.04L7.78 15.87ZM17.41 10.5C17.65 9.86 18.15 8.63 17.84 6.25C18.54 7.54 18.89 8.96 18.89 10.5C18.89 13.79 17.16 16.74 14.49 18.28C15.46 15.69 16.43 13.08 17.41 10.5ZM6.1 18.59C3.12 17.15 1.11 14.03 1.11 10.5C1.11 9.2 1.34 8.02 1.83 6.91C3.25 10.8 4.67 14.7 6.1 18.59ZM10.13 11.96L12.71 18.94C11.85 19.23 10.95 19.39 10 19.39C9.21 19.39 8.43 19.28 7.71 19.06C8.52 16.68 9.33 14.32 10.13 11.96Z",
78
+ fill: "#ffffff"
79
+ }
80
+ )
81
+ ), i = /* @__PURE__ */ e.createElement(
82
+ "svg",
83
+ {
84
+ xmlns: "http://www.w3.org/2000/svg",
85
+ width: "15",
86
+ height: "14",
87
+ viewBox: "0 0 15 14",
88
+ fill: "none"
89
+ },
90
+ /* @__PURE__ */ e.createElement(
91
+ "path",
92
+ {
93
+ fillRule: "evenodd",
94
+ clipRule: "evenodd",
95
+ d: "M7.59196 3.59524L6.77745 1.96623C6.70755 1.82641 6.56464 1.7381 6.40832 1.7381H1.65079C1.42287 1.7381 1.2381 1.92287 1.2381 2.15079V11.8492C1.2381 12.0771 1.42287 12.2619 1.65079 12.2619H13.2063C13.4343 12.2619 13.619 12.0771 13.619 11.8492V4.00794C13.619 3.78001 13.4343 3.59524 13.2063 3.59524H7.59196ZM8.35714 2.35714L7.88484 1.41254C7.60521 0.853274 7.0336 0.5 6.40832 0.5H1.65079C0.739085 0.5 0 1.23909 0 2.15079V11.8492C0 12.7609 0.739085 13.5 1.65079 13.5H13.2063C14.1181 13.5 14.8571 12.7609 14.8571 11.8492V4.00794C14.8571 3.09623 14.1181 2.35714 13.2063 2.35714H8.35714Z"
96
+ }
97
+ )
98
+ ), o = /* @__PURE__ */ e.createElement(
99
+ "svg",
100
+ {
101
+ xmlns: "http://www.w3.org/2000/svg",
102
+ width: "16",
103
+ height: "16",
104
+ fill: "currentColor",
105
+ className: "bi bi-file-earmark",
106
+ viewBox: "0 0 16 16"
107
+ },
108
+ /* @__PURE__ */ e.createElement("path", { d: "M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5z" })
109
+ ), h = (t) => /* @__PURE__ */ e.createElement(
110
+ "svg",
111
+ {
112
+ xmlns: "http://www.w3.org/2000/svg",
113
+ width: "14",
114
+ height: "14",
115
+ viewBox: "0 0 14 14",
116
+ fill: "none",
117
+ ...t
118
+ },
119
+ /* @__PURE__ */ e.createElement(
120
+ "path",
121
+ {
122
+ fillRule: "evenodd",
123
+ clipRule: "evenodd",
124
+ d: "M7 12.6875C3.85888 12.6875 1.3125 10.1411 1.3125 7C1.3125 3.85888 3.85888 1.3125 7 1.3125C10.1411 1.3125 12.6875 3.85888 12.6875 7C12.6875 10.1411 10.1411 12.6875 7 12.6875ZM0 7C0 3.13401 3.13401 0 7 0C10.866 0 14 3.13401 14 7C14 10.866 10.866 14 7 14C3.13401 14 0 10.866 0 7ZM7.875 7.875V3.5H6.5625V6.5625H4.8125V7.875H7.875Z",
125
+ fill: "#949494"
126
+ }
127
+ )
128
+ ), a = /* @__PURE__ */ e.createElement(
129
+ "svg",
130
+ {
131
+ xmlns: "http://www.w3.org/2000/svg",
132
+ width: "14",
133
+ height: "14",
134
+ viewBox: "0 0 14 14",
135
+ fill: "none"
136
+ },
137
+ /* @__PURE__ */ e.createElement(
138
+ "path",
894
139
  {
895
- "aria-hidden": "true",
896
- dangerouslySetInnerHTML: { __html: h.join("") }
140
+ fillRule: "evenodd",
141
+ clipRule: "evenodd",
142
+ d: "M12.25 1.3125H1.75C1.50838 1.3125 1.3125 1.50838 1.3125 1.75V4.37495H12.6875V1.75C12.6875 1.50837 12.4916 1.3125 12.25 1.3125ZM12.6875 5.68745H5.25003V12.6875H12.25C12.4916 12.6875 12.6875 12.4916 12.6875 12.25V5.68745ZM3.93753 5.68745H1.3125V12.25C1.3125 12.4916 1.50837 12.6875 1.75 12.6875H3.93753L3.93753 5.68745ZM1.75 0H12.25C13.2165 0 14 0.783502 14 1.75V12.25C14 13.2165 13.2165 14 12.25 14H1.75C0.783502 14 0 13.2165 0 12.25V1.75C0 0.783502 0.783502 0 1.75 0Z",
143
+ fill: "#949494"
897
144
  }
898
- ), s.type === "folder" ? /* @__PURE__ */ u.createElement(Or, { width: 16, icon: b ? jr : Fr }) : /* @__PURE__ */ u.createElement("div", { style: { width: 16 } }, " "), s.name);
899
- };
145
+ )
146
+ );
147
+ function w(t) {
148
+ return `data:${t.mime};base64,${t.data}`;
149
+ }
900
150
  export {
901
- Mr as PathMappingControlDemo
151
+ h as ClockIcon,
152
+ n as WordPressIcon,
153
+ o as file,
154
+ i as folder,
155
+ w as getLogoDataURL,
156
+ a as layout,
157
+ r as playgroundLogo,
158
+ C as temporaryStorage
902
159
  };