@measured/puck-plugin-heading-analyzer 0.4.1 → 0.5.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/dist/index.css +15 -13
- package/dist/index.js +1088 -7
- package/package.json +2 -2
package/dist/index.css
CHANGED
@@ -1,33 +1,35 @@
|
|
1
1
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css/#css-module-data */
|
2
|
-
.
|
2
|
+
._SidebarSection_1y6bv_1 {
|
3
3
|
display: flex;
|
4
|
+
position: relative;
|
4
5
|
flex-direction: column;
|
5
6
|
}
|
6
|
-
.
|
7
|
+
._SidebarSection_1y6bv_1:last-of-type {
|
7
8
|
flex-grow: 1;
|
8
9
|
}
|
9
|
-
._SidebarSection-
|
10
|
+
._SidebarSection-title_1y6bv_11 {
|
10
11
|
background: white;
|
11
12
|
padding: 16px;
|
12
13
|
border-bottom: 1px solid var(--puck-color-grey-8);
|
13
14
|
}
|
14
|
-
._SidebarSection-
|
15
|
-
opacity: 0.6;
|
16
|
-
cursor: pointer;
|
17
|
-
}
|
18
|
-
._SidebarSection-content_yd8db_21 {
|
15
|
+
._SidebarSection-content_1y6bv_17 {
|
19
16
|
border-bottom: 1px solid var(--puck-color-grey-8);
|
20
17
|
padding: 16px;
|
21
18
|
}
|
22
|
-
.
|
19
|
+
._SidebarSection--noPadding_1y6bv_22 ._SidebarSection-content_1y6bv_17 {
|
20
|
+
padding: 0px;
|
21
|
+
}
|
22
|
+
._SidebarSection_1y6bv_1:last-of-type ._SidebarSection-content_1y6bv_17 {
|
23
23
|
border-bottom: none;
|
24
24
|
flex-grow: 1;
|
25
25
|
}
|
26
|
-
.
|
27
|
-
|
26
|
+
._SidebarSection-breadcrumb_1y6bv_31 {
|
27
|
+
color: var(--puck-color-azure-3);
|
28
28
|
}
|
29
|
-
.
|
30
|
-
|
29
|
+
._SidebarSection-breadcrumb_1y6bv_31:hover {
|
30
|
+
color: var(--puck-color-azure-4);
|
31
|
+
cursor: pointer;
|
32
|
+
text-decoration: underline;
|
31
33
|
}
|
32
34
|
|
33
35
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/Heading/styles.module.css/#css-module-data */
|
package/dist/index.js
CHANGED
@@ -108,6 +108,962 @@ var require_classnames = __commonJS({
|
|
108
108
|
}
|
109
109
|
});
|
110
110
|
|
111
|
+
// ../../node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
|
112
|
+
var require_react_is_production_min = __commonJS({
|
113
|
+
"../../node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js"(exports) {
|
114
|
+
"use strict";
|
115
|
+
init_react_import();
|
116
|
+
var b = "function" === typeof Symbol && Symbol.for;
|
117
|
+
var c = b ? Symbol.for("react.element") : 60103;
|
118
|
+
var d = b ? Symbol.for("react.portal") : 60106;
|
119
|
+
var e = b ? Symbol.for("react.fragment") : 60107;
|
120
|
+
var f = b ? Symbol.for("react.strict_mode") : 60108;
|
121
|
+
var g = b ? Symbol.for("react.profiler") : 60114;
|
122
|
+
var h = b ? Symbol.for("react.provider") : 60109;
|
123
|
+
var k = b ? Symbol.for("react.context") : 60110;
|
124
|
+
var l = b ? Symbol.for("react.async_mode") : 60111;
|
125
|
+
var m = b ? Symbol.for("react.concurrent_mode") : 60111;
|
126
|
+
var n = b ? Symbol.for("react.forward_ref") : 60112;
|
127
|
+
var p = b ? Symbol.for("react.suspense") : 60113;
|
128
|
+
var q = b ? Symbol.for("react.suspense_list") : 60120;
|
129
|
+
var r = b ? Symbol.for("react.memo") : 60115;
|
130
|
+
var t = b ? Symbol.for("react.lazy") : 60116;
|
131
|
+
var v = b ? Symbol.for("react.block") : 60121;
|
132
|
+
var w = b ? Symbol.for("react.fundamental") : 60117;
|
133
|
+
var x = b ? Symbol.for("react.responder") : 60118;
|
134
|
+
var y = b ? Symbol.for("react.scope") : 60119;
|
135
|
+
function z(a) {
|
136
|
+
if ("object" === typeof a && null !== a) {
|
137
|
+
var u = a.$$typeof;
|
138
|
+
switch (u) {
|
139
|
+
case c:
|
140
|
+
switch (a = a.type, a) {
|
141
|
+
case l:
|
142
|
+
case m:
|
143
|
+
case e:
|
144
|
+
case g:
|
145
|
+
case f:
|
146
|
+
case p:
|
147
|
+
return a;
|
148
|
+
default:
|
149
|
+
switch (a = a && a.$$typeof, a) {
|
150
|
+
case k:
|
151
|
+
case n:
|
152
|
+
case t:
|
153
|
+
case r:
|
154
|
+
case h:
|
155
|
+
return a;
|
156
|
+
default:
|
157
|
+
return u;
|
158
|
+
}
|
159
|
+
}
|
160
|
+
case d:
|
161
|
+
return u;
|
162
|
+
}
|
163
|
+
}
|
164
|
+
}
|
165
|
+
function A(a) {
|
166
|
+
return z(a) === m;
|
167
|
+
}
|
168
|
+
exports.AsyncMode = l;
|
169
|
+
exports.ConcurrentMode = m;
|
170
|
+
exports.ContextConsumer = k;
|
171
|
+
exports.ContextProvider = h;
|
172
|
+
exports.Element = c;
|
173
|
+
exports.ForwardRef = n;
|
174
|
+
exports.Fragment = e;
|
175
|
+
exports.Lazy = t;
|
176
|
+
exports.Memo = r;
|
177
|
+
exports.Portal = d;
|
178
|
+
exports.Profiler = g;
|
179
|
+
exports.StrictMode = f;
|
180
|
+
exports.Suspense = p;
|
181
|
+
exports.isAsyncMode = function(a) {
|
182
|
+
return A(a) || z(a) === l;
|
183
|
+
};
|
184
|
+
exports.isConcurrentMode = A;
|
185
|
+
exports.isContextConsumer = function(a) {
|
186
|
+
return z(a) === k;
|
187
|
+
};
|
188
|
+
exports.isContextProvider = function(a) {
|
189
|
+
return z(a) === h;
|
190
|
+
};
|
191
|
+
exports.isElement = function(a) {
|
192
|
+
return "object" === typeof a && null !== a && a.$$typeof === c;
|
193
|
+
};
|
194
|
+
exports.isForwardRef = function(a) {
|
195
|
+
return z(a) === n;
|
196
|
+
};
|
197
|
+
exports.isFragment = function(a) {
|
198
|
+
return z(a) === e;
|
199
|
+
};
|
200
|
+
exports.isLazy = function(a) {
|
201
|
+
return z(a) === t;
|
202
|
+
};
|
203
|
+
exports.isMemo = function(a) {
|
204
|
+
return z(a) === r;
|
205
|
+
};
|
206
|
+
exports.isPortal = function(a) {
|
207
|
+
return z(a) === d;
|
208
|
+
};
|
209
|
+
exports.isProfiler = function(a) {
|
210
|
+
return z(a) === g;
|
211
|
+
};
|
212
|
+
exports.isStrictMode = function(a) {
|
213
|
+
return z(a) === f;
|
214
|
+
};
|
215
|
+
exports.isSuspense = function(a) {
|
216
|
+
return z(a) === p;
|
217
|
+
};
|
218
|
+
exports.isValidElementType = function(a) {
|
219
|
+
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
220
|
+
};
|
221
|
+
exports.typeOf = z;
|
222
|
+
}
|
223
|
+
});
|
224
|
+
|
225
|
+
// ../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js
|
226
|
+
var require_react_is_development = __commonJS({
|
227
|
+
"../../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"(exports) {
|
228
|
+
"use strict";
|
229
|
+
init_react_import();
|
230
|
+
if (process.env.NODE_ENV !== "production") {
|
231
|
+
(function() {
|
232
|
+
"use strict";
|
233
|
+
var hasSymbol = typeof Symbol === "function" && Symbol.for;
|
234
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103;
|
235
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106;
|
236
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107;
|
237
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108;
|
238
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114;
|
239
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109;
|
240
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110;
|
241
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111;
|
242
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111;
|
243
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112;
|
244
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113;
|
245
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120;
|
246
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115;
|
247
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116;
|
248
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121;
|
249
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117;
|
250
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118;
|
251
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
|
252
|
+
function isValidElementType(type) {
|
253
|
+
return typeof type === "string" || typeof type === "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
254
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
255
|
+
}
|
256
|
+
function typeOf(object) {
|
257
|
+
if (typeof object === "object" && object !== null) {
|
258
|
+
var $$typeof = object.$$typeof;
|
259
|
+
switch ($$typeof) {
|
260
|
+
case REACT_ELEMENT_TYPE:
|
261
|
+
var type = object.type;
|
262
|
+
switch (type) {
|
263
|
+
case REACT_ASYNC_MODE_TYPE:
|
264
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
265
|
+
case REACT_FRAGMENT_TYPE:
|
266
|
+
case REACT_PROFILER_TYPE:
|
267
|
+
case REACT_STRICT_MODE_TYPE:
|
268
|
+
case REACT_SUSPENSE_TYPE:
|
269
|
+
return type;
|
270
|
+
default:
|
271
|
+
var $$typeofType = type && type.$$typeof;
|
272
|
+
switch ($$typeofType) {
|
273
|
+
case REACT_CONTEXT_TYPE:
|
274
|
+
case REACT_FORWARD_REF_TYPE:
|
275
|
+
case REACT_LAZY_TYPE:
|
276
|
+
case REACT_MEMO_TYPE:
|
277
|
+
case REACT_PROVIDER_TYPE:
|
278
|
+
return $$typeofType;
|
279
|
+
default:
|
280
|
+
return $$typeof;
|
281
|
+
}
|
282
|
+
}
|
283
|
+
case REACT_PORTAL_TYPE:
|
284
|
+
return $$typeof;
|
285
|
+
}
|
286
|
+
}
|
287
|
+
return void 0;
|
288
|
+
}
|
289
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
290
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
291
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
292
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
293
|
+
var Element = REACT_ELEMENT_TYPE;
|
294
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
295
|
+
var Fragment2 = REACT_FRAGMENT_TYPE;
|
296
|
+
var Lazy = REACT_LAZY_TYPE;
|
297
|
+
var Memo = REACT_MEMO_TYPE;
|
298
|
+
var Portal = REACT_PORTAL_TYPE;
|
299
|
+
var Profiler = REACT_PROFILER_TYPE;
|
300
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
301
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
302
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
303
|
+
function isAsyncMode(object) {
|
304
|
+
{
|
305
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
306
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
307
|
+
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
|
308
|
+
}
|
309
|
+
}
|
310
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
311
|
+
}
|
312
|
+
function isConcurrentMode(object) {
|
313
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
314
|
+
}
|
315
|
+
function isContextConsumer(object) {
|
316
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
317
|
+
}
|
318
|
+
function isContextProvider(object) {
|
319
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
320
|
+
}
|
321
|
+
function isElement(object) {
|
322
|
+
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
323
|
+
}
|
324
|
+
function isForwardRef(object) {
|
325
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
326
|
+
}
|
327
|
+
function isFragment(object) {
|
328
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
329
|
+
}
|
330
|
+
function isLazy(object) {
|
331
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
332
|
+
}
|
333
|
+
function isMemo(object) {
|
334
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
335
|
+
}
|
336
|
+
function isPortal(object) {
|
337
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
338
|
+
}
|
339
|
+
function isProfiler(object) {
|
340
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
341
|
+
}
|
342
|
+
function isStrictMode(object) {
|
343
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
344
|
+
}
|
345
|
+
function isSuspense(object) {
|
346
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
347
|
+
}
|
348
|
+
exports.AsyncMode = AsyncMode;
|
349
|
+
exports.ConcurrentMode = ConcurrentMode;
|
350
|
+
exports.ContextConsumer = ContextConsumer;
|
351
|
+
exports.ContextProvider = ContextProvider;
|
352
|
+
exports.Element = Element;
|
353
|
+
exports.ForwardRef = ForwardRef;
|
354
|
+
exports.Fragment = Fragment2;
|
355
|
+
exports.Lazy = Lazy;
|
356
|
+
exports.Memo = Memo;
|
357
|
+
exports.Portal = Portal;
|
358
|
+
exports.Profiler = Profiler;
|
359
|
+
exports.StrictMode = StrictMode;
|
360
|
+
exports.Suspense = Suspense;
|
361
|
+
exports.isAsyncMode = isAsyncMode;
|
362
|
+
exports.isConcurrentMode = isConcurrentMode;
|
363
|
+
exports.isContextConsumer = isContextConsumer;
|
364
|
+
exports.isContextProvider = isContextProvider;
|
365
|
+
exports.isElement = isElement;
|
366
|
+
exports.isForwardRef = isForwardRef;
|
367
|
+
exports.isFragment = isFragment;
|
368
|
+
exports.isLazy = isLazy;
|
369
|
+
exports.isMemo = isMemo;
|
370
|
+
exports.isPortal = isPortal;
|
371
|
+
exports.isProfiler = isProfiler;
|
372
|
+
exports.isStrictMode = isStrictMode;
|
373
|
+
exports.isSuspense = isSuspense;
|
374
|
+
exports.isValidElementType = isValidElementType;
|
375
|
+
exports.typeOf = typeOf;
|
376
|
+
})();
|
377
|
+
}
|
378
|
+
}
|
379
|
+
});
|
380
|
+
|
381
|
+
// ../../node_modules/prop-types/node_modules/react-is/index.js
|
382
|
+
var require_react_is = __commonJS({
|
383
|
+
"../../node_modules/prop-types/node_modules/react-is/index.js"(exports, module2) {
|
384
|
+
"use strict";
|
385
|
+
init_react_import();
|
386
|
+
if (process.env.NODE_ENV === "production") {
|
387
|
+
module2.exports = require_react_is_production_min();
|
388
|
+
} else {
|
389
|
+
module2.exports = require_react_is_development();
|
390
|
+
}
|
391
|
+
}
|
392
|
+
});
|
393
|
+
|
394
|
+
// ../../node_modules/object-assign/index.js
|
395
|
+
var require_object_assign = __commonJS({
|
396
|
+
"../../node_modules/object-assign/index.js"(exports, module2) {
|
397
|
+
"use strict";
|
398
|
+
init_react_import();
|
399
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
400
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
401
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
402
|
+
function toObject(val) {
|
403
|
+
if (val === null || val === void 0) {
|
404
|
+
throw new TypeError("Object.assign cannot be called with null or undefined");
|
405
|
+
}
|
406
|
+
return Object(val);
|
407
|
+
}
|
408
|
+
function shouldUseNative() {
|
409
|
+
try {
|
410
|
+
if (!Object.assign) {
|
411
|
+
return false;
|
412
|
+
}
|
413
|
+
var test1 = new String("abc");
|
414
|
+
test1[5] = "de";
|
415
|
+
if (Object.getOwnPropertyNames(test1)[0] === "5") {
|
416
|
+
return false;
|
417
|
+
}
|
418
|
+
var test2 = {};
|
419
|
+
for (var i = 0; i < 10; i++) {
|
420
|
+
test2["_" + String.fromCharCode(i)] = i;
|
421
|
+
}
|
422
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
|
423
|
+
return test2[n];
|
424
|
+
});
|
425
|
+
if (order2.join("") !== "0123456789") {
|
426
|
+
return false;
|
427
|
+
}
|
428
|
+
var test3 = {};
|
429
|
+
"abcdefghijklmnopqrst".split("").forEach(function(letter) {
|
430
|
+
test3[letter] = letter;
|
431
|
+
});
|
432
|
+
if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") {
|
433
|
+
return false;
|
434
|
+
}
|
435
|
+
return true;
|
436
|
+
} catch (err) {
|
437
|
+
return false;
|
438
|
+
}
|
439
|
+
}
|
440
|
+
module2.exports = shouldUseNative() ? Object.assign : function(target, source) {
|
441
|
+
var from;
|
442
|
+
var to = toObject(target);
|
443
|
+
var symbols;
|
444
|
+
for (var s = 1; s < arguments.length; s++) {
|
445
|
+
from = Object(arguments[s]);
|
446
|
+
for (var key in from) {
|
447
|
+
if (hasOwnProperty.call(from, key)) {
|
448
|
+
to[key] = from[key];
|
449
|
+
}
|
450
|
+
}
|
451
|
+
if (getOwnPropertySymbols) {
|
452
|
+
symbols = getOwnPropertySymbols(from);
|
453
|
+
for (var i = 0; i < symbols.length; i++) {
|
454
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
455
|
+
to[symbols[i]] = from[symbols[i]];
|
456
|
+
}
|
457
|
+
}
|
458
|
+
}
|
459
|
+
}
|
460
|
+
return to;
|
461
|
+
};
|
462
|
+
}
|
463
|
+
});
|
464
|
+
|
465
|
+
// ../../node_modules/prop-types/lib/ReactPropTypesSecret.js
|
466
|
+
var require_ReactPropTypesSecret = __commonJS({
|
467
|
+
"../../node_modules/prop-types/lib/ReactPropTypesSecret.js"(exports, module2) {
|
468
|
+
"use strict";
|
469
|
+
init_react_import();
|
470
|
+
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
471
|
+
module2.exports = ReactPropTypesSecret;
|
472
|
+
}
|
473
|
+
});
|
474
|
+
|
475
|
+
// ../../node_modules/prop-types/lib/has.js
|
476
|
+
var require_has = __commonJS({
|
477
|
+
"../../node_modules/prop-types/lib/has.js"(exports, module2) {
|
478
|
+
init_react_import();
|
479
|
+
module2.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
480
|
+
}
|
481
|
+
});
|
482
|
+
|
483
|
+
// ../../node_modules/prop-types/checkPropTypes.js
|
484
|
+
var require_checkPropTypes = __commonJS({
|
485
|
+
"../../node_modules/prop-types/checkPropTypes.js"(exports, module2) {
|
486
|
+
"use strict";
|
487
|
+
init_react_import();
|
488
|
+
var printWarning = function() {
|
489
|
+
};
|
490
|
+
if (process.env.NODE_ENV !== "production") {
|
491
|
+
ReactPropTypesSecret = require_ReactPropTypesSecret();
|
492
|
+
loggedTypeFailures = {};
|
493
|
+
has = require_has();
|
494
|
+
printWarning = function(text) {
|
495
|
+
var message = "Warning: " + text;
|
496
|
+
if (typeof console !== "undefined") {
|
497
|
+
console.error(message);
|
498
|
+
}
|
499
|
+
try {
|
500
|
+
throw new Error(message);
|
501
|
+
} catch (x) {
|
502
|
+
}
|
503
|
+
};
|
504
|
+
}
|
505
|
+
var ReactPropTypesSecret;
|
506
|
+
var loggedTypeFailures;
|
507
|
+
var has;
|
508
|
+
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
509
|
+
if (process.env.NODE_ENV !== "production") {
|
510
|
+
for (var typeSpecName in typeSpecs) {
|
511
|
+
if (has(typeSpecs, typeSpecName)) {
|
512
|
+
var error;
|
513
|
+
try {
|
514
|
+
if (typeof typeSpecs[typeSpecName] !== "function") {
|
515
|
+
var err = Error(
|
516
|
+
(componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
517
|
+
);
|
518
|
+
err.name = "Invariant Violation";
|
519
|
+
throw err;
|
520
|
+
}
|
521
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
522
|
+
} catch (ex) {
|
523
|
+
error = ex;
|
524
|
+
}
|
525
|
+
if (error && !(error instanceof Error)) {
|
526
|
+
printWarning(
|
527
|
+
(componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
528
|
+
);
|
529
|
+
}
|
530
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
531
|
+
loggedTypeFailures[error.message] = true;
|
532
|
+
var stack = getStack ? getStack() : "";
|
533
|
+
printWarning(
|
534
|
+
"Failed " + location + " type: " + error.message + (stack != null ? stack : "")
|
535
|
+
);
|
536
|
+
}
|
537
|
+
}
|
538
|
+
}
|
539
|
+
}
|
540
|
+
}
|
541
|
+
checkPropTypes.resetWarningCache = function() {
|
542
|
+
if (process.env.NODE_ENV !== "production") {
|
543
|
+
loggedTypeFailures = {};
|
544
|
+
}
|
545
|
+
};
|
546
|
+
module2.exports = checkPropTypes;
|
547
|
+
}
|
548
|
+
});
|
549
|
+
|
550
|
+
// ../../node_modules/prop-types/factoryWithTypeCheckers.js
|
551
|
+
var require_factoryWithTypeCheckers = __commonJS({
|
552
|
+
"../../node_modules/prop-types/factoryWithTypeCheckers.js"(exports, module2) {
|
553
|
+
"use strict";
|
554
|
+
init_react_import();
|
555
|
+
var ReactIs = require_react_is();
|
556
|
+
var assign = require_object_assign();
|
557
|
+
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
558
|
+
var has = require_has();
|
559
|
+
var checkPropTypes = require_checkPropTypes();
|
560
|
+
var printWarning = function() {
|
561
|
+
};
|
562
|
+
if (process.env.NODE_ENV !== "production") {
|
563
|
+
printWarning = function(text) {
|
564
|
+
var message = "Warning: " + text;
|
565
|
+
if (typeof console !== "undefined") {
|
566
|
+
console.error(message);
|
567
|
+
}
|
568
|
+
try {
|
569
|
+
throw new Error(message);
|
570
|
+
} catch (x) {
|
571
|
+
}
|
572
|
+
};
|
573
|
+
}
|
574
|
+
function emptyFunctionThatReturnsNull() {
|
575
|
+
return null;
|
576
|
+
}
|
577
|
+
module2.exports = function(isValidElement, throwOnDirectAccess) {
|
578
|
+
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
579
|
+
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
580
|
+
function getIteratorFn(maybeIterable) {
|
581
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
582
|
+
if (typeof iteratorFn === "function") {
|
583
|
+
return iteratorFn;
|
584
|
+
}
|
585
|
+
}
|
586
|
+
var ANONYMOUS = "<<anonymous>>";
|
587
|
+
var ReactPropTypes = {
|
588
|
+
array: createPrimitiveTypeChecker("array"),
|
589
|
+
bigint: createPrimitiveTypeChecker("bigint"),
|
590
|
+
bool: createPrimitiveTypeChecker("boolean"),
|
591
|
+
func: createPrimitiveTypeChecker("function"),
|
592
|
+
number: createPrimitiveTypeChecker("number"),
|
593
|
+
object: createPrimitiveTypeChecker("object"),
|
594
|
+
string: createPrimitiveTypeChecker("string"),
|
595
|
+
symbol: createPrimitiveTypeChecker("symbol"),
|
596
|
+
any: createAnyTypeChecker(),
|
597
|
+
arrayOf: createArrayOfTypeChecker,
|
598
|
+
element: createElementTypeChecker(),
|
599
|
+
elementType: createElementTypeTypeChecker(),
|
600
|
+
instanceOf: createInstanceTypeChecker,
|
601
|
+
node: createNodeChecker(),
|
602
|
+
objectOf: createObjectOfTypeChecker,
|
603
|
+
oneOf: createEnumTypeChecker,
|
604
|
+
oneOfType: createUnionTypeChecker,
|
605
|
+
shape: createShapeTypeChecker,
|
606
|
+
exact: createStrictShapeTypeChecker
|
607
|
+
};
|
608
|
+
function is(x, y) {
|
609
|
+
if (x === y) {
|
610
|
+
return x !== 0 || 1 / x === 1 / y;
|
611
|
+
} else {
|
612
|
+
return x !== x && y !== y;
|
613
|
+
}
|
614
|
+
}
|
615
|
+
function PropTypeError(message, data) {
|
616
|
+
this.message = message;
|
617
|
+
this.data = data && typeof data === "object" ? data : {};
|
618
|
+
this.stack = "";
|
619
|
+
}
|
620
|
+
PropTypeError.prototype = Error.prototype;
|
621
|
+
function createChainableTypeChecker(validate) {
|
622
|
+
if (process.env.NODE_ENV !== "production") {
|
623
|
+
var manualPropTypeCallCache = {};
|
624
|
+
var manualPropTypeWarningCount = 0;
|
625
|
+
}
|
626
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
627
|
+
componentName = componentName || ANONYMOUS;
|
628
|
+
propFullName = propFullName || propName;
|
629
|
+
if (secret !== ReactPropTypesSecret) {
|
630
|
+
if (throwOnDirectAccess) {
|
631
|
+
var err = new Error(
|
632
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
633
|
+
);
|
634
|
+
err.name = "Invariant Violation";
|
635
|
+
throw err;
|
636
|
+
} else if (process.env.NODE_ENV !== "production" && typeof console !== "undefined") {
|
637
|
+
var cacheKey = componentName + ":" + propName;
|
638
|
+
if (!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
|
639
|
+
manualPropTypeWarningCount < 3) {
|
640
|
+
printWarning(
|
641
|
+
"You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
642
|
+
);
|
643
|
+
manualPropTypeCallCache[cacheKey] = true;
|
644
|
+
manualPropTypeWarningCount++;
|
645
|
+
}
|
646
|
+
}
|
647
|
+
}
|
648
|
+
if (props[propName] == null) {
|
649
|
+
if (isRequired) {
|
650
|
+
if (props[propName] === null) {
|
651
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`."));
|
652
|
+
}
|
653
|
+
return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`."));
|
654
|
+
}
|
655
|
+
return null;
|
656
|
+
} else {
|
657
|
+
return validate(props, propName, componentName, location, propFullName);
|
658
|
+
}
|
659
|
+
}
|
660
|
+
var chainedCheckType = checkType.bind(null, false);
|
661
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
662
|
+
return chainedCheckType;
|
663
|
+
}
|
664
|
+
function createPrimitiveTypeChecker(expectedType) {
|
665
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
666
|
+
var propValue = props[propName];
|
667
|
+
var propType = getPropType(propValue);
|
668
|
+
if (propType !== expectedType) {
|
669
|
+
var preciseType = getPreciseType(propValue);
|
670
|
+
return new PropTypeError(
|
671
|
+
"Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
|
672
|
+
{ expectedType }
|
673
|
+
);
|
674
|
+
}
|
675
|
+
return null;
|
676
|
+
}
|
677
|
+
return createChainableTypeChecker(validate);
|
678
|
+
}
|
679
|
+
function createAnyTypeChecker() {
|
680
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
681
|
+
}
|
682
|
+
function createArrayOfTypeChecker(typeChecker) {
|
683
|
+
function validate(props, propName, componentName, location, propFullName) {
|
684
|
+
if (typeof typeChecker !== "function") {
|
685
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
|
686
|
+
}
|
687
|
+
var propValue = props[propName];
|
688
|
+
if (!Array.isArray(propValue)) {
|
689
|
+
var propType = getPropType(propValue);
|
690
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
|
691
|
+
}
|
692
|
+
for (var i = 0; i < propValue.length; i++) {
|
693
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
|
694
|
+
if (error instanceof Error) {
|
695
|
+
return error;
|
696
|
+
}
|
697
|
+
}
|
698
|
+
return null;
|
699
|
+
}
|
700
|
+
return createChainableTypeChecker(validate);
|
701
|
+
}
|
702
|
+
function createElementTypeChecker() {
|
703
|
+
function validate(props, propName, componentName, location, propFullName) {
|
704
|
+
var propValue = props[propName];
|
705
|
+
if (!isValidElement(propValue)) {
|
706
|
+
var propType = getPropType(propValue);
|
707
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
708
|
+
}
|
709
|
+
return null;
|
710
|
+
}
|
711
|
+
return createChainableTypeChecker(validate);
|
712
|
+
}
|
713
|
+
function createElementTypeTypeChecker() {
|
714
|
+
function validate(props, propName, componentName, location, propFullName) {
|
715
|
+
var propValue = props[propName];
|
716
|
+
if (!ReactIs.isValidElementType(propValue)) {
|
717
|
+
var propType = getPropType(propValue);
|
718
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
|
719
|
+
}
|
720
|
+
return null;
|
721
|
+
}
|
722
|
+
return createChainableTypeChecker(validate);
|
723
|
+
}
|
724
|
+
function createInstanceTypeChecker(expectedClass) {
|
725
|
+
function validate(props, propName, componentName, location, propFullName) {
|
726
|
+
if (!(props[propName] instanceof expectedClass)) {
|
727
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
728
|
+
var actualClassName = getClassName4(props[propName]);
|
729
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
730
|
+
}
|
731
|
+
return null;
|
732
|
+
}
|
733
|
+
return createChainableTypeChecker(validate);
|
734
|
+
}
|
735
|
+
function createEnumTypeChecker(expectedValues) {
|
736
|
+
if (!Array.isArray(expectedValues)) {
|
737
|
+
if (process.env.NODE_ENV !== "production") {
|
738
|
+
if (arguments.length > 1) {
|
739
|
+
printWarning(
|
740
|
+
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
741
|
+
);
|
742
|
+
} else {
|
743
|
+
printWarning("Invalid argument supplied to oneOf, expected an array.");
|
744
|
+
}
|
745
|
+
}
|
746
|
+
return emptyFunctionThatReturnsNull;
|
747
|
+
}
|
748
|
+
function validate(props, propName, componentName, location, propFullName) {
|
749
|
+
var propValue = props[propName];
|
750
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
751
|
+
if (is(propValue, expectedValues[i])) {
|
752
|
+
return null;
|
753
|
+
}
|
754
|
+
}
|
755
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
756
|
+
var type = getPreciseType(value);
|
757
|
+
if (type === "symbol") {
|
758
|
+
return String(value);
|
759
|
+
}
|
760
|
+
return value;
|
761
|
+
});
|
762
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
|
763
|
+
}
|
764
|
+
return createChainableTypeChecker(validate);
|
765
|
+
}
|
766
|
+
function createObjectOfTypeChecker(typeChecker) {
|
767
|
+
function validate(props, propName, componentName, location, propFullName) {
|
768
|
+
if (typeof typeChecker !== "function") {
|
769
|
+
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
|
770
|
+
}
|
771
|
+
var propValue = props[propName];
|
772
|
+
var propType = getPropType(propValue);
|
773
|
+
if (propType !== "object") {
|
774
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
|
775
|
+
}
|
776
|
+
for (var key in propValue) {
|
777
|
+
if (has(propValue, key)) {
|
778
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
779
|
+
if (error instanceof Error) {
|
780
|
+
return error;
|
781
|
+
}
|
782
|
+
}
|
783
|
+
}
|
784
|
+
return null;
|
785
|
+
}
|
786
|
+
return createChainableTypeChecker(validate);
|
787
|
+
}
|
788
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
789
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
790
|
+
process.env.NODE_ENV !== "production" ? printWarning("Invalid argument supplied to oneOfType, expected an instance of array.") : void 0;
|
791
|
+
return emptyFunctionThatReturnsNull;
|
792
|
+
}
|
793
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
794
|
+
var checker = arrayOfTypeCheckers[i];
|
795
|
+
if (typeof checker !== "function") {
|
796
|
+
printWarning(
|
797
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
|
798
|
+
);
|
799
|
+
return emptyFunctionThatReturnsNull;
|
800
|
+
}
|
801
|
+
}
|
802
|
+
function validate(props, propName, componentName, location, propFullName) {
|
803
|
+
var expectedTypes = [];
|
804
|
+
for (var i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
|
805
|
+
var checker2 = arrayOfTypeCheckers[i2];
|
806
|
+
var checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
|
807
|
+
if (checkerResult == null) {
|
808
|
+
return null;
|
809
|
+
}
|
810
|
+
if (checkerResult.data && has(checkerResult.data, "expectedType")) {
|
811
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
812
|
+
}
|
813
|
+
}
|
814
|
+
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
|
815
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
|
816
|
+
}
|
817
|
+
return createChainableTypeChecker(validate);
|
818
|
+
}
|
819
|
+
function createNodeChecker() {
|
820
|
+
function validate(props, propName, componentName, location, propFullName) {
|
821
|
+
if (!isNode(props[propName])) {
|
822
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
|
823
|
+
}
|
824
|
+
return null;
|
825
|
+
}
|
826
|
+
return createChainableTypeChecker(validate);
|
827
|
+
}
|
828
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
829
|
+
return new PropTypeError(
|
830
|
+
(componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
|
831
|
+
);
|
832
|
+
}
|
833
|
+
function createShapeTypeChecker(shapeTypes) {
|
834
|
+
function validate(props, propName, componentName, location, propFullName) {
|
835
|
+
var propValue = props[propName];
|
836
|
+
var propType = getPropType(propValue);
|
837
|
+
if (propType !== "object") {
|
838
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
839
|
+
}
|
840
|
+
for (var key in shapeTypes) {
|
841
|
+
var checker = shapeTypes[key];
|
842
|
+
if (typeof checker !== "function") {
|
843
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
844
|
+
}
|
845
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
846
|
+
if (error) {
|
847
|
+
return error;
|
848
|
+
}
|
849
|
+
}
|
850
|
+
return null;
|
851
|
+
}
|
852
|
+
return createChainableTypeChecker(validate);
|
853
|
+
}
|
854
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
855
|
+
function validate(props, propName, componentName, location, propFullName) {
|
856
|
+
var propValue = props[propName];
|
857
|
+
var propType = getPropType(propValue);
|
858
|
+
if (propType !== "object") {
|
859
|
+
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
|
860
|
+
}
|
861
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
862
|
+
for (var key in allKeys) {
|
863
|
+
var checker = shapeTypes[key];
|
864
|
+
if (has(shapeTypes, key) && typeof checker !== "function") {
|
865
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
866
|
+
}
|
867
|
+
if (!checker) {
|
868
|
+
return new PropTypeError(
|
869
|
+
"Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")
|
870
|
+
);
|
871
|
+
}
|
872
|
+
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
|
873
|
+
if (error) {
|
874
|
+
return error;
|
875
|
+
}
|
876
|
+
}
|
877
|
+
return null;
|
878
|
+
}
|
879
|
+
return createChainableTypeChecker(validate);
|
880
|
+
}
|
881
|
+
function isNode(propValue) {
|
882
|
+
switch (typeof propValue) {
|
883
|
+
case "number":
|
884
|
+
case "string":
|
885
|
+
case "undefined":
|
886
|
+
return true;
|
887
|
+
case "boolean":
|
888
|
+
return !propValue;
|
889
|
+
case "object":
|
890
|
+
if (Array.isArray(propValue)) {
|
891
|
+
return propValue.every(isNode);
|
892
|
+
}
|
893
|
+
if (propValue === null || isValidElement(propValue)) {
|
894
|
+
return true;
|
895
|
+
}
|
896
|
+
var iteratorFn = getIteratorFn(propValue);
|
897
|
+
if (iteratorFn) {
|
898
|
+
var iterator = iteratorFn.call(propValue);
|
899
|
+
var step;
|
900
|
+
if (iteratorFn !== propValue.entries) {
|
901
|
+
while (!(step = iterator.next()).done) {
|
902
|
+
if (!isNode(step.value)) {
|
903
|
+
return false;
|
904
|
+
}
|
905
|
+
}
|
906
|
+
} else {
|
907
|
+
while (!(step = iterator.next()).done) {
|
908
|
+
var entry = step.value;
|
909
|
+
if (entry) {
|
910
|
+
if (!isNode(entry[1])) {
|
911
|
+
return false;
|
912
|
+
}
|
913
|
+
}
|
914
|
+
}
|
915
|
+
}
|
916
|
+
} else {
|
917
|
+
return false;
|
918
|
+
}
|
919
|
+
return true;
|
920
|
+
default:
|
921
|
+
return false;
|
922
|
+
}
|
923
|
+
}
|
924
|
+
function isSymbol(propType, propValue) {
|
925
|
+
if (propType === "symbol") {
|
926
|
+
return true;
|
927
|
+
}
|
928
|
+
if (!propValue) {
|
929
|
+
return false;
|
930
|
+
}
|
931
|
+
if (propValue["@@toStringTag"] === "Symbol") {
|
932
|
+
return true;
|
933
|
+
}
|
934
|
+
if (typeof Symbol === "function" && propValue instanceof Symbol) {
|
935
|
+
return true;
|
936
|
+
}
|
937
|
+
return false;
|
938
|
+
}
|
939
|
+
function getPropType(propValue) {
|
940
|
+
var propType = typeof propValue;
|
941
|
+
if (Array.isArray(propValue)) {
|
942
|
+
return "array";
|
943
|
+
}
|
944
|
+
if (propValue instanceof RegExp) {
|
945
|
+
return "object";
|
946
|
+
}
|
947
|
+
if (isSymbol(propType, propValue)) {
|
948
|
+
return "symbol";
|
949
|
+
}
|
950
|
+
return propType;
|
951
|
+
}
|
952
|
+
function getPreciseType(propValue) {
|
953
|
+
if (typeof propValue === "undefined" || propValue === null) {
|
954
|
+
return "" + propValue;
|
955
|
+
}
|
956
|
+
var propType = getPropType(propValue);
|
957
|
+
if (propType === "object") {
|
958
|
+
if (propValue instanceof Date) {
|
959
|
+
return "date";
|
960
|
+
} else if (propValue instanceof RegExp) {
|
961
|
+
return "regexp";
|
962
|
+
}
|
963
|
+
}
|
964
|
+
return propType;
|
965
|
+
}
|
966
|
+
function getPostfixForTypeWarning(value) {
|
967
|
+
var type = getPreciseType(value);
|
968
|
+
switch (type) {
|
969
|
+
case "array":
|
970
|
+
case "object":
|
971
|
+
return "an " + type;
|
972
|
+
case "boolean":
|
973
|
+
case "date":
|
974
|
+
case "regexp":
|
975
|
+
return "a " + type;
|
976
|
+
default:
|
977
|
+
return type;
|
978
|
+
}
|
979
|
+
}
|
980
|
+
function getClassName4(propValue) {
|
981
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
982
|
+
return ANONYMOUS;
|
983
|
+
}
|
984
|
+
return propValue.constructor.name;
|
985
|
+
}
|
986
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
987
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
988
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
989
|
+
return ReactPropTypes;
|
990
|
+
};
|
991
|
+
}
|
992
|
+
});
|
993
|
+
|
994
|
+
// ../../node_modules/prop-types/factoryWithThrowingShims.js
|
995
|
+
var require_factoryWithThrowingShims = __commonJS({
|
996
|
+
"../../node_modules/prop-types/factoryWithThrowingShims.js"(exports, module2) {
|
997
|
+
"use strict";
|
998
|
+
init_react_import();
|
999
|
+
var ReactPropTypesSecret = require_ReactPropTypesSecret();
|
1000
|
+
function emptyFunction() {
|
1001
|
+
}
|
1002
|
+
function emptyFunctionWithReset() {
|
1003
|
+
}
|
1004
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
1005
|
+
module2.exports = function() {
|
1006
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
1007
|
+
if (secret === ReactPropTypesSecret) {
|
1008
|
+
return;
|
1009
|
+
}
|
1010
|
+
var err = new Error(
|
1011
|
+
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
1012
|
+
);
|
1013
|
+
err.name = "Invariant Violation";
|
1014
|
+
throw err;
|
1015
|
+
}
|
1016
|
+
;
|
1017
|
+
shim.isRequired = shim;
|
1018
|
+
function getShim() {
|
1019
|
+
return shim;
|
1020
|
+
}
|
1021
|
+
;
|
1022
|
+
var ReactPropTypes = {
|
1023
|
+
array: shim,
|
1024
|
+
bigint: shim,
|
1025
|
+
bool: shim,
|
1026
|
+
func: shim,
|
1027
|
+
number: shim,
|
1028
|
+
object: shim,
|
1029
|
+
string: shim,
|
1030
|
+
symbol: shim,
|
1031
|
+
any: shim,
|
1032
|
+
arrayOf: getShim,
|
1033
|
+
element: shim,
|
1034
|
+
elementType: shim,
|
1035
|
+
instanceOf: getShim,
|
1036
|
+
node: shim,
|
1037
|
+
objectOf: getShim,
|
1038
|
+
oneOf: getShim,
|
1039
|
+
oneOfType: getShim,
|
1040
|
+
shape: getShim,
|
1041
|
+
exact: getShim,
|
1042
|
+
checkPropTypes: emptyFunctionWithReset,
|
1043
|
+
resetWarningCache: emptyFunction
|
1044
|
+
};
|
1045
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
1046
|
+
return ReactPropTypes;
|
1047
|
+
};
|
1048
|
+
}
|
1049
|
+
});
|
1050
|
+
|
1051
|
+
// ../../node_modules/prop-types/index.js
|
1052
|
+
var require_prop_types = __commonJS({
|
1053
|
+
"../../node_modules/prop-types/index.js"(exports, module2) {
|
1054
|
+
init_react_import();
|
1055
|
+
if (process.env.NODE_ENV !== "production") {
|
1056
|
+
ReactIs = require_react_is();
|
1057
|
+
throwOnDirectAccess = true;
|
1058
|
+
module2.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
1059
|
+
} else {
|
1060
|
+
module2.exports = require_factoryWithThrowingShims()();
|
1061
|
+
}
|
1062
|
+
var ReactIs;
|
1063
|
+
var throwOnDirectAccess;
|
1064
|
+
}
|
1065
|
+
});
|
1066
|
+
|
111
1067
|
// index.ts
|
112
1068
|
var plugin_heading_analyzer_exports = {};
|
113
1069
|
__export(plugin_heading_analyzer_exports, {
|
@@ -118,14 +1074,14 @@ init_react_import();
|
|
118
1074
|
|
119
1075
|
// src/HeadingAnalyzer.tsx
|
120
1076
|
init_react_import();
|
121
|
-
var
|
1077
|
+
var import_react3 = require("react");
|
122
1078
|
|
123
1079
|
// ../core/components/SidebarSection/index.tsx
|
124
1080
|
init_react_import();
|
125
1081
|
|
126
1082
|
// css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css#css-module
|
127
1083
|
init_react_import();
|
128
|
-
var styles_module_default = { "SidebarSection": "
|
1084
|
+
var styles_module_default = { "SidebarSection": "_SidebarSection_1y6bv_1", "SidebarSection-title": "_SidebarSection-title_1y6bv_11", "SidebarSection-content": "_SidebarSection-content_1y6bv_17", "SidebarSection--noPadding": "_SidebarSection--noPadding_1y6bv_22", "SidebarSection-breadcrumb": "_SidebarSection-breadcrumb_1y6bv_31" };
|
129
1085
|
|
130
1086
|
// ../core/lib/get-class-name-factory.ts
|
131
1087
|
init_react_import();
|
@@ -178,14 +1134,112 @@ var Heading = ({ children, rank, size = "m" }) => {
|
|
178
1134
|
);
|
179
1135
|
};
|
180
1136
|
|
1137
|
+
// ../../node_modules/react-feather/dist/index.js
|
1138
|
+
init_react_import();
|
1139
|
+
|
1140
|
+
// ../../node_modules/react-feather/dist/icons/chevron-right.js
|
1141
|
+
init_react_import();
|
1142
|
+
var import_react2 = __toESM(require("react"));
|
1143
|
+
var import_prop_types = __toESM(require_prop_types());
|
1144
|
+
function _extends() {
|
1145
|
+
_extends = Object.assign || function(target) {
|
1146
|
+
for (var i = 1; i < arguments.length; i++) {
|
1147
|
+
var source = arguments[i];
|
1148
|
+
for (var key in source) {
|
1149
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
1150
|
+
target[key] = source[key];
|
1151
|
+
}
|
1152
|
+
}
|
1153
|
+
}
|
1154
|
+
return target;
|
1155
|
+
};
|
1156
|
+
return _extends.apply(this, arguments);
|
1157
|
+
}
|
1158
|
+
function _objectWithoutProperties(source, excluded) {
|
1159
|
+
if (source == null)
|
1160
|
+
return {};
|
1161
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
1162
|
+
var key, i;
|
1163
|
+
if (Object.getOwnPropertySymbols) {
|
1164
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
1165
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
1166
|
+
key = sourceSymbolKeys[i];
|
1167
|
+
if (excluded.indexOf(key) >= 0)
|
1168
|
+
continue;
|
1169
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key))
|
1170
|
+
continue;
|
1171
|
+
target[key] = source[key];
|
1172
|
+
}
|
1173
|
+
}
|
1174
|
+
return target;
|
1175
|
+
}
|
1176
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
1177
|
+
if (source == null)
|
1178
|
+
return {};
|
1179
|
+
var target = {};
|
1180
|
+
var sourceKeys = Object.keys(source);
|
1181
|
+
var key, i;
|
1182
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
1183
|
+
key = sourceKeys[i];
|
1184
|
+
if (excluded.indexOf(key) >= 0)
|
1185
|
+
continue;
|
1186
|
+
target[key] = source[key];
|
1187
|
+
}
|
1188
|
+
return target;
|
1189
|
+
}
|
1190
|
+
var ChevronRight = (0, import_react2.forwardRef)(function(_ref, ref) {
|
1191
|
+
var _ref$color = _ref.color, color = _ref$color === void 0 ? "currentColor" : _ref$color, _ref$size = _ref.size, size = _ref$size === void 0 ? 24 : _ref$size, rest = _objectWithoutProperties(_ref, ["color", "size"]);
|
1192
|
+
return /* @__PURE__ */ import_react2.default.createElement("svg", _extends({
|
1193
|
+
ref,
|
1194
|
+
xmlns: "http://www.w3.org/2000/svg",
|
1195
|
+
width: size,
|
1196
|
+
height: size,
|
1197
|
+
viewBox: "0 0 24 24",
|
1198
|
+
fill: "none",
|
1199
|
+
stroke: color,
|
1200
|
+
strokeWidth: "2",
|
1201
|
+
strokeLinecap: "round",
|
1202
|
+
strokeLinejoin: "round"
|
1203
|
+
}, rest), /* @__PURE__ */ import_react2.default.createElement("polyline", {
|
1204
|
+
points: "9 18 15 12 9 6"
|
1205
|
+
}));
|
1206
|
+
});
|
1207
|
+
ChevronRight.propTypes = {
|
1208
|
+
color: import_prop_types.default.string,
|
1209
|
+
size: import_prop_types.default.oneOfType([import_prop_types.default.string, import_prop_types.default.number])
|
1210
|
+
};
|
1211
|
+
ChevronRight.displayName = "ChevronRight";
|
1212
|
+
var chevron_right_default = ChevronRight;
|
1213
|
+
|
181
1214
|
// ../core/components/SidebarSection/index.tsx
|
182
1215
|
var getClassName2 = get_class_name_factory_default("SidebarSection", styles_module_default);
|
183
1216
|
var SidebarSection = ({
|
184
1217
|
children,
|
185
1218
|
title,
|
186
|
-
background
|
1219
|
+
background,
|
1220
|
+
breadcrumb,
|
1221
|
+
breadcrumbClick,
|
1222
|
+
noPadding
|
187
1223
|
}) => {
|
188
|
-
return /* @__PURE__ */ import_react.default.createElement("
|
1224
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: getClassName2({ noPadding }), style: { background } }, /* @__PURE__ */ import_react.default.createElement("div", { className: getClassName2("title") }, /* @__PURE__ */ import_react.default.createElement(
|
1225
|
+
"span",
|
1226
|
+
{
|
1227
|
+
style: {
|
1228
|
+
display: "flex",
|
1229
|
+
gap: 4,
|
1230
|
+
alignItems: "center"
|
1231
|
+
}
|
1232
|
+
},
|
1233
|
+
breadcrumb && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
1234
|
+
"div",
|
1235
|
+
{
|
1236
|
+
className: getClassName2("breadcrumb"),
|
1237
|
+
onClick: breadcrumbClick
|
1238
|
+
},
|
1239
|
+
breadcrumb
|
1240
|
+
), /* @__PURE__ */ import_react.default.createElement(chevron_right_default, { size: 16 })),
|
1241
|
+
/* @__PURE__ */ import_react.default.createElement(Heading, { rank: 2, size: "xs" }, title)
|
1242
|
+
)), /* @__PURE__ */ import_react.default.createElement("div", { className: getClassName2("content") }, children));
|
189
1243
|
};
|
190
1244
|
|
191
1245
|
// ../core/components/OutlineList/index.tsx
|
@@ -285,9 +1339,9 @@ var HeadingOutlineAnalyer = ({
|
|
285
1339
|
children,
|
286
1340
|
data
|
287
1341
|
}) => {
|
288
|
-
const [hierarchy, setHierarchy] = (0,
|
289
|
-
const [firstRender, setFirstRender] = (0,
|
290
|
-
(0,
|
1342
|
+
const [hierarchy, setHierarchy] = (0, import_react3.useState)([]);
|
1343
|
+
const [firstRender, setFirstRender] = (0, import_react3.useState)(true);
|
1344
|
+
(0, import_react3.useEffect)(() => {
|
291
1345
|
if (firstRender) {
|
292
1346
|
setTimeout(() => {
|
293
1347
|
setHierarchy(buildHierarchy());
|
@@ -375,4 +1429,31 @@ classnames/index.js:
|
|
375
1429
|
Licensed under the MIT License (MIT), see
|
376
1430
|
http://jedwatson.github.io/classnames
|
377
1431
|
*)
|
1432
|
+
|
1433
|
+
react-is/cjs/react-is.production.min.js:
|
1434
|
+
(** @license React v16.13.1
|
1435
|
+
* react-is.production.min.js
|
1436
|
+
*
|
1437
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
1438
|
+
*
|
1439
|
+
* This source code is licensed under the MIT license found in the
|
1440
|
+
* LICENSE file in the root directory of this source tree.
|
1441
|
+
*)
|
1442
|
+
|
1443
|
+
react-is/cjs/react-is.development.js:
|
1444
|
+
(** @license React v16.13.1
|
1445
|
+
* react-is.development.js
|
1446
|
+
*
|
1447
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
1448
|
+
*
|
1449
|
+
* This source code is licensed under the MIT license found in the
|
1450
|
+
* LICENSE file in the root directory of this source tree.
|
1451
|
+
*)
|
1452
|
+
|
1453
|
+
object-assign/index.js:
|
1454
|
+
(*
|
1455
|
+
object-assign
|
1456
|
+
(c) Sindre Sorhus
|
1457
|
+
@license MIT
|
1458
|
+
*)
|
378
1459
|
*/
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@measured/puck-plugin-heading-analyzer",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.5.0",
|
4
4
|
"private": false,
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"types": "./dist/index.d.ts",
|
@@ -14,7 +14,7 @@
|
|
14
14
|
"dist"
|
15
15
|
],
|
16
16
|
"devDependencies": {
|
17
|
-
"@measured/puck": "^0.
|
17
|
+
"@measured/puck": "^0.5.0",
|
18
18
|
"@types/react": "^18.2.0",
|
19
19
|
"@types/react-dom": "^18.2.0",
|
20
20
|
"eslint": "^7.32.0",
|