@storybook/addon-onboarding 11.0.0-alpha.0 → 11.0.0-alpha.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.
|
@@ -512,7 +512,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
|
512
512
|
shape: createShapeTypeChecker,
|
|
513
513
|
exact: createStrictShapeTypeChecker
|
|
514
514
|
};
|
|
515
|
-
function
|
|
515
|
+
function is3(x2, y2) {
|
|
516
516
|
return x2 === y2 ? x2 !== 0 || 1 / x2 === 1 / y2 : x2 !== x2 && y2 !== y2;
|
|
517
517
|
}
|
|
518
518
|
function PropTypeError(message, data) {
|
|
@@ -616,7 +616,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
|
616
616
|
) : printWarning("Invalid argument supplied to oneOf, expected an array.")), emptyFunctionThatReturnsNull;
|
|
617
617
|
function validate(props, propName, componentName, location, propFullName) {
|
|
618
618
|
for (var propValue = props[propName], i2 = 0; i2 < expectedValues.length; i2++)
|
|
619
|
-
if (
|
|
619
|
+
if (is3(propValue, expectedValues[i2]))
|
|
620
620
|
return null;
|
|
621
621
|
var valuesString = JSON.stringify(expectedValues, function(key, value) {
|
|
622
622
|
var type = getPreciseType(value);
|
|
@@ -1968,7 +1968,7 @@ is.weakMap = isObjectOfType("WeakMap");
|
|
|
1968
1968
|
is.weakSet = isObjectOfType("WeakSet");
|
|
1969
1969
|
var src_default = is;
|
|
1970
1970
|
|
|
1971
|
-
// ../../../node_modules/
|
|
1971
|
+
// ../../../node_modules/tree-changes/dist/index.mjs
|
|
1972
1972
|
function canHaveLength(...arguments_) {
|
|
1973
1973
|
return arguments_.every((d2) => src_default.string(d2) || src_default.array(d2) || src_default.plainObject(d2));
|
|
1974
1974
|
}
|
|
@@ -3283,7 +3283,7 @@ is2.weakMap = isObjectOfType2("WeakMap");
|
|
|
3283
3283
|
is2.weakSet = isObjectOfType2("WeakSet");
|
|
3284
3284
|
var esm_default = is2;
|
|
3285
3285
|
|
|
3286
|
-
// ../../../node_modules/
|
|
3286
|
+
// ../../../node_modules/react-floater/node_modules/@gilbarbara/deep-equal/esm/helpers.js
|
|
3287
3287
|
function isOfType4(type) {
|
|
3288
3288
|
return function(value) {
|
|
3289
3289
|
return typeof value === type;
|
|
@@ -3297,7 +3297,7 @@ var isFunction3 = isOfType4("function"), isNull2 = function(value) {
|
|
|
3297
3297
|
return !isUndefined2(value) && !isNull2(value) && (isFunction3(value) || typeof value == "object");
|
|
3298
3298
|
}, isUndefined2 = isOfType4("undefined");
|
|
3299
3299
|
|
|
3300
|
-
// ../../../node_modules/
|
|
3300
|
+
// ../../../node_modules/react-floater/node_modules/@gilbarbara/deep-equal/esm/index.js
|
|
3301
3301
|
var __values = function(o2) {
|
|
3302
3302
|
var s2 = typeof Symbol == "function" && Symbol.iterator, m2 = s2 && o2[s2], i2 = 0;
|
|
3303
3303
|
if (m2) return m2.call(o2);
|
|
@@ -3418,203 +3418,34 @@ function equal2(left, right) {
|
|
|
3418
3418
|
return Number.isNaN(left) && Number.isNaN(right) ? !0 : left === right;
|
|
3419
3419
|
}
|
|
3420
3420
|
|
|
3421
|
-
// ../../../node_modules/
|
|
3422
|
-
var DOM_PROPERTIES_TO_CHECK3 = [
|
|
3423
|
-
"innerHTML",
|
|
3424
|
-
"ownerDocument",
|
|
3425
|
-
"style",
|
|
3426
|
-
"attributes",
|
|
3427
|
-
"nodeValue"
|
|
3428
|
-
], objectTypes3 = [
|
|
3429
|
-
"Array",
|
|
3430
|
-
"ArrayBuffer",
|
|
3431
|
-
"AsyncFunction",
|
|
3432
|
-
"AsyncGenerator",
|
|
3433
|
-
"AsyncGeneratorFunction",
|
|
3434
|
-
"Date",
|
|
3435
|
-
"Error",
|
|
3436
|
-
"Function",
|
|
3437
|
-
"Generator",
|
|
3438
|
-
"GeneratorFunction",
|
|
3439
|
-
"HTMLElement",
|
|
3440
|
-
"Map",
|
|
3441
|
-
"Object",
|
|
3442
|
-
"Promise",
|
|
3443
|
-
"RegExp",
|
|
3444
|
-
"Set",
|
|
3445
|
-
"WeakMap",
|
|
3446
|
-
"WeakSet"
|
|
3447
|
-
], primitiveTypes3 = [
|
|
3448
|
-
"bigint",
|
|
3449
|
-
"boolean",
|
|
3450
|
-
"null",
|
|
3451
|
-
"number",
|
|
3452
|
-
"string",
|
|
3453
|
-
"symbol",
|
|
3454
|
-
"undefined"
|
|
3455
|
-
];
|
|
3456
|
-
function getObjectType3(value) {
|
|
3457
|
-
var objectTypeName = Object.prototype.toString.call(value).slice(8, -1);
|
|
3458
|
-
if (/HTML\w+Element/.test(objectTypeName))
|
|
3459
|
-
return "HTMLElement";
|
|
3460
|
-
if (isObjectType3(objectTypeName))
|
|
3461
|
-
return objectTypeName;
|
|
3462
|
-
}
|
|
3463
|
-
function isObjectOfType3(type) {
|
|
3464
|
-
return function(value) {
|
|
3465
|
-
return getObjectType3(value) === type;
|
|
3466
|
-
};
|
|
3467
|
-
}
|
|
3468
|
-
function isObjectType3(name) {
|
|
3469
|
-
return objectTypes3.includes(name);
|
|
3470
|
-
}
|
|
3471
|
-
function isOfType5(type) {
|
|
3472
|
-
return function(value) {
|
|
3473
|
-
return typeof value === type;
|
|
3474
|
-
};
|
|
3475
|
-
}
|
|
3476
|
-
function isPrimitiveType3(name) {
|
|
3477
|
-
return primitiveTypes3.includes(name);
|
|
3478
|
-
}
|
|
3479
|
-
function is3(value) {
|
|
3480
|
-
if (value === null)
|
|
3481
|
-
return "null";
|
|
3482
|
-
switch (typeof value) {
|
|
3483
|
-
case "bigint":
|
|
3484
|
-
return "bigint";
|
|
3485
|
-
case "boolean":
|
|
3486
|
-
return "boolean";
|
|
3487
|
-
case "number":
|
|
3488
|
-
return "number";
|
|
3489
|
-
case "string":
|
|
3490
|
-
return "string";
|
|
3491
|
-
case "symbol":
|
|
3492
|
-
return "symbol";
|
|
3493
|
-
case "undefined":
|
|
3494
|
-
return "undefined";
|
|
3495
|
-
default:
|
|
3496
|
-
}
|
|
3497
|
-
if (is3.array(value))
|
|
3498
|
-
return "Array";
|
|
3499
|
-
if (is3.plainFunction(value))
|
|
3500
|
-
return "Function";
|
|
3501
|
-
var tagType = getObjectType3(value);
|
|
3502
|
-
return tagType || "Object";
|
|
3503
|
-
}
|
|
3504
|
-
is3.array = Array.isArray;
|
|
3505
|
-
is3.arrayOf = function(target, predicate) {
|
|
3506
|
-
return !is3.array(target) && !is3.function(predicate) ? !1 : target.every(function(d2) {
|
|
3507
|
-
return predicate(d2);
|
|
3508
|
-
});
|
|
3509
|
-
};
|
|
3510
|
-
is3.asyncGeneratorFunction = function(value) {
|
|
3511
|
-
return getObjectType3(value) === "AsyncGeneratorFunction";
|
|
3512
|
-
};
|
|
3513
|
-
is3.asyncFunction = isObjectOfType3("AsyncFunction");
|
|
3514
|
-
is3.bigint = isOfType5("bigint");
|
|
3515
|
-
is3.boolean = function(value) {
|
|
3516
|
-
return value === !0 || value === !1;
|
|
3517
|
-
};
|
|
3518
|
-
is3.date = isObjectOfType3("Date");
|
|
3519
|
-
is3.defined = function(value) {
|
|
3520
|
-
return !is3.undefined(value);
|
|
3521
|
-
};
|
|
3522
|
-
is3.domElement = function(value) {
|
|
3523
|
-
return is3.object(value) && !is3.plainObject(value) && value.nodeType === 1 && is3.string(value.nodeName) && DOM_PROPERTIES_TO_CHECK3.every(function(property) {
|
|
3524
|
-
return property in value;
|
|
3525
|
-
});
|
|
3526
|
-
};
|
|
3527
|
-
is3.empty = function(value) {
|
|
3528
|
-
return is3.string(value) && value.length === 0 || is3.array(value) && value.length === 0 || is3.object(value) && !is3.map(value) && !is3.set(value) && Object.keys(value).length === 0 || is3.set(value) && value.size === 0 || is3.map(value) && value.size === 0;
|
|
3529
|
-
};
|
|
3530
|
-
is3.error = isObjectOfType3("Error");
|
|
3531
|
-
is3.function = isOfType5("function");
|
|
3532
|
-
is3.generator = function(value) {
|
|
3533
|
-
return is3.iterable(value) && is3.function(value.next) && is3.function(value.throw);
|
|
3534
|
-
};
|
|
3535
|
-
is3.generatorFunction = isObjectOfType3("GeneratorFunction");
|
|
3536
|
-
is3.instanceOf = function(instance, class_) {
|
|
3537
|
-
return !instance || !class_ ? !1 : Object.getPrototypeOf(instance) === class_.prototype;
|
|
3538
|
-
};
|
|
3539
|
-
is3.iterable = function(value) {
|
|
3540
|
-
return !is3.nullOrUndefined(value) && is3.function(value[Symbol.iterator]);
|
|
3541
|
-
};
|
|
3542
|
-
is3.map = isObjectOfType3("Map");
|
|
3543
|
-
is3.nan = function(value) {
|
|
3544
|
-
return Number.isNaN(value);
|
|
3545
|
-
};
|
|
3546
|
-
is3.null = function(value) {
|
|
3547
|
-
return value === null;
|
|
3548
|
-
};
|
|
3549
|
-
is3.nullOrUndefined = function(value) {
|
|
3550
|
-
return is3.null(value) || is3.undefined(value);
|
|
3551
|
-
};
|
|
3552
|
-
is3.number = function(value) {
|
|
3553
|
-
return isOfType5("number")(value) && !is3.nan(value);
|
|
3554
|
-
};
|
|
3555
|
-
is3.numericString = function(value) {
|
|
3556
|
-
return is3.string(value) && value.length > 0 && !Number.isNaN(Number(value));
|
|
3557
|
-
};
|
|
3558
|
-
is3.object = function(value) {
|
|
3559
|
-
return !is3.nullOrUndefined(value) && (is3.function(value) || typeof value == "object");
|
|
3560
|
-
};
|
|
3561
|
-
is3.oneOf = function(target, value) {
|
|
3562
|
-
return is3.array(target) ? target.indexOf(value) > -1 : !1;
|
|
3563
|
-
};
|
|
3564
|
-
is3.plainFunction = isObjectOfType3("Function");
|
|
3565
|
-
is3.plainObject = function(value) {
|
|
3566
|
-
if (getObjectType3(value) !== "Object")
|
|
3567
|
-
return !1;
|
|
3568
|
-
var prototype = Object.getPrototypeOf(value);
|
|
3569
|
-
return prototype === null || prototype === Object.getPrototypeOf({});
|
|
3570
|
-
};
|
|
3571
|
-
is3.primitive = function(value) {
|
|
3572
|
-
return is3.null(value) || isPrimitiveType3(typeof value);
|
|
3573
|
-
};
|
|
3574
|
-
is3.promise = isObjectOfType3("Promise");
|
|
3575
|
-
is3.propertyOf = function(target, key, predicate) {
|
|
3576
|
-
if (!is3.object(target) || !key)
|
|
3577
|
-
return !1;
|
|
3578
|
-
var value = target[key];
|
|
3579
|
-
return is3.function(predicate) ? predicate(value) : is3.defined(value);
|
|
3580
|
-
};
|
|
3581
|
-
is3.regexp = isObjectOfType3("RegExp");
|
|
3582
|
-
is3.set = isObjectOfType3("Set");
|
|
3583
|
-
is3.string = isOfType5("string");
|
|
3584
|
-
is3.symbol = isOfType5("symbol");
|
|
3585
|
-
is3.undefined = isOfType5("undefined");
|
|
3586
|
-
is3.weakMap = isObjectOfType3("WeakMap");
|
|
3587
|
-
is3.weakSet = isObjectOfType3("WeakSet");
|
|
3588
|
-
var esm_default2 = is3;
|
|
3589
|
-
|
|
3590
|
-
// ../../../node_modules/tree-changes/esm/helpers.js
|
|
3421
|
+
// ../../../node_modules/react-floater/node_modules/tree-changes/esm/helpers.js
|
|
3591
3422
|
function canHaveLength2() {
|
|
3592
3423
|
for (var arguments_ = [], _i = 0; _i < arguments.length; _i++)
|
|
3593
3424
|
arguments_[_i] = arguments[_i];
|
|
3594
3425
|
return arguments_.every(function(d2) {
|
|
3595
|
-
return
|
|
3426
|
+
return esm_default.string(d2) || esm_default.array(d2) || esm_default.plainObject(d2);
|
|
3596
3427
|
});
|
|
3597
3428
|
}
|
|
3598
3429
|
function checkEquality2(left, right, value) {
|
|
3599
|
-
return isSameType2(left, right) ? [left, right].every(
|
|
3430
|
+
return isSameType2(left, right) ? [left, right].every(esm_default.array) ? !left.some(hasValue2(value)) && right.some(hasValue2(value)) : [left, right].every(esm_default.plainObject) ? !Object.entries(left).some(hasEntry2(value)) && Object.entries(right).some(hasEntry2(value)) : right === value : !1;
|
|
3600
3431
|
}
|
|
3601
3432
|
function compareNumbers2(previousData, data, options) {
|
|
3602
|
-
var actual = options.actual, key = options.key, previous = options.previous, type = options.type, left = nested2(previousData, key), right = nested2(data, key), changed = [left, right].every(
|
|
3603
|
-
return
|
|
3433
|
+
var actual = options.actual, key = options.key, previous = options.previous, type = options.type, left = nested2(previousData, key), right = nested2(data, key), changed = [left, right].every(esm_default.number) && (type === "increased" ? left < right : left > right);
|
|
3434
|
+
return esm_default.undefined(actual) || (changed = changed && right === actual), esm_default.undefined(previous) || (changed = changed && left === previous), changed;
|
|
3604
3435
|
}
|
|
3605
3436
|
function compareValues2(previousData, data, options) {
|
|
3606
3437
|
var key = options.key, type = options.type, value = options.value, left = nested2(previousData, key), right = nested2(data, key), primary = type === "added" ? left : right, secondary = type === "added" ? right : left;
|
|
3607
|
-
if (!
|
|
3608
|
-
if (
|
|
3609
|
-
if (
|
|
3438
|
+
if (!esm_default.nullOrUndefined(value)) {
|
|
3439
|
+
if (esm_default.defined(primary)) {
|
|
3440
|
+
if (esm_default.array(primary) || esm_default.plainObject(primary))
|
|
3610
3441
|
return checkEquality2(primary, secondary, value);
|
|
3611
3442
|
} else
|
|
3612
3443
|
return equal2(secondary, value);
|
|
3613
3444
|
return !1;
|
|
3614
3445
|
}
|
|
3615
|
-
return [left, right].every(
|
|
3616
|
-
return
|
|
3617
|
-
}) && (type === "added" ? !
|
|
3446
|
+
return [left, right].every(esm_default.array) ? !secondary.every(isEqualPredicate2(primary)) : [left, right].every(esm_default.plainObject) ? hasExtraKeys2(Object.keys(primary), Object.keys(secondary)) : ![left, right].every(function(d2) {
|
|
3447
|
+
return esm_default.primitive(d2) && esm_default.defined(d2);
|
|
3448
|
+
}) && (type === "added" ? !esm_default.defined(left) && esm_default.defined(right) : esm_default.defined(left) && !esm_default.defined(right));
|
|
3618
3449
|
}
|
|
3619
3450
|
function getIterables2(previousData, data, _a) {
|
|
3620
3451
|
var _b = _a === void 0 ? {} : _a, key = _b.key, left = nested2(previousData, key), right = nested2(data, key);
|
|
@@ -3622,14 +3453,14 @@ function getIterables2(previousData, data, _a) {
|
|
|
3622
3453
|
throw new TypeError("Inputs have different types");
|
|
3623
3454
|
if (!canHaveLength2(left, right))
|
|
3624
3455
|
throw new TypeError("Inputs don't have length");
|
|
3625
|
-
return [left, right].every(
|
|
3456
|
+
return [left, right].every(esm_default.plainObject) && (left = Object.keys(left), right = Object.keys(right)), [left, right];
|
|
3626
3457
|
}
|
|
3627
3458
|
function hasEntry2(input) {
|
|
3628
3459
|
return function(_a) {
|
|
3629
3460
|
var key = _a[0], value = _a[1];
|
|
3630
|
-
return
|
|
3631
|
-
return equal2(d2, value) ||
|
|
3632
|
-
}) :
|
|
3461
|
+
return esm_default.array(input) ? equal2(input, value) || input.some(function(d2) {
|
|
3462
|
+
return equal2(d2, value) || esm_default.array(value) && isEqualPredicate2(value)(d2);
|
|
3463
|
+
}) : esm_default.plainObject(input) && input[key] ? !!input[key] && equal2(input[key], value) : equal2(input, value);
|
|
3633
3464
|
};
|
|
3634
3465
|
}
|
|
3635
3466
|
function hasExtraKeys2(left, right) {
|
|
@@ -3639,13 +3470,13 @@ function hasExtraKeys2(left, right) {
|
|
|
3639
3470
|
}
|
|
3640
3471
|
function hasValue2(input) {
|
|
3641
3472
|
return function(value) {
|
|
3642
|
-
return
|
|
3643
|
-
return equal2(d2, value) ||
|
|
3473
|
+
return esm_default.array(input) ? input.some(function(d2) {
|
|
3474
|
+
return equal2(d2, value) || esm_default.array(value) && isEqualPredicate2(value)(d2);
|
|
3644
3475
|
}) : equal2(input, value);
|
|
3645
3476
|
};
|
|
3646
3477
|
}
|
|
3647
3478
|
function includesOrEqualsTo2(previousValue, value) {
|
|
3648
|
-
return
|
|
3479
|
+
return esm_default.array(previousValue) ? previousValue.some(function(d2) {
|
|
3649
3480
|
return equal2(d2, value);
|
|
3650
3481
|
}) : equal2(previousValue, value);
|
|
3651
3482
|
}
|
|
@@ -3659,27 +3490,27 @@ function isEqualPredicate2(data) {
|
|
|
3659
3490
|
function isSameType2() {
|
|
3660
3491
|
for (var arguments_ = [], _i = 0; _i < arguments.length; _i++)
|
|
3661
3492
|
arguments_[_i] = arguments[_i];
|
|
3662
|
-
return arguments_.every(
|
|
3493
|
+
return arguments_.every(esm_default.array) || arguments_.every(esm_default.number) || arguments_.every(esm_default.plainObject) || arguments_.every(esm_default.string);
|
|
3663
3494
|
}
|
|
3664
3495
|
function nested2(data, property) {
|
|
3665
|
-
if (
|
|
3666
|
-
if (
|
|
3496
|
+
if (esm_default.plainObject(data) || esm_default.array(data)) {
|
|
3497
|
+
if (esm_default.string(property)) {
|
|
3667
3498
|
var props = property.split(".");
|
|
3668
3499
|
return props.reduce(function(acc, d2) {
|
|
3669
3500
|
return acc && acc[d2];
|
|
3670
3501
|
}, data);
|
|
3671
3502
|
}
|
|
3672
|
-
return
|
|
3503
|
+
return esm_default.number(property) ? data[property] : data;
|
|
3673
3504
|
}
|
|
3674
3505
|
return data;
|
|
3675
3506
|
}
|
|
3676
3507
|
|
|
3677
|
-
// ../../../node_modules/tree-changes/esm/index.js
|
|
3508
|
+
// ../../../node_modules/react-floater/node_modules/tree-changes/esm/index.js
|
|
3678
3509
|
function treeChanges2(previousData, data) {
|
|
3679
|
-
if ([previousData, data].some(
|
|
3510
|
+
if ([previousData, data].some(esm_default.nullOrUndefined))
|
|
3680
3511
|
throw new Error("Missing required parameters");
|
|
3681
3512
|
if (![previousData, data].every(function(d2) {
|
|
3682
|
-
return
|
|
3513
|
+
return esm_default.plainObject(d2) || esm_default.array(d2);
|
|
3683
3514
|
}))
|
|
3684
3515
|
throw new Error("Expected plain objects or array");
|
|
3685
3516
|
var added = function(key, value) {
|
|
@@ -3690,28 +3521,28 @@ function treeChanges2(previousData, data) {
|
|
|
3690
3521
|
}
|
|
3691
3522
|
}, changed = function(key, actual, previous) {
|
|
3692
3523
|
try {
|
|
3693
|
-
var left = nested2(previousData, key), right = nested2(data, key), hasActual =
|
|
3524
|
+
var left = nested2(previousData, key), right = nested2(data, key), hasActual = esm_default.defined(actual), hasPrevious = esm_default.defined(previous);
|
|
3694
3525
|
if (hasActual || hasPrevious) {
|
|
3695
3526
|
var leftComparator = hasPrevious ? includesOrEqualsTo2(previous, left) : !includesOrEqualsTo2(actual, left), rightComparator = includesOrEqualsTo2(actual, right);
|
|
3696
3527
|
return leftComparator && rightComparator;
|
|
3697
3528
|
}
|
|
3698
|
-
return [left, right].every(
|
|
3529
|
+
return [left, right].every(esm_default.array) || [left, right].every(esm_default.plainObject) ? !equal2(left, right) : left !== right;
|
|
3699
3530
|
} catch {
|
|
3700
3531
|
return !1;
|
|
3701
3532
|
}
|
|
3702
3533
|
}, changedFrom = function(key, previous, actual) {
|
|
3703
|
-
if (!
|
|
3534
|
+
if (!esm_default.defined(key))
|
|
3704
3535
|
return !1;
|
|
3705
3536
|
try {
|
|
3706
|
-
var left = nested2(previousData, key), right = nested2(data, key), hasActual =
|
|
3537
|
+
var left = nested2(previousData, key), right = nested2(data, key), hasActual = esm_default.defined(actual);
|
|
3707
3538
|
return includesOrEqualsTo2(previous, left) && (hasActual ? includesOrEqualsTo2(actual, right) : !hasActual);
|
|
3708
3539
|
} catch {
|
|
3709
3540
|
return !1;
|
|
3710
3541
|
}
|
|
3711
3542
|
}, changedTo = function(key, actual) {
|
|
3712
|
-
return
|
|
3543
|
+
return esm_default.defined(key) ? (process.env.NODE_ENV === "development" && console.warn("`changedTo` is deprecated! Replace it with `change`"), changed(key, actual)) : !1;
|
|
3713
3544
|
}, decreased = function(key, actual, previous) {
|
|
3714
|
-
if (!
|
|
3545
|
+
if (!esm_default.defined(key))
|
|
3715
3546
|
return !1;
|
|
3716
3547
|
try {
|
|
3717
3548
|
return compareNumbers2(previousData, data, { key, actual, previous, type: "decreased" });
|
|
@@ -3733,7 +3564,7 @@ function treeChanges2(previousData, data) {
|
|
|
3733
3564
|
return !1;
|
|
3734
3565
|
}
|
|
3735
3566
|
}, increased = function(key, actual, previous) {
|
|
3736
|
-
if (!
|
|
3567
|
+
if (!esm_default.defined(key))
|
|
3737
3568
|
return !1;
|
|
3738
3569
|
try {
|
|
3739
3570
|
return compareNumbers2(previousData, data, { key, actual, previous, type: "increased" });
|
|
@@ -4333,14 +4164,14 @@ function getBrowser(userAgent = navigator.userAgent) {
|
|
|
4333
4164
|
let browser = userAgent;
|
|
4334
4165
|
return typeof window > "u" ? browser = "node" : document.documentMode ? browser = "ie" : /Edge/.test(userAgent) ? browser = "edge" : window.opera || userAgent.includes(" OPR/") ? browser = "opera" : typeof window.InstallTrigger < "u" ? browser = "firefox" : window.chrome ? browser = "chrome" : /(Version\/([\d._]+).*Safari|CriOS|FxiOS| Mobile\/)/.test(userAgent) && (browser = "safari"), browser;
|
|
4335
4166
|
}
|
|
4336
|
-
function
|
|
4167
|
+
function getObjectType3(value) {
|
|
4337
4168
|
return Object.prototype.toString.call(value).slice(8, -1).toLowerCase();
|
|
4338
4169
|
}
|
|
4339
4170
|
function getReactNodeText(input, options = {}) {
|
|
4340
4171
|
let { defaultValue, step, steps } = options, text = (0, import_react_innertext.default)(input);
|
|
4341
4172
|
if (text)
|
|
4342
4173
|
(text.includes("{step}") || text.includes("{steps}")) && step && steps && (text = text.replace("{step}", step.toString()).replace("{steps}", steps.toString()));
|
|
4343
|
-
else if (isValidElement(input) && !Object.values(input.props).length &&
|
|
4174
|
+
else if (isValidElement(input) && !Object.values(input.props).length && getObjectType3(input.type) === "function") {
|
|
4344
4175
|
let component = input.type({});
|
|
4345
4176
|
text = getReactNodeText(component, options);
|
|
4346
4177
|
} else
|
|
@@ -4392,12 +4223,12 @@ function pick(input, ...filter) {
|
|
|
4392
4223
|
}
|
|
4393
4224
|
function replaceLocaleContent(input, step, steps) {
|
|
4394
4225
|
let replacer = (text) => text.replace("{step}", String(step)).replace("{steps}", String(steps));
|
|
4395
|
-
if (
|
|
4226
|
+
if (getObjectType3(input) === "string")
|
|
4396
4227
|
return replacer(input);
|
|
4397
4228
|
if (!isValidElement(input))
|
|
4398
4229
|
return input;
|
|
4399
4230
|
let { children } = input.props;
|
|
4400
|
-
if (
|
|
4231
|
+
if (getObjectType3(children) === "string" && children.includes("{step}"))
|
|
4401
4232
|
return cloneElement(input, {
|
|
4402
4233
|
children: replacer(children)
|
|
4403
4234
|
});
|
|
@@ -4405,7 +4236,7 @@ function replaceLocaleContent(input, step, steps) {
|
|
|
4405
4236
|
return cloneElement(input, {
|
|
4406
4237
|
children: children.map((child) => typeof child == "string" ? replacer(child) : replaceLocaleContent(child, step, steps))
|
|
4407
4238
|
});
|
|
4408
|
-
if (
|
|
4239
|
+
if (getObjectType3(input.type) === "function" && !Object.values(input.props).length) {
|
|
4409
4240
|
let component = input.type({});
|
|
4410
4241
|
return replaceLocaleContent(component, step, steps);
|
|
4411
4242
|
}
|
package/dist/manager.js
CHANGED
|
@@ -9,7 +9,7 @@ import React, { Suspense, lazy } from "react";
|
|
|
9
9
|
import { createRoot } from "react-dom/client";
|
|
10
10
|
import { STORY_SPECIFIED } from "storybook/internal/core-events";
|
|
11
11
|
import { addons, internal_universalChecklistStore as checklistStore } from "storybook/manager-api";
|
|
12
|
-
var Onboarding = lazy(() => import("./_browser-chunks/Onboarding-
|
|
12
|
+
var Onboarding = lazy(() => import("./_browser-chunks/Onboarding-GSIT5DYS.js")), Survey = lazy(() => import("./_browser-chunks/Survey-ONUNS54C.js")), root = null, render = (node) => {
|
|
13
13
|
let container = document.getElementById("storybook-addon-onboarding");
|
|
14
14
|
container || (container = document.createElement("div"), container.id = "storybook-addon-onboarding", document.body.appendChild(container)), root = root ?? createRoot(container), root.render(React.createElement(Suspense, { fallback: React.createElement("div", null) }, node));
|
|
15
15
|
};
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_ufa2wjwnrol from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_ufa2wjwnrol from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_ufa2wjwnrol from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_ufa2wjwnrol.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_ufa2wjwnrol.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_ufa2wjwnrol.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -14,7 +14,7 @@ var require = CJS_COMPAT_NODE_MODULE_m9o6c2b4l9n.createRequire(import.meta.url);
|
|
|
14
14
|
import { telemetry } from "storybook/internal/telemetry";
|
|
15
15
|
|
|
16
16
|
// package.json
|
|
17
|
-
var version = "11.0.0-alpha.
|
|
17
|
+
var version = "11.0.0-alpha.1";
|
|
18
18
|
|
|
19
19
|
// src/constants.ts
|
|
20
20
|
var ADDON_ID = "storybook/onboarding", ADDON_ONBOARDING_CHANNEL = `${ADDON_ID}/channel`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-onboarding",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.1",
|
|
4
4
|
"description": "Storybook Onboarding: Help new users learn how to write stories",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"typescript": "^6.0.3"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
|
-
"storybook": "^11.0.0-alpha.
|
|
59
|
+
"storybook": "^11.0.0-alpha.1"
|
|
60
60
|
},
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"access": "public"
|