@storybook/addon-docs 10.3.0-alpha.9 → 10.3.0-beta.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/_browser-chunks/{chunk-AAVP3AE4.js → chunk-SPXYZZB5.js} +2 -1
- package/dist/_node-chunks/{chunk-MYDVOALB.js → chunk-6BFCIGCM.js} +9 -9
- package/dist/_node-chunks/{chunk-KCVAI2VV.js → chunk-DATC37WR.js} +6 -6
- package/dist/_node-chunks/{chunk-FGVZYJUX.js → chunk-GRO2TTCV.js} +6 -6
- package/dist/_node-chunks/{chunk-LVCH3OAT.js → chunk-XT6FJF4D.js} +6 -6
- package/dist/_node-chunks/{mdx-plugin-R52MLWWS.js → mdx-plugin-DC76DDEP.js} +11 -11
- package/dist/_node-chunks/{rehype-external-links-BOMNX6HL.js → rehype-external-links-XHBPKWIC.js} +9 -9
- package/dist/_node-chunks/{rehype-slug-2PCCIDEK.js → rehype-slug-TNCA5B3W.js} +8 -8
- package/dist/blocks.d.ts +22 -30
- package/dist/blocks.js +832 -615
- package/dist/manager.js +1 -1
- package/dist/mdx-loader.js +10 -10
- package/dist/preset.js +20 -11
- package/package.json +4 -4
package/dist/blocks.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
curriedOpacify$1,
|
|
11
11
|
curriedTransparentize$1,
|
|
12
12
|
rgba
|
|
13
|
-
} from "./_browser-chunks/chunk-
|
|
13
|
+
} from "./_browser-chunks/chunk-SPXYZZB5.js";
|
|
14
14
|
import "./_browser-chunks/chunk-SL3VIQZ3.js";
|
|
15
15
|
|
|
16
16
|
// src/blocks/components/ArgsTable/ArgsTable.tsx
|
|
@@ -21,8 +21,8 @@ import { includeConditionalArg } from "storybook/internal/csf";
|
|
|
21
21
|
import { DocumentIcon as DocumentIcon2, UndoIcon } from "@storybook/icons";
|
|
22
22
|
|
|
23
23
|
// ../../../node_modules/es-toolkit/dist/predicate/isPrimitive.mjs
|
|
24
|
-
function isPrimitive(
|
|
25
|
-
return
|
|
24
|
+
function isPrimitive(value) {
|
|
25
|
+
return value == null || typeof value != "object" && typeof value != "function";
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
// ../../../node_modules/es-toolkit/dist/predicate/isTypedArray.mjs
|
|
@@ -31,13 +31,13 @@ function isTypedArray(x2) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
// ../../../node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs
|
|
34
|
-
function getSymbols(
|
|
35
|
-
return Object.getOwnPropertySymbols(
|
|
34
|
+
function getSymbols(object) {
|
|
35
|
+
return Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol));
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
// ../../../node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
|
|
39
|
-
function getTag(
|
|
40
|
-
return
|
|
39
|
+
function getTag(value) {
|
|
40
|
+
return value == null ? value === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(value);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
// ../../../node_modules/es-toolkit/dist/compat/_internal/tags.mjs
|
|
@@ -72,15 +72,15 @@ function cloneDeepWithImpl(valueToClone, keyToClone, objectToClone, stack = /* @
|
|
|
72
72
|
if (valueToClone instanceof Map) {
|
|
73
73
|
let result = /* @__PURE__ */ new Map();
|
|
74
74
|
stack.set(valueToClone, result);
|
|
75
|
-
for (let [key,
|
|
76
|
-
result.set(key, cloneDeepWithImpl(
|
|
75
|
+
for (let [key, value] of valueToClone)
|
|
76
|
+
result.set(key, cloneDeepWithImpl(value, key, objectToClone, stack, cloneValue));
|
|
77
77
|
return result;
|
|
78
78
|
}
|
|
79
79
|
if (valueToClone instanceof Set) {
|
|
80
80
|
let result = /* @__PURE__ */ new Set();
|
|
81
81
|
stack.set(valueToClone, result);
|
|
82
|
-
for (let
|
|
83
|
-
result.add(cloneDeepWithImpl(
|
|
82
|
+
for (let value of valueToClone)
|
|
83
|
+
result.add(cloneDeepWithImpl(value, void 0, objectToClone, stack, cloneValue));
|
|
84
84
|
return result;
|
|
85
85
|
}
|
|
86
86
|
if (typeof Buffer < "u" && Buffer.isBuffer(valueToClone))
|
|
@@ -137,8 +137,8 @@ function copyProperties(target, source, objectToClone = target, stack, cloneValu
|
|
|
137
137
|
(descriptor == null || descriptor.writable) && (target[key] = cloneDeepWithImpl(source[key], key, objectToClone, stack, cloneValue));
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
function isCloneableObject(
|
|
141
|
-
switch (getTag(
|
|
140
|
+
function isCloneableObject(object) {
|
|
141
|
+
switch (getTag(object)) {
|
|
142
142
|
case argumentsTag:
|
|
143
143
|
case arrayTag:
|
|
144
144
|
case arrayBufferTag:
|
|
@@ -176,8 +176,8 @@ function cloneDeep(obj) {
|
|
|
176
176
|
function pickBy(obj, shouldPick) {
|
|
177
177
|
let result = {}, keys = Object.keys(obj);
|
|
178
178
|
for (let i2 = 0; i2 < keys.length; i2++) {
|
|
179
|
-
let key = keys[i2],
|
|
180
|
-
shouldPick(
|
|
179
|
+
let key = keys[i2], value = obj[key];
|
|
180
|
+
shouldPick(value, key) && (result[key] = value);
|
|
181
181
|
}
|
|
182
182
|
return result;
|
|
183
183
|
}
|
|
@@ -657,16 +657,16 @@ var Label = styled.label(({ theme }) => ({
|
|
|
657
657
|
textDecoration: "underline"
|
|
658
658
|
}
|
|
659
659
|
}
|
|
660
|
-
})), parse = (
|
|
660
|
+
})), parse = (value) => value === "true", BooleanControl = ({
|
|
661
661
|
name,
|
|
662
|
-
value
|
|
662
|
+
value,
|
|
663
663
|
onChange,
|
|
664
664
|
onBlur,
|
|
665
665
|
onFocus,
|
|
666
666
|
argType
|
|
667
667
|
}) => {
|
|
668
668
|
let onSetFalse = useCallback(() => onChange(!1), [onChange]), readonly = !!argType?.table?.readonly;
|
|
669
|
-
if (
|
|
669
|
+
if (value === void 0)
|
|
670
670
|
return React.createElement(
|
|
671
671
|
Button,
|
|
672
672
|
{
|
|
@@ -679,7 +679,7 @@ var Label = styled.label(({ theme }) => ({
|
|
|
679
679
|
},
|
|
680
680
|
"Set boolean"
|
|
681
681
|
);
|
|
682
|
-
let controlId = getControlId(name), parsedValue = typeof
|
|
682
|
+
let controlId = getControlId(name), parsedValue = typeof value == "string" ? parse(value) : value;
|
|
683
683
|
return React.createElement(Label, { "aria-disabled": readonly, htmlFor: controlId, "aria-label": name }, React.createElement(
|
|
684
684
|
"input",
|
|
685
685
|
{
|
|
@@ -700,17 +700,17 @@ var Label = styled.label(({ theme }) => ({
|
|
|
700
700
|
import React2, { useEffect, useRef, useState } from "react";
|
|
701
701
|
import { Form } from "storybook/internal/components";
|
|
702
702
|
import { styled as styled2 } from "storybook/theming";
|
|
703
|
-
var parseDate = (
|
|
704
|
-
let [year, month, day] =
|
|
703
|
+
var parseDate = (value) => {
|
|
704
|
+
let [year, month, day] = value.split("-"), result = /* @__PURE__ */ new Date();
|
|
705
705
|
return result.setFullYear(parseInt(year, 10), parseInt(month, 10) - 1, parseInt(day, 10)), result;
|
|
706
|
-
}, parseTime = (
|
|
707
|
-
let [hours, minutes] =
|
|
706
|
+
}, parseTime = (value) => {
|
|
707
|
+
let [hours, minutes] = value.split(":"), result = /* @__PURE__ */ new Date();
|
|
708
708
|
return result.setHours(parseInt(hours, 10)), result.setMinutes(parseInt(minutes, 10)), result;
|
|
709
|
-
}, formatDate = (
|
|
710
|
-
let date = new Date(
|
|
709
|
+
}, formatDate = (value) => {
|
|
710
|
+
let date = new Date(value), year = `000${date.getFullYear()}`.slice(-4), month = `0${date.getMonth() + 1}`.slice(-2), day = `0${date.getDate()}`.slice(-2);
|
|
711
711
|
return `${year}-${month}-${day}`;
|
|
712
|
-
}, formatTime = (
|
|
713
|
-
let date = new Date(
|
|
712
|
+
}, formatTime = (value) => {
|
|
713
|
+
let date = new Date(value), hours = `0${date.getHours()}`.slice(-2), minutes = `0${date.getMinutes()}`.slice(-2);
|
|
714
714
|
return `${hours}:${minutes}`;
|
|
715
715
|
}, FormInput = styled2(Form.Input)(({ theme }) => ({
|
|
716
716
|
"&[readonly]": {
|
|
@@ -734,22 +734,22 @@ var parseDate = (value2) => {
|
|
|
734
734
|
"div:last-of-type": {
|
|
735
735
|
flex: 3
|
|
736
736
|
}
|
|
737
|
-
}), DateControl = ({ name, value
|
|
737
|
+
}), DateControl = ({ name, value, onChange, onFocus, onBlur, argType }) => {
|
|
738
738
|
let [valid, setValid] = useState(!0), dateRef = useRef(), timeRef = useRef(), readonly = !!argType?.table?.readonly;
|
|
739
739
|
useEffect(() => {
|
|
740
|
-
valid !== !1 && (dateRef && dateRef.current && (dateRef.current.value =
|
|
741
|
-
}, [
|
|
740
|
+
valid !== !1 && (dateRef && dateRef.current && (dateRef.current.value = value ? formatDate(value) : ""), timeRef && timeRef.current && (timeRef.current.value = value ? formatTime(value) : ""));
|
|
741
|
+
}, [value]);
|
|
742
742
|
let onDateChange = (e2) => {
|
|
743
743
|
if (!e2.target.value)
|
|
744
744
|
return onChange();
|
|
745
|
-
let parsed = parseDate(e2.target.value), result = new Date(
|
|
745
|
+
let parsed = parseDate(e2.target.value), result = new Date(value ?? "");
|
|
746
746
|
result.setFullYear(parsed.getFullYear(), parsed.getMonth(), parsed.getDate());
|
|
747
747
|
let time = result.getTime();
|
|
748
748
|
time && onChange(time), setValid(!!time);
|
|
749
749
|
}, onTimeChange = (e2) => {
|
|
750
750
|
if (!e2.target.value)
|
|
751
751
|
return onChange();
|
|
752
|
-
let parsed = parseTime(e2.target.value), result = new Date(
|
|
752
|
+
let parsed = parseTime(e2.target.value), result = new Date(value ?? "");
|
|
753
753
|
result.setHours(parsed.getHours()), result.setMinutes(parsed.getMinutes());
|
|
754
754
|
let time = result.getTime();
|
|
755
755
|
time && onChange(time), setValid(!!time);
|
|
@@ -788,14 +788,14 @@ import { Button as Button2, Form as Form2 } from "storybook/internal/components"
|
|
|
788
788
|
import { styled as styled3 } from "storybook/theming";
|
|
789
789
|
var Wrapper = styled3.label({
|
|
790
790
|
display: "flex"
|
|
791
|
-
}), parse2 = (
|
|
792
|
-
let result = parseFloat(
|
|
791
|
+
}), parse2 = (value) => {
|
|
792
|
+
let result = parseFloat(value);
|
|
793
793
|
return Number.isNaN(result) ? void 0 : result;
|
|
794
|
-
}, format = (
|
|
794
|
+
}, format = (value) => value != null ? String(value) : "", FormInput2 = styled3(Form2.Input)(({ theme }) => ({
|
|
795
795
|
background: theme.base === "light" ? theme.color.lighter : "transparent"
|
|
796
796
|
})), NumberControl = ({
|
|
797
797
|
name,
|
|
798
|
-
value
|
|
798
|
+
value,
|
|
799
799
|
onChange,
|
|
800
800
|
min,
|
|
801
801
|
max,
|
|
@@ -804,7 +804,7 @@ var Wrapper = styled3.label({
|
|
|
804
804
|
onFocus,
|
|
805
805
|
argType
|
|
806
806
|
}) => {
|
|
807
|
-
let [inputValue, setInputValue] = useState2(typeof
|
|
807
|
+
let [inputValue, setInputValue] = useState2(typeof value == "number" ? value : ""), [forceVisible, setForceVisible] = useState2(!1), [parseError, setParseError] = useState2(null), readonly = !!argType?.table?.readonly, handleChange = useCallback2(
|
|
808
808
|
(event) => {
|
|
809
809
|
setInputValue(event.target.value);
|
|
810
810
|
let result = parseFloat(event.target.value);
|
|
@@ -822,9 +822,9 @@ var Wrapper = styled3.label({
|
|
|
822
822
|
return useEffect2(() => {
|
|
823
823
|
forceVisible && htmlElRef.current && htmlElRef.current.select();
|
|
824
824
|
}, [forceVisible]), useEffect2(() => {
|
|
825
|
-
let newInputValue = typeof
|
|
825
|
+
let newInputValue = typeof value == "number" ? value : "";
|
|
826
826
|
inputValue !== newInputValue && setInputValue(newInputValue);
|
|
827
|
-
}, [
|
|
827
|
+
}, [value]), value === void 0 ? React3.createElement(
|
|
828
828
|
Button2,
|
|
829
829
|
{
|
|
830
830
|
ariaLabel: !1,
|
|
@@ -867,10 +867,10 @@ import { logger } from "storybook/internal/client-logger";
|
|
|
867
867
|
import { styled as styled4 } from "storybook/theming";
|
|
868
868
|
|
|
869
869
|
// src/blocks/controls/options/helpers.ts
|
|
870
|
-
var selectedKey = (
|
|
871
|
-
let entry = options && Object.entries(options).find(([_key, val]) => val ===
|
|
870
|
+
var selectedKey = (value, options) => {
|
|
871
|
+
let entry = options && Object.entries(options).find(([_key, val]) => val === value);
|
|
872
872
|
return entry ? entry[0] : void 0;
|
|
873
|
-
}, selectedKeys = (
|
|
873
|
+
}, selectedKeys = (value, options) => value && options ? Object.entries(options).filter((entry) => value.includes(entry[1])).map((entry) => entry[0]) : [], selectedValues = (keys, options) => keys && options && keys.map((key) => options[key]);
|
|
874
874
|
|
|
875
875
|
// src/blocks/controls/options/Checkbox.tsx
|
|
876
876
|
var Wrapper2 = styled4.fieldset(
|
|
@@ -908,20 +908,20 @@ var Wrapper2 = styled4.fieldset(
|
|
|
908
908
|
})), CheckboxControl = ({
|
|
909
909
|
name,
|
|
910
910
|
options,
|
|
911
|
-
value
|
|
911
|
+
value,
|
|
912
912
|
onChange,
|
|
913
913
|
isInline,
|
|
914
914
|
argType
|
|
915
915
|
}) => {
|
|
916
916
|
if (!options)
|
|
917
917
|
return logger.warn(`Checkbox with no options: ${name}`), React4.createElement(React4.Fragment, null, "-");
|
|
918
|
-
let initial2 = selectedKeys(
|
|
918
|
+
let initial2 = selectedKeys(value || [], options), [selected, setSelected] = useState3(initial2), readonly = !!argType?.table?.readonly, handleChange = (e2) => {
|
|
919
919
|
let option = e2.target.value, updated = [...selected];
|
|
920
920
|
updated.includes(option) ? updated.splice(updated.indexOf(option), 1) : updated.push(option), onChange(selectedValues(updated, options)), setSelected(updated);
|
|
921
921
|
};
|
|
922
922
|
useEffect3(() => {
|
|
923
|
-
setSelected(selectedKeys(
|
|
924
|
-
}, [
|
|
923
|
+
setSelected(selectedKeys(value || [], options));
|
|
924
|
+
}, [value]);
|
|
925
925
|
let controlId = getControlId(name);
|
|
926
926
|
return React4.createElement(Wrapper2, { $isInline: isInline }, React4.createElement("legend", { className: "sb-sr-only" }, name), Object.keys(options).map((key, index) => {
|
|
927
927
|
let id = `${controlId}-${index}`;
|
|
@@ -979,14 +979,14 @@ var Wrapper3 = styled5.fieldset(
|
|
|
979
979
|
})), RadioControl = ({
|
|
980
980
|
name,
|
|
981
981
|
options,
|
|
982
|
-
value
|
|
982
|
+
value,
|
|
983
983
|
onChange,
|
|
984
984
|
isInline,
|
|
985
985
|
argType
|
|
986
986
|
}) => {
|
|
987
987
|
if (!options)
|
|
988
988
|
return logger2.warn(`Radio with no options: ${name}`), React5.createElement(React5.Fragment, null, "-");
|
|
989
|
-
let selection = selectedKey(
|
|
989
|
+
let selection = selectedKey(value, options), controlId = getControlId(name), readonly = !!argType?.table?.readonly;
|
|
990
990
|
return React5.createElement(Wrapper3, { isInline }, React5.createElement("legend", { className: "sb-sr-only" }, name), Object.keys(options).map((key, index) => {
|
|
991
991
|
let id = `${controlId}-${index}`;
|
|
992
992
|
return React5.createElement(Label3, { key: id, htmlFor: id, $readOnly: readonly }, React5.createElement(
|
|
@@ -1080,16 +1080,16 @@ var styleResets = {
|
|
|
1080
1080
|
fill: theme.textMutedColor
|
|
1081
1081
|
}
|
|
1082
1082
|
}
|
|
1083
|
-
})), NO_SELECTION = "Choose option...", SingleSelect = ({ name, value
|
|
1083
|
+
})), NO_SELECTION = "Choose option...", SingleSelect = ({ name, value, options, onChange, argType }) => {
|
|
1084
1084
|
let handleChange = (e2) => {
|
|
1085
1085
|
onChange(options[e2.currentTarget.value]);
|
|
1086
|
-
}, selection = selectedKey(
|
|
1086
|
+
}, selection = selectedKey(value, options) || NO_SELECTION, controlId = getControlId(name), readonly = !!argType?.table?.readonly;
|
|
1087
1087
|
return React6.createElement(SelectWrapper, null, React6.createElement(ChevronSmallDownIcon, null), React6.createElement("label", { htmlFor: controlId, className: "sb-sr-only" }, name), React6.createElement(OptionsSelect, { disabled: readonly, id: controlId, value: selection, onChange: handleChange }, React6.createElement("option", { disabled: selection === NO_SELECTION, key: "no-selection" }, NO_SELECTION), Object.keys(options).map((key) => React6.createElement("option", { key, value: key }, key))));
|
|
1088
|
-
}, MultiSelect = ({ name, value
|
|
1088
|
+
}, MultiSelect = ({ name, value, options, onChange, argType }) => {
|
|
1089
1089
|
let handleChange = (e2) => {
|
|
1090
1090
|
let selection2 = Array.from(e2.currentTarget.options).filter((option) => option.selected).map((option) => option.value);
|
|
1091
1091
|
onChange(selectedValues(selection2, options));
|
|
1092
|
-
}, selection = selectedKeys(
|
|
1092
|
+
}, selection = selectedKeys(value, options), controlId = getControlId(name), readonly = !!argType?.table?.readonly;
|
|
1093
1093
|
return React6.createElement(SelectWrapper, null, React6.createElement("label", { htmlFor: controlId, className: "sb-sr-only" }, name), React6.createElement(
|
|
1094
1094
|
OptionsSelect,
|
|
1095
1095
|
{
|
|
@@ -1130,7 +1130,7 @@ var normalizeOptions = (options, labels) => Array.isArray(options) ? options.red
|
|
|
1130
1130
|
// src/blocks/controls/Object.tsx
|
|
1131
1131
|
import React11, { useCallback as useCallback3, useEffect as useEffect4, useMemo, useRef as useRef3, useState as useState4 } from "react";
|
|
1132
1132
|
import { Button as Button3, Form as Form3, ToggleButton } from "storybook/internal/components";
|
|
1133
|
-
import { AddIcon, SubtractIcon } from "@storybook/icons";
|
|
1133
|
+
import { AddIcon, EditIcon, SubtractIcon } from "@storybook/icons";
|
|
1134
1134
|
import { styled as styled8, useTheme } from "storybook/theming";
|
|
1135
1135
|
|
|
1136
1136
|
// src/blocks/controls/react-editable-json-tree/index.tsx
|
|
@@ -1221,7 +1221,7 @@ function JsonNodeAccordion({
|
|
|
1221
1221
|
), React8.createElement(
|
|
1222
1222
|
Region,
|
|
1223
1223
|
{
|
|
1224
|
-
role: "
|
|
1224
|
+
role: "group",
|
|
1225
1225
|
id: ids.region,
|
|
1226
1226
|
"aria-labelledby": ids.trigger,
|
|
1227
1227
|
className: "rejt-accordion-region"
|
|
@@ -1354,7 +1354,7 @@ var JsonArray = class extends Component {
|
|
|
1354
1354
|
}
|
|
1355
1355
|
handleRemoveItem(index) {
|
|
1356
1356
|
return () => {
|
|
1357
|
-
let { beforeRemoveAction, logger:
|
|
1357
|
+
let { beforeRemoveAction, logger: logger5 } = this.props, { data, keyPath, nextDeep: deep } = this.state, oldValue = data[index];
|
|
1358
1358
|
(beforeRemoveAction || Promise.resolve.bind(Promise))(index, keyPath, deep, oldValue).then(() => {
|
|
1359
1359
|
let deltaUpdateResult = {
|
|
1360
1360
|
keyPath,
|
|
@@ -1366,11 +1366,11 @@ var JsonArray = class extends Component {
|
|
|
1366
1366
|
data.splice(index, 1), this.setState({ data });
|
|
1367
1367
|
let { onUpdate, onDeltaUpdate } = this.props;
|
|
1368
1368
|
onUpdate(keyPath[keyPath.length - 1], data), onDeltaUpdate(deltaUpdateResult);
|
|
1369
|
-
}).catch(
|
|
1369
|
+
}).catch(logger5.error);
|
|
1370
1370
|
};
|
|
1371
1371
|
}
|
|
1372
1372
|
handleAddValueAdd({ newValue }) {
|
|
1373
|
-
let { data, keyPath = [], nextDeep: deep } = this.state, { beforeAddAction, logger:
|
|
1373
|
+
let { data, keyPath = [], nextDeep: deep } = this.state, { beforeAddAction, logger: logger5 } = this.props, key = data.length;
|
|
1374
1374
|
(beforeAddAction || Promise.resolve.bind(Promise))(key, keyPath, deep, newValue).then(() => {
|
|
1375
1375
|
data[key] = newValue, this.setState({
|
|
1376
1376
|
data
|
|
@@ -1383,18 +1383,18 @@ var JsonArray = class extends Component {
|
|
|
1383
1383
|
key,
|
|
1384
1384
|
newValue
|
|
1385
1385
|
});
|
|
1386
|
-
}).catch(
|
|
1386
|
+
}).catch(logger5.error);
|
|
1387
1387
|
}
|
|
1388
1388
|
handleAddValueCancel() {
|
|
1389
1389
|
this.setState({
|
|
1390
1390
|
addFormVisible: !1
|
|
1391
1391
|
});
|
|
1392
1392
|
}
|
|
1393
|
-
handleEditValue({ key, value
|
|
1393
|
+
handleEditValue({ key, value }) {
|
|
1394
1394
|
return new Promise((resolve, reject) => {
|
|
1395
1395
|
let { beforeUpdateAction } = this.props, { data, keyPath, nextDeep: deep } = this.state, oldValue = data[key];
|
|
1396
|
-
(beforeUpdateAction || Promise.resolve.bind(Promise))(key, keyPath, deep, oldValue,
|
|
1397
|
-
data[key] =
|
|
1396
|
+
(beforeUpdateAction || Promise.resolve.bind(Promise))(key, keyPath, deep, oldValue, value).then(() => {
|
|
1397
|
+
data[key] = value, this.setState({
|
|
1398
1398
|
data
|
|
1399
1399
|
});
|
|
1400
1400
|
let { onUpdate, onDeltaUpdate } = this.props;
|
|
@@ -1403,20 +1403,19 @@ var JsonArray = class extends Component {
|
|
|
1403
1403
|
keyPath,
|
|
1404
1404
|
deep,
|
|
1405
1405
|
key,
|
|
1406
|
-
newValue:
|
|
1406
|
+
newValue: value,
|
|
1407
1407
|
oldValue
|
|
1408
1408
|
}), resolve(void 0);
|
|
1409
1409
|
}).catch(reject);
|
|
1410
1410
|
});
|
|
1411
1411
|
}
|
|
1412
1412
|
renderCollapsed() {
|
|
1413
|
-
let { name, data, keyPath, deep } = this.state, { handleRemove, readOnly,
|
|
1413
|
+
let { name, data, keyPath, deep } = this.state, { handleRemove, readOnly, dataType, minusMenuElement } = this.props, isReadOnly = readOnly(name, data, keyPath, deep, dataType), removeItemButton = minusMenuElement && cloneElement2(minusMenuElement, {
|
|
1414
1414
|
onClick: handleRemove,
|
|
1415
1415
|
className: "rejt-minus-menu",
|
|
1416
|
-
style: minus,
|
|
1417
1416
|
"aria-label": `remove the array '${String(name)}'`
|
|
1418
1417
|
});
|
|
1419
|
-
return React9.createElement(React9.Fragment, null, React9.createElement("span", {
|
|
1418
|
+
return React9.createElement(React9.Fragment, null, React9.createElement("span", { className: "rejt-collapsed-value" }, "[...] ", data.length, " ", data.length === 1 ? "item" : "items"), !isReadOnly && removeItemButton);
|
|
1420
1419
|
}
|
|
1421
1420
|
renderNotCollapsed() {
|
|
1422
1421
|
let { name, data, keyPath, deep, addFormVisible, nextDeep } = this.state, {
|
|
@@ -1424,7 +1423,6 @@ var JsonArray = class extends Component {
|
|
|
1424
1423
|
handleRemove,
|
|
1425
1424
|
onDeltaUpdate,
|
|
1426
1425
|
readOnly,
|
|
1427
|
-
getStyle,
|
|
1428
1426
|
dataType,
|
|
1429
1427
|
addButtonElement,
|
|
1430
1428
|
cancelButtonElement,
|
|
@@ -1435,20 +1433,18 @@ var JsonArray = class extends Component {
|
|
|
1435
1433
|
beforeRemoveAction,
|
|
1436
1434
|
beforeAddAction,
|
|
1437
1435
|
beforeUpdateAction,
|
|
1438
|
-
logger:
|
|
1436
|
+
logger: logger5,
|
|
1439
1437
|
onSubmitValueParser
|
|
1440
|
-
} = this.props,
|
|
1438
|
+
} = this.props, isReadOnly = readOnly(name, data, keyPath, deep, dataType), addItemButton = plusMenuElement && cloneElement2(plusMenuElement, {
|
|
1441
1439
|
onClick: this.handleAddMode,
|
|
1442
1440
|
className: "rejt-plus-menu",
|
|
1443
|
-
style: plus,
|
|
1444
1441
|
"aria-label": `add a new item to the '${String(name)}' array`
|
|
1445
1442
|
}), removeItemButton = minusMenuElement && cloneElement2(minusMenuElement, {
|
|
1446
1443
|
onClick: handleRemove,
|
|
1447
1444
|
className: "rejt-minus-menu",
|
|
1448
|
-
style: minus,
|
|
1449
1445
|
"aria-label": `remove the array '${String(name)}'`
|
|
1450
1446
|
});
|
|
1451
|
-
return React9.createElement(React9.Fragment, null, React9.createElement("span", { className: "rejt-not-collapsed-delimiter"
|
|
1447
|
+
return React9.createElement(React9.Fragment, null, React9.createElement("span", { className: "rejt-not-collapsed-delimiter" }, "["), !addFormVisible && addItemButton, React9.createElement("ul", { className: "rejt-not-collapsed-list" }, data.map((item, index) => React9.createElement(
|
|
1452
1448
|
JsonNode,
|
|
1453
1449
|
{
|
|
1454
1450
|
key: index,
|
|
@@ -1462,7 +1458,6 @@ var JsonArray = class extends Component {
|
|
|
1462
1458
|
onUpdate: this.onChildUpdate,
|
|
1463
1459
|
onDeltaUpdate,
|
|
1464
1460
|
readOnly,
|
|
1465
|
-
getStyle,
|
|
1466
1461
|
addButtonElement,
|
|
1467
1462
|
cancelButtonElement,
|
|
1468
1463
|
inputElementGenerator,
|
|
@@ -1472,10 +1467,10 @@ var JsonArray = class extends Component {
|
|
|
1472
1467
|
beforeRemoveAction,
|
|
1473
1468
|
beforeAddAction,
|
|
1474
1469
|
beforeUpdateAction,
|
|
1475
|
-
logger:
|
|
1470
|
+
logger: logger5,
|
|
1476
1471
|
onSubmitValueParser
|
|
1477
1472
|
}
|
|
1478
|
-
))), !isReadOnly && addFormVisible && React9.createElement("div", { className: "rejt-add-form"
|
|
1473
|
+
))), !isReadOnly && addFormVisible && React9.createElement("div", { className: "rejt-add-form" }, React9.createElement(
|
|
1479
1474
|
JsonAddValue,
|
|
1480
1475
|
{
|
|
1481
1476
|
handleAdd: this.handleAddValueAdd,
|
|
@@ -1488,10 +1483,10 @@ var JsonArray = class extends Component {
|
|
|
1488
1483
|
deep,
|
|
1489
1484
|
onSubmitValueParser
|
|
1490
1485
|
}
|
|
1491
|
-
)), React9.createElement("span", { className: "rejt-not-collapsed-delimiter"
|
|
1486
|
+
)), React9.createElement("span", { className: "rejt-not-collapsed-delimiter" }, "]"), !isReadOnly && removeItemButton);
|
|
1492
1487
|
}
|
|
1493
1488
|
render() {
|
|
1494
|
-
let { name, collapsed, keyPath, deep } = this.state,
|
|
1489
|
+
let { name, collapsed, keyPath, deep } = this.state, value = collapsed ? this.renderCollapsed() : this.renderNotCollapsed();
|
|
1495
1490
|
return React9.createElement(
|
|
1496
1491
|
JsonNodeAccordion,
|
|
1497
1492
|
{
|
|
@@ -1501,7 +1496,7 @@ var JsonArray = class extends Component {
|
|
|
1501
1496
|
keyPath,
|
|
1502
1497
|
onClick: this.handleCollapseMode
|
|
1503
1498
|
},
|
|
1504
|
-
|
|
1499
|
+
value
|
|
1505
1500
|
);
|
|
1506
1501
|
}
|
|
1507
1502
|
};
|
|
@@ -1528,7 +1523,7 @@ var JsonFunctionValue = class extends Component {
|
|
|
1528
1523
|
return props.value !== state.value ? { value: props.value } : null;
|
|
1529
1524
|
}
|
|
1530
1525
|
componentDidUpdate() {
|
|
1531
|
-
let { editEnabled, inputRef, name, value
|
|
1526
|
+
let { editEnabled, inputRef, name, value, keyPath, deep } = this.state, { readOnly, dataType } = this.props, readOnlyResult = readOnly(name, value, keyPath, deep, dataType);
|
|
1532
1527
|
editEnabled && !readOnlyResult && typeof inputRef.focus == "function" && inputRef.focus();
|
|
1533
1528
|
}
|
|
1534
1529
|
onKeydown(event) {
|
|
@@ -1536,7 +1531,7 @@ var JsonFunctionValue = class extends Component {
|
|
|
1536
1531
|
event.altKey || event.ctrlKey || event.metaKey || event.shiftKey || event.repeat || inputRef !== event.target || ((event.code === "Enter" || event.key === "Enter") && (event.preventDefault(), this.handleEdit()), (event.code === "Escape" || event.key === "Escape") && (event.preventDefault(), this.handleCancelEdit()));
|
|
1537
1532
|
}
|
|
1538
1533
|
handleEdit() {
|
|
1539
|
-
let { handleUpdateValue, originalValue, logger:
|
|
1534
|
+
let { handleUpdateValue, originalValue, logger: logger5, onSubmitValueParser, keyPath } = this.props, { inputRef, name, deep } = this.state;
|
|
1540
1535
|
if (!inputRef)
|
|
1541
1536
|
return;
|
|
1542
1537
|
let newValue = onSubmitValueParser(!0, keyPath, deep, name, inputRef.value), result = {
|
|
@@ -1545,7 +1540,7 @@ var JsonFunctionValue = class extends Component {
|
|
|
1545
1540
|
};
|
|
1546
1541
|
(handleUpdateValue || Promise.resolve.bind(Promise))(result).then(() => {
|
|
1547
1542
|
isComponentWillChange(originalValue, newValue) || this.handleCancelEdit();
|
|
1548
|
-
}).catch(
|
|
1543
|
+
}).catch(logger5.error);
|
|
1549
1544
|
}
|
|
1550
1545
|
handleEditMode() {
|
|
1551
1546
|
this.setState({
|
|
@@ -1561,16 +1556,15 @@ var JsonFunctionValue = class extends Component {
|
|
|
1561
1556
|
});
|
|
1562
1557
|
}
|
|
1563
1558
|
render() {
|
|
1564
|
-
let { name, value
|
|
1559
|
+
let { name, value, editEnabled, keyPath, deep } = this.state, {
|
|
1565
1560
|
handleRemove,
|
|
1566
1561
|
originalValue,
|
|
1567
1562
|
readOnly,
|
|
1568
1563
|
dataType,
|
|
1569
|
-
getStyle,
|
|
1570
1564
|
textareaElementGenerator,
|
|
1571
1565
|
minusMenuElement,
|
|
1572
1566
|
keyPath: comeFromKeyPath = []
|
|
1573
|
-
} = this.props,
|
|
1567
|
+
} = this.props, result = null, minusElement = null, resultOnlyResult = readOnly(name, originalValue, keyPath, deep, dataType);
|
|
1574
1568
|
if (editEnabled && !resultOnlyResult) {
|
|
1575
1569
|
let textareaElement = textareaElementGenerator(
|
|
1576
1570
|
VALUE,
|
|
@@ -1581,29 +1575,20 @@ var JsonFunctionValue = class extends Component {
|
|
|
1581
1575
|
dataType
|
|
1582
1576
|
), textareaElementLayout = cloneElement2(textareaElement, {
|
|
1583
1577
|
ref: this.refInput,
|
|
1584
|
-
defaultValue:
|
|
1578
|
+
defaultValue: value,
|
|
1585
1579
|
onKeyDown: this.onKeydown
|
|
1586
1580
|
});
|
|
1587
|
-
result = React9.createElement("span", { className: "rejt-edit-form"
|
|
1581
|
+
result = React9.createElement("span", { className: "rejt-edit-form" }, textareaElementLayout), minusElement = null;
|
|
1588
1582
|
} else {
|
|
1589
|
-
result = React9.createElement(
|
|
1590
|
-
"span",
|
|
1591
|
-
{
|
|
1592
|
-
className: "rejt-value",
|
|
1593
|
-
style: style.value,
|
|
1594
|
-
onClick: resultOnlyResult ? void 0 : this.handleEditMode
|
|
1595
|
-
},
|
|
1596
|
-
value2
|
|
1597
|
-
);
|
|
1583
|
+
result = React9.createElement("span", { className: "rejt-value", onClick: resultOnlyResult ? void 0 : this.handleEditMode }, value);
|
|
1598
1584
|
let parentPropertyName = comeFromKeyPath.at(-1), minusMenuLayout = minusMenuElement && cloneElement2(minusMenuElement, {
|
|
1599
1585
|
onClick: handleRemove,
|
|
1600
1586
|
className: "rejt-minus-menu",
|
|
1601
|
-
style: style.minus,
|
|
1602
1587
|
"aria-label": `remove the function '${String(name)}'${String(parentPropertyName) ? ` from '${String(parentPropertyName)}'` : ""}`
|
|
1603
1588
|
});
|
|
1604
1589
|
minusElement = resultOnlyResult ? null : minusMenuLayout;
|
|
1605
1590
|
}
|
|
1606
|
-
return React9.createElement("li", { className: "rejt-value-node"
|
|
1591
|
+
return React9.createElement("li", { className: "rejt-value-node" }, React9.createElement("span", { className: "rejt-name" }, name, " : "), result, minusElement);
|
|
1607
1592
|
}
|
|
1608
1593
|
};
|
|
1609
1594
|
JsonFunctionValue.defaultProps = {
|
|
@@ -1634,7 +1619,6 @@ var JsonNode = class extends Component {
|
|
|
1634
1619
|
onUpdate,
|
|
1635
1620
|
onDeltaUpdate,
|
|
1636
1621
|
readOnly,
|
|
1637
|
-
getStyle,
|
|
1638
1622
|
addButtonElement,
|
|
1639
1623
|
cancelButtonElement,
|
|
1640
1624
|
inputElementGenerator,
|
|
@@ -1644,7 +1628,7 @@ var JsonNode = class extends Component {
|
|
|
1644
1628
|
beforeRemoveAction,
|
|
1645
1629
|
beforeAddAction,
|
|
1646
1630
|
beforeUpdateAction,
|
|
1647
|
-
logger:
|
|
1631
|
+
logger: logger5,
|
|
1648
1632
|
onSubmitValueParser
|
|
1649
1633
|
} = this.props, readOnlyTrue = () => !0, dataType = getObjectType(data);
|
|
1650
1634
|
switch (dataType) {
|
|
@@ -1662,7 +1646,6 @@ var JsonNode = class extends Component {
|
|
|
1662
1646
|
onDeltaUpdate,
|
|
1663
1647
|
readOnly: readOnlyTrue,
|
|
1664
1648
|
dataType,
|
|
1665
|
-
getStyle,
|
|
1666
1649
|
addButtonElement,
|
|
1667
1650
|
cancelButtonElement,
|
|
1668
1651
|
inputElementGenerator,
|
|
@@ -1672,7 +1655,7 @@ var JsonNode = class extends Component {
|
|
|
1672
1655
|
beforeRemoveAction,
|
|
1673
1656
|
beforeAddAction,
|
|
1674
1657
|
beforeUpdateAction,
|
|
1675
|
-
logger:
|
|
1658
|
+
logger: logger5,
|
|
1676
1659
|
onSubmitValueParser
|
|
1677
1660
|
}
|
|
1678
1661
|
);
|
|
@@ -1690,7 +1673,6 @@ var JsonNode = class extends Component {
|
|
|
1690
1673
|
onDeltaUpdate,
|
|
1691
1674
|
readOnly,
|
|
1692
1675
|
dataType,
|
|
1693
|
-
getStyle,
|
|
1694
1676
|
addButtonElement,
|
|
1695
1677
|
cancelButtonElement,
|
|
1696
1678
|
inputElementGenerator,
|
|
@@ -1700,7 +1682,7 @@ var JsonNode = class extends Component {
|
|
|
1700
1682
|
beforeRemoveAction,
|
|
1701
1683
|
beforeAddAction,
|
|
1702
1684
|
beforeUpdateAction,
|
|
1703
|
-
logger:
|
|
1685
|
+
logger: logger5,
|
|
1704
1686
|
onSubmitValueParser
|
|
1705
1687
|
}
|
|
1706
1688
|
);
|
|
@@ -1718,7 +1700,6 @@ var JsonNode = class extends Component {
|
|
|
1718
1700
|
onDeltaUpdate,
|
|
1719
1701
|
readOnly,
|
|
1720
1702
|
dataType,
|
|
1721
|
-
getStyle,
|
|
1722
1703
|
addButtonElement,
|
|
1723
1704
|
cancelButtonElement,
|
|
1724
1705
|
inputElementGenerator,
|
|
@@ -1728,7 +1709,7 @@ var JsonNode = class extends Component {
|
|
|
1728
1709
|
beforeRemoveAction,
|
|
1729
1710
|
beforeAddAction,
|
|
1730
1711
|
beforeUpdateAction,
|
|
1731
|
-
logger:
|
|
1712
|
+
logger: logger5,
|
|
1732
1713
|
onSubmitValueParser
|
|
1733
1714
|
}
|
|
1734
1715
|
);
|
|
@@ -1745,11 +1726,10 @@ var JsonNode = class extends Component {
|
|
|
1745
1726
|
handleUpdateValue,
|
|
1746
1727
|
readOnly,
|
|
1747
1728
|
dataType,
|
|
1748
|
-
getStyle,
|
|
1749
1729
|
cancelButtonElement,
|
|
1750
1730
|
inputElementGenerator,
|
|
1751
1731
|
minusMenuElement,
|
|
1752
|
-
logger:
|
|
1732
|
+
logger: logger5,
|
|
1753
1733
|
onSubmitValueParser
|
|
1754
1734
|
}
|
|
1755
1735
|
);
|
|
@@ -1766,11 +1746,10 @@ var JsonNode = class extends Component {
|
|
|
1766
1746
|
handleUpdateValue,
|
|
1767
1747
|
readOnly,
|
|
1768
1748
|
dataType,
|
|
1769
|
-
getStyle,
|
|
1770
1749
|
cancelButtonElement,
|
|
1771
1750
|
inputElementGenerator,
|
|
1772
1751
|
minusMenuElement,
|
|
1773
|
-
logger:
|
|
1752
|
+
logger: logger5,
|
|
1774
1753
|
onSubmitValueParser
|
|
1775
1754
|
}
|
|
1776
1755
|
);
|
|
@@ -1787,11 +1766,10 @@ var JsonNode = class extends Component {
|
|
|
1787
1766
|
handleUpdateValue,
|
|
1788
1767
|
readOnly,
|
|
1789
1768
|
dataType,
|
|
1790
|
-
getStyle,
|
|
1791
1769
|
cancelButtonElement,
|
|
1792
1770
|
inputElementGenerator,
|
|
1793
1771
|
minusMenuElement,
|
|
1794
|
-
logger:
|
|
1772
|
+
logger: logger5,
|
|
1795
1773
|
onSubmitValueParser
|
|
1796
1774
|
}
|
|
1797
1775
|
);
|
|
@@ -1808,11 +1786,10 @@ var JsonNode = class extends Component {
|
|
|
1808
1786
|
handleUpdateValue,
|
|
1809
1787
|
readOnly: readOnlyTrue,
|
|
1810
1788
|
dataType,
|
|
1811
|
-
getStyle,
|
|
1812
1789
|
cancelButtonElement,
|
|
1813
1790
|
inputElementGenerator,
|
|
1814
1791
|
minusMenuElement,
|
|
1815
|
-
logger:
|
|
1792
|
+
logger: logger5,
|
|
1816
1793
|
onSubmitValueParser
|
|
1817
1794
|
}
|
|
1818
1795
|
);
|
|
@@ -1829,11 +1806,10 @@ var JsonNode = class extends Component {
|
|
|
1829
1806
|
handleUpdateValue,
|
|
1830
1807
|
readOnly,
|
|
1831
1808
|
dataType,
|
|
1832
|
-
getStyle,
|
|
1833
1809
|
cancelButtonElement,
|
|
1834
1810
|
inputElementGenerator,
|
|
1835
1811
|
minusMenuElement,
|
|
1836
|
-
logger:
|
|
1812
|
+
logger: logger5,
|
|
1837
1813
|
onSubmitValueParser
|
|
1838
1814
|
}
|
|
1839
1815
|
);
|
|
@@ -1850,11 +1826,10 @@ var JsonNode = class extends Component {
|
|
|
1850
1826
|
handleUpdateValue,
|
|
1851
1827
|
readOnly,
|
|
1852
1828
|
dataType,
|
|
1853
|
-
getStyle,
|
|
1854
1829
|
cancelButtonElement,
|
|
1855
1830
|
inputElementGenerator,
|
|
1856
1831
|
minusMenuElement,
|
|
1857
|
-
logger:
|
|
1832
|
+
logger: logger5,
|
|
1858
1833
|
onSubmitValueParser
|
|
1859
1834
|
}
|
|
1860
1835
|
);
|
|
@@ -1871,11 +1846,10 @@ var JsonNode = class extends Component {
|
|
|
1871
1846
|
handleUpdateValue,
|
|
1872
1847
|
readOnly,
|
|
1873
1848
|
dataType,
|
|
1874
|
-
getStyle,
|
|
1875
1849
|
cancelButtonElement,
|
|
1876
1850
|
textareaElementGenerator,
|
|
1877
1851
|
minusMenuElement,
|
|
1878
|
-
logger:
|
|
1852
|
+
logger: logger5,
|
|
1879
1853
|
onSubmitValueParser
|
|
1880
1854
|
}
|
|
1881
1855
|
);
|
|
@@ -1892,11 +1866,10 @@ var JsonNode = class extends Component {
|
|
|
1892
1866
|
handleUpdateValue,
|
|
1893
1867
|
readOnly: readOnlyTrue,
|
|
1894
1868
|
dataType,
|
|
1895
|
-
getStyle,
|
|
1896
1869
|
cancelButtonElement,
|
|
1897
1870
|
inputElementGenerator,
|
|
1898
1871
|
minusMenuElement,
|
|
1899
|
-
logger:
|
|
1872
|
+
logger: logger5,
|
|
1900
1873
|
onSubmitValueParser
|
|
1901
1874
|
}
|
|
1902
1875
|
);
|
|
@@ -1945,7 +1918,7 @@ var JsonObject = class extends Component {
|
|
|
1945
1918
|
});
|
|
1946
1919
|
}
|
|
1947
1920
|
handleAddValueAdd({ key, newValue }) {
|
|
1948
|
-
let { data, keyPath = [], nextDeep: deep } = this.state, { beforeAddAction, logger:
|
|
1921
|
+
let { data, keyPath = [], nextDeep: deep } = this.state, { beforeAddAction, logger: logger5 } = this.props;
|
|
1949
1922
|
(beforeAddAction || Promise.resolve.bind(Promise))(key, keyPath, deep, newValue).then(() => {
|
|
1950
1923
|
data[key] = newValue, this.setState({
|
|
1951
1924
|
data
|
|
@@ -1958,11 +1931,11 @@ var JsonObject = class extends Component {
|
|
|
1958
1931
|
key,
|
|
1959
1932
|
newValue
|
|
1960
1933
|
});
|
|
1961
|
-
}).catch(
|
|
1934
|
+
}).catch(logger5.error);
|
|
1962
1935
|
}
|
|
1963
1936
|
handleRemoveValue(key) {
|
|
1964
1937
|
return () => {
|
|
1965
|
-
let { beforeRemoveAction, logger:
|
|
1938
|
+
let { beforeRemoveAction, logger: logger5 } = this.props, { data, keyPath = [], nextDeep: deep } = this.state, oldValue = data[key];
|
|
1966
1939
|
(beforeRemoveAction || Promise.resolve.bind(Promise))(key, keyPath, deep, oldValue).then(() => {
|
|
1967
1940
|
let deltaUpdateResult = {
|
|
1968
1941
|
keyPath,
|
|
@@ -1974,7 +1947,7 @@ var JsonObject = class extends Component {
|
|
|
1974
1947
|
delete data[key], this.setState({ data });
|
|
1975
1948
|
let { onUpdate, onDeltaUpdate } = this.props;
|
|
1976
1949
|
onUpdate(keyPath[keyPath.length - 1], data), onDeltaUpdate(deltaUpdateResult);
|
|
1977
|
-
}).catch(
|
|
1950
|
+
}).catch(logger5.error);
|
|
1978
1951
|
};
|
|
1979
1952
|
}
|
|
1980
1953
|
handleCollapseMode() {
|
|
@@ -1982,11 +1955,11 @@ var JsonObject = class extends Component {
|
|
|
1982
1955
|
collapsed: !state.collapsed
|
|
1983
1956
|
}));
|
|
1984
1957
|
}
|
|
1985
|
-
handleEditValue({ key, value
|
|
1958
|
+
handleEditValue({ key, value }) {
|
|
1986
1959
|
return new Promise((resolve, reject) => {
|
|
1987
1960
|
let { beforeUpdateAction } = this.props, { data, keyPath = [], nextDeep: deep } = this.state, oldValue = data[key];
|
|
1988
|
-
(beforeUpdateAction || Promise.resolve.bind(Promise))(key, keyPath, deep, oldValue,
|
|
1989
|
-
data[key] =
|
|
1961
|
+
(beforeUpdateAction || Promise.resolve.bind(Promise))(key, keyPath, deep, oldValue, value).then(() => {
|
|
1962
|
+
data[key] = value, this.setState({
|
|
1990
1963
|
data
|
|
1991
1964
|
});
|
|
1992
1965
|
let { onUpdate, onDeltaUpdate } = this.props;
|
|
@@ -1995,20 +1968,19 @@ var JsonObject = class extends Component {
|
|
|
1995
1968
|
keyPath,
|
|
1996
1969
|
deep,
|
|
1997
1970
|
key,
|
|
1998
|
-
newValue:
|
|
1971
|
+
newValue: value,
|
|
1999
1972
|
oldValue
|
|
2000
1973
|
}), resolve();
|
|
2001
1974
|
}).catch(reject);
|
|
2002
1975
|
});
|
|
2003
1976
|
}
|
|
2004
1977
|
renderCollapsed() {
|
|
2005
|
-
let { name, keyPath, deep, data } = this.state, { handleRemove, readOnly, dataType,
|
|
1978
|
+
let { name, keyPath, deep, data } = this.state, { handleRemove, readOnly, dataType, minusMenuElement } = this.props, keyList = Object.getOwnPropertyNames(data), isReadOnly = readOnly(name, data, keyPath, deep, dataType), removeItemButton = minusMenuElement && cloneElement2(minusMenuElement, {
|
|
2006
1979
|
onClick: handleRemove,
|
|
2007
1980
|
className: "rejt-minus-menu",
|
|
2008
|
-
style: minus,
|
|
2009
1981
|
"aria-label": `remove the object '${String(name)}'`
|
|
2010
1982
|
});
|
|
2011
|
-
return React9.createElement(React9.Fragment, null, React9.createElement("span", {
|
|
1983
|
+
return React9.createElement(React9.Fragment, null, React9.createElement("span", { className: "rejt-collapsed-value" }, "{...}", " ", keyList.length, " ", keyList.length === 1 ? "key" : "keys"), !isReadOnly && removeItemButton);
|
|
2012
1984
|
}
|
|
2013
1985
|
renderNotCollapsed() {
|
|
2014
1986
|
let { name, data, keyPath, deep, nextDeep, addFormVisible } = this.state, {
|
|
@@ -2016,7 +1988,6 @@ var JsonObject = class extends Component {
|
|
|
2016
1988
|
handleRemove,
|
|
2017
1989
|
onDeltaUpdate,
|
|
2018
1990
|
readOnly,
|
|
2019
|
-
getStyle,
|
|
2020
1991
|
dataType,
|
|
2021
1992
|
addButtonElement,
|
|
2022
1993
|
cancelButtonElement,
|
|
@@ -2027,17 +1998,15 @@ var JsonObject = class extends Component {
|
|
|
2027
1998
|
beforeRemoveAction,
|
|
2028
1999
|
beforeAddAction,
|
|
2029
2000
|
beforeUpdateAction,
|
|
2030
|
-
logger:
|
|
2001
|
+
logger: logger5,
|
|
2031
2002
|
onSubmitValueParser
|
|
2032
|
-
} = this.props,
|
|
2003
|
+
} = this.props, keyList = Object.getOwnPropertyNames(data), isReadOnly = readOnly(name, data, keyPath, deep, dataType), addItemButton = plusMenuElement && cloneElement2(plusMenuElement, {
|
|
2033
2004
|
onClick: this.handleAddMode,
|
|
2034
2005
|
className: "rejt-plus-menu",
|
|
2035
|
-
style: plus,
|
|
2036
2006
|
"aria-label": `add a new property to the object '${String(name)}'`
|
|
2037
2007
|
}), removeItemButton = minusMenuElement && cloneElement2(minusMenuElement, {
|
|
2038
2008
|
onClick: handleRemove,
|
|
2039
2009
|
className: "rejt-minus-menu",
|
|
2040
|
-
style: minus,
|
|
2041
2010
|
"aria-label": `remove the object '${String(name)}'`
|
|
2042
2011
|
}), list = keyList.map((key) => React9.createElement(
|
|
2043
2012
|
JsonNode,
|
|
@@ -2053,7 +2022,6 @@ var JsonObject = class extends Component {
|
|
|
2053
2022
|
onUpdate: this.onChildUpdate,
|
|
2054
2023
|
onDeltaUpdate,
|
|
2055
2024
|
readOnly,
|
|
2056
|
-
getStyle,
|
|
2057
2025
|
addButtonElement,
|
|
2058
2026
|
cancelButtonElement,
|
|
2059
2027
|
inputElementGenerator,
|
|
@@ -2063,11 +2031,11 @@ var JsonObject = class extends Component {
|
|
|
2063
2031
|
beforeRemoveAction,
|
|
2064
2032
|
beforeAddAction,
|
|
2065
2033
|
beforeUpdateAction,
|
|
2066
|
-
logger:
|
|
2034
|
+
logger: logger5,
|
|
2067
2035
|
onSubmitValueParser
|
|
2068
2036
|
}
|
|
2069
2037
|
));
|
|
2070
|
-
return React9.createElement(React9.Fragment, null, React9.createElement("span", { className: "rejt-not-collapsed-delimiter"
|
|
2038
|
+
return React9.createElement(React9.Fragment, null, React9.createElement("span", { className: "rejt-not-collapsed-delimiter" }, "{"), !isReadOnly && addItemButton, React9.createElement("ul", { className: "rejt-not-collapsed-list" }, list), !isReadOnly && addFormVisible && React9.createElement("div", { className: "rejt-add-form" }, React9.createElement(
|
|
2071
2039
|
JsonAddValue,
|
|
2072
2040
|
{
|
|
2073
2041
|
handleAdd: this.handleAddValueAdd,
|
|
@@ -2079,10 +2047,10 @@ var JsonObject = class extends Component {
|
|
|
2079
2047
|
deep,
|
|
2080
2048
|
onSubmitValueParser
|
|
2081
2049
|
}
|
|
2082
|
-
)), React9.createElement("span", { className: "rejt-not-collapsed-delimiter"
|
|
2050
|
+
)), React9.createElement("span", { className: "rejt-not-collapsed-delimiter" }, "}"), !isReadOnly && removeItemButton);
|
|
2083
2051
|
}
|
|
2084
2052
|
render() {
|
|
2085
|
-
let { name, collapsed, keyPath, deep = 0 } = this.state,
|
|
2053
|
+
let { name, collapsed, keyPath, deep = 0 } = this.state, value = collapsed ? this.renderCollapsed() : this.renderNotCollapsed();
|
|
2086
2054
|
return React9.createElement(
|
|
2087
2055
|
JsonNodeAccordion,
|
|
2088
2056
|
{
|
|
@@ -2092,7 +2060,7 @@ var JsonObject = class extends Component {
|
|
|
2092
2060
|
keyPath,
|
|
2093
2061
|
onClick: this.handleCollapseMode
|
|
2094
2062
|
},
|
|
2095
|
-
|
|
2063
|
+
value
|
|
2096
2064
|
);
|
|
2097
2065
|
}
|
|
2098
2066
|
};
|
|
@@ -2119,7 +2087,7 @@ var JsonValue = class extends Component {
|
|
|
2119
2087
|
return props.value !== state.value ? { value: props.value } : null;
|
|
2120
2088
|
}
|
|
2121
2089
|
componentDidUpdate() {
|
|
2122
|
-
let { editEnabled, inputRef, name, value
|
|
2090
|
+
let { editEnabled, inputRef, name, value, keyPath, deep } = this.state, { readOnly, dataType } = this.props, isReadOnly = readOnly(name, value, keyPath, deep, dataType);
|
|
2123
2091
|
editEnabled && !isReadOnly && typeof inputRef.focus == "function" && inputRef.focus();
|
|
2124
2092
|
}
|
|
2125
2093
|
onKeydown(event) {
|
|
@@ -2127,7 +2095,7 @@ var JsonValue = class extends Component {
|
|
|
2127
2095
|
event.altKey || event.ctrlKey || event.metaKey || event.shiftKey || event.repeat || inputRef !== event.target || ((event.code === "Enter" || event.key === "Enter") && (event.preventDefault(), this.handleEdit()), (event.code === "Escape" || event.key === "Escape") && (event.preventDefault(), this.handleCancelEdit()));
|
|
2128
2096
|
}
|
|
2129
2097
|
handleEdit() {
|
|
2130
|
-
let { handleUpdateValue, originalValue, logger:
|
|
2098
|
+
let { handleUpdateValue, originalValue, logger: logger5, onSubmitValueParser, keyPath } = this.props, { inputRef, name, deep } = this.state;
|
|
2131
2099
|
if (!inputRef)
|
|
2132
2100
|
return;
|
|
2133
2101
|
let newValue = onSubmitValueParser(!0, keyPath, deep, name, inputRef.value), result = {
|
|
@@ -2136,7 +2104,7 @@ var JsonValue = class extends Component {
|
|
|
2136
2104
|
};
|
|
2137
2105
|
(handleUpdateValue || Promise.resolve.bind(Promise))(result).then(() => {
|
|
2138
2106
|
isComponentWillChange(originalValue, newValue) || this.handleCancelEdit();
|
|
2139
|
-
}).catch(
|
|
2107
|
+
}).catch(logger5.error);
|
|
2140
2108
|
}
|
|
2141
2109
|
handleEditMode() {
|
|
2142
2110
|
this.setState({
|
|
@@ -2152,16 +2120,15 @@ var JsonValue = class extends Component {
|
|
|
2152
2120
|
});
|
|
2153
2121
|
}
|
|
2154
2122
|
render() {
|
|
2155
|
-
let { name, value
|
|
2123
|
+
let { name, value, editEnabled, keyPath, deep } = this.state, {
|
|
2156
2124
|
handleRemove,
|
|
2157
2125
|
originalValue,
|
|
2158
2126
|
readOnly,
|
|
2159
2127
|
dataType,
|
|
2160
|
-
getStyle,
|
|
2161
2128
|
inputElementGenerator,
|
|
2162
2129
|
minusMenuElement,
|
|
2163
2130
|
keyPath: comeFromKeyPath
|
|
2164
|
-
} = this.props,
|
|
2131
|
+
} = this.props, isReadOnly = readOnly(name, originalValue, keyPath, deep, dataType), isEditing = editEnabled && !isReadOnly, inputElement = inputElementGenerator(
|
|
2165
2132
|
VALUE,
|
|
2166
2133
|
comeFromKeyPath,
|
|
2167
2134
|
deep,
|
|
@@ -2175,18 +2142,9 @@ var JsonValue = class extends Component {
|
|
|
2175
2142
|
}), parentPropertyName = keyPath.at(-2), minusMenuLayout = minusMenuElement && cloneElement2(minusMenuElement, {
|
|
2176
2143
|
onClick: handleRemove,
|
|
2177
2144
|
className: "rejt-minus-menu",
|
|
2178
|
-
style: style.minus,
|
|
2179
2145
|
"aria-label": `remove the property '${String(name)}' with value '${String(originalValue)}'${String(parentPropertyName) ? ` from '${String(parentPropertyName)}'` : ""}`
|
|
2180
2146
|
});
|
|
2181
|
-
return React9.createElement("li", { className: "rejt-value-node"
|
|
2182
|
-
"span",
|
|
2183
|
-
{
|
|
2184
|
-
className: "rejt-value",
|
|
2185
|
-
style: style.value,
|
|
2186
|
-
onClick: isReadOnly ? void 0 : this.handleEditMode
|
|
2187
|
-
},
|
|
2188
|
-
String(value2)
|
|
2189
|
-
), !isReadOnly && !isEditing && minusMenuLayout);
|
|
2147
|
+
return React9.createElement("li", { className: "rejt-value-node" }, React9.createElement("span", { className: "rejt-name" }, name, " : "), isEditing ? React9.createElement("span", { className: "rejt-edit-form" }, inputElementLayout) : React9.createElement("span", { className: "rejt-value", onClick: isReadOnly ? void 0 : this.handleEditMode }, String(value)), !isReadOnly && !isEditing && minusMenuLayout);
|
|
2190
2148
|
}
|
|
2191
2149
|
};
|
|
2192
2150
|
JsonValue.defaultProps = {
|
|
@@ -2209,65 +2167,6 @@ function parse3(string) {
|
|
|
2209
2167
|
return result;
|
|
2210
2168
|
}
|
|
2211
2169
|
|
|
2212
|
-
// src/blocks/controls/react-editable-json-tree/utils/styles.ts
|
|
2213
|
-
var object = {
|
|
2214
|
-
minus: {
|
|
2215
|
-
color: "red"
|
|
2216
|
-
},
|
|
2217
|
-
plus: {
|
|
2218
|
-
color: "green"
|
|
2219
|
-
},
|
|
2220
|
-
collapsed: {
|
|
2221
|
-
color: "grey"
|
|
2222
|
-
},
|
|
2223
|
-
delimiter: {},
|
|
2224
|
-
ul: {
|
|
2225
|
-
padding: "0px",
|
|
2226
|
-
margin: "0 0 0 25px",
|
|
2227
|
-
listStyle: "none"
|
|
2228
|
-
},
|
|
2229
|
-
name: {
|
|
2230
|
-
color: "#2287CD"
|
|
2231
|
-
},
|
|
2232
|
-
addForm: {}
|
|
2233
|
-
}, array = {
|
|
2234
|
-
minus: {
|
|
2235
|
-
color: "red"
|
|
2236
|
-
},
|
|
2237
|
-
plus: {
|
|
2238
|
-
color: "green"
|
|
2239
|
-
},
|
|
2240
|
-
collapsed: {
|
|
2241
|
-
color: "grey"
|
|
2242
|
-
},
|
|
2243
|
-
delimiter: {},
|
|
2244
|
-
ul: {
|
|
2245
|
-
padding: "0px",
|
|
2246
|
-
margin: "0 0 0 25px",
|
|
2247
|
-
listStyle: "none"
|
|
2248
|
-
},
|
|
2249
|
-
name: {
|
|
2250
|
-
color: "#2287CD"
|
|
2251
|
-
},
|
|
2252
|
-
addForm: {}
|
|
2253
|
-
}, value = {
|
|
2254
|
-
minus: {
|
|
2255
|
-
color: "red"
|
|
2256
|
-
},
|
|
2257
|
-
editForm: {},
|
|
2258
|
-
value: {
|
|
2259
|
-
color: "#7bba3d"
|
|
2260
|
-
},
|
|
2261
|
-
li: {
|
|
2262
|
-
minHeight: "22px",
|
|
2263
|
-
lineHeight: "22px",
|
|
2264
|
-
outline: "0px"
|
|
2265
|
-
},
|
|
2266
|
-
name: {
|
|
2267
|
-
color: "#2287CD"
|
|
2268
|
-
}
|
|
2269
|
-
};
|
|
2270
|
-
|
|
2271
2170
|
// src/blocks/controls/react-editable-json-tree/index.tsx
|
|
2272
2171
|
var JsonTree = class extends Component2 {
|
|
2273
2172
|
constructor(props) {
|
|
@@ -2293,7 +2192,6 @@ var JsonTree = class extends Component2 {
|
|
|
2293
2192
|
isCollapsed,
|
|
2294
2193
|
onDeltaUpdate,
|
|
2295
2194
|
readOnly,
|
|
2296
|
-
getStyle,
|
|
2297
2195
|
addButtonElement,
|
|
2298
2196
|
cancelButtonElement,
|
|
2299
2197
|
inputElement,
|
|
@@ -2303,7 +2201,7 @@ var JsonTree = class extends Component2 {
|
|
|
2303
2201
|
beforeRemoveAction,
|
|
2304
2202
|
beforeAddAction,
|
|
2305
2203
|
beforeUpdateAction,
|
|
2306
|
-
logger:
|
|
2204
|
+
logger: logger5,
|
|
2307
2205
|
onSubmitValueParser,
|
|
2308
2206
|
fallback = null
|
|
2309
2207
|
} = this.props, dataType = getObjectType(data), readOnlyFunction = readOnly;
|
|
@@ -2322,7 +2220,6 @@ var JsonTree = class extends Component2 {
|
|
|
2322
2220
|
onDeltaUpdate: onDeltaUpdate ?? (() => {
|
|
2323
2221
|
}),
|
|
2324
2222
|
readOnly: readOnlyFunction,
|
|
2325
|
-
getStyle: getStyle ?? (() => ({})),
|
|
2326
2223
|
addButtonElement,
|
|
2327
2224
|
cancelButtonElement,
|
|
2328
2225
|
inputElementGenerator: inputElementFunction,
|
|
@@ -2333,7 +2230,7 @@ var JsonTree = class extends Component2 {
|
|
|
2333
2230
|
beforeRemoveAction,
|
|
2334
2231
|
beforeAddAction,
|
|
2335
2232
|
beforeUpdateAction,
|
|
2336
|
-
logger:
|
|
2233
|
+
logger: logger5 ?? {},
|
|
2337
2234
|
onSubmitValueParser: onSubmitValueParser ?? ((val) => val)
|
|
2338
2235
|
}
|
|
2339
2236
|
)) : fallback;
|
|
@@ -2342,17 +2239,6 @@ var JsonTree = class extends Component2 {
|
|
|
2342
2239
|
JsonTree.defaultProps = {
|
|
2343
2240
|
rootName: "root",
|
|
2344
2241
|
isCollapsed: (keyPath, deep) => deep !== -1,
|
|
2345
|
-
getStyle: (keyName, data, keyPath, deep, dataType) => {
|
|
2346
|
-
switch (dataType) {
|
|
2347
|
-
case "Object":
|
|
2348
|
-
case "Error":
|
|
2349
|
-
return object;
|
|
2350
|
-
case "Array":
|
|
2351
|
-
return array;
|
|
2352
|
-
default:
|
|
2353
|
-
return value;
|
|
2354
|
-
}
|
|
2355
|
-
},
|
|
2356
2242
|
readOnly: () => !1,
|
|
2357
2243
|
onFullyUpdate: () => {
|
|
2358
2244
|
},
|
|
@@ -2374,7 +2260,9 @@ var { window: globalWindow } = globalThis, Wrapper4 = styled8.div(({ theme }) =>
|
|
|
2374
2260
|
position: "relative",
|
|
2375
2261
|
display: "flex",
|
|
2376
2262
|
isolation: "isolate",
|
|
2263
|
+
gap: 8,
|
|
2377
2264
|
".rejt-tree": {
|
|
2265
|
+
flex: 1,
|
|
2378
2266
|
marginLeft: "1rem",
|
|
2379
2267
|
fontSize: "13px",
|
|
2380
2268
|
listStyleType: "none"
|
|
@@ -2392,8 +2280,14 @@ var { window: globalWindow } = globalThis, Wrapper4 = styled8.div(({ theme }) =>
|
|
|
2392
2280
|
alignItems: "center"
|
|
2393
2281
|
},
|
|
2394
2282
|
".rejt-name": {
|
|
2283
|
+
color: theme.color.secondary,
|
|
2395
2284
|
lineHeight: "22px"
|
|
2396
2285
|
},
|
|
2286
|
+
".rejt-not-collapsed-list": {
|
|
2287
|
+
listStyle: "none",
|
|
2288
|
+
margin: "0 0 0 1rem",
|
|
2289
|
+
padding: 0
|
|
2290
|
+
},
|
|
2397
2291
|
".rejt-not-collapsed-delimiter": {
|
|
2398
2292
|
lineHeight: "22px"
|
|
2399
2293
|
},
|
|
@@ -2409,6 +2303,9 @@ var { window: globalWindow } = globalThis, Wrapper4 = styled8.div(({ theme }) =>
|
|
|
2409
2303
|
".rejt-value-node:hover > .rejt-value": {
|
|
2410
2304
|
background: theme.base === "light" ? theme.color.lighter : "hsl(0 0 100 / 0.02)",
|
|
2411
2305
|
borderColor: theme.appBorderColor
|
|
2306
|
+
},
|
|
2307
|
+
".rejt-collapsed-value": {
|
|
2308
|
+
color: theme.color.defaultText
|
|
2412
2309
|
}
|
|
2413
2310
|
})), ButtonInline = styled8.button(({ theme, primary }) => ({
|
|
2414
2311
|
border: 0,
|
|
@@ -2463,10 +2360,9 @@ var { window: globalWindow } = globalThis, Wrapper4 = styled8.div(({ theme }) =>
|
|
|
2463
2360
|
border: `1px solid ${theme.color.secondary}`
|
|
2464
2361
|
}
|
|
2465
2362
|
})), RawButton = styled8(ToggleButton)({
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
right: 2
|
|
2363
|
+
alignSelf: "flex-start",
|
|
2364
|
+
order: 2,
|
|
2365
|
+
marginRight: -10
|
|
2470
2366
|
}), RawInput = styled8(Form3.Textarea)(({ theme }) => ({
|
|
2471
2367
|
flex: 1,
|
|
2472
2368
|
padding: "7px 6px",
|
|
@@ -2490,23 +2386,8 @@ var { window: globalWindow } = globalThis, Wrapper4 = styled8.div(({ theme }) =>
|
|
|
2490
2386
|
event.currentTarget.dispatchEvent(new globalWindow.KeyboardEvent("keydown", ENTER_EVENT));
|
|
2491
2387
|
}, selectValue = (event) => {
|
|
2492
2388
|
event.currentTarget.select();
|
|
2493
|
-
},
|
|
2494
|
-
|
|
2495
|
-
color: theme.color.secondary
|
|
2496
|
-
},
|
|
2497
|
-
collapsed: {
|
|
2498
|
-
color: theme.color.dark
|
|
2499
|
-
},
|
|
2500
|
-
ul: {
|
|
2501
|
-
listStyle: "none",
|
|
2502
|
-
margin: "0 0 0 1rem",
|
|
2503
|
-
padding: 0
|
|
2504
|
-
},
|
|
2505
|
-
li: {
|
|
2506
|
-
outline: 0
|
|
2507
|
-
}
|
|
2508
|
-
}), ObjectControl = ({ name, value: value2, onChange, argType }) => {
|
|
2509
|
-
let theme = useTheme(), data = useMemo(() => value2 && cloneDeep(value2), [value2]), hasData = data != null, [showRaw, setShowRaw] = useState4(!hasData), [parseError, setParseError] = useState4(null), readonly = !!argType?.table?.readonly, updateRaw = useCallback3(
|
|
2389
|
+
}, ObjectControl = ({ name, value, onChange, argType }) => {
|
|
2390
|
+
let theme = useTheme(), data = useMemo(() => value && cloneDeep(value), [value]), hasData = data != null, [showRaw, setShowRaw] = useState4(!hasData), [parseError, setParseError] = useState4(null), readonly = !!argType?.table?.readonly, updateRaw = useCallback3(
|
|
2510
2391
|
(raw) => {
|
|
2511
2392
|
try {
|
|
2512
2393
|
raw && onChange(JSON.parse(raw)), setParseError(null);
|
|
@@ -2517,7 +2398,7 @@ var { window: globalWindow } = globalThis, Wrapper4 = styled8.div(({ theme }) =>
|
|
|
2517
2398
|
[onChange]
|
|
2518
2399
|
), [forceVisible, setForceVisible] = useState4(!1), onForceVisible = useCallback3(() => {
|
|
2519
2400
|
onChange({}), setForceVisible(!0);
|
|
2520
|
-
}, [setForceVisible]), htmlElRef = useRef3(null);
|
|
2401
|
+
}, [onChange, setForceVisible]), htmlElRef = useRef3(null);
|
|
2521
2402
|
useEffect4(() => {
|
|
2522
2403
|
forceVisible && htmlElRef.current && htmlElRef.current.select();
|
|
2523
2404
|
}, [forceVisible]);
|
|
@@ -2548,18 +2429,21 @@ var { window: globalWindow } = globalThis, Wrapper4 = styled8.div(({ theme }) =>
|
|
|
2548
2429
|
valid: parseError ? "error" : void 0,
|
|
2549
2430
|
readOnly: readonly
|
|
2550
2431
|
}
|
|
2551
|
-
), isObjectOrArray = Array.isArray(
|
|
2432
|
+
), isObjectOrArray = Array.isArray(value) || typeof value == "object" && value?.constructor === Object;
|
|
2552
2433
|
return React11.createElement(Wrapper4, null, isObjectOrArray && React11.createElement(
|
|
2553
2434
|
RawButton,
|
|
2554
2435
|
{
|
|
2555
2436
|
disabled: readonly,
|
|
2556
2437
|
pressed: showRaw,
|
|
2557
|
-
ariaLabel: `Edit
|
|
2438
|
+
ariaLabel: `Edit ${name} as JSON`,
|
|
2558
2439
|
onClick: (e2) => {
|
|
2559
2440
|
e2.preventDefault(), setShowRaw((isRaw) => !isRaw);
|
|
2560
|
-
}
|
|
2441
|
+
},
|
|
2442
|
+
variant: "ghost",
|
|
2443
|
+
padding: "small",
|
|
2444
|
+
size: "small"
|
|
2561
2445
|
},
|
|
2562
|
-
|
|
2446
|
+
React11.createElement(EditIcon, null)
|
|
2563
2447
|
), showRaw ? rawJSONForm : React11.createElement(
|
|
2564
2448
|
JsonTree,
|
|
2565
2449
|
{
|
|
@@ -2571,7 +2455,6 @@ var { window: globalWindow } = globalThis, Wrapper4 = styled8.div(({ theme }) =>
|
|
|
2571
2455
|
data,
|
|
2572
2456
|
rootName: name,
|
|
2573
2457
|
onFullyUpdate: onChange,
|
|
2574
|
-
getStyle: getCustomStyleFunction(theme),
|
|
2575
2458
|
cancelButtonElement: React11.createElement(ButtonInline, { type: "button" }, "Cancel"),
|
|
2576
2459
|
addButtonElement: React11.createElement(ButtonInline, { type: "submit", primary: !0 }, "Save"),
|
|
2577
2460
|
plusMenuElement: React11.createElement(ActionButton, { type: "button" }, React11.createElement(AddIcon, null)),
|
|
@@ -2586,14 +2469,14 @@ var { window: globalWindow } = globalThis, Wrapper4 = styled8.div(({ theme }) =>
|
|
|
2586
2469
|
import React12, { useMemo as useMemo2 } from "react";
|
|
2587
2470
|
import { styled as styled9 } from "storybook/theming";
|
|
2588
2471
|
var RangeInput = styled9.input(
|
|
2589
|
-
({ theme, min, max, value
|
|
2472
|
+
({ theme, min, max, value, disabled }) => {
|
|
2590
2473
|
let trackBaseStyles = {
|
|
2591
2474
|
background: theme.base === "light" ? `linear-gradient(to right,
|
|
2592
|
-
${theme.color.green} 0%, ${theme.color.green} ${(
|
|
2593
|
-
${curriedDarken$1(0.02, theme.input.background)} ${(
|
|
2475
|
+
${theme.color.green} 0%, ${theme.color.green} ${(value - min) / (max - min) * 100}%,
|
|
2476
|
+
${curriedDarken$1(0.02, theme.input.background)} ${(value - min) / (max - min) * 100}%,
|
|
2594
2477
|
${curriedDarken$1(0.02, theme.input.background)} 100%)` : `linear-gradient(to right,
|
|
2595
|
-
${theme.color.green} 0%, ${theme.color.green} ${(
|
|
2596
|
-
${curriedLighten$1(0.02, theme.input.background)} ${(
|
|
2478
|
+
${theme.color.green} 0%, ${theme.color.green} ${(value - min) / (max - min) * 100}%,
|
|
2479
|
+
${curriedLighten$1(0.02, theme.input.background)} ${(value - min) / (max - min) * 100}%,
|
|
2597
2480
|
${curriedLighten$1(0.02, theme.input.background)} 100%)`,
|
|
2598
2481
|
borderRadius: 6,
|
|
2599
2482
|
boxShadow: `${theme.base == "dark" ? "hsl(0 0 100 / 0.4)" : "hsl(0 0 0 / 0.44)"} 0 0 0 1px inset`,
|
|
@@ -2701,7 +2584,7 @@ function getNumberOfDecimalPlaces(number) {
|
|
|
2701
2584
|
}
|
|
2702
2585
|
var RangeControl = ({
|
|
2703
2586
|
name,
|
|
2704
|
-
value
|
|
2587
|
+
value,
|
|
2705
2588
|
onChange,
|
|
2706
2589
|
min = 0,
|
|
2707
2590
|
max = 100,
|
|
@@ -2712,7 +2595,7 @@ var RangeControl = ({
|
|
|
2712
2595
|
}) => {
|
|
2713
2596
|
let handleChange = (event) => {
|
|
2714
2597
|
onChange(parse2(event.target.value));
|
|
2715
|
-
}, hasValue =
|
|
2598
|
+
}, hasValue = value !== void 0, numberOFDecimalsPlaces = useMemo2(() => getNumberOfDecimalPlaces(step), [step]), readonly = !!argType?.table?.readonly, controlId = getControlId(name);
|
|
2716
2599
|
return React12.createElement(RangeWrapper, { readOnly: readonly }, React12.createElement("label", { htmlFor: controlId, className: "sb-sr-only" }, name), React12.createElement(RangeLabel, null, min), React12.createElement(
|
|
2717
2600
|
RangeInput,
|
|
2718
2601
|
{
|
|
@@ -2726,9 +2609,9 @@ var RangeControl = ({
|
|
|
2726
2609
|
step,
|
|
2727
2610
|
onFocus,
|
|
2728
2611
|
onBlur,
|
|
2729
|
-
value:
|
|
2612
|
+
value: value ?? min
|
|
2730
2613
|
}
|
|
2731
|
-
), React12.createElement(RangeCurrentAndMaxLabel, { numberOFDecimalsPlaces, max }, hasValue ?
|
|
2614
|
+
), React12.createElement(RangeCurrentAndMaxLabel, { numberOFDecimalsPlaces, max }, hasValue ? value.toFixed(numberOFDecimalsPlaces) : "--", " / ", max));
|
|
2732
2615
|
};
|
|
2733
2616
|
|
|
2734
2617
|
// src/blocks/controls/Text.tsx
|
|
@@ -2743,7 +2626,7 @@ var Wrapper5 = styled10.label({
|
|
|
2743
2626
|
color: isMaxed ? "red" : void 0
|
|
2744
2627
|
})), TextControl = ({
|
|
2745
2628
|
name,
|
|
2746
|
-
value
|
|
2629
|
+
value,
|
|
2747
2630
|
onChange,
|
|
2748
2631
|
onFocus,
|
|
2749
2632
|
onBlur,
|
|
@@ -2755,7 +2638,7 @@ var Wrapper5 = styled10.label({
|
|
|
2755
2638
|
}, readonly = !!argType?.table?.readonly, [forceVisible, setForceVisible] = useState5(!1), onForceVisible = useCallback4(() => {
|
|
2756
2639
|
onChange(""), setForceVisible(!0);
|
|
2757
2640
|
}, [setForceVisible]);
|
|
2758
|
-
if (
|
|
2641
|
+
if (value === void 0)
|
|
2759
2642
|
return React13.createElement(
|
|
2760
2643
|
Button4,
|
|
2761
2644
|
{
|
|
@@ -2768,7 +2651,7 @@ var Wrapper5 = styled10.label({
|
|
|
2768
2651
|
},
|
|
2769
2652
|
"Set string"
|
|
2770
2653
|
);
|
|
2771
|
-
let isValid = typeof
|
|
2654
|
+
let isValid = typeof value == "string";
|
|
2772
2655
|
return React13.createElement(Wrapper5, null, React13.createElement(
|
|
2773
2656
|
Form4.Textarea,
|
|
2774
2657
|
{
|
|
@@ -2781,11 +2664,11 @@ var Wrapper5 = styled10.label({
|
|
|
2781
2664
|
autoFocus: forceVisible,
|
|
2782
2665
|
valid: isValid ? void 0 : "error",
|
|
2783
2666
|
name,
|
|
2784
|
-
value: isValid ?
|
|
2667
|
+
value: isValid ? value : "",
|
|
2785
2668
|
onFocus,
|
|
2786
2669
|
onBlur
|
|
2787
2670
|
}
|
|
2788
|
-
), maxLength && React13.createElement(MaxLength, { isMaxed:
|
|
2671
|
+
), maxLength && React13.createElement(MaxLength, { isMaxed: value?.length === maxLength }, value?.length ?? 0, " / ", maxLength));
|
|
2789
2672
|
};
|
|
2790
2673
|
|
|
2791
2674
|
// src/blocks/controls/Files.tsx
|
|
@@ -2804,7 +2687,7 @@ var FilesControl = ({
|
|
|
2804
2687
|
onChange,
|
|
2805
2688
|
name,
|
|
2806
2689
|
accept = "image/*",
|
|
2807
|
-
value
|
|
2690
|
+
value,
|
|
2808
2691
|
argType
|
|
2809
2692
|
}) => {
|
|
2810
2693
|
let inputElement = useRef4(null), readonly = argType?.control?.readOnly;
|
|
@@ -2812,11 +2695,11 @@ var FilesControl = ({
|
|
|
2812
2695
|
if (!e2.target.files)
|
|
2813
2696
|
return;
|
|
2814
2697
|
let fileUrls = Array.from(e2.target.files).map((file) => URL.createObjectURL(file));
|
|
2815
|
-
onChange(fileUrls), revokeOldUrls(
|
|
2698
|
+
onChange(fileUrls), revokeOldUrls(value || []);
|
|
2816
2699
|
}
|
|
2817
2700
|
useEffect5(() => {
|
|
2818
|
-
|
|
2819
|
-
}, [
|
|
2701
|
+
value == null && inputElement.current && (inputElement.current.value = "");
|
|
2702
|
+
}, [value, name]);
|
|
2820
2703
|
let controlId = getControlId(name);
|
|
2821
2704
|
return React14.createElement(React14.Fragment, null, React14.createElement("label", { htmlFor: controlId, className: "sb-sr-only" }, name), React14.createElement(
|
|
2822
2705
|
FileInput,
|
|
@@ -3035,10 +2918,10 @@ var ITEMS_BEFORE_EXPANSION = 8, Summary = styled13.div(({ isExpanded }) => ({
|
|
|
3035
2918
|
}), EmptyArg = () => React18.createElement("span", null, "-"), ArgText = ({ text, simple }) => React18.createElement(Text3, { simple }, text), getSummaryItems = (summary) => {
|
|
3036
2919
|
if (!summary)
|
|
3037
2920
|
return [summary];
|
|
3038
|
-
let summaryItems = summary.split("|").map((
|
|
2921
|
+
let summaryItems = summary.split("|").map((value) => value.trim());
|
|
3039
2922
|
return uniq(summaryItems);
|
|
3040
|
-
}, renderSummaryItems = (summaryItems) => summaryItems.slice(0, ITEMS_BEFORE_EXPANSION).map((item) => React18.createElement(ArgText, { key: item, text: item === "" ? '""' : item })), renderExpandedItems = (summaryItems) => summaryItems.slice(ITEMS_BEFORE_EXPANSION).map((item) => React18.createElement(ArgText, { key: item, text: item === "" ? '""' : item })), ArgSummary = ({ value
|
|
3041
|
-
let { summary, detail } =
|
|
2923
|
+
}, renderSummaryItems = (summaryItems) => summaryItems.slice(0, ITEMS_BEFORE_EXPANSION).map((item) => React18.createElement(ArgText, { key: item, text: item === "" ? '""' : item })), renderExpandedItems = (summaryItems) => summaryItems.slice(ITEMS_BEFORE_EXPANSION).map((item) => React18.createElement(ArgText, { key: item, text: item === "" ? '""' : item })), ArgSummary = ({ value, initialExpandedArgs }) => {
|
|
2924
|
+
let { summary, detail } = value, [isOpen, setIsOpen] = useState7(!1), [isExpanded, setIsExpanded] = useState7(initialExpandedArgs || !1);
|
|
3042
2925
|
if (summary == null)
|
|
3043
2926
|
return null;
|
|
3044
2927
|
let summaryAsString = typeof summary.toString == "function" ? summary.toString() : summary;
|
|
@@ -3062,7 +2945,7 @@ var ITEMS_BEFORE_EXPANSION = 8, Summary = styled13.div(({ isExpanded }) => ({
|
|
|
3062
2945
|
},
|
|
3063
2946
|
React18.createElement(Expandable, { className: "sbdocs-expandable" }, React18.createElement("span", null, summaryAsString), isOpen ? React18.createElement(ChevronUpIcon, null) : React18.createElement(ChevronDownIcon, null))
|
|
3064
2947
|
);
|
|
3065
|
-
}, ArgValue = ({ value
|
|
2948
|
+
}, ArgValue = ({ value, initialExpandedArgs }) => value == null ? React18.createElement(EmptyArg, null) : React18.createElement(ArgSummary, { value, initialExpandedArgs });
|
|
3066
2949
|
|
|
3067
2950
|
// src/blocks/components/ArgsTable/ArgRow.tsx
|
|
3068
2951
|
var Name = styled14.span({ fontWeight: "bold" }), Required = styled14.span(({ theme }) => ({
|
|
@@ -3099,7 +2982,7 @@ var Name = styled14.span({ fontWeight: "bold" }), Required = styled14.span(({ th
|
|
|
3099
2982
|
marginBottom: 12
|
|
3100
2983
|
})), StyledTd = styled14.td(({ expandable }) => ({
|
|
3101
2984
|
paddingLeft: expandable ? "40px !important" : "20px !important"
|
|
3102
|
-
})), toSummary = (
|
|
2985
|
+
})), toSummary = (value) => value && { summary: typeof value == "string" ? value : value.name }, ArgRow = (props) => {
|
|
3103
2986
|
let [isHovered, setIsHovered] = useState8(!1), { row, updateArgs, compact: compact2, expandable, initialExpandedArgs } = props, { name, description } = row, table = row.table || {}, type = table.type || toSummary(row.type), defaultValue = table.defaultValue || row.defaultValue, required = row.type?.required, hasDescription = description != null && description !== "";
|
|
3104
2987
|
return React19.createElement("tr", { onMouseEnter: () => setIsHovered(!0), onMouseLeave: () => setIsHovered(!1) }, React19.createElement(StyledTd, { expandable: expandable ?? !1 }, React19.createElement(Name, null, name), required ? React19.createElement(Required, { title: "Required" }, "*") : null), compact2 ? null : React19.createElement("td", null, hasDescription && React19.createElement(Description, null, React19.createElement(index_modern_default, null, description)), table.jsDocTags != null ? React19.createElement(React19.Fragment, null, React19.createElement(TypeWithJsDoc, { hasDescription }, React19.createElement(ArgValue, { value: type, initialExpandedArgs })), React19.createElement(ArgJsDoc, { tags: table.jsDocTags })) : React19.createElement(Type, { hasDescription }, React19.createElement(ArgValue, { value: type, initialExpandedArgs }))), compact2 ? null : React19.createElement("td", null, React19.createElement(ArgValue, { value: defaultValue, initialExpandedArgs })), updateArgs ? React19.createElement("td", null, React19.createElement(ArgControl, { ...props, isHovered })) : null);
|
|
3105
2988
|
};
|
|
@@ -3566,7 +3449,8 @@ var sortFns = {
|
|
|
3566
3449
|
import React24 from "react";
|
|
3567
3450
|
import { withReset } from "storybook/internal/components";
|
|
3568
3451
|
import { styled as styled19 } from "storybook/theming";
|
|
3569
|
-
var toGlobalSelector = (element) => `& :where(${element}:not(.sb-anchor, .sb-unstyled, .sb-unstyled ${element}))`, breakpoint = 600, Title = styled19.h1(
|
|
3452
|
+
var toGlobalSelector = (element) => `& :where(${element}:not(.sb-anchor, .sb-unstyled, .sb-unstyled ${element}))`, breakpoint = 600, Title = styled19.h1(({ theme }) => ({
|
|
3453
|
+
...withReset({ theme }),
|
|
3570
3454
|
color: theme.color.defaultText,
|
|
3571
3455
|
fontSize: theme.typography.size.m3,
|
|
3572
3456
|
fontWeight: theme.typography.weight.bold,
|
|
@@ -3576,7 +3460,8 @@ var toGlobalSelector = (element) => `& :where(${element}:not(.sb-anchor, .sb-uns
|
|
|
3576
3460
|
lineHeight: "36px",
|
|
3577
3461
|
marginBottom: "16px"
|
|
3578
3462
|
}
|
|
3579
|
-
})), Subtitle = styled19.h2(
|
|
3463
|
+
})), Subtitle = styled19.h2(({ theme }) => ({
|
|
3464
|
+
...withReset({ theme }),
|
|
3580
3465
|
fontWeight: theme.typography.weight.regular,
|
|
3581
3466
|
fontSize: theme.typography.size.s3,
|
|
3582
3467
|
lineHeight: "20px",
|
|
@@ -3633,7 +3518,10 @@ var toGlobalSelector = (element) => `& :where(${element}:not(.sb-anchor, .sb-uns
|
|
|
3633
3518
|
fontSize: "inherit",
|
|
3634
3519
|
lineHeight: "24px",
|
|
3635
3520
|
color: theme.color.secondary,
|
|
3636
|
-
|
|
3521
|
+
// Ensure WCAG Level A compliance (SC 1.4.1), see https://www.w3.org/WAI/WCAG22/Techniques/failures/F73
|
|
3522
|
+
textDecoration: "underline",
|
|
3523
|
+
textDecorationThickness: "0.03125rem",
|
|
3524
|
+
textUnderlineOffset: "0.11em",
|
|
3637
3525
|
"&.absent": {
|
|
3638
3526
|
color: "#cc0000"
|
|
3639
3527
|
},
|
|
@@ -3645,7 +3533,11 @@ var toGlobalSelector = (element) => `& :where(${element}:not(.sb-anchor, .sb-uns
|
|
|
3645
3533
|
position: "absolute",
|
|
3646
3534
|
top: 0,
|
|
3647
3535
|
left: 0,
|
|
3648
|
-
bottom: 0
|
|
3536
|
+
bottom: 0,
|
|
3537
|
+
textDecoration: "none"
|
|
3538
|
+
},
|
|
3539
|
+
"&.anchor:hover, &.anchor:focus": {
|
|
3540
|
+
textDecoration: "underline"
|
|
3649
3541
|
}
|
|
3650
3542
|
},
|
|
3651
3543
|
[toGlobalSelector("blockquote")]: {
|
|
@@ -3947,8 +3839,324 @@ var toGlobalSelector = (element) => `& :where(${element}:not(.sb-anchor, .sb-uns
|
|
|
3947
3839
|
})), DocsPageWrapper = ({ children, toc }) => React24.createElement(DocsWrapper, { className: "sbdocs sbdocs-wrapper" }, toc, React24.createElement(DocsContent, { className: "sbdocs sbdocs-content" }, children));
|
|
3948
3840
|
|
|
3949
3841
|
// src/blocks/components/Preview.tsx
|
|
3950
|
-
import
|
|
3951
|
-
import {
|
|
3842
|
+
import React30, { Children, useCallback as useCallback6, useContext as useContext2, useMemo as useMemo3, useState as useState13 } from "react";
|
|
3843
|
+
import { logger as logger4 } from "storybook/internal/client-logger";
|
|
3844
|
+
import { Bar, Button as Button7, ToggleButton as ToggleButton2, Zoom } from "storybook/internal/components";
|
|
3845
|
+
import { CopyIcon, MarkupIcon } from "@storybook/icons";
|
|
3846
|
+
|
|
3847
|
+
// ../../../node_modules/@react-aria/utils/dist/useLayoutEffect.mjs
|
|
3848
|
+
import $HgANd$react from "react";
|
|
3849
|
+
var $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document < "u" ? $HgANd$react.useLayoutEffect : () => {
|
|
3850
|
+
};
|
|
3851
|
+
|
|
3852
|
+
// ../../../node_modules/@react-aria/utils/dist/useValueEffect.mjs
|
|
3853
|
+
import { useState as $fCAlL$useState, useRef as $fCAlL$useRef, useCallback as $fCAlL$useCallback } from "react";
|
|
3854
|
+
|
|
3855
|
+
// ../../../node_modules/@react-aria/utils/dist/useId.mjs
|
|
3856
|
+
import { useState as $eKkEp$useState, useRef as $eKkEp$useRef, useEffect as $eKkEp$useEffect, useCallback as $eKkEp$useCallback } from "react";
|
|
3857
|
+
|
|
3858
|
+
// ../../../node_modules/@react-aria/ssr/dist/SSRProvider.mjs
|
|
3859
|
+
import $670gB$react, { useContext as $670gB$useContext, useState as $670gB$useState, useMemo as $670gB$useMemo, useLayoutEffect as $670gB$useLayoutEffect, useRef as $670gB$useRef } from "react";
|
|
3860
|
+
var $b5e257d569688ac6$var$defaultContext = {
|
|
3861
|
+
prefix: String(Math.round(Math.random() * 1e10)),
|
|
3862
|
+
current: 0
|
|
3863
|
+
}, $b5e257d569688ac6$var$SSRContext = $670gB$react.createContext($b5e257d569688ac6$var$defaultContext), $b5e257d569688ac6$var$IsSSRContext = $670gB$react.createContext(!1);
|
|
3864
|
+
var $b5e257d569688ac6$var$canUseDOM = !!(typeof window < "u" && window.document && window.document.createElement), $b5e257d569688ac6$var$componentIds = /* @__PURE__ */ new WeakMap();
|
|
3865
|
+
function $b5e257d569688ac6$var$useCounter(isDisabled = !1) {
|
|
3866
|
+
let ctx = $670gB$useContext($b5e257d569688ac6$var$SSRContext), ref = $670gB$useRef(null);
|
|
3867
|
+
if (ref.current === null && !isDisabled) {
|
|
3868
|
+
var _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner, _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
3869
|
+
let currentOwner = (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = $670gB$react.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === void 0 || (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner = _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner === void 0 ? void 0 : _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner.current;
|
|
3870
|
+
if (currentOwner) {
|
|
3871
|
+
let prevComponentValue = $b5e257d569688ac6$var$componentIds.get(currentOwner);
|
|
3872
|
+
prevComponentValue == null ? $b5e257d569688ac6$var$componentIds.set(currentOwner, {
|
|
3873
|
+
id: ctx.current,
|
|
3874
|
+
state: currentOwner.memoizedState
|
|
3875
|
+
}) : currentOwner.memoizedState !== prevComponentValue.state && (ctx.current = prevComponentValue.id, $b5e257d569688ac6$var$componentIds.delete(currentOwner));
|
|
3876
|
+
}
|
|
3877
|
+
ref.current = ++ctx.current;
|
|
3878
|
+
}
|
|
3879
|
+
return ref.current;
|
|
3880
|
+
}
|
|
3881
|
+
function $b5e257d569688ac6$var$useLegacySSRSafeId(defaultId) {
|
|
3882
|
+
let ctx = $670gB$useContext($b5e257d569688ac6$var$SSRContext);
|
|
3883
|
+
ctx === $b5e257d569688ac6$var$defaultContext && !$b5e257d569688ac6$var$canUseDOM && process.env.NODE_ENV !== "production" && console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
|
|
3884
|
+
let counter = $b5e257d569688ac6$var$useCounter(!!defaultId), prefix = ctx === $b5e257d569688ac6$var$defaultContext && process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${ctx.prefix}`;
|
|
3885
|
+
return defaultId || `${prefix}-${counter}`;
|
|
3886
|
+
}
|
|
3887
|
+
function $b5e257d569688ac6$var$useModernSSRSafeId(defaultId) {
|
|
3888
|
+
let id = $670gB$react.useId(), [didSSR] = $670gB$useState($b5e257d569688ac6$export$535bd6ca7f90a273()), prefix = didSSR || process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${$b5e257d569688ac6$var$defaultContext.prefix}`;
|
|
3889
|
+
return defaultId || `${prefix}-${id}`;
|
|
3890
|
+
}
|
|
3891
|
+
var $b5e257d569688ac6$export$619500959fc48b26 = typeof $670gB$react.useId == "function" ? $b5e257d569688ac6$var$useModernSSRSafeId : $b5e257d569688ac6$var$useLegacySSRSafeId;
|
|
3892
|
+
function $b5e257d569688ac6$var$getSnapshot() {
|
|
3893
|
+
return !1;
|
|
3894
|
+
}
|
|
3895
|
+
function $b5e257d569688ac6$var$getServerSnapshot() {
|
|
3896
|
+
return !0;
|
|
3897
|
+
}
|
|
3898
|
+
function $b5e257d569688ac6$var$subscribe(onStoreChange) {
|
|
3899
|
+
return () => {
|
|
3900
|
+
};
|
|
3901
|
+
}
|
|
3902
|
+
function $b5e257d569688ac6$export$535bd6ca7f90a273() {
|
|
3903
|
+
return typeof $670gB$react.useSyncExternalStore == "function" ? $670gB$react.useSyncExternalStore($b5e257d569688ac6$var$subscribe, $b5e257d569688ac6$var$getSnapshot, $b5e257d569688ac6$var$getServerSnapshot) : $670gB$useContext($b5e257d569688ac6$var$IsSSRContext);
|
|
3904
|
+
}
|
|
3905
|
+
|
|
3906
|
+
// ../../../node_modules/@react-aria/utils/dist/useId.mjs
|
|
3907
|
+
var $bdb11010cef70236$var$canUseDOM = !!(typeof window < "u" && window.document && window.document.createElement), $bdb11010cef70236$export$d41a04c74483c6ef = /* @__PURE__ */ new Map(), $bdb11010cef70236$var$registry;
|
|
3908
|
+
typeof FinalizationRegistry < "u" && ($bdb11010cef70236$var$registry = new FinalizationRegistry((heldValue) => {
|
|
3909
|
+
$bdb11010cef70236$export$d41a04c74483c6ef.delete(heldValue);
|
|
3910
|
+
}));
|
|
3911
|
+
function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
|
|
3912
|
+
let [value, setValue] = $eKkEp$useState(defaultId), nextId = $eKkEp$useRef(null), res = $b5e257d569688ac6$export$619500959fc48b26(value), cleanupRef = $eKkEp$useRef(null);
|
|
3913
|
+
if ($bdb11010cef70236$var$registry && $bdb11010cef70236$var$registry.register(cleanupRef, res), $bdb11010cef70236$var$canUseDOM) {
|
|
3914
|
+
let cacheIdRef = $bdb11010cef70236$export$d41a04c74483c6ef.get(res);
|
|
3915
|
+
cacheIdRef && !cacheIdRef.includes(nextId) ? cacheIdRef.push(nextId) : $bdb11010cef70236$export$d41a04c74483c6ef.set(res, [
|
|
3916
|
+
nextId
|
|
3917
|
+
]);
|
|
3918
|
+
}
|
|
3919
|
+
return $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
|
|
3920
|
+
let r2 = res;
|
|
3921
|
+
return () => {
|
|
3922
|
+
$bdb11010cef70236$var$registry && $bdb11010cef70236$var$registry.unregister(cleanupRef), $bdb11010cef70236$export$d41a04c74483c6ef.delete(r2);
|
|
3923
|
+
};
|
|
3924
|
+
}, [
|
|
3925
|
+
res
|
|
3926
|
+
]), $eKkEp$useEffect(() => {
|
|
3927
|
+
let newId = nextId.current;
|
|
3928
|
+
return newId && setValue(newId), () => {
|
|
3929
|
+
newId && (nextId.current = null);
|
|
3930
|
+
};
|
|
3931
|
+
}), res;
|
|
3932
|
+
}
|
|
3933
|
+
|
|
3934
|
+
// ../../../node_modules/@react-aria/utils/dist/focusWithoutScrolling.mjs
|
|
3935
|
+
function $7215afc6de606d6b$export$de79e2c695e052f3(element) {
|
|
3936
|
+
if ($7215afc6de606d6b$var$supportsPreventScroll()) element.focus({
|
|
3937
|
+
preventScroll: !0
|
|
3938
|
+
});
|
|
3939
|
+
else {
|
|
3940
|
+
let scrollableElements = $7215afc6de606d6b$var$getScrollableElements(element);
|
|
3941
|
+
element.focus(), $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements);
|
|
3942
|
+
}
|
|
3943
|
+
}
|
|
3944
|
+
var $7215afc6de606d6b$var$supportsPreventScrollCached = null;
|
|
3945
|
+
function $7215afc6de606d6b$var$supportsPreventScroll() {
|
|
3946
|
+
if ($7215afc6de606d6b$var$supportsPreventScrollCached == null) {
|
|
3947
|
+
$7215afc6de606d6b$var$supportsPreventScrollCached = !1;
|
|
3948
|
+
try {
|
|
3949
|
+
document.createElement("div").focus({
|
|
3950
|
+
get preventScroll() {
|
|
3951
|
+
return $7215afc6de606d6b$var$supportsPreventScrollCached = !0, !0;
|
|
3952
|
+
}
|
|
3953
|
+
});
|
|
3954
|
+
} catch {
|
|
3955
|
+
}
|
|
3956
|
+
}
|
|
3957
|
+
return $7215afc6de606d6b$var$supportsPreventScrollCached;
|
|
3958
|
+
}
|
|
3959
|
+
function $7215afc6de606d6b$var$getScrollableElements(element) {
|
|
3960
|
+
let parent = element.parentNode, scrollableElements = [], rootScrollingElement = document.scrollingElement || document.documentElement;
|
|
3961
|
+
for (; parent instanceof HTMLElement && parent !== rootScrollingElement; )
|
|
3962
|
+
(parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) && scrollableElements.push({
|
|
3963
|
+
element: parent,
|
|
3964
|
+
scrollTop: parent.scrollTop,
|
|
3965
|
+
scrollLeft: parent.scrollLeft
|
|
3966
|
+
}), parent = parent.parentNode;
|
|
3967
|
+
return rootScrollingElement instanceof HTMLElement && scrollableElements.push({
|
|
3968
|
+
element: rootScrollingElement,
|
|
3969
|
+
scrollTop: rootScrollingElement.scrollTop,
|
|
3970
|
+
scrollLeft: rootScrollingElement.scrollLeft
|
|
3971
|
+
}), scrollableElements;
|
|
3972
|
+
}
|
|
3973
|
+
function $7215afc6de606d6b$var$restoreScrollPosition(scrollableElements) {
|
|
3974
|
+
for (let { element, scrollTop, scrollLeft } of scrollableElements)
|
|
3975
|
+
element.scrollTop = scrollTop, element.scrollLeft = scrollLeft;
|
|
3976
|
+
}
|
|
3977
|
+
|
|
3978
|
+
// ../../../node_modules/@react-aria/utils/dist/platform.mjs
|
|
3979
|
+
function $c87311424ea30a05$var$testUserAgent(re2) {
|
|
3980
|
+
var _window_navigator_userAgentData;
|
|
3981
|
+
if (typeof window > "u" || window.navigator == null) return !1;
|
|
3982
|
+
let brands = (_window_navigator_userAgentData = window.navigator.userAgentData) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.brands;
|
|
3983
|
+
return Array.isArray(brands) && brands.some((brand) => re2.test(brand.brand)) || re2.test(window.navigator.userAgent);
|
|
3984
|
+
}
|
|
3985
|
+
function $c87311424ea30a05$var$testPlatform(re2) {
|
|
3986
|
+
var _window_navigator_userAgentData;
|
|
3987
|
+
return typeof window < "u" && window.navigator != null ? re2.test(((_window_navigator_userAgentData = window.navigator.userAgentData) === null || _window_navigator_userAgentData === void 0 ? void 0 : _window_navigator_userAgentData.platform) || window.navigator.platform) : !1;
|
|
3988
|
+
}
|
|
3989
|
+
function $c87311424ea30a05$var$cached(fn) {
|
|
3990
|
+
if (process.env.NODE_ENV === "test") return fn;
|
|
3991
|
+
let res = null;
|
|
3992
|
+
return () => (res == null && (res = fn()), res);
|
|
3993
|
+
}
|
|
3994
|
+
var $c87311424ea30a05$export$9ac100e40613ea10 = $c87311424ea30a05$var$cached(function() {
|
|
3995
|
+
return $c87311424ea30a05$var$testPlatform(/^Mac/i);
|
|
3996
|
+
}), $c87311424ea30a05$export$186c6964ca17d99 = $c87311424ea30a05$var$cached(function() {
|
|
3997
|
+
return $c87311424ea30a05$var$testPlatform(/^iPhone/i);
|
|
3998
|
+
}), $c87311424ea30a05$export$7bef049ce92e4224 = $c87311424ea30a05$var$cached(function() {
|
|
3999
|
+
return $c87311424ea30a05$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
|
|
4000
|
+
$c87311424ea30a05$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
|
|
4001
|
+
}), $c87311424ea30a05$export$fedb369cb70207f1 = $c87311424ea30a05$var$cached(function() {
|
|
4002
|
+
return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224();
|
|
4003
|
+
}), $c87311424ea30a05$export$e1865c3bedcd822b = $c87311424ea30a05$var$cached(function() {
|
|
4004
|
+
return $c87311424ea30a05$export$9ac100e40613ea10() || $c87311424ea30a05$export$fedb369cb70207f1();
|
|
4005
|
+
}), $c87311424ea30a05$export$78551043582a6a98 = $c87311424ea30a05$var$cached(function() {
|
|
4006
|
+
return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e();
|
|
4007
|
+
}), $c87311424ea30a05$export$6446a186d09e379e = $c87311424ea30a05$var$cached(function() {
|
|
4008
|
+
return $c87311424ea30a05$var$testUserAgent(/Chrome/i);
|
|
4009
|
+
}), $c87311424ea30a05$export$a11b0059900ceec8 = $c87311424ea30a05$var$cached(function() {
|
|
4010
|
+
return $c87311424ea30a05$var$testUserAgent(/Android/i);
|
|
4011
|
+
}), $c87311424ea30a05$export$b7d78993b74f766d = $c87311424ea30a05$var$cached(function() {
|
|
4012
|
+
return $c87311424ea30a05$var$testUserAgent(/Firefox/i);
|
|
4013
|
+
});
|
|
4014
|
+
|
|
4015
|
+
// ../../../node_modules/@react-aria/utils/dist/openLink.mjs
|
|
4016
|
+
import $g3jFn$react, { createContext as $g3jFn$createContext, useMemo as $g3jFn$useMemo, useContext as $g3jFn$useContext } from "react";
|
|
4017
|
+
var $ea8dcbcb9ea1b556$var$RouterContext = $g3jFn$createContext({
|
|
4018
|
+
isNative: !0,
|
|
4019
|
+
open: $ea8dcbcb9ea1b556$var$openSyntheticLink,
|
|
4020
|
+
useHref: (href) => href
|
|
4021
|
+
});
|
|
4022
|
+
function $ea8dcbcb9ea1b556$export$95185d699e05d4d7(target, modifiers, setOpening = !0) {
|
|
4023
|
+
var _window_event_type, _window_event;
|
|
4024
|
+
let { metaKey, ctrlKey, altKey, shiftKey } = modifiers;
|
|
4025
|
+
$c87311424ea30a05$export$b7d78993b74f766d() && (!((_window_event = window.event) === null || _window_event === void 0 || (_window_event_type = _window_event.type) === null || _window_event_type === void 0) && _window_event_type.startsWith("key")) && target.target === "_blank" && ($c87311424ea30a05$export$9ac100e40613ea10() ? metaKey = !0 : ctrlKey = !0);
|
|
4026
|
+
let event = $c87311424ea30a05$export$78551043582a6a98() && $c87311424ea30a05$export$9ac100e40613ea10() && !$c87311424ea30a05$export$7bef049ce92e4224() && process.env.NODE_ENV !== "test" ? new KeyboardEvent("keydown", {
|
|
4027
|
+
keyIdentifier: "Enter",
|
|
4028
|
+
metaKey,
|
|
4029
|
+
ctrlKey,
|
|
4030
|
+
altKey,
|
|
4031
|
+
shiftKey
|
|
4032
|
+
}) : new MouseEvent("click", {
|
|
4033
|
+
metaKey,
|
|
4034
|
+
ctrlKey,
|
|
4035
|
+
altKey,
|
|
4036
|
+
shiftKey,
|
|
4037
|
+
detail: 1,
|
|
4038
|
+
bubbles: !0,
|
|
4039
|
+
cancelable: !0
|
|
4040
|
+
});
|
|
4041
|
+
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = setOpening, $7215afc6de606d6b$export$de79e2c695e052f3(target), target.dispatchEvent(event), $ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = !1;
|
|
4042
|
+
}
|
|
4043
|
+
$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening = !1;
|
|
4044
|
+
function $ea8dcbcb9ea1b556$var$getSyntheticLink(target, open) {
|
|
4045
|
+
if (target instanceof HTMLAnchorElement) open(target);
|
|
4046
|
+
else if (target.hasAttribute("data-href")) {
|
|
4047
|
+
let link = document.createElement("a");
|
|
4048
|
+
link.href = target.getAttribute("data-href"), target.hasAttribute("data-target") && (link.target = target.getAttribute("data-target")), target.hasAttribute("data-rel") && (link.rel = target.getAttribute("data-rel")), target.hasAttribute("data-download") && (link.download = target.getAttribute("data-download")), target.hasAttribute("data-ping") && (link.ping = target.getAttribute("data-ping")), target.hasAttribute("data-referrer-policy") && (link.referrerPolicy = target.getAttribute("data-referrer-policy")), target.appendChild(link), open(link), target.removeChild(link);
|
|
4049
|
+
}
|
|
4050
|
+
}
|
|
4051
|
+
function $ea8dcbcb9ea1b556$var$openSyntheticLink(target, modifiers) {
|
|
4052
|
+
$ea8dcbcb9ea1b556$var$getSyntheticLink(target, (link) => $ea8dcbcb9ea1b556$export$95185d699e05d4d7(link, modifiers));
|
|
4053
|
+
}
|
|
4054
|
+
|
|
4055
|
+
// ../../../node_modules/@react-aria/utils/dist/runAfterTransition.mjs
|
|
4056
|
+
var $bbed8b41f857bcc0$var$transitionsByElement = /* @__PURE__ */ new Map(), $bbed8b41f857bcc0$var$transitionCallbacks = /* @__PURE__ */ new Set();
|
|
4057
|
+
function $bbed8b41f857bcc0$var$setupGlobalEvents() {
|
|
4058
|
+
if (typeof window > "u") return;
|
|
4059
|
+
function isTransitionEvent(event) {
|
|
4060
|
+
return "propertyName" in event;
|
|
4061
|
+
}
|
|
4062
|
+
let onTransitionStart = (e2) => {
|
|
4063
|
+
if (!isTransitionEvent(e2) || !e2.target) return;
|
|
4064
|
+
let transitions = $bbed8b41f857bcc0$var$transitionsByElement.get(e2.target);
|
|
4065
|
+
transitions || (transitions = /* @__PURE__ */ new Set(), $bbed8b41f857bcc0$var$transitionsByElement.set(e2.target, transitions), e2.target.addEventListener("transitioncancel", onTransitionEnd, {
|
|
4066
|
+
once: !0
|
|
4067
|
+
})), transitions.add(e2.propertyName);
|
|
4068
|
+
}, onTransitionEnd = (e2) => {
|
|
4069
|
+
if (!isTransitionEvent(e2) || !e2.target) return;
|
|
4070
|
+
let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(e2.target);
|
|
4071
|
+
if (properties && (properties.delete(e2.propertyName), properties.size === 0 && (e2.target.removeEventListener("transitioncancel", onTransitionEnd), $bbed8b41f857bcc0$var$transitionsByElement.delete(e2.target)), $bbed8b41f857bcc0$var$transitionsByElement.size === 0)) {
|
|
4072
|
+
for (let cb of $bbed8b41f857bcc0$var$transitionCallbacks) cb();
|
|
4073
|
+
$bbed8b41f857bcc0$var$transitionCallbacks.clear();
|
|
4074
|
+
}
|
|
4075
|
+
};
|
|
4076
|
+
document.body.addEventListener("transitionrun", onTransitionStart), document.body.addEventListener("transitionend", onTransitionEnd);
|
|
4077
|
+
}
|
|
4078
|
+
typeof document < "u" && (document.readyState !== "loading" ? $bbed8b41f857bcc0$var$setupGlobalEvents() : document.addEventListener("DOMContentLoaded", $bbed8b41f857bcc0$var$setupGlobalEvents));
|
|
4079
|
+
|
|
4080
|
+
// ../../../node_modules/@react-aria/utils/dist/useDrag1D.mjs
|
|
4081
|
+
import { useRef as $1rnCS$useRef } from "react";
|
|
4082
|
+
|
|
4083
|
+
// ../../../node_modules/@react-aria/utils/dist/useGlobalListeners.mjs
|
|
4084
|
+
import { useRef as $lPAwt$useRef, useCallback as $lPAwt$useCallback, useEffect as $lPAwt$useEffect } from "react";
|
|
4085
|
+
|
|
4086
|
+
// ../../../node_modules/@react-aria/utils/dist/useObjectRef.mjs
|
|
4087
|
+
import { useRef as $gbmns$useRef, useCallback as $gbmns$useCallback, useMemo as $gbmns$useMemo } from "react";
|
|
4088
|
+
|
|
4089
|
+
// ../../../node_modules/@react-aria/utils/dist/useEffectEvent.mjs
|
|
4090
|
+
import $lmaYr$react, { useRef as $lmaYr$useRef, useCallback as $lmaYr$useCallback } from "react";
|
|
4091
|
+
var $8ae05eaa5c114e9c$var$_React_useInsertionEffect, $8ae05eaa5c114e9c$var$useEarlyEffect = ($8ae05eaa5c114e9c$var$_React_useInsertionEffect = $lmaYr$react.useInsertionEffect) !== null && $8ae05eaa5c114e9c$var$_React_useInsertionEffect !== void 0 ? $8ae05eaa5c114e9c$var$_React_useInsertionEffect : $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c;
|
|
4092
|
+
|
|
4093
|
+
// ../../../node_modules/@react-aria/utils/dist/useUpdateEffect.mjs
|
|
4094
|
+
import { useRef as $9vW05$useRef, useEffect as $9vW05$useEffect } from "react";
|
|
4095
|
+
|
|
4096
|
+
// ../../../node_modules/@react-aria/utils/dist/useUpdateLayoutEffect.mjs
|
|
4097
|
+
import { useRef as $azsE2$useRef } from "react";
|
|
4098
|
+
|
|
4099
|
+
// ../../../node_modules/@react-aria/utils/dist/useResizeObserver.mjs
|
|
4100
|
+
import { useEffect as $Vsl8o$useEffect } from "react";
|
|
4101
|
+
|
|
4102
|
+
// ../../../node_modules/@react-aria/utils/dist/useViewportSize.mjs
|
|
4103
|
+
import { useState as $fuDHA$useState, useEffect as $fuDHA$useEffect } from "react";
|
|
4104
|
+
var $5df64b3807dc15ee$var$visualViewport = typeof document < "u" && window.visualViewport;
|
|
4105
|
+
|
|
4106
|
+
// ../../../node_modules/@react-aria/utils/dist/useDescription.mjs
|
|
4107
|
+
import { useState as $hQ5Hp$useState } from "react";
|
|
4108
|
+
|
|
4109
|
+
// ../../../node_modules/@react-aria/utils/dist/useEvent.mjs
|
|
4110
|
+
import { useEffect as $ceQd6$useEffect } from "react";
|
|
4111
|
+
|
|
4112
|
+
// ../../../node_modules/@react-aria/utils/dist/useDeepMemo.mjs
|
|
4113
|
+
import { useRef as $jtQ6z$useRef } from "react";
|
|
4114
|
+
|
|
4115
|
+
// ../../../node_modules/@react-aria/utils/dist/useFormReset.mjs
|
|
4116
|
+
import { useEffect as $8rM3G$useEffect } from "react";
|
|
4117
|
+
|
|
4118
|
+
// ../../../node_modules/@react-aria/utils/dist/useLoadMore.mjs
|
|
4119
|
+
import { useRef as $hDRkU$useRef, useCallback as $hDRkU$useCallback } from "react";
|
|
4120
|
+
|
|
4121
|
+
// ../../../node_modules/@react-aria/utils/dist/useLoadMoreSentinel.mjs
|
|
4122
|
+
import { useRef as $7FoZl$useRef } from "react";
|
|
4123
|
+
|
|
4124
|
+
// ../../../node_modules/@react-aria/utils/dist/inertValue.mjs
|
|
4125
|
+
import { version as $iulvE$version } from "react";
|
|
4126
|
+
|
|
4127
|
+
// ../../../node_modules/@react-aria/utils/dist/animation.mjs
|
|
4128
|
+
import { flushSync as $jJMAe$flushSync } from "react-dom";
|
|
4129
|
+
import { useState as $jJMAe$useState, useCallback as $jJMAe$useCallback } from "react";
|
|
4130
|
+
|
|
4131
|
+
// ../../../node_modules/@react-aria/utils/dist/isElementVisible.mjs
|
|
4132
|
+
var $7d2416ea0959daaa$var$supportsCheckVisibility = typeof Element < "u" && "checkVisibility" in Element.prototype;
|
|
4133
|
+
|
|
4134
|
+
// ../../../node_modules/@react-aria/utils/dist/isFocusable.mjs
|
|
4135
|
+
var $b4b717babfbb907b$var$focusableElements = [
|
|
4136
|
+
"input:not([disabled]):not([type=hidden])",
|
|
4137
|
+
"select:not([disabled])",
|
|
4138
|
+
"textarea:not([disabled])",
|
|
4139
|
+
"button:not([disabled])",
|
|
4140
|
+
"a[href]",
|
|
4141
|
+
"area[href]",
|
|
4142
|
+
"summary",
|
|
4143
|
+
"iframe",
|
|
4144
|
+
"object",
|
|
4145
|
+
"embed",
|
|
4146
|
+
"audio[controls]",
|
|
4147
|
+
"video[controls]",
|
|
4148
|
+
'[contenteditable]:not([contenteditable^="false"])',
|
|
4149
|
+
"permission"
|
|
4150
|
+
], $b4b717babfbb907b$var$FOCUSABLE_ELEMENT_SELECTOR = $b4b717babfbb907b$var$focusableElements.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
|
|
4151
|
+
$b4b717babfbb907b$var$focusableElements.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
|
|
4152
|
+
var $b4b717babfbb907b$var$TABBABLE_ELEMENT_SELECTOR = $b4b717babfbb907b$var$focusableElements.join(':not([hidden]):not([tabindex="-1"]),');
|
|
4153
|
+
|
|
4154
|
+
// ../../../node_modules/@react-stately/utils/dist/useControlledState.mjs
|
|
4155
|
+
import $3whtM$react, { useState as $3whtM$useState, useRef as $3whtM$useRef, useEffect as $3whtM$useEffect, useReducer as $3whtM$useReducer, useCallback as $3whtM$useCallback } from "react";
|
|
4156
|
+
var $458b0a5536c1a7cf$var$_React_useInsertionEffect, $458b0a5536c1a7cf$var$useEarlyEffect = typeof document < "u" ? ($458b0a5536c1a7cf$var$_React_useInsertionEffect = $3whtM$react.useInsertionEffect) !== null && $458b0a5536c1a7cf$var$_React_useInsertionEffect !== void 0 ? $458b0a5536c1a7cf$var$_React_useInsertionEffect : $3whtM$react.useLayoutEffect : () => {
|
|
4157
|
+
};
|
|
4158
|
+
|
|
4159
|
+
// src/blocks/components/Preview.tsx
|
|
3952
4160
|
import { styled as styled22 } from "storybook/theming";
|
|
3953
4161
|
|
|
3954
4162
|
// src/blocks/blocks/DocsContext.ts
|
|
@@ -3957,7 +4165,7 @@ globalThis && globalThis.__DOCS_CONTEXT__ === void 0 && (globalThis.__DOCS_CONTE
|
|
|
3957
4165
|
var DocsContext = globalThis ? globalThis.__DOCS_CONTEXT__ : createContext(null);
|
|
3958
4166
|
|
|
3959
4167
|
// src/blocks/blocks/Story.tsx
|
|
3960
|
-
import
|
|
4168
|
+
import React26, { useContext } from "react";
|
|
3961
4169
|
|
|
3962
4170
|
// src/blocks/blocks/useStory.ts
|
|
3963
4171
|
import { useEffect as useEffect8, useState as useState11 } from "react";
|
|
@@ -3987,6 +4195,23 @@ function useStories(storyIds, context) {
|
|
|
3987
4195
|
});
|
|
3988
4196
|
}
|
|
3989
4197
|
|
|
4198
|
+
// src/blocks/blocks/with-mdx-component-override.tsx
|
|
4199
|
+
import React25 from "react";
|
|
4200
|
+
import { useMDXComponents } from "@mdx-js/react";
|
|
4201
|
+
var MDX_WRAPPED_BLOCK = Symbol("mdxWrappedBlock"), MdxWrappedBlockContext = React25.createContext(null), withMdxComponentOverride = (blockName, Block) => {
|
|
4202
|
+
let WrappedBlock = (props) => {
|
|
4203
|
+
let wrappedBlocks = React25.useContext(MdxWrappedBlockContext), Override = useMDXComponents()[blockName];
|
|
4204
|
+
if (wrappedBlocks?.has(blockName) || Override === WrappedBlock)
|
|
4205
|
+
return React25.createElement(Block, { ...props });
|
|
4206
|
+
if (Override) {
|
|
4207
|
+
let nextWrappedBlocks = new Set(wrappedBlocks ?? []);
|
|
4208
|
+
return nextWrappedBlocks.add(blockName), React25.createElement(MdxWrappedBlockContext.Provider, { value: nextWrappedBlocks }, React25.createElement(Override, { ...props }));
|
|
4209
|
+
}
|
|
4210
|
+
return React25.createElement(Block, { ...props });
|
|
4211
|
+
};
|
|
4212
|
+
return WrappedBlock.displayName = blockName, WrappedBlock[MDX_WRAPPED_BLOCK] = !0, WrappedBlock;
|
|
4213
|
+
};
|
|
4214
|
+
|
|
3990
4215
|
// src/blocks/blocks/Story.tsx
|
|
3991
4216
|
var getStoryId = (props, context) => {
|
|
3992
4217
|
let { of, meta } = props;
|
|
@@ -4016,13 +4241,13 @@ var getStoryId = (props, context) => {
|
|
|
4016
4241
|
height,
|
|
4017
4242
|
primary: !!props.__primary
|
|
4018
4243
|
};
|
|
4019
|
-
},
|
|
4244
|
+
}, StoryImpl = (props = { __forceInitialArgs: !1, __primary: !1 }) => {
|
|
4020
4245
|
let context = useContext(DocsContext), storyId = getStoryId(props, context), story = useStory(storyId, context);
|
|
4021
4246
|
if (!story)
|
|
4022
|
-
return
|
|
4247
|
+
return React26.createElement(StorySkeleton, null);
|
|
4023
4248
|
let storyProps = getStoryProps(props, story, context);
|
|
4024
|
-
return storyProps ?
|
|
4025
|
-
};
|
|
4249
|
+
return storyProps ? React26.createElement(Story, { ...storyProps }) : null;
|
|
4250
|
+
}, Story2 = withMdxComponentOverride("Story", StoryImpl);
|
|
4026
4251
|
|
|
4027
4252
|
// src/blocks/components/BlockBackgroundStyles.tsx
|
|
4028
4253
|
var getBlockBackgroundStyle = (theme) => ({
|
|
@@ -4033,20 +4258,20 @@ var getBlockBackgroundStyle = (theme) => ({
|
|
|
4033
4258
|
});
|
|
4034
4259
|
|
|
4035
4260
|
// src/blocks/components/Story.tsx
|
|
4036
|
-
import
|
|
4261
|
+
import React28, { useEffect as useEffect9, useRef as useRef5, useState as useState12 } from "react";
|
|
4037
4262
|
import { ErrorFormatter, Loader } from "storybook/internal/components";
|
|
4038
4263
|
import { styled as styled20 } from "storybook/theming";
|
|
4039
4264
|
|
|
4040
4265
|
// src/blocks/getStoryHref.ts
|
|
4041
4266
|
var getStoryHref = (storyId, additionalParams = {}) => {
|
|
4042
4267
|
let baseUrl = globalThis.PREVIEW_URL || "iframe.html", [url, paramsStr] = baseUrl.split("?"), params = new URLSearchParams(paramsStr || "");
|
|
4043
|
-
return Object.entries(additionalParams).forEach(([key,
|
|
4044
|
-
params.set(key,
|
|
4268
|
+
return Object.entries(additionalParams).forEach(([key, value]) => {
|
|
4269
|
+
params.set(key, value);
|
|
4045
4270
|
}), params.set("id", storyId), `${url}?${params.toString()}`;
|
|
4046
4271
|
};
|
|
4047
4272
|
|
|
4048
4273
|
// src/blocks/components/IFrame.tsx
|
|
4049
|
-
import
|
|
4274
|
+
import React27, { Component as Component3 } from "react";
|
|
4050
4275
|
var { window: globalWindow2 } = globalThis, IFrame = class extends Component3 {
|
|
4051
4276
|
constructor() {
|
|
4052
4277
|
super(...arguments);
|
|
@@ -4070,7 +4295,7 @@ var { window: globalWindow2 } = globalThis, IFrame = class extends Component3 {
|
|
|
4070
4295
|
}
|
|
4071
4296
|
render() {
|
|
4072
4297
|
let { id, title, src, allowFullScreen, scale, ...rest } = this.props;
|
|
4073
|
-
return
|
|
4298
|
+
return React27.createElement(
|
|
4074
4299
|
"iframe",
|
|
4075
4300
|
{
|
|
4076
4301
|
id,
|
|
@@ -4111,10 +4336,10 @@ var storyBlockIdFromId = ({ story, primary }) => `story--${story.id}${primary ?
|
|
|
4111
4336
|
return setShowLoader(!1), () => {
|
|
4112
4337
|
Promise.resolve().then(() => cleanup());
|
|
4113
4338
|
};
|
|
4114
|
-
}, [autoplay, renderStoryToElement, story]), error ?
|
|
4339
|
+
}, [autoplay, renderStoryToElement, story]), error ? React28.createElement("pre", null, React28.createElement(ErrorFormatter, { error })) : React28.createElement(React28.Fragment, null, height ? React28.createElement("style", null, `#${storyBlockIdFromId(
|
|
4115
4340
|
props
|
|
4116
|
-
)} { min-height: ${height}; transform: translateZ(0); overflow: auto }`) : null, showLoader &&
|
|
4117
|
-
}, IFrameStory = ({ story, height = "500px" }) =>
|
|
4341
|
+
)} { min-height: ${height}; transform: translateZ(0); overflow: auto }`) : null, showLoader && React28.createElement(StorySkeleton, null), React28.createElement("div", { ref: storyRef, id: `${storyBlockIdFromId(props)}-inner`, "data-name": story.name }));
|
|
4342
|
+
}, IFrameStory = ({ story, height = "500px" }) => React28.createElement("div", { style: { width: "100%", height } }, React28.createElement(ZoomContext.Consumer, null, ({ scale }) => React28.createElement(
|
|
4118
4343
|
IFrame,
|
|
4119
4344
|
{
|
|
4120
4345
|
key: "iframe",
|
|
@@ -4133,11 +4358,11 @@ var storyBlockIdFromId = ({ story, primary }) => `story--${story.id}${primary ?
|
|
|
4133
4358
|
color: theme.color.orange
|
|
4134
4359
|
})), Story = (props) => {
|
|
4135
4360
|
let { inline, story } = props;
|
|
4136
|
-
return inline && !props.autoplay && story.usesMount ?
|
|
4137
|
-
}, StorySkeleton = () =>
|
|
4361
|
+
return inline && !props.autoplay && story.usesMount ? React28.createElement(ErrorMessage, null, "This story mounts inside of play. Set", " ", React28.createElement("a", { href: "https://storybook.js.org/docs/api/doc-blocks/doc-block-story?ref=ui#autoplay" }, "autoplay"), " ", "to true to view this story.") : React28.createElement("div", { id: storyBlockIdFromId(props), className: "sb-story sb-unstyled", "data-story-block": "true" }, inline ? React28.createElement(InlineStory, { ...props }) : React28.createElement(IFrameStory, { ...props }));
|
|
4362
|
+
}, StorySkeleton = () => React28.createElement(Loader, null);
|
|
4138
4363
|
|
|
4139
4364
|
// src/blocks/components/Toolbar.tsx
|
|
4140
|
-
import
|
|
4365
|
+
import React29 from "react";
|
|
4141
4366
|
import { Button as Button6, Toolbar as SharedToolbar } from "storybook/internal/components";
|
|
4142
4367
|
import { ShareAltIcon, ZoomIcon, ZoomOutIcon, ZoomResetIcon } from "@storybook/icons";
|
|
4143
4368
|
import { styled as styled21 } from "storybook/theming";
|
|
@@ -4160,7 +4385,7 @@ var AbsoluteBar = styled21(SharedToolbar)({
|
|
|
4160
4385
|
margin: "0 7px",
|
|
4161
4386
|
backgroundColor: theme.appBorderColor,
|
|
4162
4387
|
animation: `${theme.animation.glow} 1.5s ease-in-out infinite`
|
|
4163
|
-
})), Toolbar = ({ isLoading, storyId, zoom, resetZoom, ...rest }) =>
|
|
4388
|
+
})), Toolbar = ({ isLoading, storyId, zoom, resetZoom, ...rest }) => React29.createElement(AbsoluteBar, { innerStyle: { gap: 4, paddingInline: 7, justifyContent: "space-between" }, ...rest }, React29.createElement(Wrapper7, { key: "left" }, isLoading ? [1, 2, 3].map((key) => React29.createElement(IconPlaceholder, { key })) : React29.createElement(React29.Fragment, null, React29.createElement(
|
|
4164
4389
|
Button6,
|
|
4165
4390
|
{
|
|
4166
4391
|
padding: "small",
|
|
@@ -4171,8 +4396,8 @@ var AbsoluteBar = styled21(SharedToolbar)({
|
|
|
4171
4396
|
},
|
|
4172
4397
|
ariaLabel: "Zoom in"
|
|
4173
4398
|
},
|
|
4174
|
-
|
|
4175
|
-
),
|
|
4399
|
+
React29.createElement(ZoomIcon, null)
|
|
4400
|
+
), React29.createElement(
|
|
4176
4401
|
Button6,
|
|
4177
4402
|
{
|
|
4178
4403
|
padding: "small",
|
|
@@ -4183,8 +4408,8 @@ var AbsoluteBar = styled21(SharedToolbar)({
|
|
|
4183
4408
|
},
|
|
4184
4409
|
ariaLabel: "Zoom out"
|
|
4185
4410
|
},
|
|
4186
|
-
|
|
4187
|
-
),
|
|
4411
|
+
React29.createElement(ZoomOutIcon, null)
|
|
4412
|
+
), React29.createElement(
|
|
4188
4413
|
Button6,
|
|
4189
4414
|
{
|
|
4190
4415
|
padding: "small",
|
|
@@ -4195,8 +4420,8 @@ var AbsoluteBar = styled21(SharedToolbar)({
|
|
|
4195
4420
|
},
|
|
4196
4421
|
ariaLabel: "Reset zoom"
|
|
4197
4422
|
},
|
|
4198
|
-
|
|
4199
|
-
))), isLoading ?
|
|
4423
|
+
React29.createElement(ZoomResetIcon, null)
|
|
4424
|
+
))), isLoading ? React29.createElement(Wrapper7, { key: "right" }, React29.createElement(IconPlaceholder, null)) : storyId && React29.createElement(Wrapper7, { key: "right" }, React29.createElement(
|
|
4200
4425
|
Button6,
|
|
4201
4426
|
{
|
|
4202
4427
|
asChild: !0,
|
|
@@ -4205,7 +4430,7 @@ var AbsoluteBar = styled21(SharedToolbar)({
|
|
|
4205
4430
|
key: "opener",
|
|
4206
4431
|
ariaLabel: "Open canvas in new tab"
|
|
4207
4432
|
},
|
|
4208
|
-
|
|
4433
|
+
React29.createElement("a", { href: getStoryHref(storyId), target: "_blank", rel: "noopener noreferrer" }, React29.createElement(ShareAltIcon, null))
|
|
4209
4434
|
)));
|
|
4210
4435
|
|
|
4211
4436
|
// src/blocks/components/Preview.tsx
|
|
@@ -4239,7 +4464,10 @@ var ChildrenContainer = styled22.div(
|
|
|
4239
4464
|
alignItems: "center"
|
|
4240
4465
|
} : {},
|
|
4241
4466
|
({ columns }) => columns && columns > 1 ? { ".innerZoomElementWrapper > *": { minWidth: `calc(100% / ${columns} - 20px)` } } : {}
|
|
4242
|
-
),
|
|
4467
|
+
), ActionBar = styled22(Bar)({
|
|
4468
|
+
marginTop: -40,
|
|
4469
|
+
marginBottom: 40
|
|
4470
|
+
}), StyledSource = styled22(Source)(({ theme }) => ({
|
|
4243
4471
|
margin: 0,
|
|
4244
4472
|
borderTopLeftRadius: 0,
|
|
4245
4473
|
borderTopRightRadius: 0,
|
|
@@ -4252,51 +4480,17 @@ var ChildrenContainer = styled22.div(
|
|
|
4252
4480
|
background: theme.base === "light" ? "rgba(0, 0, 0, 0.85)" : curriedDarken$1(0.05, theme.background.content)
|
|
4253
4481
|
}
|
|
4254
4482
|
})), PreviewContainer = styled22.div(
|
|
4255
|
-
({ theme
|
|
4483
|
+
({ theme }) => ({
|
|
4256
4484
|
position: "relative",
|
|
4257
4485
|
overflow: "hidden",
|
|
4258
4486
|
margin: "25px 0 40px",
|
|
4259
4487
|
...getBlockBackgroundStyle(theme),
|
|
4260
|
-
borderBottomLeftRadius: withSource && isExpanded && 0,
|
|
4261
|
-
borderBottomRightRadius: withSource && isExpanded && 0,
|
|
4262
|
-
borderBottomWidth: isExpanded && 0,
|
|
4263
4488
|
"h3 + &": {
|
|
4264
4489
|
marginTop: "16px"
|
|
4265
4490
|
}
|
|
4266
4491
|
}),
|
|
4267
4492
|
({ withToolbar }) => withToolbar && { paddingTop: 40 }
|
|
4268
|
-
)
|
|
4269
|
-
switch (!0) {
|
|
4270
|
-
case !!(withSource && withSource.error):
|
|
4271
|
-
return {
|
|
4272
|
-
source: null,
|
|
4273
|
-
actionItem: {
|
|
4274
|
-
title: "No code available",
|
|
4275
|
-
className: "docblock-code-toggle docblock-code-toggle--disabled",
|
|
4276
|
-
disabled: !0,
|
|
4277
|
-
onClick: () => setExpanded(!1)
|
|
4278
|
-
}
|
|
4279
|
-
};
|
|
4280
|
-
case expanded:
|
|
4281
|
-
return {
|
|
4282
|
-
source: React29.createElement(StyledSource, { ...withSource, dark: !0 }),
|
|
4283
|
-
actionItem: {
|
|
4284
|
-
title: "Hide code",
|
|
4285
|
-
className: "docblock-code-toggle docblock-code-toggle--expanded",
|
|
4286
|
-
onClick: () => setExpanded(!1)
|
|
4287
|
-
}
|
|
4288
|
-
};
|
|
4289
|
-
default:
|
|
4290
|
-
return {
|
|
4291
|
-
source: React29.createElement(StyledSource, { ...withSource, dark: !0 }),
|
|
4292
|
-
actionItem: {
|
|
4293
|
-
title: "Show code",
|
|
4294
|
-
className: "docblock-code-toggle",
|
|
4295
|
-
onClick: () => setExpanded(!0)
|
|
4296
|
-
}
|
|
4297
|
-
};
|
|
4298
|
-
}
|
|
4299
|
-
};
|
|
4493
|
+
);
|
|
4300
4494
|
function getChildProps(children) {
|
|
4301
4495
|
if (Children.count(children) === 1) {
|
|
4302
4496
|
let elt = children;
|
|
@@ -4311,10 +4505,7 @@ var PositionedToolbar = styled22(Toolbar)({
|
|
|
4311
4505
|
left: 0,
|
|
4312
4506
|
right: 0,
|
|
4313
4507
|
height: 40
|
|
4314
|
-
}),
|
|
4315
|
-
overflow: "hidden",
|
|
4316
|
-
position: "relative"
|
|
4317
|
-
}), Preview = ({
|
|
4508
|
+
}), COPIED_LABEL_ANIMATION_DURATION = 2e3, Preview = ({
|
|
4318
4509
|
isLoading,
|
|
4319
4510
|
isColumn,
|
|
4320
4511
|
columns,
|
|
@@ -4328,30 +4519,21 @@ var PositionedToolbar = styled22(Toolbar)({
|
|
|
4328
4519
|
inline = !1,
|
|
4329
4520
|
...props
|
|
4330
4521
|
}) => {
|
|
4331
|
-
let [expanded, setExpanded] = useState13(isExpanded),
|
|
4332
|
-
additionalActions ? [...additionalActions] : []
|
|
4333
|
-
|
|
4522
|
+
let [expanded, setExpanded] = useState13(isExpanded), [copied, setCopied] = useState13(null), [scale, setScale] = useState13(1), additionalActionItems = useMemo3(
|
|
4523
|
+
() => additionalActions ? [...additionalActions] : [],
|
|
4524
|
+
[additionalActions]
|
|
4525
|
+
), sourceId = $bdb11010cef70236$export$f680877a34711e37(), previewClasses = [className].concat(["sbdocs", "sbdocs-preview", "sb-unstyled"]), context = useContext2(DocsContext), copyToClipboard = useCallback6(async (text) => {
|
|
4334
4526
|
let { createCopyToClipboardFunction } = await import("storybook/internal/components");
|
|
4335
|
-
createCopyToClipboardFunction();
|
|
4336
|
-
}, []),
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
}
|
|
4346
|
-
]), globalWindow4.setTimeout(
|
|
4347
|
-
() => setAdditionalActionItems(
|
|
4348
|
-
additionalActionItems.filter((item) => item.title !== "Copied")
|
|
4349
|
-
),
|
|
4350
|
-
1500
|
|
4351
|
-
);
|
|
4352
|
-
}));
|
|
4353
|
-
}, childProps = getChildProps(children);
|
|
4354
|
-
return React29.createElement(
|
|
4527
|
+
await createCopyToClipboardFunction()(text);
|
|
4528
|
+
}, []), handleCopyCode = useCallback6(async () => {
|
|
4529
|
+
try {
|
|
4530
|
+
await copyToClipboard(withSource?.code ?? ""), setCopied("Copied!");
|
|
4531
|
+
} catch (err) {
|
|
4532
|
+
logger4.error(err), setCopied("Copy error!");
|
|
4533
|
+
}
|
|
4534
|
+
globalThis.window.setTimeout(() => setCopied(null), COPIED_LABEL_ANIMATION_DURATION);
|
|
4535
|
+
}, [copyToClipboard, withSource?.code]), childProps = getChildProps(children), hasSourceError = !!(withSource && withSource.error), hasValidSource = !!(withSource && !withSource.error);
|
|
4536
|
+
return React30.createElement(React30.Fragment, null, React30.createElement(
|
|
4355
4537
|
PreviewContainer,
|
|
4356
4538
|
{
|
|
4357
4539
|
withSource,
|
|
@@ -4359,7 +4541,7 @@ var PositionedToolbar = styled22(Toolbar)({
|
|
|
4359
4541
|
...props,
|
|
4360
4542
|
className: previewClasses.join(" ")
|
|
4361
4543
|
},
|
|
4362
|
-
withToolbar &&
|
|
4544
|
+
withToolbar && React30.createElement(
|
|
4363
4545
|
PositionedToolbar,
|
|
4364
4546
|
{
|
|
4365
4547
|
isLoading,
|
|
@@ -4369,18 +4551,53 @@ var PositionedToolbar = styled22(Toolbar)({
|
|
|
4369
4551
|
storyId: !isLoading && childProps ? getStoryId(childProps, context) : void 0
|
|
4370
4552
|
}
|
|
4371
4553
|
),
|
|
4372
|
-
|
|
4554
|
+
React30.createElement(ZoomContext.Provider, { value: { scale } }, React30.createElement(
|
|
4373
4555
|
ChildrenContainer,
|
|
4374
4556
|
{
|
|
4375
4557
|
isColumn: isColumn || !Array.isArray(children),
|
|
4376
4558
|
columns,
|
|
4377
4559
|
layout,
|
|
4378
|
-
inline
|
|
4560
|
+
inline,
|
|
4561
|
+
className: "docs-story"
|
|
4379
4562
|
},
|
|
4380
|
-
|
|
4381
|
-
)
|
|
4382
|
-
|
|
4383
|
-
)
|
|
4563
|
+
React30.createElement(Zoom.Element, { centered: layout === "centered", scale: inline ? scale : 1 }, Array.isArray(children) ? children.map((child, i2) => React30.createElement("div", { key: i2 }, child)) : React30.createElement("div", null, children))
|
|
4564
|
+
)),
|
|
4565
|
+
hasValidSource && expanded && React30.createElement("div", { id: sourceId }, React30.createElement(StyledSource, { ...withSource, dark: !0, copyable: !1 }))
|
|
4566
|
+
), (withSource || additionalActionItems.length > 0) && React30.createElement(ActionBar, { className: "sbdocs sbdocs-preview-actions", innerStyle: { paddingInline: 0 } }, hasSourceError && React30.createElement(
|
|
4567
|
+
Button7,
|
|
4568
|
+
{
|
|
4569
|
+
ariaLabel: !1,
|
|
4570
|
+
disabled: !0,
|
|
4571
|
+
variant: "ghost",
|
|
4572
|
+
className: "docblock-code-toggle docblock-code-toggle--disabled"
|
|
4573
|
+
},
|
|
4574
|
+
React30.createElement(MarkupIcon, null),
|
|
4575
|
+
" No code available"
|
|
4576
|
+
), hasValidSource && React30.createElement(React30.Fragment, null, React30.createElement(
|
|
4577
|
+
ToggleButton2,
|
|
4578
|
+
{
|
|
4579
|
+
ariaLabel: !1,
|
|
4580
|
+
pressed: expanded,
|
|
4581
|
+
"aria-expanded": expanded,
|
|
4582
|
+
"aria-controls": sourceId,
|
|
4583
|
+
onClick: () => setExpanded(!expanded),
|
|
4584
|
+
variant: "ghost",
|
|
4585
|
+
className: `docblock-code-toggle${expanded ? " docblock-code-toggle--expanded" : ""}`
|
|
4586
|
+
},
|
|
4587
|
+
React30.createElement(MarkupIcon, null),
|
|
4588
|
+
" ",
|
|
4589
|
+
expanded ? "Hide code" : "Show code"
|
|
4590
|
+
), React30.createElement(Button7, { ariaLabel: !1, variant: "ghost", onClick: handleCopyCode }, React30.createElement(CopyIcon, null), " ", copied ?? "Copy code")), additionalActionItems.map(({ title, className: className2, onClick, disabled }, index) => React30.createElement(
|
|
4591
|
+
Button7,
|
|
4592
|
+
{
|
|
4593
|
+
key: index,
|
|
4594
|
+
className: className2,
|
|
4595
|
+
onClick,
|
|
4596
|
+
disabled: !!disabled,
|
|
4597
|
+
variant: "ghost"
|
|
4598
|
+
},
|
|
4599
|
+
title
|
|
4600
|
+
))));
|
|
4384
4601
|
}, StyledPreview = styled22(Preview)(() => ({
|
|
4385
4602
|
".docs-story": {
|
|
4386
4603
|
paddingTop: 32,
|
|
@@ -4389,7 +4606,7 @@ var PositionedToolbar = styled22(Toolbar)({
|
|
|
4389
4606
|
}));
|
|
4390
4607
|
|
|
4391
4608
|
// src/blocks/components/ArgsTable/TabbedArgsTable.tsx
|
|
4392
|
-
import
|
|
4609
|
+
import React31 from "react";
|
|
4393
4610
|
import { TabsView } from "storybook/internal/components";
|
|
4394
4611
|
import { styled as styled23 } from "storybook/theming";
|
|
4395
4612
|
var StyledTabsView = styled23(TabsView)({
|
|
@@ -4397,20 +4614,20 @@ var StyledTabsView = styled23(TabsView)({
|
|
|
4397
4614
|
}), TabbedArgsTable = ({ tabs, ...props }) => {
|
|
4398
4615
|
let entries = Object.entries(tabs);
|
|
4399
4616
|
if (entries.length === 1)
|
|
4400
|
-
return
|
|
4617
|
+
return React31.createElement(ArgsTable, { ...entries[0][1], ...props });
|
|
4401
4618
|
let tabsFromEntries = entries.map(([label, table], index) => ({
|
|
4402
4619
|
id: `prop_table_div_${label}`,
|
|
4403
4620
|
title: label,
|
|
4404
4621
|
children: () => {
|
|
4405
4622
|
let argsTableProps = index === 0 ? props : { sort: props.sort };
|
|
4406
|
-
return
|
|
4623
|
+
return React31.createElement(ArgsTable, { inTabPanel: !0, key: `prop_table_${label}`, ...table, ...argsTableProps });
|
|
4407
4624
|
}
|
|
4408
4625
|
}));
|
|
4409
|
-
return
|
|
4626
|
+
return React31.createElement(StyledTabsView, { tabs: tabsFromEntries });
|
|
4410
4627
|
};
|
|
4411
4628
|
|
|
4412
4629
|
// src/blocks/components/Typeset.tsx
|
|
4413
|
-
import
|
|
4630
|
+
import React32 from "react";
|
|
4414
4631
|
import { withReset as withReset2 } from "storybook/internal/components";
|
|
4415
4632
|
import { styled as styled24 } from "storybook/theming";
|
|
4416
4633
|
var Label4 = styled24.div(({ theme }) => ({
|
|
@@ -4436,7 +4653,7 @@ var Label4 = styled24.div(({ theme }) => ({
|
|
|
4436
4653
|
fontWeight,
|
|
4437
4654
|
sampleText,
|
|
4438
4655
|
...props
|
|
4439
|
-
}) =>
|
|
4656
|
+
}) => React32.createElement(Wrapper8, { ...props, className: "docblock-typeset sb-unstyled" }, fontSizes.map((size) => React32.createElement(TypeSpecimen, { key: size }, React32.createElement(Label4, null, size), React32.createElement(
|
|
4440
4657
|
Sample,
|
|
4441
4658
|
{
|
|
4442
4659
|
style: {
|
|
@@ -4450,7 +4667,7 @@ var Label4 = styled24.div(({ theme }) => ({
|
|
|
4450
4667
|
))));
|
|
4451
4668
|
|
|
4452
4669
|
// src/blocks/components/ColorPalette.tsx
|
|
4453
|
-
import
|
|
4670
|
+
import React33 from "react";
|
|
4454
4671
|
import { ResetWrapper as ResetWrapper2 } from "storybook/internal/components";
|
|
4455
4672
|
import { styled as styled25 } from "storybook/theming";
|
|
4456
4673
|
var ItemTitle = styled25.div(({ theme }) => ({
|
|
@@ -4536,25 +4753,25 @@ var ItemTitle = styled25.div(({ theme }) => ({
|
|
|
4536
4753
|
flexDirection: "column"
|
|
4537
4754
|
}));
|
|
4538
4755
|
function renderSwatch(color, index) {
|
|
4539
|
-
return
|
|
4756
|
+
return React33.createElement(Swatch, { key: `${color}-${index}`, title: color, background: color });
|
|
4540
4757
|
}
|
|
4541
4758
|
function renderSwatchLabel(color, index, colorDescription) {
|
|
4542
|
-
return
|
|
4759
|
+
return React33.createElement(SwatchLabel, { key: `${color}-${index}`, title: color }, React33.createElement("div", null, color, colorDescription && React33.createElement("span", null, colorDescription)));
|
|
4543
4760
|
}
|
|
4544
4761
|
function renderSwatchSpecimen(colors) {
|
|
4545
4762
|
if (Array.isArray(colors))
|
|
4546
|
-
return
|
|
4763
|
+
return React33.createElement(SwatchSpecimen, null, React33.createElement(SwatchColors, null, colors.map((color, index) => renderSwatch(color, index))), React33.createElement(SwatchLabels, null, colors.map((color, index) => renderSwatchLabel(color, index))));
|
|
4547
4764
|
let swatchElements = [], labelElements = [];
|
|
4548
4765
|
for (let colorKey in colors) {
|
|
4549
4766
|
let colorValue = colors[colorKey];
|
|
4550
4767
|
swatchElements.push(renderSwatch(colorValue, swatchElements.length)), labelElements.push(renderSwatchLabel(colorKey, labelElements.length, colorValue));
|
|
4551
4768
|
}
|
|
4552
|
-
return
|
|
4769
|
+
return React33.createElement(SwatchSpecimen, null, React33.createElement(SwatchColors, null, swatchElements), React33.createElement(SwatchLabels, null, labelElements));
|
|
4553
4770
|
}
|
|
4554
|
-
var ColorItem = ({ title, subtitle, colors }) =>
|
|
4771
|
+
var ColorItem = ({ title, subtitle, colors }) => React33.createElement(Item, null, React33.createElement(ItemDescription, null, React33.createElement(ItemTitle, null, title), React33.createElement(ItemSubtitle, null, subtitle)), React33.createElement(Swatches, null, renderSwatchSpecimen(colors))), ColorPalette = ({ children, ...props }) => React33.createElement(ResetWrapper2, null, React33.createElement(List, { ...props, className: "docblock-colorpalette sb-unstyled" }, React33.createElement(ListHeading, null, React33.createElement(ListName, null, "Name"), React33.createElement(ListSwatches, null, "Swatches")), children));
|
|
4555
4772
|
|
|
4556
4773
|
// src/blocks/components/IconGallery.tsx
|
|
4557
|
-
import
|
|
4774
|
+
import React34 from "react";
|
|
4558
4775
|
import { ResetWrapper as ResetWrapper3 } from "storybook/internal/components";
|
|
4559
4776
|
import { styled as styled26 } from "storybook/theming";
|
|
4560
4777
|
var ItemLabel = styled26.div(({ theme }) => ({
|
|
@@ -4593,10 +4810,10 @@ var ItemLabel = styled26.div(({ theme }) => ({
|
|
|
4593
4810
|
gridGap: "8px 16px",
|
|
4594
4811
|
gridAutoFlow: "row dense",
|
|
4595
4812
|
gridAutoRows: 50
|
|
4596
|
-
}), IconItem = ({ name, children }) =>
|
|
4813
|
+
}), IconItem = ({ name, children }) => React34.createElement(Item2, null, React34.createElement(ItemSpecimen, null, children), React34.createElement(ItemLabel, null, name)), IconGallery = ({ children, ...props }) => React34.createElement(ResetWrapper3, null, React34.createElement(List2, { ...props, className: "docblock-icongallery sb-unstyled" }, children));
|
|
4597
4814
|
|
|
4598
4815
|
// src/blocks/components/TableOfContents.tsx
|
|
4599
|
-
import
|
|
4816
|
+
import React35, { useEffect as useEffect10 } from "react";
|
|
4600
4817
|
import { NAVIGATE_URL } from "storybook/internal/core-events";
|
|
4601
4818
|
import { styled as styled27 } from "storybook/theming";
|
|
4602
4819
|
|
|
@@ -4890,8 +5107,8 @@ var default_options_default = {
|
|
|
4890
5107
|
// ../../../node_modules/tocbot/src/js/parse-content.js
|
|
4891
5108
|
function parseContent(options) {
|
|
4892
5109
|
let reduce = [].reduce;
|
|
4893
|
-
function getLastItem(
|
|
4894
|
-
return
|
|
5110
|
+
function getLastItem(array) {
|
|
5111
|
+
return array[array.length - 1];
|
|
4895
5112
|
}
|
|
4896
5113
|
function getHeadingLevel(heading) {
|
|
4897
5114
|
return +heading.nodeName.toUpperCase().replace("H", "");
|
|
@@ -4917,10 +5134,10 @@ function parseContent(options) {
|
|
|
4917
5134
|
return options.includeHtml && (obj.childNodes = heading.childNodes), options.headingObjectCallback ? options.headingObjectCallback(obj, heading) : obj;
|
|
4918
5135
|
}
|
|
4919
5136
|
function addNode(node, nest) {
|
|
4920
|
-
let obj = getHeadingObject(node), level = obj.headingLevel,
|
|
4921
|
-
for (; counter > 0 && (lastItem = getLastItem(
|
|
4922
|
-
lastItem && lastItem.children !== void 0 && (
|
|
4923
|
-
return level >= options.collapseDepth && (obj.isCollapsed = !0),
|
|
5137
|
+
let obj = getHeadingObject(node), level = obj.headingLevel, array = nest, lastItem = getLastItem(array), lastItemLevel = lastItem ? lastItem.headingLevel : 0, counter = level - lastItemLevel;
|
|
5138
|
+
for (; counter > 0 && (lastItem = getLastItem(array), !(lastItem && level === lastItem.headingLevel)); )
|
|
5139
|
+
lastItem && lastItem.children !== void 0 && (array = lastItem.children), counter--;
|
|
5140
|
+
return level >= options.collapseDepth && (obj.isCollapsed = !0), array.push(obj), array;
|
|
4924
5141
|
}
|
|
4925
5142
|
function selectHeadings(contentElement, headingSelector) {
|
|
4926
5143
|
let selectors = headingSelector;
|
|
@@ -5184,7 +5401,7 @@ var Aside = styled27.aside(() => ({
|
|
|
5184
5401
|
color: theme.color.defaultText,
|
|
5185
5402
|
textTransform: "uppercase",
|
|
5186
5403
|
marginBottom: 10
|
|
5187
|
-
})), Title2 = ({ headingId, title }) => typeof title == "string" || !title ?
|
|
5404
|
+
})), Title2 = ({ headingId, title }) => typeof title == "string" || !title ? React35.createElement(Heading, { as: "h2", id: headingId, className: title ? "" : "sb-sr-only" }, title || "Table of contents") : React35.createElement("div", { id: headingId }, title), TableOfContents = ({
|
|
5188
5405
|
title,
|
|
5189
5406
|
disable,
|
|
5190
5407
|
headingSelector,
|
|
@@ -5221,15 +5438,15 @@ var Aside = styled27.aside(() => ({
|
|
|
5221
5438
|
};
|
|
5222
5439
|
}, [channel, disable, ignoreSelector, contentsSelector, headingSelector, unsafeTocbotOptions]);
|
|
5223
5440
|
let headingId = "table-of-contents";
|
|
5224
|
-
return
|
|
5441
|
+
return React35.createElement(Aside, { className }, disable ? null : React35.createElement(Nav, { "aria-labelledby": headingId }, React35.createElement(Title2, { headingId, title }), React35.createElement("div", { className: "toc-wrapper" })));
|
|
5225
5442
|
};
|
|
5226
5443
|
|
|
5227
5444
|
// src/blocks/blocks/Anchor.tsx
|
|
5228
|
-
import
|
|
5229
|
-
var anchorBlockIdFromId = (storyId) => `anchor--${storyId}`, Anchor = ({ storyId, children }) =>
|
|
5445
|
+
import React36 from "react";
|
|
5446
|
+
var anchorBlockIdFromId = (storyId) => `anchor--${storyId}`, Anchor = ({ storyId, children }) => React36.createElement("div", { id: anchorBlockIdFromId(storyId), className: "sb-anchor" }, children);
|
|
5230
5447
|
|
|
5231
5448
|
// src/blocks/blocks/ArgTypes.tsx
|
|
5232
|
-
import
|
|
5449
|
+
import React37 from "react";
|
|
5233
5450
|
import { filterArgTypes } from "storybook/preview-api";
|
|
5234
5451
|
|
|
5235
5452
|
// src/blocks/blocks/useOf.ts
|
|
@@ -5279,13 +5496,13 @@ function getArgTypesFromResolved(resolved) {
|
|
|
5279
5496
|
} = resolved;
|
|
5280
5497
|
return { argTypes, parameters, component, subcomponents };
|
|
5281
5498
|
}
|
|
5282
|
-
var
|
|
5499
|
+
var ArgTypesImpl = (props) => {
|
|
5283
5500
|
let { of } = props;
|
|
5284
5501
|
if ("of" in props && of === void 0)
|
|
5285
5502
|
throw new Error("Unexpected `of={undefined}`, did you mistype a CSF file reference?");
|
|
5286
5503
|
let resolved = useOf(of || "meta"), { argTypes, parameters, component, subcomponents } = getArgTypesFromResolved(resolved), argTypesParameters = parameters?.docs?.argTypes || {}, include = props.include ?? argTypesParameters.include, exclude = props.exclude ?? argTypesParameters.exclude, sort = props.sort ?? argTypesParameters.sort, filteredArgTypes = filterArgTypes(argTypes, include, exclude);
|
|
5287
5504
|
if (!(!!subcomponents && Object.keys(subcomponents || {}).length > 0))
|
|
5288
|
-
return
|
|
5505
|
+
return React37.createElement(ArgsTable, { rows: filteredArgTypes, sort });
|
|
5289
5506
|
let mainComponentName = getComponentName(component) || "Main", subcomponentTabs = Object.fromEntries(
|
|
5290
5507
|
Object.entries(subcomponents || {}).map(([key, comp]) => [
|
|
5291
5508
|
key,
|
|
@@ -5302,18 +5519,18 @@ var ArgTypes = (props) => {
|
|
|
5302
5519
|
[mainComponentName]: { rows: filteredArgTypes, sort },
|
|
5303
5520
|
...subcomponentTabs
|
|
5304
5521
|
};
|
|
5305
|
-
return
|
|
5306
|
-
};
|
|
5522
|
+
return React37.createElement(TabbedArgsTable, { tabs, sort });
|
|
5523
|
+
}, ArgTypes = withMdxComponentOverride("ArgTypes", ArgTypesImpl);
|
|
5307
5524
|
|
|
5308
5525
|
// src/blocks/blocks/Canvas.tsx
|
|
5309
|
-
import
|
|
5526
|
+
import React40, { useContext as useContext5 } from "react";
|
|
5310
5527
|
|
|
5311
5528
|
// src/blocks/blocks/Source.tsx
|
|
5312
|
-
import
|
|
5529
|
+
import React39, { useContext as useContext4, useMemo as useMemo4 } from "react";
|
|
5313
5530
|
import { SourceType } from "storybook/internal/docs-tools";
|
|
5314
5531
|
|
|
5315
5532
|
// src/blocks/blocks/SourceContainer.tsx
|
|
5316
|
-
import
|
|
5533
|
+
import React38, { createContext as createContext3, useEffect as useEffect11, useState as useState14 } from "react";
|
|
5317
5534
|
import { SNIPPET_RENDERED } from "storybook/internal/docs-tools";
|
|
5318
5535
|
|
|
5319
5536
|
// ../../../node_modules/telejson/dist/chunk-EAFQLD22.mjs
|
|
@@ -5347,12 +5564,12 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
5347
5564
|
"type"
|
|
5348
5565
|
], customEventSpecificProperties = ["detail"];
|
|
5349
5566
|
function extractEventHiddenProperties(event) {
|
|
5350
|
-
let rebuildEvent = eventProperties.filter((
|
|
5567
|
+
let rebuildEvent = eventProperties.filter((value) => event[value] !== void 0).reduce((acc, value) => (acc[value] = event[value], acc), {});
|
|
5351
5568
|
if (event instanceof CustomEvent)
|
|
5352
|
-
for (let
|
|
5353
|
-
(
|
|
5569
|
+
for (let value of customEventSpecificProperties.filter(
|
|
5570
|
+
(value2) => event[value2] !== void 0
|
|
5354
5571
|
))
|
|
5355
|
-
rebuildEvent[
|
|
5572
|
+
rebuildEvent[value] = event[value];
|
|
5356
5573
|
return rebuildEvent;
|
|
5357
5574
|
}
|
|
5358
5575
|
|
|
@@ -5620,8 +5837,8 @@ var require_es_object_atoms = __commonJS({
|
|
|
5620
5837
|
), $Object = Object, $getPrototypeOf = $Object.getPrototypeOf;
|
|
5621
5838
|
module.exports = desc && typeof desc.get == "function" ? callBind([desc.get]) : typeof $getPrototypeOf == "function" ? (
|
|
5622
5839
|
/** @type {import('./get')} */
|
|
5623
|
-
(function(
|
|
5624
|
-
return $getPrototypeOf(
|
|
5840
|
+
(function(value) {
|
|
5841
|
+
return $getPrototypeOf(value == null ? value : $Object(value));
|
|
5625
5842
|
})
|
|
5626
5843
|
) : !1;
|
|
5627
5844
|
}
|
|
@@ -5756,21 +5973,21 @@ var require_es_object_atoms = __commonJS({
|
|
|
5756
5973
|
errorProto = getProto(getProto(e2)), INTRINSICS["%Error.prototype%"] = errorProto;
|
|
5757
5974
|
}
|
|
5758
5975
|
var errorProto, doEval = function doEval2(name) {
|
|
5759
|
-
var
|
|
5976
|
+
var value;
|
|
5760
5977
|
if (name === "%AsyncFunction%")
|
|
5761
|
-
|
|
5978
|
+
value = getEvalledConstructor("async function () {}");
|
|
5762
5979
|
else if (name === "%GeneratorFunction%")
|
|
5763
|
-
|
|
5980
|
+
value = getEvalledConstructor("function* () {}");
|
|
5764
5981
|
else if (name === "%AsyncGeneratorFunction%")
|
|
5765
|
-
|
|
5982
|
+
value = getEvalledConstructor("async function* () {}");
|
|
5766
5983
|
else if (name === "%AsyncGenerator%") {
|
|
5767
5984
|
var fn = doEval2("%AsyncGeneratorFunction%");
|
|
5768
|
-
fn && (
|
|
5985
|
+
fn && (value = fn.prototype);
|
|
5769
5986
|
} else if (name === "%AsyncIteratorPrototype%") {
|
|
5770
5987
|
var gen = doEval2("%AsyncGenerator%");
|
|
5771
|
-
gen && getProto && (
|
|
5988
|
+
gen && getProto && (value = getProto(gen.prototype));
|
|
5772
5989
|
}
|
|
5773
|
-
return INTRINSICS[name] =
|
|
5990
|
+
return INTRINSICS[name] = value, value;
|
|
5774
5991
|
}, LEGACY_ALIASES = {
|
|
5775
5992
|
__proto__: null,
|
|
5776
5993
|
"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
|
|
@@ -5837,13 +6054,13 @@ var require_es_object_atoms = __commonJS({
|
|
|
5837
6054
|
}, getBaseIntrinsic = function(name, allowMissing) {
|
|
5838
6055
|
var intrinsicName = name, alias;
|
|
5839
6056
|
if (hasOwn(LEGACY_ALIASES, intrinsicName) && (alias = LEGACY_ALIASES[intrinsicName], intrinsicName = "%" + alias[0] + "%"), hasOwn(INTRINSICS, intrinsicName)) {
|
|
5840
|
-
var
|
|
5841
|
-
if (
|
|
6057
|
+
var value = INTRINSICS[intrinsicName];
|
|
6058
|
+
if (value === needsEval && (value = doEval(intrinsicName)), typeof value > "u" && !allowMissing)
|
|
5842
6059
|
throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!");
|
|
5843
6060
|
return {
|
|
5844
6061
|
alias,
|
|
5845
6062
|
name: intrinsicName,
|
|
5846
|
-
value
|
|
6063
|
+
value
|
|
5847
6064
|
};
|
|
5848
6065
|
}
|
|
5849
6066
|
throw new $SyntaxError("intrinsic " + name + " does not exist!");
|
|
@@ -5855,29 +6072,29 @@ var require_es_object_atoms = __commonJS({
|
|
|
5855
6072
|
throw new $TypeError('"allowMissing" argument must be a boolean');
|
|
5856
6073
|
if ($exec(/^%?[^%]*%?$/, name) === null)
|
|
5857
6074
|
throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
5858
|
-
var parts = stringToPath2(name), intrinsicBaseName = parts.length > 0 ? parts[0] : "", intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing), intrinsicRealName = intrinsic.name,
|
|
6075
|
+
var parts = stringToPath2(name), intrinsicBaseName = parts.length > 0 ? parts[0] : "", intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing), intrinsicRealName = intrinsic.name, value = intrinsic.value, skipFurtherCaching = !1, alias = intrinsic.alias;
|
|
5859
6076
|
alias && (intrinsicBaseName = alias[0], $spliceApply(parts, $concat([0, 1], alias)));
|
|
5860
6077
|
for (var i2 = 1, isOwn = !0; i2 < parts.length; i2 += 1) {
|
|
5861
6078
|
var part = parts[i2], first = $strSlice(part, 0, 1), last2 = $strSlice(part, -1);
|
|
5862
6079
|
if ((first === '"' || first === "'" || first === "`" || last2 === '"' || last2 === "'" || last2 === "`") && first !== last2)
|
|
5863
6080
|
throw new $SyntaxError("property names with quotes must have matching quotes");
|
|
5864
6081
|
if ((part === "constructor" || !isOwn) && (skipFurtherCaching = !0), intrinsicBaseName += "." + part, intrinsicRealName = "%" + intrinsicBaseName + "%", hasOwn(INTRINSICS, intrinsicRealName))
|
|
5865
|
-
|
|
5866
|
-
else if (
|
|
5867
|
-
if (!(part in
|
|
6082
|
+
value = INTRINSICS[intrinsicRealName];
|
|
6083
|
+
else if (value != null) {
|
|
6084
|
+
if (!(part in value)) {
|
|
5868
6085
|
if (!allowMissing)
|
|
5869
6086
|
throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available.");
|
|
5870
6087
|
return;
|
|
5871
6088
|
}
|
|
5872
6089
|
if ($gOPD && i2 + 1 >= parts.length) {
|
|
5873
|
-
var desc = $gOPD(
|
|
5874
|
-
isOwn = !!desc, isOwn && "get" in desc && !("originalValue" in desc.get) ?
|
|
6090
|
+
var desc = $gOPD(value, part);
|
|
6091
|
+
isOwn = !!desc, isOwn && "get" in desc && !("originalValue" in desc.get) ? value = desc.get : value = value[part];
|
|
5875
6092
|
} else
|
|
5876
|
-
isOwn = hasOwn(
|
|
5877
|
-
isOwn && !skipFurtherCaching && (INTRINSICS[intrinsicRealName] =
|
|
6093
|
+
isOwn = hasOwn(value, part), value = value[part];
|
|
6094
|
+
isOwn && !skipFurtherCaching && (INTRINSICS[intrinsicRealName] = value);
|
|
5878
6095
|
}
|
|
5879
6096
|
}
|
|
5880
|
-
return
|
|
6097
|
+
return value;
|
|
5881
6098
|
};
|
|
5882
6099
|
}
|
|
5883
6100
|
}), require_call_bound = __commonJS({
|
|
@@ -5912,14 +6129,14 @@ var require_es_object_atoms = __commonJS({
|
|
|
5912
6129
|
}, badStringifier = {
|
|
5913
6130
|
toString: throwRegexMarker,
|
|
5914
6131
|
valueOf: throwRegexMarker
|
|
5915
|
-
}, typeof Symbol.toPrimitive == "symbol" && (badStringifier[Symbol.toPrimitive] = throwRegexMarker), fn = function(
|
|
5916
|
-
if (!
|
|
6132
|
+
}, typeof Symbol.toPrimitive == "symbol" && (badStringifier[Symbol.toPrimitive] = throwRegexMarker), fn = function(value) {
|
|
6133
|
+
if (!value || typeof value != "object")
|
|
5917
6134
|
return !1;
|
|
5918
6135
|
var descriptor = (
|
|
5919
6136
|
/** @type {NonNullable<typeof gOPD>} */
|
|
5920
6137
|
gOPD(
|
|
5921
6138
|
/** @type {{ lastIndex?: unknown }} */
|
|
5922
|
-
|
|
6139
|
+
value,
|
|
5923
6140
|
"lastIndex"
|
|
5924
6141
|
)
|
|
5925
6142
|
), hasLastIndexDataProperty = descriptor && hasOwn(descriptor, "value");
|
|
@@ -5927,7 +6144,7 @@ var require_es_object_atoms = __commonJS({
|
|
|
5927
6144
|
return !1;
|
|
5928
6145
|
try {
|
|
5929
6146
|
$exec(
|
|
5930
|
-
|
|
6147
|
+
value,
|
|
5931
6148
|
/** @type {string} */
|
|
5932
6149
|
/** @type {unknown} */
|
|
5933
6150
|
badStringifier
|
|
@@ -5935,8 +6152,8 @@ var require_es_object_atoms = __commonJS({
|
|
|
5935
6152
|
} catch (e2) {
|
|
5936
6153
|
return e2 === isRegexMarker;
|
|
5937
6154
|
}
|
|
5938
|
-
}) : ($toString = callBound("Object.prototype.toString"), regexClass = "[object RegExp]", fn = function(
|
|
5939
|
-
return !
|
|
6155
|
+
}) : ($toString = callBound("Object.prototype.toString"), regexClass = "[object RegExp]", fn = function(value) {
|
|
6156
|
+
return !value || typeof value != "object" && typeof value != "function" ? !1 : $toString(value) === regexClass;
|
|
5940
6157
|
});
|
|
5941
6158
|
var $exec, isRegexMarker, throwRegexMarker, badStringifier, $toString, regexClass;
|
|
5942
6159
|
module.exports = fn;
|
|
@@ -5969,19 +6186,19 @@ var require_es_object_atoms = __commonJS({
|
|
|
5969
6186
|
"node_modules/.pnpm/is-symbol@1.1.1/node_modules/is-symbol/index.js"(exports, module) {
|
|
5970
6187
|
"use strict";
|
|
5971
6188
|
var callBound = require_call_bound(), $toString = callBound("Object.prototype.toString"), hasSymbols = require_has_symbols()(), safeRegexTest = require_safe_regex_test();
|
|
5972
|
-
hasSymbols ? ($symToStr = callBound("Symbol.prototype.toString"), isSymString = safeRegexTest(/^Symbol\(.*\)$/), isSymbolObject = function(
|
|
5973
|
-
return typeof
|
|
5974
|
-
}, module.exports = function(
|
|
5975
|
-
if (typeof
|
|
6189
|
+
hasSymbols ? ($symToStr = callBound("Symbol.prototype.toString"), isSymString = safeRegexTest(/^Symbol\(.*\)$/), isSymbolObject = function(value) {
|
|
6190
|
+
return typeof value.valueOf() != "symbol" ? !1 : isSymString($symToStr(value));
|
|
6191
|
+
}, module.exports = function(value) {
|
|
6192
|
+
if (typeof value == "symbol")
|
|
5976
6193
|
return !0;
|
|
5977
|
-
if (!
|
|
6194
|
+
if (!value || typeof value != "object" || $toString(value) !== "[object Symbol]")
|
|
5978
6195
|
return !1;
|
|
5979
6196
|
try {
|
|
5980
|
-
return isSymbolObject(
|
|
6197
|
+
return isSymbolObject(value);
|
|
5981
6198
|
} catch {
|
|
5982
6199
|
return !1;
|
|
5983
6200
|
}
|
|
5984
|
-
}) : module.exports = function(
|
|
6201
|
+
}) : module.exports = function(value) {
|
|
5985
6202
|
return !1;
|
|
5986
6203
|
};
|
|
5987
6204
|
var $symToStr, isSymString, isSymbolObject;
|
|
@@ -5991,35 +6208,35 @@ function isObject(val) {
|
|
|
5991
6208
|
return val != null && typeof val == "object" && Array.isArray(val) === !1;
|
|
5992
6209
|
}
|
|
5993
6210
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global, freeGlobal_default = freeGlobal, freeSelf = typeof self == "object" && self && self.Object === Object && self, root = freeGlobal_default || freeSelf || Function("return this")(), root_default = root, Symbol2 = root_default.Symbol, Symbol_default = Symbol2, objectProto = Object.prototype, hasOwnProperty = objectProto.hasOwnProperty, nativeObjectToString = objectProto.toString, symToStringTag = Symbol_default ? Symbol_default.toStringTag : void 0;
|
|
5994
|
-
function getRawTag(
|
|
5995
|
-
var isOwn = hasOwnProperty.call(
|
|
6211
|
+
function getRawTag(value) {
|
|
6212
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
5996
6213
|
try {
|
|
5997
|
-
|
|
6214
|
+
value[symToStringTag] = void 0;
|
|
5998
6215
|
var unmasked = !0;
|
|
5999
6216
|
} catch {
|
|
6000
6217
|
}
|
|
6001
|
-
var result = nativeObjectToString.call(
|
|
6002
|
-
return unmasked && (isOwn ?
|
|
6218
|
+
var result = nativeObjectToString.call(value);
|
|
6219
|
+
return unmasked && (isOwn ? value[symToStringTag] = tag : delete value[symToStringTag]), result;
|
|
6003
6220
|
}
|
|
6004
6221
|
var getRawTag_default = getRawTag, objectProto2 = Object.prototype, nativeObjectToString2 = objectProto2.toString;
|
|
6005
|
-
function objectToString(
|
|
6006
|
-
return nativeObjectToString2.call(
|
|
6222
|
+
function objectToString(value) {
|
|
6223
|
+
return nativeObjectToString2.call(value);
|
|
6007
6224
|
}
|
|
6008
6225
|
var objectToString_default = objectToString, nullTag = "[object Null]", undefinedTag = "[object Undefined]", symToStringTag2 = Symbol_default ? Symbol_default.toStringTag : void 0;
|
|
6009
|
-
function baseGetTag(
|
|
6010
|
-
return
|
|
6226
|
+
function baseGetTag(value) {
|
|
6227
|
+
return value == null ? value === void 0 ? undefinedTag : nullTag : symToStringTag2 && symToStringTag2 in Object(value) ? getRawTag_default(value) : objectToString_default(value);
|
|
6011
6228
|
}
|
|
6012
6229
|
var baseGetTag_default = baseGetTag;
|
|
6013
6230
|
var symbolProto = Symbol_default ? Symbol_default.prototype : void 0, symbolToString = symbolProto ? symbolProto.toString : void 0;
|
|
6014
|
-
function isObject2(
|
|
6015
|
-
var type = typeof
|
|
6016
|
-
return
|
|
6231
|
+
function isObject2(value) {
|
|
6232
|
+
var type = typeof value;
|
|
6233
|
+
return value != null && (type == "object" || type == "function");
|
|
6017
6234
|
}
|
|
6018
6235
|
var isObject_default = isObject2, asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
|
|
6019
|
-
function isFunction(
|
|
6020
|
-
if (!isObject_default(
|
|
6236
|
+
function isFunction(value) {
|
|
6237
|
+
if (!isObject_default(value))
|
|
6021
6238
|
return !1;
|
|
6022
|
-
var tag = baseGetTag_default(
|
|
6239
|
+
var tag = baseGetTag_default(value);
|
|
6023
6240
|
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
6024
6241
|
}
|
|
6025
6242
|
var isFunction_default = isFunction, coreJsData = root_default["__core-js_shared__"], coreJsData_default = coreJsData, maskSrcKey = (function() {
|
|
@@ -6046,24 +6263,24 @@ function toSource(func) {
|
|
|
6046
6263
|
var toSource_default = toSource, reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reIsHostCtor = /^\[object .+?Constructor\]$/, funcProto2 = Function.prototype, objectProto3 = Object.prototype, funcToString2 = funcProto2.toString, hasOwnProperty2 = objectProto3.hasOwnProperty, reIsNative = RegExp(
|
|
6047
6264
|
"^" + funcToString2.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
6048
6265
|
);
|
|
6049
|
-
function baseIsNative(
|
|
6050
|
-
if (!isObject_default(
|
|
6266
|
+
function baseIsNative(value) {
|
|
6267
|
+
if (!isObject_default(value) || isMasked_default(value))
|
|
6051
6268
|
return !1;
|
|
6052
|
-
var pattern = isFunction_default(
|
|
6053
|
-
return pattern.test(toSource_default(
|
|
6269
|
+
var pattern = isFunction_default(value) ? reIsNative : reIsHostCtor;
|
|
6270
|
+
return pattern.test(toSource_default(value));
|
|
6054
6271
|
}
|
|
6055
6272
|
var baseIsNative_default = baseIsNative;
|
|
6056
|
-
function getValue(
|
|
6057
|
-
return
|
|
6273
|
+
function getValue(object, key) {
|
|
6274
|
+
return object?.[key];
|
|
6058
6275
|
}
|
|
6059
6276
|
var getValue_default = getValue;
|
|
6060
|
-
function getNative(
|
|
6061
|
-
var
|
|
6062
|
-
return baseIsNative_default(
|
|
6277
|
+
function getNative(object, key) {
|
|
6278
|
+
var value = getValue_default(object, key);
|
|
6279
|
+
return baseIsNative_default(value) ? value : void 0;
|
|
6063
6280
|
}
|
|
6064
6281
|
var getNative_default = getNative;
|
|
6065
|
-
function eq(
|
|
6066
|
-
return
|
|
6282
|
+
function eq(value, other) {
|
|
6283
|
+
return value === other || value !== value && other !== other;
|
|
6067
6284
|
}
|
|
6068
6285
|
var eq_default = eq;
|
|
6069
6286
|
var nativeCreate = getNative_default(Object, "create"), nativeCreate_default = nativeCreate;
|
|
@@ -6090,9 +6307,9 @@ function hashHas(key) {
|
|
|
6090
6307
|
return nativeCreate_default ? data[key] !== void 0 : hasOwnProperty4.call(data, key);
|
|
6091
6308
|
}
|
|
6092
6309
|
var hashHas_default = hashHas, HASH_UNDEFINED2 = "__lodash_hash_undefined__";
|
|
6093
|
-
function hashSet(key,
|
|
6310
|
+
function hashSet(key, value) {
|
|
6094
6311
|
var data = this.__data__;
|
|
6095
|
-
return this.size += this.has(key) ? 0 : 1, data[key] = nativeCreate_default &&
|
|
6312
|
+
return this.size += this.has(key) ? 0 : 1, data[key] = nativeCreate_default && value === void 0 ? HASH_UNDEFINED2 : value, this;
|
|
6096
6313
|
}
|
|
6097
6314
|
var hashSet_default = hashSet;
|
|
6098
6315
|
function Hash(entries) {
|
|
@@ -6112,9 +6329,9 @@ function listCacheClear() {
|
|
|
6112
6329
|
this.__data__ = [], this.size = 0;
|
|
6113
6330
|
}
|
|
6114
6331
|
var listCacheClear_default = listCacheClear;
|
|
6115
|
-
function assocIndexOf(
|
|
6116
|
-
for (var length =
|
|
6117
|
-
if (eq_default(
|
|
6332
|
+
function assocIndexOf(array, key) {
|
|
6333
|
+
for (var length = array.length; length--; )
|
|
6334
|
+
if (eq_default(array[length][0], key))
|
|
6118
6335
|
return length;
|
|
6119
6336
|
return -1;
|
|
6120
6337
|
}
|
|
@@ -6136,9 +6353,9 @@ function listCacheHas(key) {
|
|
|
6136
6353
|
return assocIndexOf_default(this.__data__, key) > -1;
|
|
6137
6354
|
}
|
|
6138
6355
|
var listCacheHas_default = listCacheHas;
|
|
6139
|
-
function listCacheSet(key,
|
|
6356
|
+
function listCacheSet(key, value) {
|
|
6140
6357
|
var data = this.__data__, index = assocIndexOf_default(data, key);
|
|
6141
|
-
return index < 0 ? (++this.size, data.push([key,
|
|
6358
|
+
return index < 0 ? (++this.size, data.push([key, value])) : data[index][1] = value, this;
|
|
6142
6359
|
}
|
|
6143
6360
|
var listCacheSet_default = listCacheSet;
|
|
6144
6361
|
function ListCache(entries) {
|
|
@@ -6162,9 +6379,9 @@ function mapCacheClear() {
|
|
|
6162
6379
|
};
|
|
6163
6380
|
}
|
|
6164
6381
|
var mapCacheClear_default = mapCacheClear;
|
|
6165
|
-
function isKeyable(
|
|
6166
|
-
var type = typeof
|
|
6167
|
-
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ?
|
|
6382
|
+
function isKeyable(value) {
|
|
6383
|
+
var type = typeof value;
|
|
6384
|
+
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
6168
6385
|
}
|
|
6169
6386
|
var isKeyable_default = isKeyable;
|
|
6170
6387
|
function getMapData(map, key) {
|
|
@@ -6185,9 +6402,9 @@ function mapCacheHas(key) {
|
|
|
6185
6402
|
return getMapData_default(this, key).has(key);
|
|
6186
6403
|
}
|
|
6187
6404
|
var mapCacheHas_default = mapCacheHas;
|
|
6188
|
-
function mapCacheSet(key,
|
|
6405
|
+
function mapCacheSet(key, value) {
|
|
6189
6406
|
var data = getMapData_default(this, key), size = data.size;
|
|
6190
|
-
return data.set(key,
|
|
6407
|
+
return data.set(key, value), this.size += data.size == size ? 0 : 1, this;
|
|
6191
6408
|
}
|
|
6192
6409
|
var mapCacheSet_default = mapCacheSet;
|
|
6193
6410
|
function MapCache(entries) {
|
|
@@ -6245,62 +6462,62 @@ function convertUnconventionalData(data) {
|
|
|
6245
6462
|
}
|
|
6246
6463
|
var replacer = function(options) {
|
|
6247
6464
|
let objects, map, stack, keys;
|
|
6248
|
-
return function(key,
|
|
6465
|
+
return function(key, value) {
|
|
6249
6466
|
try {
|
|
6250
6467
|
if (key === "")
|
|
6251
|
-
return keys = [], objects = /* @__PURE__ */ new Map([[
|
|
6468
|
+
return keys = [], objects = /* @__PURE__ */ new Map([[value, "[]"]]), map = /* @__PURE__ */ new Map(), stack = [], value;
|
|
6252
6469
|
let origin = map.get(this) || this;
|
|
6253
6470
|
for (; stack.length && origin !== stack[0]; )
|
|
6254
6471
|
stack.shift(), keys.pop();
|
|
6255
|
-
if (typeof
|
|
6256
|
-
return
|
|
6257
|
-
if (
|
|
6472
|
+
if (typeof value == "boolean")
|
|
6473
|
+
return value;
|
|
6474
|
+
if (value === void 0)
|
|
6258
6475
|
return options.allowUndefined ? "_undefined_" : void 0;
|
|
6259
|
-
if (
|
|
6476
|
+
if (value === null)
|
|
6260
6477
|
return null;
|
|
6261
|
-
if (typeof
|
|
6262
|
-
return
|
|
6263
|
-
if (typeof
|
|
6264
|
-
return `_bigint_${
|
|
6265
|
-
if (typeof
|
|
6266
|
-
return dateFormat.test(
|
|
6267
|
-
if ((0, import_is_regex.default)(
|
|
6268
|
-
return options.allowRegExp ? `_regexp_${
|
|
6269
|
-
if ((0, import_is_function.default)(
|
|
6478
|
+
if (typeof value == "number")
|
|
6479
|
+
return value === Number.NEGATIVE_INFINITY ? "_-Infinity_" : value === Number.POSITIVE_INFINITY ? "_Infinity_" : Number.isNaN(value) ? "_NaN_" : value;
|
|
6480
|
+
if (typeof value == "bigint")
|
|
6481
|
+
return `_bigint_${value.toString()}`;
|
|
6482
|
+
if (typeof value == "string")
|
|
6483
|
+
return dateFormat.test(value) ? options.allowDate ? `_date_${value}` : void 0 : value;
|
|
6484
|
+
if ((0, import_is_regex.default)(value))
|
|
6485
|
+
return options.allowRegExp ? `_regexp_${value.flags}|${value.source}` : void 0;
|
|
6486
|
+
if ((0, import_is_function.default)(value))
|
|
6270
6487
|
return;
|
|
6271
|
-
if ((0, import_is_symbol.default)(
|
|
6488
|
+
if ((0, import_is_symbol.default)(value)) {
|
|
6272
6489
|
if (!options.allowSymbol)
|
|
6273
6490
|
return;
|
|
6274
|
-
let globalRegistryKey = Symbol.keyFor(
|
|
6275
|
-
return globalRegistryKey !== void 0 ? `_gsymbol_${globalRegistryKey}` : `_symbol_${
|
|
6491
|
+
let globalRegistryKey = Symbol.keyFor(value);
|
|
6492
|
+
return globalRegistryKey !== void 0 ? `_gsymbol_${globalRegistryKey}` : `_symbol_${value.toString().slice(7, -1)}`;
|
|
6276
6493
|
}
|
|
6277
6494
|
if (stack.length >= options.maxDepth)
|
|
6278
|
-
return Array.isArray(
|
|
6279
|
-
if (
|
|
6495
|
+
return Array.isArray(value) ? `[Array(${value.length})]` : "[Object]";
|
|
6496
|
+
if (value === this)
|
|
6280
6497
|
return `_duplicate_${JSON.stringify(keys)}`;
|
|
6281
|
-
if (
|
|
6498
|
+
if (value instanceof Error && options.allowError)
|
|
6282
6499
|
return {
|
|
6283
6500
|
__isConvertedError__: !0,
|
|
6284
6501
|
errorProperties: {
|
|
6285
6502
|
// @ts-expect-error cause is not defined in the current tsconfig target(es2020)
|
|
6286
|
-
...
|
|
6287
|
-
...
|
|
6288
|
-
name:
|
|
6289
|
-
message:
|
|
6290
|
-
stack:
|
|
6291
|
-
"_constructor-name_":
|
|
6503
|
+
...value.cause ? { cause: value.cause } : {},
|
|
6504
|
+
...value,
|
|
6505
|
+
name: value.name,
|
|
6506
|
+
message: value.message,
|
|
6507
|
+
stack: value.stack,
|
|
6508
|
+
"_constructor-name_": value.constructor.name
|
|
6292
6509
|
}
|
|
6293
6510
|
};
|
|
6294
|
-
if (
|
|
6295
|
-
let found2 = objects.get(
|
|
6511
|
+
if (value?.constructor?.name && value.constructor.name !== "Object" && !Array.isArray(value)) {
|
|
6512
|
+
let found2 = objects.get(value);
|
|
6296
6513
|
if (!found2) {
|
|
6297
6514
|
let plainObject = {
|
|
6298
6515
|
__isClassInstance__: !0,
|
|
6299
|
-
__className__:
|
|
6300
|
-
...Object.getOwnPropertyNames(
|
|
6516
|
+
__className__: value.constructor.name,
|
|
6517
|
+
...Object.getOwnPropertyNames(value).reduce(
|
|
6301
6518
|
(acc, prop) => {
|
|
6302
6519
|
try {
|
|
6303
|
-
acc[prop] =
|
|
6520
|
+
acc[prop] = value[prop];
|
|
6304
6521
|
} catch {
|
|
6305
6522
|
}
|
|
6306
6523
|
return acc;
|
|
@@ -6308,14 +6525,14 @@ var replacer = function(options) {
|
|
|
6308
6525
|
{}
|
|
6309
6526
|
)
|
|
6310
6527
|
};
|
|
6311
|
-
return keys.push(key), stack.unshift(plainObject), objects.set(
|
|
6528
|
+
return keys.push(key), stack.unshift(plainObject), objects.set(value, JSON.stringify(keys)), value !== plainObject && map.set(value, plainObject), plainObject;
|
|
6312
6529
|
}
|
|
6313
6530
|
return `_duplicate_${found2}`;
|
|
6314
6531
|
}
|
|
6315
|
-
let found = objects.get(
|
|
6532
|
+
let found = objects.get(value);
|
|
6316
6533
|
if (!found) {
|
|
6317
|
-
let converted = Array.isArray(
|
|
6318
|
-
return keys.push(key), stack.unshift(converted), objects.set(
|
|
6534
|
+
let converted = Array.isArray(value) ? value : convertUnconventionalData(value);
|
|
6535
|
+
return keys.push(key), stack.unshift(converted), objects.set(value, JSON.stringify(keys)), value !== converted && map.set(value, converted), converted;
|
|
6319
6536
|
}
|
|
6320
6537
|
return `_duplicate_${found}`;
|
|
6321
6538
|
} catch {
|
|
@@ -6366,7 +6583,7 @@ var SourceContext = createContext3({ sources: {} }), UNKNOWN_ARGS_HASH = "--unkn
|
|
|
6366
6583
|
}));
|
|
6367
6584
|
};
|
|
6368
6585
|
return channel.on(SNIPPET_RENDERED, handleSnippetRendered), () => channel.off(SNIPPET_RENDERED, handleSnippetRendered);
|
|
6369
|
-
}, []),
|
|
6586
|
+
}, []), React38.createElement(SourceContext.Provider, { value: { sources } }, children);
|
|
6370
6587
|
};
|
|
6371
6588
|
|
|
6372
6589
|
// src/blocks/blocks/useTransformCode.tsx
|
|
@@ -6396,7 +6613,7 @@ var getStorySource = (storyId, args, sourceContext) => {
|
|
|
6396
6613
|
type === SourceType.AUTO && snippet && isArgsStory ? snippet : sourceParameters.originalSource || "", transformer = transformFromProps ?? sourceParameters.transform, transformedCode = transformer ? useTransformCode(code, transformer, storyContext) : code;
|
|
6397
6614
|
return sourceParameters.code !== void 0 ? sourceParameters.code : transformedCode;
|
|
6398
6615
|
}, useSourceProps = (props, docsContext, sourceContext) => {
|
|
6399
|
-
let { of } = props, story =
|
|
6616
|
+
let { of } = props, story = useMemo4(() => {
|
|
6400
6617
|
if (of)
|
|
6401
6618
|
return docsContext.resolveOf(of, ["story"]).story;
|
|
6402
6619
|
try {
|
|
@@ -6423,18 +6640,18 @@ var getStorySource = (storyId, args, sourceContext) => {
|
|
|
6423
6640
|
language,
|
|
6424
6641
|
dark
|
|
6425
6642
|
});
|
|
6426
|
-
},
|
|
6643
|
+
}, SourceImpl = (props) => {
|
|
6427
6644
|
let sourceContext = useContext4(SourceContext), docsContext = useContext4(DocsContext), sourceProps = useSourceProps(props, docsContext, sourceContext);
|
|
6428
|
-
return
|
|
6429
|
-
};
|
|
6645
|
+
return React39.createElement(Source, { ...sourceProps });
|
|
6646
|
+
}, Source2 = withMdxComponentOverride("Source", SourceImpl);
|
|
6430
6647
|
|
|
6431
6648
|
// src/blocks/blocks/Canvas.tsx
|
|
6432
|
-
var
|
|
6649
|
+
var CanvasImpl = (props) => {
|
|
6433
6650
|
let docsContext = useContext5(DocsContext), sourceContext = useContext5(SourceContext), { of, source } = props;
|
|
6434
6651
|
if ("of" in props && of === void 0)
|
|
6435
6652
|
throw new Error("Unexpected `of={undefined}`, did you mistype a CSF file reference?");
|
|
6436
6653
|
let { story } = useOf(of || "story", ["story"]), sourceProps = useSourceProps({ ...source, ...of && { of } }, docsContext, sourceContext), layout = props.layout ?? story.parameters.layout ?? story.parameters.docs?.canvas?.layout ?? "padded", withToolbar = props.withToolbar ?? story.parameters.docs?.canvas?.withToolbar ?? !1, additionalActions = props.additionalActions ?? story.parameters.docs?.canvas?.additionalActions, sourceState = props.sourceState ?? story.parameters.docs?.canvas?.sourceState ?? "hidden", className = props.className ?? story.parameters.docs?.canvas?.className, inline = props.story?.inline ?? story.parameters?.docs?.story?.inline ?? !1;
|
|
6437
|
-
return
|
|
6654
|
+
return React40.createElement(
|
|
6438
6655
|
Preview,
|
|
6439
6656
|
{
|
|
6440
6657
|
withSource: sourceState === "none" ? void 0 : sourceProps,
|
|
@@ -6445,12 +6662,12 @@ var Canvas = (props) => {
|
|
|
6445
6662
|
layout,
|
|
6446
6663
|
inline
|
|
6447
6664
|
},
|
|
6448
|
-
|
|
6665
|
+
React40.createElement(Story2, { of: of || story.moduleExport, meta: props.meta, ...props.story })
|
|
6449
6666
|
);
|
|
6450
|
-
};
|
|
6667
|
+
}, Canvas = withMdxComponentOverride("Canvas", CanvasImpl);
|
|
6451
6668
|
|
|
6452
6669
|
// src/blocks/blocks/Controls.tsx
|
|
6453
|
-
import
|
|
6670
|
+
import React41, { useContext as useContext7 } from "react";
|
|
6454
6671
|
import { filterArgTypes as filterArgTypes2 } from "storybook/preview-api";
|
|
6455
6672
|
|
|
6456
6673
|
// src/blocks/blocks/useArgs.ts
|
|
@@ -6508,13 +6725,13 @@ function extractComponentArgTypes2(component, parameters) {
|
|
|
6508
6725
|
throw new Error("Args unsupported. See Args documentation for your framework." /* ARGS_UNSUPPORTED */);
|
|
6509
6726
|
return extractArgTypes(component);
|
|
6510
6727
|
}
|
|
6511
|
-
var
|
|
6728
|
+
var ControlsImpl = (props) => {
|
|
6512
6729
|
let { of } = props, context = useContext7(DocsContext), primaryStory = usePrimaryStory(), story = of ? context.resolveOf(of, ["story"]).story : primaryStory;
|
|
6513
6730
|
if (!story)
|
|
6514
6731
|
return null;
|
|
6515
6732
|
let { parameters, argTypes, component, subcomponents } = story, controlsParameters = parameters.docs?.controls || {}, include = props.include ?? controlsParameters.include, exclude = props.exclude ?? controlsParameters.exclude, sort = props.sort ?? controlsParameters.sort, [args, updateArgs, resetArgs] = useArgs(story, context), [globals] = useGlobals(story, context), filteredArgTypes = filterArgTypes2(argTypes, include, exclude);
|
|
6516
6733
|
if (!(!!subcomponents && Object.keys(subcomponents || {}).length > 0))
|
|
6517
|
-
return Object.keys(filteredArgTypes).length > 0 || Object.keys(args).length > 0 ?
|
|
6734
|
+
return Object.keys(filteredArgTypes).length > 0 || Object.keys(args).length > 0 ? React41.createElement(
|
|
6518
6735
|
ArgsTable,
|
|
6519
6736
|
{
|
|
6520
6737
|
rows: filteredArgTypes,
|
|
@@ -6537,7 +6754,7 @@ var Controls3 = (props) => {
|
|
|
6537
6754
|
[mainComponentName]: { rows: filteredArgTypes, sort },
|
|
6538
6755
|
...subcomponentTabs
|
|
6539
6756
|
};
|
|
6540
|
-
return
|
|
6757
|
+
return React41.createElement(
|
|
6541
6758
|
TabbedArgsTable,
|
|
6542
6759
|
{
|
|
6543
6760
|
tabs,
|
|
@@ -6548,17 +6765,17 @@ var Controls3 = (props) => {
|
|
|
6548
6765
|
resetArgs
|
|
6549
6766
|
}
|
|
6550
6767
|
);
|
|
6551
|
-
};
|
|
6768
|
+
}, Controls3 = withMdxComponentOverride("Controls", ControlsImpl);
|
|
6552
6769
|
|
|
6553
6770
|
// src/blocks/blocks/Description.tsx
|
|
6554
|
-
import
|
|
6771
|
+
import React44 from "react";
|
|
6555
6772
|
|
|
6556
6773
|
// src/blocks/blocks/Markdown.tsx
|
|
6557
|
-
import
|
|
6774
|
+
import React43 from "react";
|
|
6558
6775
|
import { dedent } from "ts-dedent";
|
|
6559
6776
|
|
|
6560
6777
|
// src/blocks/blocks/mdx.tsx
|
|
6561
|
-
import
|
|
6778
|
+
import React42, { useContext as useContext8 } from "react";
|
|
6562
6779
|
import { Code, components, nameSpaceClassNames } from "storybook/internal/components";
|
|
6563
6780
|
import { NAVIGATE_URL as NAVIGATE_URL2 } from "storybook/internal/core-events";
|
|
6564
6781
|
import { LinkIcon } from "@storybook/icons";
|
|
@@ -6568,17 +6785,17 @@ var { document: document2 } = globalThis, assertIsFn = (val) => {
|
|
|
6568
6785
|
throw new Error(`Expected story function, got: ${val}`);
|
|
6569
6786
|
return val;
|
|
6570
6787
|
}, AddContext = (props) => {
|
|
6571
|
-
let { children, ...rest } = props, parentContext =
|
|
6572
|
-
return
|
|
6788
|
+
let { children, ...rest } = props, parentContext = React42.useContext(DocsContext);
|
|
6789
|
+
return React42.createElement(DocsContext.Provider, { value: { ...parentContext, ...rest } }, children);
|
|
6573
6790
|
}, CodeOrSourceMdx = ({
|
|
6574
6791
|
className,
|
|
6575
6792
|
children,
|
|
6576
6793
|
...rest
|
|
6577
6794
|
}) => {
|
|
6578
6795
|
if (typeof className != "string" && (typeof children != "string" || !children.match(/[\n\r]/g)))
|
|
6579
|
-
return
|
|
6796
|
+
return React42.createElement(Code, null, children);
|
|
6580
6797
|
let language = className && className.split("-");
|
|
6581
|
-
return
|
|
6798
|
+
return React42.createElement(
|
|
6582
6799
|
Source,
|
|
6583
6800
|
{
|
|
6584
6801
|
language: language && language[1] || "text",
|
|
@@ -6593,7 +6810,7 @@ function navigate(context, url) {
|
|
|
6593
6810
|
}
|
|
6594
6811
|
var A2 = components.a, AnchorInPage = ({ hash, children }) => {
|
|
6595
6812
|
let context = useContext8(DocsContext);
|
|
6596
|
-
return
|
|
6813
|
+
return React42.createElement(
|
|
6597
6814
|
A2,
|
|
6598
6815
|
{
|
|
6599
6816
|
href: hash,
|
|
@@ -6607,7 +6824,7 @@ var A2 = components.a, AnchorInPage = ({ hash, children }) => {
|
|
|
6607
6824
|
);
|
|
6608
6825
|
}, AnchorMdx = (props) => {
|
|
6609
6826
|
let { href, target, children, ...rest } = props, context = useContext8(DocsContext);
|
|
6610
|
-
return !href || target === "_blank" || /^https?:\/\//.test(href) ?
|
|
6827
|
+
return !href || target === "_blank" || /^https?:\/\//.test(href) ? React42.createElement(A2, { ...props }) : href.startsWith("#") ? React42.createElement(AnchorInPage, { hash: href }, children) : React42.createElement(
|
|
6611
6828
|
A2,
|
|
6612
6829
|
{
|
|
6613
6830
|
href,
|
|
@@ -6650,7 +6867,7 @@ var A2 = components.a, AnchorInPage = ({ hash, children }) => {
|
|
|
6650
6867
|
...rest
|
|
6651
6868
|
}) => {
|
|
6652
6869
|
let context = useContext8(DocsContext), OcticonHeader = OcticonHeaders[as], hash = `#${id}`;
|
|
6653
|
-
return
|
|
6870
|
+
return React42.createElement(OcticonHeader, { id, ...rest }, React42.createElement(
|
|
6654
6871
|
OcticonAnchor,
|
|
6655
6872
|
{
|
|
6656
6873
|
"aria-hidden": "true",
|
|
@@ -6661,25 +6878,25 @@ var A2 = components.a, AnchorInPage = ({ hash, children }) => {
|
|
|
6661
6878
|
document2.getElementById(id) && navigate(context, hash);
|
|
6662
6879
|
}
|
|
6663
6880
|
},
|
|
6664
|
-
|
|
6881
|
+
React42.createElement(LinkIcon, null)
|
|
6665
6882
|
), children);
|
|
6666
6883
|
}, HeaderMdx = (props) => {
|
|
6667
6884
|
let { as, id, children, ...rest } = props;
|
|
6668
6885
|
if (id)
|
|
6669
|
-
return
|
|
6886
|
+
return React42.createElement(HeaderWithOcticonAnchor, { as, id, ...rest }, children);
|
|
6670
6887
|
let Component4 = as, { as: omittedAs, ...withoutAs } = props;
|
|
6671
|
-
return
|
|
6888
|
+
return React42.createElement(Component4, { ...nameSpaceClassNames(withoutAs, as) });
|
|
6672
6889
|
}, HeadersMdx = SUPPORTED_MDX_HEADERS.reduce(
|
|
6673
6890
|
(acc, headerType) => ({
|
|
6674
6891
|
...acc,
|
|
6675
6892
|
// @ts-expect-error (Converted from ts-ignore)
|
|
6676
|
-
[headerType]: (props) =>
|
|
6893
|
+
[headerType]: (props) => React42.createElement(HeaderMdx, { as: headerType, ...props })
|
|
6677
6894
|
}),
|
|
6678
6895
|
{}
|
|
6679
6896
|
);
|
|
6680
6897
|
|
|
6681
6898
|
// src/blocks/blocks/Markdown.tsx
|
|
6682
|
-
var
|
|
6899
|
+
var MarkdownImpl = (props) => {
|
|
6683
6900
|
if (!props.children)
|
|
6684
6901
|
return null;
|
|
6685
6902
|
if (typeof props.children != "string")
|
|
@@ -6702,7 +6919,7 @@ var Markdown = (props) => {
|
|
|
6702
6919
|
</Markdown>
|
|
6703
6920
|
`
|
|
6704
6921
|
);
|
|
6705
|
-
return
|
|
6922
|
+
return React43.createElement(
|
|
6706
6923
|
index_modern_default,
|
|
6707
6924
|
{
|
|
6708
6925
|
...props,
|
|
@@ -6718,7 +6935,7 @@ var Markdown = (props) => {
|
|
|
6718
6935
|
}
|
|
6719
6936
|
}
|
|
6720
6937
|
);
|
|
6721
|
-
};
|
|
6938
|
+
}, Markdown = withMdxComponentOverride("Markdown", MarkdownImpl);
|
|
6722
6939
|
|
|
6723
6940
|
// src/blocks/blocks/Description.tsx
|
|
6724
6941
|
var DescriptionType = /* @__PURE__ */ ((DescriptionType2) => (DescriptionType2.INFO = "info", DescriptionType2.NOTES = "notes", DescriptionType2.DOCGEN = "docgen", DescriptionType2.AUTO = "auto", DescriptionType2))(DescriptionType || {}), getDescriptionFromResolvedOf = (resolvedOf) => {
|
|
@@ -6747,19 +6964,19 @@ var DescriptionType = /* @__PURE__ */ ((DescriptionType2) => (DescriptionType2.I
|
|
|
6747
6964
|
`Unrecognized module type resolved from 'useOf', got: ${resolvedOf.type}`
|
|
6748
6965
|
);
|
|
6749
6966
|
}
|
|
6750
|
-
},
|
|
6967
|
+
}, DescriptionImpl = (props) => {
|
|
6751
6968
|
let { of } = props;
|
|
6752
6969
|
if ("of" in props && of === void 0)
|
|
6753
6970
|
throw new Error("Unexpected `of={undefined}`, did you mistype a CSF file reference?");
|
|
6754
6971
|
let resolvedOf = useOf(of || "meta"), markdown = getDescriptionFromResolvedOf(resolvedOf);
|
|
6755
|
-
return markdown ?
|
|
6756
|
-
};
|
|
6972
|
+
return markdown ? React44.createElement(Markdown, null, markdown) : null;
|
|
6973
|
+
}, Description2 = withMdxComponentOverride("Description", DescriptionImpl);
|
|
6757
6974
|
|
|
6758
6975
|
// src/blocks/blocks/Docs.tsx
|
|
6759
|
-
import
|
|
6976
|
+
import React54 from "react";
|
|
6760
6977
|
|
|
6761
6978
|
// src/blocks/blocks/DocsContainer.tsx
|
|
6762
|
-
import
|
|
6979
|
+
import React45, { useEffect as useEffect15 } from "react";
|
|
6763
6980
|
import { ThemeProvider, ensure as ensureTheme } from "storybook/theming";
|
|
6764
6981
|
var { document: document3, window: globalWindow3 } = globalThis, DocsContainer = ({
|
|
6765
6982
|
context,
|
|
@@ -6783,10 +7000,10 @@ var { document: document3, window: globalWindow3 } = globalThis, DocsContainer =
|
|
|
6783
7000
|
}
|
|
6784
7001
|
} catch {
|
|
6785
7002
|
}
|
|
6786
|
-
}),
|
|
7003
|
+
}), React45.createElement(DocsContext.Provider, { value: context }, React45.createElement(SourceContainer, { channel: context.channel }, React45.createElement(ThemeProvider, { theme: ensureTheme(theme) }, React45.createElement(
|
|
6787
7004
|
DocsPageWrapper,
|
|
6788
7005
|
{
|
|
6789
|
-
toc: toc ?
|
|
7006
|
+
toc: toc ? React45.createElement(
|
|
6790
7007
|
TableOfContents,
|
|
6791
7008
|
{
|
|
6792
7009
|
className: "sbdocs sbdocs-toc--custom",
|
|
@@ -6800,20 +7017,20 @@ var { document: document3, window: globalWindow3 } = globalThis, DocsContainer =
|
|
|
6800
7017
|
};
|
|
6801
7018
|
|
|
6802
7019
|
// src/blocks/blocks/DocsPage.tsx
|
|
6803
|
-
import
|
|
7020
|
+
import React53 from "react";
|
|
6804
7021
|
|
|
6805
7022
|
// src/blocks/blocks/Primary.tsx
|
|
6806
|
-
import
|
|
7023
|
+
import React49 from "react";
|
|
6807
7024
|
|
|
6808
7025
|
// src/blocks/blocks/DocsStory.tsx
|
|
6809
|
-
import
|
|
7026
|
+
import React48 from "react";
|
|
6810
7027
|
|
|
6811
7028
|
// src/blocks/blocks/Subheading.tsx
|
|
6812
|
-
import
|
|
7029
|
+
import React47 from "react";
|
|
6813
7030
|
import { H3 } from "storybook/internal/components";
|
|
6814
7031
|
|
|
6815
7032
|
// src/blocks/blocks/Heading.tsx
|
|
6816
|
-
import
|
|
7033
|
+
import React46 from "react";
|
|
6817
7034
|
import { H2 } from "storybook/internal/components";
|
|
6818
7035
|
|
|
6819
7036
|
// ../../../node_modules/github-slugger/regex.js
|
|
@@ -6841,8 +7058,8 @@ var own = Object.hasOwnProperty, BananaSlug = class {
|
|
|
6841
7058
|
* @return {string}
|
|
6842
7059
|
* A unique slug string
|
|
6843
7060
|
*/
|
|
6844
|
-
slug(
|
|
6845
|
-
let self2 = this, result = slug(
|
|
7061
|
+
slug(value, maintainCase) {
|
|
7062
|
+
let self2 = this, result = slug(value, maintainCase === !0), originalSlug = result;
|
|
6846
7063
|
for (; own.call(self2.occurrences, result); )
|
|
6847
7064
|
self2.occurrences[originalSlug]++, result = originalSlug + "-" + self2.occurrences[originalSlug];
|
|
6848
7065
|
return self2.occurrences[result] = 0, result;
|
|
@@ -6856,32 +7073,32 @@ var own = Object.hasOwnProperty, BananaSlug = class {
|
|
|
6856
7073
|
this.occurrences = /* @__PURE__ */ Object.create(null);
|
|
6857
7074
|
}
|
|
6858
7075
|
};
|
|
6859
|
-
function slug(
|
|
6860
|
-
return typeof
|
|
7076
|
+
function slug(value, maintainCase) {
|
|
7077
|
+
return typeof value != "string" ? "" : (maintainCase || (value = value.toLowerCase()), value.replace(regex, "").replace(/ /g, "-"));
|
|
6861
7078
|
}
|
|
6862
7079
|
|
|
6863
7080
|
// src/blocks/blocks/Heading.tsx
|
|
6864
|
-
var slugs = new BananaSlug(),
|
|
7081
|
+
var slugs = new BananaSlug(), HeadingImpl = ({
|
|
6865
7082
|
children,
|
|
6866
7083
|
disableAnchor,
|
|
6867
7084
|
...props
|
|
6868
7085
|
}) => {
|
|
6869
7086
|
if (disableAnchor || typeof children != "string")
|
|
6870
|
-
return
|
|
7087
|
+
return React46.createElement(H2, null, children);
|
|
6871
7088
|
let tagID = slugs.slug(children.toLowerCase());
|
|
6872
|
-
return
|
|
6873
|
-
};
|
|
7089
|
+
return React46.createElement(HeaderMdx, { as: "h2", id: tagID, ...props }, children);
|
|
7090
|
+
}, Heading2 = withMdxComponentOverride("Heading", HeadingImpl);
|
|
6874
7091
|
|
|
6875
7092
|
// src/blocks/blocks/Subheading.tsx
|
|
6876
|
-
var
|
|
7093
|
+
var SubheadingImpl = ({ children, disableAnchor }) => {
|
|
6877
7094
|
if (disableAnchor || typeof children != "string")
|
|
6878
|
-
return
|
|
7095
|
+
return React47.createElement(H3, null, children);
|
|
6879
7096
|
let tagID = slugs.slug(children.toLowerCase());
|
|
6880
|
-
return
|
|
6881
|
-
};
|
|
7097
|
+
return React47.createElement(HeaderMdx, { as: "h3", id: tagID }, children);
|
|
7098
|
+
}, Subheading = withMdxComponentOverride("Subheading", SubheadingImpl);
|
|
6882
7099
|
|
|
6883
7100
|
// src/blocks/blocks/DocsStory.tsx
|
|
6884
|
-
var
|
|
7101
|
+
var DocsStoryImpl = ({
|
|
6885
7102
|
of,
|
|
6886
7103
|
expanded = !0,
|
|
6887
7104
|
withToolbar: withToolbarProp = !1,
|
|
@@ -6889,7 +7106,7 @@ var DocsStory = ({
|
|
|
6889
7106
|
__primary = !1
|
|
6890
7107
|
}) => {
|
|
6891
7108
|
let { story } = useOf(of || "story", ["story"]), withToolbar = story.parameters.docs?.canvas?.withToolbar ?? withToolbarProp;
|
|
6892
|
-
return
|
|
7109
|
+
return React48.createElement(Anchor, { storyId: __primary ? `primary--${story.id}` : story.id }, expanded && React48.createElement(React48.Fragment, null, React48.createElement(Subheading, null, story.name), React48.createElement(Description2, { of })), React48.createElement(
|
|
6893
7110
|
Canvas,
|
|
6894
7111
|
{
|
|
6895
7112
|
of,
|
|
@@ -6898,16 +7115,16 @@ var DocsStory = ({
|
|
|
6898
7115
|
source: { __forceInitialArgs }
|
|
6899
7116
|
}
|
|
6900
7117
|
));
|
|
6901
|
-
};
|
|
7118
|
+
}, DocsStory = withMdxComponentOverride("DocsStory", DocsStoryImpl);
|
|
6902
7119
|
|
|
6903
7120
|
// src/blocks/blocks/Primary.tsx
|
|
6904
|
-
var
|
|
7121
|
+
var PrimaryImpl = () => {
|
|
6905
7122
|
let primaryStory = usePrimaryStory();
|
|
6906
|
-
return primaryStory ?
|
|
6907
|
-
};
|
|
7123
|
+
return primaryStory ? React49.createElement(DocsStory, { of: primaryStory.moduleExport, expanded: !1, __primary: !0, withToolbar: !0 }) : null;
|
|
7124
|
+
}, Primary = withMdxComponentOverride("Primary", PrimaryImpl);
|
|
6908
7125
|
|
|
6909
7126
|
// src/blocks/blocks/Stories.tsx
|
|
6910
|
-
import
|
|
7127
|
+
import React50, { useContext as useContext9 } from "react";
|
|
6911
7128
|
import { Tag as Tag2 } from "storybook/internal/preview-api";
|
|
6912
7129
|
import { styled as styled29 } from "storybook/theming";
|
|
6913
7130
|
var StyledHeading = styled29(Heading2)(({ theme }) => ({
|
|
@@ -6923,17 +7140,17 @@ var StyledHeading = styled29(Heading2)(({ theme }) => ({
|
|
|
6923
7140
|
// specificity issue
|
|
6924
7141
|
marginTop: "56px"
|
|
6925
7142
|
}
|
|
6926
|
-
})),
|
|
7143
|
+
})), StoriesImpl = ({ title = "Stories", includePrimary = !0 }) => {
|
|
6927
7144
|
let { componentStories, projectAnnotations, getStoryContext } = useContext9(DocsContext), stories = componentStories(), { stories: { filter } = { filter: void 0 } } = projectAnnotations.parameters?.docs || {};
|
|
6928
|
-
return filter && (stories = stories.filter((story) => filter(story, getStoryContext(story)))), stories.some((story) => story.tags?.includes(Tag2.AUTODOCS)) && (stories = stories.filter((story) => story.tags?.includes(Tag2.AUTODOCS) && !story.usesMount)), includePrimary || (stories = stories.slice(1)), !stories || stories.length === 0 ? null :
|
|
6929
|
-
(story) => story &&
|
|
7145
|
+
return filter && (stories = stories.filter((story) => filter(story, getStoryContext(story)))), stories.some((story) => story.tags?.includes(Tag2.AUTODOCS)) && (stories = stories.filter((story) => story.tags?.includes(Tag2.AUTODOCS) && !story.usesMount)), includePrimary || (stories = stories.slice(1)), !stories || stories.length === 0 ? null : React50.createElement(React50.Fragment, null, typeof title == "string" ? React50.createElement(StyledHeading, null, title) : title, stories.map(
|
|
7146
|
+
(story) => story && React50.createElement(DocsStory, { key: story.id, of: story.moduleExport, expanded: !0, __forceInitialArgs: !0 })
|
|
6930
7147
|
));
|
|
6931
|
-
};
|
|
7148
|
+
}, Stories = withMdxComponentOverride("Stories", StoriesImpl);
|
|
6932
7149
|
|
|
6933
7150
|
// src/blocks/blocks/Subtitle.tsx
|
|
6934
|
-
import
|
|
7151
|
+
import React51 from "react";
|
|
6935
7152
|
import { deprecate } from "storybook/internal/client-logger";
|
|
6936
|
-
var DEPRECATION_MIGRATION_LINK = "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#subtitle-block-and-parameterscomponentsubtitle",
|
|
7153
|
+
var DEPRECATION_MIGRATION_LINK = "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#subtitle-block-and-parameterscomponentsubtitle", SubtitleImpl = (props) => {
|
|
6937
7154
|
let { of, children } = props;
|
|
6938
7155
|
if ("of" in props && of === void 0)
|
|
6939
7156
|
throw new Error("Unexpected `of={undefined}`, did you mistype a CSF file reference?");
|
|
@@ -6949,15 +7166,15 @@ var DEPRECATION_MIGRATION_LINK = "https://github.com/storybookjs/storybook/blob/
|
|
|
6949
7166
|
`Using 'parameters.componentSubtitle' property to subtitle stories is deprecated. See ${DEPRECATION_MIGRATION_LINK}`
|
|
6950
7167
|
);
|
|
6951
7168
|
let content = children || docs?.subtitle || componentSubtitle;
|
|
6952
|
-
return content ?
|
|
6953
|
-
};
|
|
7169
|
+
return content ? React51.createElement(Subtitle, { className: "sbdocs-subtitle sb-unstyled" }, content) : null;
|
|
7170
|
+
}, Subtitle2 = withMdxComponentOverride("Subtitle", SubtitleImpl);
|
|
6954
7171
|
|
|
6955
7172
|
// src/blocks/blocks/Title.tsx
|
|
6956
|
-
import
|
|
7173
|
+
import React52 from "react";
|
|
6957
7174
|
var STORY_KIND_PATH_SEPARATOR = /\s*\/\s*/, extractTitle = (title) => {
|
|
6958
7175
|
let groups = title.trim().split(STORY_KIND_PATH_SEPARATOR);
|
|
6959
7176
|
return groups?.[groups?.length - 1] || title;
|
|
6960
|
-
},
|
|
7177
|
+
}, TitleImpl = (props) => {
|
|
6961
7178
|
let { children, of } = props;
|
|
6962
7179
|
if ("of" in props && of === void 0)
|
|
6963
7180
|
throw new Error("Unexpected `of={undefined}`, did you mistype a CSF file reference?");
|
|
@@ -6969,13 +7186,13 @@ var STORY_KIND_PATH_SEPARATOR = /\s*\/\s*/, extractTitle = (title) => {
|
|
|
6969
7186
|
throw error;
|
|
6970
7187
|
}
|
|
6971
7188
|
let content = children || extractTitle(preparedMeta?.title || "");
|
|
6972
|
-
return content ?
|
|
6973
|
-
};
|
|
7189
|
+
return content ? React52.createElement(Title, { className: "sbdocs-title sb-unstyled" }, content) : null;
|
|
7190
|
+
}, Title3 = withMdxComponentOverride("Title", TitleImpl);
|
|
6974
7191
|
|
|
6975
7192
|
// src/blocks/blocks/DocsPage.tsx
|
|
6976
7193
|
var DocsPage = () => {
|
|
6977
7194
|
let resolvedOf = useOf("meta", ["meta"]), { stories } = resolvedOf.csfFile, isSingleStory = Object.keys(stories).length === 1;
|
|
6978
|
-
return
|
|
7195
|
+
return React53.createElement(React53.Fragment, null, React53.createElement(Title3, null), React53.createElement(Subtitle2, null), React53.createElement(Description2, { of: "meta" }), isSingleStory ? React53.createElement(Description2, { of: "story" }) : null, React53.createElement(Primary, null), React53.createElement(Controls3, null), isSingleStory ? null : React53.createElement(Stories, null));
|
|
6979
7196
|
};
|
|
6980
7197
|
|
|
6981
7198
|
// src/blocks/blocks/Docs.tsx
|
|
@@ -6984,11 +7201,11 @@ function Docs({
|
|
|
6984
7201
|
docsParameter
|
|
6985
7202
|
}) {
|
|
6986
7203
|
let Container2 = docsParameter.container || DocsContainer, Page = docsParameter.page || DocsPage;
|
|
6987
|
-
return
|
|
7204
|
+
return React54.createElement(Container2, { context, theme: docsParameter.theme }, React54.createElement(Page, null));
|
|
6988
7205
|
}
|
|
6989
7206
|
|
|
6990
7207
|
// src/blocks/blocks/external/ExternalDocs.tsx
|
|
6991
|
-
import
|
|
7208
|
+
import React55, { useRef as useRef6 } from "react";
|
|
6992
7209
|
import { composeConfigs as composeConfigs2 } from "storybook/preview-api";
|
|
6993
7210
|
|
|
6994
7211
|
// src/blocks/blocks/external/ExternalPreview.ts
|
|
@@ -7080,34 +7297,34 @@ function ExternalDocs({
|
|
|
7080
7297
|
...projectAnnotations.parameters?.docs,
|
|
7081
7298
|
page: () => children
|
|
7082
7299
|
};
|
|
7083
|
-
return
|
|
7300
|
+
return React55.createElement(Docs, { docsParameter, context: preview2.docsContext() });
|
|
7084
7301
|
}
|
|
7085
7302
|
|
|
7086
7303
|
// src/blocks/blocks/external/ExternalDocsContainer.tsx
|
|
7087
|
-
import
|
|
7304
|
+
import React56 from "react";
|
|
7088
7305
|
import { ThemeProvider as ThemeProvider2, ensure, themes } from "storybook/theming";
|
|
7089
|
-
var preview, ExternalDocsContainer = ({ projectAnnotations, children }) => (preview || (preview = new ExternalPreview(projectAnnotations)),
|
|
7306
|
+
var preview, ExternalDocsContainer = ({ projectAnnotations, children }) => (preview || (preview = new ExternalPreview(projectAnnotations)), React56.createElement(DocsContext.Provider, { value: preview.docsContext() }, React56.createElement(ThemeProvider2, { theme: ensure(themes.light) }, children)));
|
|
7090
7307
|
|
|
7091
7308
|
// src/blocks/blocks/Meta.tsx
|
|
7092
|
-
import
|
|
7309
|
+
import React57, { useContext as useContext10 } from "react";
|
|
7093
7310
|
var Meta = ({ of }) => {
|
|
7094
7311
|
let context = useContext10(DocsContext);
|
|
7095
7312
|
of && context.referenceMeta(of, !0);
|
|
7096
7313
|
try {
|
|
7097
7314
|
let primary = context.storyById();
|
|
7098
|
-
return
|
|
7315
|
+
return React57.createElement(Anchor, { storyId: primary.id });
|
|
7099
7316
|
} catch {
|
|
7100
7317
|
return null;
|
|
7101
7318
|
}
|
|
7102
7319
|
};
|
|
7103
7320
|
|
|
7104
7321
|
// src/blocks/blocks/Unstyled.tsx
|
|
7105
|
-
import
|
|
7106
|
-
var
|
|
7322
|
+
import React58 from "react";
|
|
7323
|
+
var UnstyledImpl = (props) => React58.createElement("div", { ...props, className: "sb-unstyled" }), Unstyled = withMdxComponentOverride("Unstyled", UnstyledImpl);
|
|
7107
7324
|
|
|
7108
7325
|
// src/blocks/blocks/Wrapper.tsx
|
|
7109
|
-
import
|
|
7110
|
-
var
|
|
7326
|
+
import React59 from "react";
|
|
7327
|
+
var WrapperImpl = ({ children }) => React59.createElement("div", { style: { fontFamily: "sans-serif" } }, children), Wrapper9 = withMdxComponentOverride("Wrapper", WrapperImpl);
|
|
7111
7328
|
|
|
7112
7329
|
// src/blocks/blocks/types.ts
|
|
7113
7330
|
var PRIMARY_STORY = "^";
|
|
@@ -7124,7 +7341,7 @@ export {
|
|
|
7124
7341
|
ColorPalette,
|
|
7125
7342
|
Controls3 as Controls,
|
|
7126
7343
|
DateControl,
|
|
7127
|
-
|
|
7344
|
+
Description2 as Description,
|
|
7128
7345
|
DescriptionType,
|
|
7129
7346
|
Docs,
|
|
7130
7347
|
DocsContainer,
|