@makeswift/runtime 0.8.5 → 0.8.7
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/Box.cjs.js +11 -11
- package/dist/Box.cjs.js.map +1 -1
- package/dist/Box.es.js +9 -9
- package/dist/Box.es.js.map +1 -1
- package/dist/Button.cjs.js +36 -37
- package/dist/Button.cjs.js.map +1 -1
- package/dist/Button.es.js +13 -14
- package/dist/Button.es.js.map +1 -1
- package/dist/Carousel.cjs.js +38 -37
- package/dist/Carousel.cjs.js.map +1 -1
- package/dist/Carousel.es.js +19 -18
- package/dist/Carousel.es.js.map +1 -1
- package/dist/Countdown.cjs.js +55 -29
- package/dist/Countdown.cjs.js.map +1 -1
- package/dist/Countdown.es.js +35 -9
- package/dist/Countdown.es.js.map +1 -1
- package/dist/Divider.cjs.js +36 -10
- package/dist/Divider.cjs.js.map +1 -1
- package/dist/Divider.es.js +31 -5
- package/dist/Divider.es.js.map +1 -1
- package/dist/Embed.cjs.js +31 -5
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +30 -4
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +72 -73
- package/dist/Form.cjs.js.map +1 -1
- package/dist/Form.es.js +32 -33
- package/dist/Form.es.js.map +1 -1
- package/dist/Image.cjs.js +22 -21
- package/dist/Image.cjs.js.map +1 -1
- package/dist/Image.es.js +20 -19
- package/dist/Image.es.js.map +1 -1
- package/dist/LiveProvider.cjs.js +12 -12
- package/dist/LiveProvider.cjs.js.map +1 -1
- package/dist/LiveProvider.es.js +12 -12
- package/dist/LiveProvider.es.js.map +1 -1
- package/dist/Navigation.cjs.js +33 -34
- package/dist/Navigation.cjs.js.map +1 -1
- package/dist/Navigation.es.js +14 -15
- package/dist/Navigation.es.js.map +1 -1
- package/dist/PreviewProvider.cjs.js +16 -13
- package/dist/PreviewProvider.cjs.js.map +1 -1
- package/dist/PreviewProvider.es.js +16 -13
- package/dist/PreviewProvider.es.js.map +1 -1
- package/dist/ReadOnlyText.cjs.js +15 -16
- package/dist/ReadOnlyText.cjs.js.map +1 -1
- package/dist/ReadOnlyText.es.js +11 -12
- package/dist/ReadOnlyText.es.js.map +1 -1
- package/dist/Root.cjs.js +10 -10
- package/dist/Root.cjs.js.map +1 -1
- package/dist/Root.es.js +8 -8
- package/dist/SocialLinks.cjs.js +12 -13
- package/dist/SocialLinks.cjs.js.map +1 -1
- package/dist/SocialLinks.es.js +7 -8
- package/dist/SocialLinks.es.js.map +1 -1
- package/dist/Text.cjs.js +3 -4
- package/dist/Text.cjs.js.map +1 -1
- package/dist/Text.es.js +4 -5
- package/dist/Text.es.js.map +1 -1
- package/dist/Video.cjs.js +31 -5
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +30 -4
- package/dist/Video.es.js.map +1 -1
- package/dist/actions.cjs.js +6 -1
- package/dist/actions.cjs.js.map +1 -1
- package/dist/actions.es.js +6 -2
- package/dist/actions.es.js.map +1 -1
- package/dist/components.cjs.js +10 -10
- package/dist/components.es.js +10 -10
- package/dist/constants.cjs.js +13 -3
- package/dist/constants.cjs.js.map +1 -1
- package/dist/constants.es.js +13 -4
- package/dist/constants.es.js.map +1 -1
- package/dist/descriptors.cjs.js.map +1 -1
- package/dist/descriptors.es.js.map +1 -1
- package/dist/index.cjs.js +1010 -163
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs2.js +29 -29
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs3.js +1 -2
- package/dist/index.cjs3.js.map +1 -1
- package/dist/index.cjs4.js +2 -2
- package/dist/index.cjs4.js.map +1 -1
- package/dist/index.cjs5.js +262 -109
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.cjs6.js +3 -4
- package/dist/index.cjs6.js.map +1 -1
- package/dist/index.cjs7.js +16 -17
- package/dist/index.cjs7.js.map +1 -1
- package/dist/index.es.js +965 -133
- package/dist/index.es.js.map +1 -1
- package/dist/index.es2.js +6 -6
- package/dist/index.es2.js.map +1 -1
- package/dist/index.es3.js +1 -2
- package/dist/index.es3.js.map +1 -1
- package/dist/index.es4.js +2 -2
- package/dist/index.es4.js.map +1 -1
- package/dist/index.es5.js +262 -109
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es6.js +3 -4
- package/dist/index.es6.js.map +1 -1
- package/dist/index.es7.js +12 -13
- package/dist/index.es7.js.map +1 -1
- package/dist/introspection.cjs.js +5 -2
- package/dist/introspection.cjs.js.map +1 -1
- package/dist/introspection.es.js +4 -2
- package/dist/introspection.es.js.map +1 -1
- package/dist/leaf.cjs.js +15 -17
- package/dist/leaf.cjs.js.map +1 -1
- package/dist/leaf.es.js +10 -11
- package/dist/leaf.es.js.map +1 -1
- package/dist/main.cjs.js +2 -1
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +2 -2
- package/dist/next.cjs.js +5 -6
- package/dist/next.cjs.js.map +1 -1
- package/dist/next.es.js +6 -7
- package/dist/next.es.js.map +1 -1
- package/dist/prop-controllers.cjs.js +0 -1
- package/dist/prop-controllers.cjs.js.map +1 -1
- package/dist/prop-controllers.es.js +0 -1
- package/dist/prop-controllers.es.js.map +1 -1
- package/dist/react.cjs.js +3 -4
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.es.js +3 -4
- package/dist/react.es.js.map +1 -1
- package/dist/slate.cjs.js +1 -12
- package/dist/slate.cjs.js.map +1 -1
- package/dist/slate.es.js +1 -12
- package/dist/slate.es.js.map +1 -1
- package/dist/state/breakpoints.cjs.js +175 -0
- package/dist/state/breakpoints.cjs.js.map +1 -0
- package/dist/state/breakpoints.es.js +160 -0
- package/dist/state/breakpoints.es.js.map +1 -0
- package/dist/types/src/components/builtin/Box/Box.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Box/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Button/Button.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Button/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Carousel/Carousel.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Carousel/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Countdown/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
- package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Form/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Image/Image.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Navigation/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/SocialLinks/register.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +0 -4
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/register.d.ts.map +1 -1
- package/dist/types/src/components/hooks/useMediaQuery.d.ts.map +1 -1
- package/dist/types/src/components/utils/drop-first.d.ts +2 -0
- package/dist/types/src/components/utils/drop-first.d.ts.map +1 -0
- package/dist/types/src/components/utils/responsive-style.d.ts +21 -10
- package/dist/types/src/components/utils/responsive-style.d.ts.map +1 -1
- package/dist/types/src/controls/types.d.ts +1 -1
- package/dist/types/src/controls/types.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/next/api-handler/handlers/manifest.d.ts +1 -0
- package/dist/types/src/next/api-handler/handlers/manifest.d.ts.map +1 -1
- package/dist/types/src/next/client.d.ts +4 -1
- package/dist/types/src/next/client.d.ts.map +1 -1
- package/dist/types/src/next/index.d.ts +3 -1
- package/dist/types/src/next/index.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/descriptors.d.ts +1 -1
- package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/components/LiveProvider.d.ts +3 -1
- package/dist/types/src/runtimes/react/components/LiveProvider.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/components/PreviewProvider.d.ts +3 -1
- package/dist/types/src/runtimes/react/components/PreviewProvider.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/index.d.ts +22 -4
- package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/clearBlockKeyForDevice.d.ts +2 -2
- package/dist/types/src/slate/BlockPlugin/clearBlockKeyForDevice.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/index.d.ts +4 -0
- package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts +7 -3
- package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/types.d.ts +2 -2
- package/dist/types/src/slate/BlockPlugin/types.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts +4 -0
- package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts.map +1 -0
- package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts +4 -0
- package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts.map +1 -0
- package/dist/types/src/slate/ListPlugin/toggleList.d.ts +2 -1
- package/dist/types/src/slate/ListPlugin/toggleList.d.ts.map +1 -1
- package/dist/types/src/slate/ListPlugin/unwrapList.d.ts +6 -2
- package/dist/types/src/slate/ListPlugin/unwrapList.d.ts.map +1 -1
- package/dist/types/src/slate/ListPlugin/utils/getSelectedListItems.d.ts +0 -1
- package/dist/types/src/slate/ListPlugin/utils/getSelectedListItems.d.ts.map +1 -1
- package/dist/types/src/slate/ListPlugin/wrapList.d.ts +2 -1
- package/dist/types/src/slate/ListPlugin/wrapList.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/clearActiveTypographyStyle.d.ts +6 -2
- package/dist/types/src/slate/TypographyPlugin/clearActiveTypographyStyle.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/clearDeviceActiveTypography.d.ts +6 -2
- package/dist/types/src/slate/TypographyPlugin/clearDeviceActiveTypography.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts +6 -2
- package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/setActiveTypographyId.d.ts +6 -2
- package/dist/types/src/slate/TypographyPlugin/setActiveTypographyId.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts +7 -2
- package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts.map +1 -1
- package/dist/types/src/slate/selectors.d.ts +19 -0
- package/dist/types/src/slate/selectors.d.ts.map +1 -0
- package/dist/types/src/slate/utils/editor.d.ts.map +1 -1
- package/dist/types/src/slate/utils/element.d.ts +2 -1
- package/dist/types/src/slate/utils/element.d.ts.map +1 -1
- package/dist/types/src/slate/utils/unhangRange.d.ts +10 -0
- package/dist/types/src/slate/utils/unhangRange.d.ts.map +1 -0
- package/dist/types/src/state/actions.d.ts +10 -1
- package/dist/types/src/state/actions.d.ts.map +1 -1
- package/dist/types/src/state/modules/breakpoints.d.ts +44 -0
- package/dist/types/src/state/modules/breakpoints.d.ts.map +1 -0
- package/dist/types/src/state/react-builder-preview.d.ts +2 -0
- package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
- package/dist/types/src/state/react-page.d.ts +5 -1
- package/dist/types/src/state/react-page.d.ts.map +1 -1
- package/dist/types/src/utils/isNonNullable.d.ts +2 -0
- package/dist/types/src/utils/isNonNullable.d.ts.map +1 -0
- package/dist/useMediaQuery.cjs.js +38 -0
- package/dist/useMediaQuery.cjs.js.map +1 -0
- package/dist/useMediaQuery.es.js +37 -0
- package/dist/useMediaQuery.es.js.map +1 -0
- package/package.json +10 -2
- package/state/breakpoints.js +1 -0
- package/dist/isNonNullable.cjs.js +0 -6
- package/dist/isNonNullable.cjs.js.map +0 -1
- package/dist/isNonNullable.es.js +0 -5
- package/dist/isNonNullable.es.js.map +0 -1
- package/dist/responsive-style.cjs.js +0 -917
- package/dist/responsive-style.cjs.js.map +0 -1
- package/dist/responsive-style.es.js +0 -853
- package/dist/responsive-style.es.js.map +0 -1
- package/dist/types/src/components/utils/devices.d.ts +0 -17
- package/dist/types/src/components/utils/devices.d.ts.map +0 -1
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __spreadValues = (a, b) => {
|
|
8
|
+
for (var prop in b || (b = {}))
|
|
9
|
+
if (__hasOwnProp.call(b, prop))
|
|
10
|
+
__defNormalProp(a, prop, b[prop]);
|
|
11
|
+
if (__getOwnPropSymbols)
|
|
12
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
13
|
+
if (__propIsEnum.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
}
|
|
16
|
+
return a;
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
19
|
+
var actions = require("../actions.cjs.js");
|
|
20
|
+
const keys = (o) => Object.keys(o);
|
|
21
|
+
const coalesce = (...args) => {
|
|
22
|
+
let i;
|
|
23
|
+
for (i = 0; i < args.length - 1; i += 1) {
|
|
24
|
+
if (args[i] != null)
|
|
25
|
+
return args[i];
|
|
26
|
+
}
|
|
27
|
+
return args[i];
|
|
28
|
+
};
|
|
29
|
+
function shallowMerge(a, b) {
|
|
30
|
+
const bKeys = keys(b);
|
|
31
|
+
const merged = __spreadValues({}, a);
|
|
32
|
+
bKeys.forEach((key) => {
|
|
33
|
+
merged[key] = coalesce(merged[key], b[key]);
|
|
34
|
+
});
|
|
35
|
+
return merged;
|
|
36
|
+
}
|
|
37
|
+
const DefaultBreakpointID = {
|
|
38
|
+
Desktop: "desktop",
|
|
39
|
+
Tablet: "tablet",
|
|
40
|
+
Mobile: "mobile"
|
|
41
|
+
};
|
|
42
|
+
const DEFAULT_BREAKPOINTS = [
|
|
43
|
+
{
|
|
44
|
+
id: DefaultBreakpointID.Desktop,
|
|
45
|
+
label: "Desktop",
|
|
46
|
+
minWidth: 769
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: DefaultBreakpointID.Tablet,
|
|
50
|
+
label: "Tablet",
|
|
51
|
+
minWidth: 576,
|
|
52
|
+
maxWidth: 768,
|
|
53
|
+
viewportWidth: 760
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: DefaultBreakpointID.Mobile,
|
|
57
|
+
label: "Mobile",
|
|
58
|
+
maxWidth: 575,
|
|
59
|
+
viewportWidth: 390
|
|
60
|
+
}
|
|
61
|
+
];
|
|
62
|
+
function getInitialState(breakpoints = DEFAULT_BREAKPOINTS) {
|
|
63
|
+
return breakpoints;
|
|
64
|
+
}
|
|
65
|
+
function reducer(state = getInitialState(), action) {
|
|
66
|
+
switch (action.type) {
|
|
67
|
+
case actions.ActionTypes.SET_BREAKPOINTS: {
|
|
68
|
+
const breakpoints = action.payload.breakpoints;
|
|
69
|
+
if (breakpoints.length === 0)
|
|
70
|
+
throw new Error("Breakpoints cannot be empty.");
|
|
71
|
+
return breakpoints;
|
|
72
|
+
}
|
|
73
|
+
default:
|
|
74
|
+
return state;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function parseBreakpointsInput(input) {
|
|
78
|
+
const breakpoints = Object.entries(input).map(([id, { label, min, max, viewport }]) => ({
|
|
79
|
+
id,
|
|
80
|
+
label: label != null ? label : id,
|
|
81
|
+
minWidth: min,
|
|
82
|
+
maxWidth: max,
|
|
83
|
+
viewportWidth: viewport
|
|
84
|
+
}));
|
|
85
|
+
return sortBreakpoints(breakpoints);
|
|
86
|
+
}
|
|
87
|
+
function sortBreakpoints(breakpoints) {
|
|
88
|
+
return breakpoints.sort((a, b) => {
|
|
89
|
+
var _a, _b;
|
|
90
|
+
return ((_a = b == null ? void 0 : b.minWidth) != null ? _a : 0) - ((_b = a == null ? void 0 : a.minWidth) != null ? _b : 0);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
const getBreakpoint = (state, breakpointId) => {
|
|
94
|
+
const breakpoint = state.find(({ id }) => id === breakpointId);
|
|
95
|
+
if (breakpoint == null)
|
|
96
|
+
throw new Error(`Unrecognized breakpoint ID: "${breakpointId}".`);
|
|
97
|
+
return breakpoint;
|
|
98
|
+
};
|
|
99
|
+
const getBaseBreakpoint = (breakpoints) => {
|
|
100
|
+
const breakpoint = sortBreakpoints(breakpoints)[0];
|
|
101
|
+
if (breakpoint == null)
|
|
102
|
+
throw new Error(`Cannot get base breakpoint.`);
|
|
103
|
+
return breakpoint;
|
|
104
|
+
};
|
|
105
|
+
function findBreakpointOverride(breakpoints, values = [], deviceId, strategy = defaultStrategy) {
|
|
106
|
+
const value = values.find(({ deviceId: d }) => d === deviceId);
|
|
107
|
+
const fallbacks = breakpoints.slice(0, breakpoints.findIndex((d) => d.id === deviceId) + 1).reverse().map((d) => values.find((v) => v.deviceId === d.id)).filter((override) => Boolean(override));
|
|
108
|
+
return value != null || fallbacks.length > 0 ? strategy(value, fallbacks) : void 0;
|
|
109
|
+
}
|
|
110
|
+
function defaultStrategy(value, fallbacks) {
|
|
111
|
+
return value || fallbacks[0];
|
|
112
|
+
}
|
|
113
|
+
function shallowMergeFallbacks(value, fallbacks) {
|
|
114
|
+
return [value, ...fallbacks].filter((override) => Boolean(override)).reduce((a, b) => ({
|
|
115
|
+
deviceId: a.deviceId || b.deviceId,
|
|
116
|
+
value: shallowMerge(a.value, b.value)
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
function join(breakpoints, responsiveValues, joinFn, strategy) {
|
|
120
|
+
return breakpoints.map(({ id }) => id).map((deviceId) => {
|
|
121
|
+
const value = joinFn(responsiveValues.map((responsiveValue) => {
|
|
122
|
+
const deviceValue = responsiveValue && findBreakpointOverride(breakpoints, responsiveValue, deviceId, strategy);
|
|
123
|
+
return deviceValue == null ? void 0 : deviceValue.value;
|
|
124
|
+
}));
|
|
125
|
+
if (value == null)
|
|
126
|
+
return null;
|
|
127
|
+
return { deviceId, value };
|
|
128
|
+
}).filter((override) => Boolean(override));
|
|
129
|
+
}
|
|
130
|
+
const getBreakpointMediaQuery = (breakpoint) => {
|
|
131
|
+
const parts = ["@media only screen"];
|
|
132
|
+
if (breakpoint.minWidth != null) {
|
|
133
|
+
parts.push(`(min-width: ${breakpoint.minWidth}px)`);
|
|
134
|
+
}
|
|
135
|
+
if (breakpoint.maxWidth != null) {
|
|
136
|
+
parts.push(`(max-width: ${breakpoint.maxWidth}px)`);
|
|
137
|
+
}
|
|
138
|
+
return parts.join(" and ");
|
|
139
|
+
};
|
|
140
|
+
const getViewportStyle = (state, deviceId) => {
|
|
141
|
+
const device = getBreakpoint(state, deviceId);
|
|
142
|
+
return device && {
|
|
143
|
+
width: device.viewportWidth != null ? device.viewportWidth : "100%",
|
|
144
|
+
minWidth: device.minWidth
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
function findNextFallback(breakpoints, value, deviceId, activeDeviceId, fallbackStrategy) {
|
|
148
|
+
var _a;
|
|
149
|
+
const deviceOverride = findBreakpointOverride(breakpoints, value.filter((v) => v.deviceId !== activeDeviceId), deviceId, fallbackStrategy);
|
|
150
|
+
return (_a = deviceOverride && getBreakpoint(breakpoints, deviceOverride.deviceId)) != null ? _a : null;
|
|
151
|
+
}
|
|
152
|
+
const mergeResponsiveValues = (breakpoints, source, override) => {
|
|
153
|
+
const devices = [
|
|
154
|
+
...new Set(source.map(({ deviceId }) => deviceId).concat(override.map(({ deviceId }) => deviceId)))
|
|
155
|
+
];
|
|
156
|
+
return devices.map((deviceId) => ({
|
|
157
|
+
deviceId,
|
|
158
|
+
value: __spreadValues(__spreadValues({}, (findBreakpointOverride(breakpoints, source, deviceId) || { value: {} }).value), (findBreakpointOverride(breakpoints, override, deviceId, (v) => v) || { value: {} }).value)
|
|
159
|
+
}));
|
|
160
|
+
};
|
|
161
|
+
exports.DEFAULT_BREAKPOINTS = DEFAULT_BREAKPOINTS;
|
|
162
|
+
exports.DefaultBreakpointID = DefaultBreakpointID;
|
|
163
|
+
exports.findBreakpointOverride = findBreakpointOverride;
|
|
164
|
+
exports.findNextFallback = findNextFallback;
|
|
165
|
+
exports.getBaseBreakpoint = getBaseBreakpoint;
|
|
166
|
+
exports.getBreakpoint = getBreakpoint;
|
|
167
|
+
exports.getBreakpointMediaQuery = getBreakpointMediaQuery;
|
|
168
|
+
exports.getInitialState = getInitialState;
|
|
169
|
+
exports.getViewportStyle = getViewportStyle;
|
|
170
|
+
exports.join = join;
|
|
171
|
+
exports.mergeResponsiveValues = mergeResponsiveValues;
|
|
172
|
+
exports.parseBreakpointsInput = parseBreakpointsInput;
|
|
173
|
+
exports.reducer = reducer;
|
|
174
|
+
exports.shallowMergeFallbacks = shallowMergeFallbacks;
|
|
175
|
+
//# sourceMappingURL=breakpoints.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breakpoints.cjs.js","sources":["../../src/utils/keys.ts","../../src/utils/coalesce.ts","../../src/utils/shallowMerge.ts","../../src/state/modules/breakpoints.ts"],"sourcesContent":["const keys = <O extends { [key: string]: unknown }>(o: O): (keyof O)[] => Object.keys(o)\n\nexport default keys\n","const coalesce = <T>(...args: Array<T>): T => {\n let i: number\n\n for (i = 0; i < args.length - 1; i += 1) {\n if (args[i] != null) return args[i]\n }\n\n return args[i]\n}\n\nexport default coalesce\n","import keys from './keys'\nimport coalesce from './coalesce'\n\nexport default function shallowMerge<\n A extends Record<string, unknown>,\n B extends Record<string, unknown>,\n>(a: A, b: B): A & B {\n const bKeys = keys(b)\n const merged = { ...a } as A & B\n\n bKeys.forEach(key => {\n // @ts-expect-error: `coalesce` returns `null | undefined` regardless of input guarantees.\n merged[key] = coalesce(merged[key], b[key])\n })\n\n return merged\n}\n","import { Viewport } from 'csstype'\n\nimport {\n ResponsiveValue as PropControllerResponsiveValue,\n DeviceOverride as PropControllerDeviceOverride,\n Device as DeviceId,\n} from '../../prop-controllers'\nimport shallowMerge from '../../utils/shallowMerge'\nimport { Action, ActionTypes } from '../actions'\n\nexport type DeviceOverride<T> = PropControllerDeviceOverride<T>\nexport type ResponsiveValue<T> = PropControllerResponsiveValue<T>\nexport type BreakpointId = DeviceId\n\nexport type Breakpoint = {\n id: BreakpointId\n label: string\n viewportWidth?: number\n minWidth?: number\n maxWidth?: number\n}\n\nexport type Breakpoints = Breakpoint[]\n\nexport type State = Breakpoints\n\nexport const DefaultBreakpointID = {\n Desktop: 'desktop',\n Tablet: 'tablet',\n Mobile: 'mobile',\n} as const\n\ntype DefaultBreakpointID = typeof DefaultBreakpointID[keyof typeof DefaultBreakpointID]\n\nexport const DEFAULT_BREAKPOINTS: Breakpoints = [\n {\n id: DefaultBreakpointID.Desktop,\n label: 'Desktop',\n minWidth: 769,\n },\n {\n id: DefaultBreakpointID.Tablet,\n label: 'Tablet',\n minWidth: 576,\n maxWidth: 768,\n viewportWidth: 760,\n },\n {\n id: DefaultBreakpointID.Mobile,\n label: 'Mobile',\n maxWidth: 575,\n viewportWidth: 390,\n },\n]\n\nexport function getInitialState(breakpoints = DEFAULT_BREAKPOINTS): State {\n return breakpoints\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.SET_BREAKPOINTS: {\n const breakpoints = action.payload.breakpoints\n\n if (breakpoints.length === 0) throw new Error('Breakpoints cannot be empty.')\n\n return breakpoints\n }\n\n default:\n return state\n }\n}\n\nexport type BreakpointsInput = Record<\n string,\n { label?: string; min?: number; max?: number; viewport?: number }\n>\n\nexport function parseBreakpointsInput(input: BreakpointsInput): Breakpoints {\n const breakpoints = Object.entries(input).map(([id, { label, min, max, viewport }]) => ({\n id,\n label: label ?? id,\n minWidth: min,\n maxWidth: max,\n viewportWidth: viewport,\n }))\n\n return sortBreakpoints(breakpoints)\n}\n\n// Sort breakpoints by minWidth in descending order\nfunction sortBreakpoints(breakpoints: Breakpoints): Breakpoints {\n return breakpoints.sort((a, b) => (b?.minWidth ?? 0) - (a?.minWidth ?? 0))\n}\n\nexport const getBreakpoint = (state: State, breakpointId: Breakpoint['id']): Breakpoint => {\n const breakpoint = state.find(({ id }) => id === breakpointId)\n\n if (breakpoint == null) throw new Error(`Unrecognized breakpoint ID: \"${breakpointId}\".`)\n\n return breakpoint\n}\n\nexport const getBaseBreakpoint = (breakpoints: Breakpoints): Breakpoint => {\n const breakpoint = sortBreakpoints(breakpoints)[0]\n\n if (breakpoint == null) throw new Error(`Cannot get base breakpoint.`)\n\n return breakpoint\n}\n\nexport function findBreakpointOverride<S>(\n breakpoints: Breakpoints,\n values: ResponsiveValue<S> = [],\n deviceId: string,\n strategy: FallbackStrategy<S> = defaultStrategy,\n): DeviceOverride<S> | undefined {\n const value = values.find(({ deviceId: d }) => d === deviceId)\n const fallbacks = breakpoints\n .slice(0, breakpoints.findIndex(d => d.id === deviceId) + 1)\n .reverse()\n .map(d => values.find(v => v.deviceId === d.id))\n .filter((override): override is DeviceOverride<S> => Boolean(override))\n\n return value != null || fallbacks.length > 0 ? strategy(value, fallbacks) : undefined\n}\n\nexport type FallbackStrategy<V> = (\n arg0: DeviceOverride<V> | undefined,\n arg1: ResponsiveValue<V>,\n) => DeviceOverride<V> | undefined\n\nfunction defaultStrategy<V>(\n value: DeviceOverride<V> | undefined,\n fallbacks: ResponsiveValue<V>,\n): DeviceOverride<V> | undefined {\n return value || fallbacks[0]\n}\n\nexport function shallowMergeFallbacks<V extends Record<string, unknown>>(\n value: DeviceOverride<V> | undefined,\n fallbacks: ResponsiveValue<V>,\n): DeviceOverride<V> | undefined {\n return [value, ...fallbacks]\n .filter((override): override is DeviceOverride<V> => Boolean(override))\n .reduce((a, b) => ({\n deviceId: a.deviceId || b.deviceId,\n value: shallowMerge(a.value, b.value),\n }))\n}\n\nexport type ExtractResponsiveValue<T> = T extends ResponsiveValue<infer V> ? V : never\n\nexport function join<V, A extends ReadonlyArray<ResponsiveValue<V> | null | undefined>, R>(\n breakpoints: Breakpoints,\n responsiveValues: A,\n joinFn: (values: { [I in keyof A]: ExtractResponsiveValue<A[I]> | undefined }) => R,\n strategy?: FallbackStrategy<V>,\n): ResponsiveValue<R> {\n return breakpoints\n .map(({ id }) => id)\n .map(deviceId => {\n const value = joinFn(\n responsiveValues.map(responsiveValue => {\n const deviceValue =\n responsiveValue &&\n findBreakpointOverride(breakpoints, responsiveValue, deviceId, strategy)\n\n return deviceValue == null ? undefined : deviceValue.value\n }) as unknown as { [I in keyof A]: ExtractResponsiveValue<A[I] | undefined> },\n )\n\n if (value == null) return null\n\n return { deviceId, value }\n })\n .filter((override): override is DeviceOverride<R> => Boolean(override))\n}\n\nexport const getBreakpointMediaQuery = (breakpoint: Breakpoint): string => {\n const parts = ['@media only screen']\n\n if (breakpoint.minWidth != null) {\n parts.push(`(min-width: ${breakpoint.minWidth}px)`)\n }\n\n if (breakpoint.maxWidth != null) {\n parts.push(`(max-width: ${breakpoint.maxWidth}px)`)\n }\n\n return parts.join(' and ')\n}\n\nexport const getViewportStyle = (\n state: State,\n deviceId: string,\n): Viewport<string | number> | null | undefined => {\n const device = getBreakpoint(state, deviceId)\n\n return (\n device && {\n width: device.viewportWidth != null ? device.viewportWidth : '100%',\n minWidth: device.minWidth,\n }\n )\n}\n\nexport function findNextFallback<V>(\n breakpoints: Breakpoints,\n value: ResponsiveValue<V>,\n deviceId: BreakpointId,\n activeDeviceId: BreakpointId,\n fallbackStrategy?: FallbackStrategy<V>,\n): Breakpoint | null {\n const deviceOverride = findBreakpointOverride(\n breakpoints,\n value.filter(v => v.deviceId !== activeDeviceId),\n deviceId,\n fallbackStrategy,\n )\n\n return (deviceOverride && getBreakpoint(breakpoints, deviceOverride.deviceId)) ?? null\n}\n\nexport const mergeResponsiveValues = <A>(\n breakpoints: Breakpoints,\n source: DeviceOverride<A>[],\n override: DeviceOverride<A>[],\n): DeviceOverride<A>[] => {\n const devices = [\n ...new Set(\n source.map(({ deviceId }) => deviceId).concat(override.map(({ deviceId }) => deviceId)),\n ),\n ]\n\n return devices.map(deviceId => ({\n deviceId,\n value: {\n ...(findBreakpointOverride(breakpoints, source, deviceId) || { value: {} }).value,\n ...(findBreakpointOverride(breakpoints, override, deviceId, v => v) || { value: {} }).value,\n },\n })) as DeviceOverride<A>[]\n}\n"],"names":["ActionTypes"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,MAAM,OAAO,CAAuC,MAAsB,OAAO,KAAK,CAAC;ACAvF,MAAM,WAAW,IAAO,SAAsB;AACxC,MAAA;AAEJ,OAAK,IAAI,GAAG,IAAI,KAAK,SAAS,GAAG,KAAK,GAAG;AACvC,QAAI,KAAK,MAAM;AAAM,aAAO,KAAK;AAAA,EACnC;AAEA,SAAO,KAAK;AACd;ACLA,sBAGE,GAAM,GAAa;AACb,QAAA,QAAQ,KAAK,CAAC;AACd,QAAA,SAAS,mBAAK;AAEpB,QAAM,QAAQ,CAAO,QAAA;AAEnB,WAAO,OAAO,SAAS,OAAO,MAAM,EAAE,IAAI;AAAA,EAAA,CAC3C;AAEM,SAAA;AACT;ACUO,MAAM,sBAAsB;AAAA,EACjC,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AACV;AAIO,MAAM,sBAAmC;AAAA,EAC9C;AAAA,IACE,IAAI,oBAAoB;AAAA,IACxB,OAAO;AAAA,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AACzB,UAAA,KAAK,eAAe,WAAW,aAAa;AAAA,EACpD;AAEI,MAAA,WAAW,YAAY,MAAM;AACzB,UAAA,KAAK,eAAe,WAAW,aAAa;AAAA,EACpD;AAEO,SAAA,MAAM,KAAK,OAAO;AAC3B;AAEa,MAAA,mBAAmB,CAC9B,OACA,aACiD;AAC3C,QAAA,SAAS,cAAc,OAAO,QAAQ;AAE5C,SACE,UAAU;AAAA,IACR,OAAO,OAAO,iBAAiB,OAAO,OAAO,gBAAgB;AAAA,IAC7D,UAAU,OAAO;AAAA,EAAA;AAGvB;AAEO,0BACL,aACA,OACA,UACA,gBACA,kBACmB;;AACb,QAAA,iBAAiB,uBACrB,aACA,MAAM,OAAO,CAAK,MAAA,EAAE,aAAa,cAAc,GAC/C,UACA,gBACF;AAEA,SAA0B,wBAAA,cAAc,aAAa,eAAe,QAAQ,MAAlD,YAAwD;AACpF;AAEO,MAAM,wBAAwB,CACnC,aACA,QACA,aACwB;AACxB,QAAM,UAAU;AAAA,IACd,GAAG,IAAI,IACL,OAAO,IAAI,CAAC,EAAE,eAAe,QAAQ,EAAE,OAAO,SAAS,IAAI,CAAC,EAAE,eAAe,QAAQ,CAAC,CACxF;AAAA,EAAA;AAGK,SAAA,QAAQ,IAAI,CAAa,aAAA;AAAA,IAC9B;AAAA,IACA,OAAO,kCACD,wBAAuB,aAAa,QAAQ,QAAQ,KAAK,EAAE,OAAO,CAAC,EAAA,GAAK,QACxE,wBAAuB,aAAa,UAAU,UAAU,CAAA,MAAK,CAAC,KAAK,EAAE,OAAO,CAAA,EAAM,GAAA;AAAA,EAExF,EAAA;AACJ;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
import { A as ActionTypes } from "../actions.es.js";
|
|
18
|
+
const keys = (o) => Object.keys(o);
|
|
19
|
+
const coalesce = (...args) => {
|
|
20
|
+
let i;
|
|
21
|
+
for (i = 0; i < args.length - 1; i += 1) {
|
|
22
|
+
if (args[i] != null)
|
|
23
|
+
return args[i];
|
|
24
|
+
}
|
|
25
|
+
return args[i];
|
|
26
|
+
};
|
|
27
|
+
function shallowMerge(a, b) {
|
|
28
|
+
const bKeys = keys(b);
|
|
29
|
+
const merged = __spreadValues({}, a);
|
|
30
|
+
bKeys.forEach((key) => {
|
|
31
|
+
merged[key] = coalesce(merged[key], b[key]);
|
|
32
|
+
});
|
|
33
|
+
return merged;
|
|
34
|
+
}
|
|
35
|
+
const DefaultBreakpointID = {
|
|
36
|
+
Desktop: "desktop",
|
|
37
|
+
Tablet: "tablet",
|
|
38
|
+
Mobile: "mobile"
|
|
39
|
+
};
|
|
40
|
+
const DEFAULT_BREAKPOINTS = [
|
|
41
|
+
{
|
|
42
|
+
id: DefaultBreakpointID.Desktop,
|
|
43
|
+
label: "Desktop",
|
|
44
|
+
minWidth: 769
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: DefaultBreakpointID.Tablet,
|
|
48
|
+
label: "Tablet",
|
|
49
|
+
minWidth: 576,
|
|
50
|
+
maxWidth: 768,
|
|
51
|
+
viewportWidth: 760
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: DefaultBreakpointID.Mobile,
|
|
55
|
+
label: "Mobile",
|
|
56
|
+
maxWidth: 575,
|
|
57
|
+
viewportWidth: 390
|
|
58
|
+
}
|
|
59
|
+
];
|
|
60
|
+
function getInitialState(breakpoints = DEFAULT_BREAKPOINTS) {
|
|
61
|
+
return breakpoints;
|
|
62
|
+
}
|
|
63
|
+
function reducer(state = getInitialState(), action) {
|
|
64
|
+
switch (action.type) {
|
|
65
|
+
case ActionTypes.SET_BREAKPOINTS: {
|
|
66
|
+
const breakpoints = action.payload.breakpoints;
|
|
67
|
+
if (breakpoints.length === 0)
|
|
68
|
+
throw new Error("Breakpoints cannot be empty.");
|
|
69
|
+
return breakpoints;
|
|
70
|
+
}
|
|
71
|
+
default:
|
|
72
|
+
return state;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function parseBreakpointsInput(input) {
|
|
76
|
+
const breakpoints = Object.entries(input).map(([id, { label, min, max, viewport }]) => ({
|
|
77
|
+
id,
|
|
78
|
+
label: label != null ? label : id,
|
|
79
|
+
minWidth: min,
|
|
80
|
+
maxWidth: max,
|
|
81
|
+
viewportWidth: viewport
|
|
82
|
+
}));
|
|
83
|
+
return sortBreakpoints(breakpoints);
|
|
84
|
+
}
|
|
85
|
+
function sortBreakpoints(breakpoints) {
|
|
86
|
+
return breakpoints.sort((a, b) => {
|
|
87
|
+
var _a, _b;
|
|
88
|
+
return ((_a = b == null ? void 0 : b.minWidth) != null ? _a : 0) - ((_b = a == null ? void 0 : a.minWidth) != null ? _b : 0);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
const getBreakpoint = (state, breakpointId) => {
|
|
92
|
+
const breakpoint = state.find(({ id }) => id === breakpointId);
|
|
93
|
+
if (breakpoint == null)
|
|
94
|
+
throw new Error(`Unrecognized breakpoint ID: "${breakpointId}".`);
|
|
95
|
+
return breakpoint;
|
|
96
|
+
};
|
|
97
|
+
const getBaseBreakpoint = (breakpoints) => {
|
|
98
|
+
const breakpoint = sortBreakpoints(breakpoints)[0];
|
|
99
|
+
if (breakpoint == null)
|
|
100
|
+
throw new Error(`Cannot get base breakpoint.`);
|
|
101
|
+
return breakpoint;
|
|
102
|
+
};
|
|
103
|
+
function findBreakpointOverride(breakpoints, values = [], deviceId, strategy = defaultStrategy) {
|
|
104
|
+
const value = values.find(({ deviceId: d }) => d === deviceId);
|
|
105
|
+
const fallbacks = breakpoints.slice(0, breakpoints.findIndex((d) => d.id === deviceId) + 1).reverse().map((d) => values.find((v) => v.deviceId === d.id)).filter((override) => Boolean(override));
|
|
106
|
+
return value != null || fallbacks.length > 0 ? strategy(value, fallbacks) : void 0;
|
|
107
|
+
}
|
|
108
|
+
function defaultStrategy(value, fallbacks) {
|
|
109
|
+
return value || fallbacks[0];
|
|
110
|
+
}
|
|
111
|
+
function shallowMergeFallbacks(value, fallbacks) {
|
|
112
|
+
return [value, ...fallbacks].filter((override) => Boolean(override)).reduce((a, b) => ({
|
|
113
|
+
deviceId: a.deviceId || b.deviceId,
|
|
114
|
+
value: shallowMerge(a.value, b.value)
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
function join(breakpoints, responsiveValues, joinFn, strategy) {
|
|
118
|
+
return breakpoints.map(({ id }) => id).map((deviceId) => {
|
|
119
|
+
const value = joinFn(responsiveValues.map((responsiveValue) => {
|
|
120
|
+
const deviceValue = responsiveValue && findBreakpointOverride(breakpoints, responsiveValue, deviceId, strategy);
|
|
121
|
+
return deviceValue == null ? void 0 : deviceValue.value;
|
|
122
|
+
}));
|
|
123
|
+
if (value == null)
|
|
124
|
+
return null;
|
|
125
|
+
return { deviceId, value };
|
|
126
|
+
}).filter((override) => Boolean(override));
|
|
127
|
+
}
|
|
128
|
+
const getBreakpointMediaQuery = (breakpoint) => {
|
|
129
|
+
const parts = ["@media only screen"];
|
|
130
|
+
if (breakpoint.minWidth != null) {
|
|
131
|
+
parts.push(`(min-width: ${breakpoint.minWidth}px)`);
|
|
132
|
+
}
|
|
133
|
+
if (breakpoint.maxWidth != null) {
|
|
134
|
+
parts.push(`(max-width: ${breakpoint.maxWidth}px)`);
|
|
135
|
+
}
|
|
136
|
+
return parts.join(" and ");
|
|
137
|
+
};
|
|
138
|
+
const getViewportStyle = (state, deviceId) => {
|
|
139
|
+
const device = getBreakpoint(state, deviceId);
|
|
140
|
+
return device && {
|
|
141
|
+
width: device.viewportWidth != null ? device.viewportWidth : "100%",
|
|
142
|
+
minWidth: device.minWidth
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
function findNextFallback(breakpoints, value, deviceId, activeDeviceId, fallbackStrategy) {
|
|
146
|
+
var _a;
|
|
147
|
+
const deviceOverride = findBreakpointOverride(breakpoints, value.filter((v) => v.deviceId !== activeDeviceId), deviceId, fallbackStrategy);
|
|
148
|
+
return (_a = deviceOverride && getBreakpoint(breakpoints, deviceOverride.deviceId)) != null ? _a : null;
|
|
149
|
+
}
|
|
150
|
+
const mergeResponsiveValues = (breakpoints, source, override) => {
|
|
151
|
+
const devices = [
|
|
152
|
+
...new Set(source.map(({ deviceId }) => deviceId).concat(override.map(({ deviceId }) => deviceId)))
|
|
153
|
+
];
|
|
154
|
+
return devices.map((deviceId) => ({
|
|
155
|
+
deviceId,
|
|
156
|
+
value: __spreadValues(__spreadValues({}, (findBreakpointOverride(breakpoints, source, deviceId) || { value: {} }).value), (findBreakpointOverride(breakpoints, override, deviceId, (v) => v) || { value: {} }).value)
|
|
157
|
+
}));
|
|
158
|
+
};
|
|
159
|
+
export { DEFAULT_BREAKPOINTS, DefaultBreakpointID, findBreakpointOverride, findNextFallback, getBaseBreakpoint, getBreakpoint, getBreakpointMediaQuery, getInitialState, getViewportStyle, join, mergeResponsiveValues, parseBreakpointsInput, reducer, shallowMergeFallbacks };
|
|
160
|
+
//# sourceMappingURL=breakpoints.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breakpoints.es.js","sources":["../../src/utils/keys.ts","../../src/utils/coalesce.ts","../../src/utils/shallowMerge.ts","../../src/state/modules/breakpoints.ts"],"sourcesContent":["const keys = <O extends { [key: string]: unknown }>(o: O): (keyof O)[] => Object.keys(o)\n\nexport default keys\n","const coalesce = <T>(...args: Array<T>): T => {\n let i: number\n\n for (i = 0; i < args.length - 1; i += 1) {\n if (args[i] != null) return args[i]\n }\n\n return args[i]\n}\n\nexport default coalesce\n","import keys from './keys'\nimport coalesce from './coalesce'\n\nexport default function shallowMerge<\n A extends Record<string, unknown>,\n B extends Record<string, unknown>,\n>(a: A, b: B): A & B {\n const bKeys = keys(b)\n const merged = { ...a } as A & B\n\n bKeys.forEach(key => {\n // @ts-expect-error: `coalesce` returns `null | undefined` regardless of input guarantees.\n merged[key] = coalesce(merged[key], b[key])\n })\n\n return merged\n}\n","import { Viewport } from 'csstype'\n\nimport {\n ResponsiveValue as PropControllerResponsiveValue,\n DeviceOverride as PropControllerDeviceOverride,\n Device as DeviceId,\n} from '../../prop-controllers'\nimport shallowMerge from '../../utils/shallowMerge'\nimport { Action, ActionTypes } from '../actions'\n\nexport type DeviceOverride<T> = PropControllerDeviceOverride<T>\nexport type ResponsiveValue<T> = PropControllerResponsiveValue<T>\nexport type BreakpointId = DeviceId\n\nexport type Breakpoint = {\n id: BreakpointId\n label: string\n viewportWidth?: number\n minWidth?: number\n maxWidth?: number\n}\n\nexport type Breakpoints = Breakpoint[]\n\nexport type State = Breakpoints\n\nexport const DefaultBreakpointID = {\n Desktop: 'desktop',\n Tablet: 'tablet',\n Mobile: 'mobile',\n} as const\n\ntype DefaultBreakpointID = typeof DefaultBreakpointID[keyof typeof DefaultBreakpointID]\n\nexport const DEFAULT_BREAKPOINTS: Breakpoints = [\n {\n id: DefaultBreakpointID.Desktop,\n label: 'Desktop',\n minWidth: 769,\n },\n {\n id: DefaultBreakpointID.Tablet,\n label: 'Tablet',\n minWidth: 576,\n maxWidth: 768,\n viewportWidth: 760,\n },\n {\n id: DefaultBreakpointID.Mobile,\n label: 'Mobile',\n maxWidth: 575,\n viewportWidth: 390,\n },\n]\n\nexport function getInitialState(breakpoints = DEFAULT_BREAKPOINTS): State {\n return breakpoints\n}\n\nexport function reducer(state: State = getInitialState(), action: Action): State {\n switch (action.type) {\n case ActionTypes.SET_BREAKPOINTS: {\n const breakpoints = action.payload.breakpoints\n\n if (breakpoints.length === 0) throw new Error('Breakpoints cannot be empty.')\n\n return breakpoints\n }\n\n default:\n return state\n }\n}\n\nexport type BreakpointsInput = Record<\n string,\n { label?: string; min?: number; max?: number; viewport?: number }\n>\n\nexport function parseBreakpointsInput(input: BreakpointsInput): Breakpoints {\n const breakpoints = Object.entries(input).map(([id, { label, min, max, viewport }]) => ({\n id,\n label: label ?? id,\n minWidth: min,\n maxWidth: max,\n viewportWidth: viewport,\n }))\n\n return sortBreakpoints(breakpoints)\n}\n\n// Sort breakpoints by minWidth in descending order\nfunction sortBreakpoints(breakpoints: Breakpoints): Breakpoints {\n return breakpoints.sort((a, b) => (b?.minWidth ?? 0) - (a?.minWidth ?? 0))\n}\n\nexport const getBreakpoint = (state: State, breakpointId: Breakpoint['id']): Breakpoint => {\n const breakpoint = state.find(({ id }) => id === breakpointId)\n\n if (breakpoint == null) throw new Error(`Unrecognized breakpoint ID: \"${breakpointId}\".`)\n\n return breakpoint\n}\n\nexport const getBaseBreakpoint = (breakpoints: Breakpoints): Breakpoint => {\n const breakpoint = sortBreakpoints(breakpoints)[0]\n\n if (breakpoint == null) throw new Error(`Cannot get base breakpoint.`)\n\n return breakpoint\n}\n\nexport function findBreakpointOverride<S>(\n breakpoints: Breakpoints,\n values: ResponsiveValue<S> = [],\n deviceId: string,\n strategy: FallbackStrategy<S> = defaultStrategy,\n): DeviceOverride<S> | undefined {\n const value = values.find(({ deviceId: d }) => d === deviceId)\n const fallbacks = breakpoints\n .slice(0, breakpoints.findIndex(d => d.id === deviceId) + 1)\n .reverse()\n .map(d => values.find(v => v.deviceId === d.id))\n .filter((override): override is DeviceOverride<S> => Boolean(override))\n\n return value != null || fallbacks.length > 0 ? strategy(value, fallbacks) : undefined\n}\n\nexport type FallbackStrategy<V> = (\n arg0: DeviceOverride<V> | undefined,\n arg1: ResponsiveValue<V>,\n) => DeviceOverride<V> | undefined\n\nfunction defaultStrategy<V>(\n value: DeviceOverride<V> | undefined,\n fallbacks: ResponsiveValue<V>,\n): DeviceOverride<V> | undefined {\n return value || fallbacks[0]\n}\n\nexport function shallowMergeFallbacks<V extends Record<string, unknown>>(\n value: DeviceOverride<V> | undefined,\n fallbacks: ResponsiveValue<V>,\n): DeviceOverride<V> | undefined {\n return [value, ...fallbacks]\n .filter((override): override is DeviceOverride<V> => Boolean(override))\n .reduce((a, b) => ({\n deviceId: a.deviceId || b.deviceId,\n value: shallowMerge(a.value, b.value),\n }))\n}\n\nexport type ExtractResponsiveValue<T> = T extends ResponsiveValue<infer V> ? V : never\n\nexport function join<V, A extends ReadonlyArray<ResponsiveValue<V> | null | undefined>, R>(\n breakpoints: Breakpoints,\n responsiveValues: A,\n joinFn: (values: { [I in keyof A]: ExtractResponsiveValue<A[I]> | undefined }) => R,\n strategy?: FallbackStrategy<V>,\n): ResponsiveValue<R> {\n return breakpoints\n .map(({ id }) => id)\n .map(deviceId => {\n const value = joinFn(\n responsiveValues.map(responsiveValue => {\n const deviceValue =\n responsiveValue &&\n findBreakpointOverride(breakpoints, responsiveValue, deviceId, strategy)\n\n return deviceValue == null ? undefined : deviceValue.value\n }) as unknown as { [I in keyof A]: ExtractResponsiveValue<A[I] | undefined> },\n )\n\n if (value == null) return null\n\n return { deviceId, value }\n })\n .filter((override): override is DeviceOverride<R> => Boolean(override))\n}\n\nexport const getBreakpointMediaQuery = (breakpoint: Breakpoint): string => {\n const parts = ['@media only screen']\n\n if (breakpoint.minWidth != null) {\n parts.push(`(min-width: ${breakpoint.minWidth}px)`)\n }\n\n if (breakpoint.maxWidth != null) {\n parts.push(`(max-width: ${breakpoint.maxWidth}px)`)\n }\n\n return parts.join(' and ')\n}\n\nexport const getViewportStyle = (\n state: State,\n deviceId: string,\n): Viewport<string | number> | null | undefined => {\n const device = getBreakpoint(state, deviceId)\n\n return (\n device && {\n width: device.viewportWidth != null ? device.viewportWidth : '100%',\n minWidth: device.minWidth,\n }\n )\n}\n\nexport function findNextFallback<V>(\n breakpoints: Breakpoints,\n value: ResponsiveValue<V>,\n deviceId: BreakpointId,\n activeDeviceId: BreakpointId,\n fallbackStrategy?: FallbackStrategy<V>,\n): Breakpoint | null {\n const deviceOverride = findBreakpointOverride(\n breakpoints,\n value.filter(v => v.deviceId !== activeDeviceId),\n deviceId,\n fallbackStrategy,\n )\n\n return (deviceOverride && getBreakpoint(breakpoints, deviceOverride.deviceId)) ?? null\n}\n\nexport const mergeResponsiveValues = <A>(\n breakpoints: Breakpoints,\n source: DeviceOverride<A>[],\n override: DeviceOverride<A>[],\n): DeviceOverride<A>[] => {\n const devices = [\n ...new Set(\n source.map(({ deviceId }) => deviceId).concat(override.map(({ deviceId }) => deviceId)),\n ),\n ]\n\n return devices.map(deviceId => ({\n deviceId,\n value: {\n ...(findBreakpointOverride(breakpoints, source, deviceId) || { value: {} }).value,\n ...(findBreakpointOverride(breakpoints, override, deviceId, v => v) || { value: {} }).value,\n },\n })) as DeviceOverride<A>[]\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,MAAM,OAAO,CAAuC,MAAsB,OAAO,KAAK,CAAC;ACAvF,MAAM,WAAW,IAAO,SAAsB;AACxC,MAAA;AAEJ,OAAK,IAAI,GAAG,IAAI,KAAK,SAAS,GAAG,KAAK,GAAG;AACvC,QAAI,KAAK,MAAM;AAAM,aAAO,KAAK;AAAA,EACnC;AAEA,SAAO,KAAK;AACd;ACLA,sBAGE,GAAM,GAAa;AACb,QAAA,QAAQ,KAAK,CAAC;AACd,QAAA,SAAS,mBAAK;AAEpB,QAAM,QAAQ,CAAO,QAAA;AAEnB,WAAO,OAAO,SAAS,OAAO,MAAM,EAAE,IAAI;AAAA,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file":"Box.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Box/Box.tsx"],"names":[],"mappings":";AAcA,OAAO,EAA6B,iBAAiB,EAAmB,MAAM,cAAc,CAAA;AAC5F,OAAO,EAEL,6BAA6B,EAC7B,SAAS,EACT,SAAS,EACT,SAAS,EAET,gBAAgB,EACjB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAoB,MAAM,oBAAoB,CAAA;AAyBrE,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Box.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Box/Box.tsx"],"names":[],"mappings":";AAcA,OAAO,EAA6B,iBAAiB,EAAmB,MAAM,cAAc,CAAA;AAC5F,OAAO,EAEL,6BAA6B,EAC7B,SAAS,EACT,SAAS,EACT,SAAS,EAET,gBAAgB,EACjB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAoB,MAAM,oBAAoB,CAAA;AAyBrE,QAAA,MAAM,GAAG;;;;;;;;;;;;;;;sEA8JP,CAAA;AAEF,eAAe,GAAG,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Box/register.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAWtD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Box/register.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAWtD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,cA2JtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Button/Button.tsx"],"names":[],"mappings":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CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAKD,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iEAkOV,CAAA;AAEF,eAAe,MAAM,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Button/register.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAKtD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Button/register.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAKtD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,cAoEtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Carousel/Carousel.tsx"],"names":[],"mappings":";AAiBA,OAAO,EACL,cAAc,EACd,WAAW,EACX,qBAAqB,EACrB,6BAA6B,EAC7B,SAAS,EACT,aAAa,EACb,WAAW,EACZ,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;
|
|
1
|
+
{"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Carousel/Carousel.tsx"],"names":[],"mappings":";AAiBA,OAAO,EACL,cAAc,EACd,WAAW,EACX,qBAAqB,EACrB,6BAA6B,EAC7B,SAAS,EACT,aAAa,EACb,WAAW,EACZ,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AA+BlE,aAAK,KAAK,GAAG;IACX,EAAE,CAAC,EAAE,cAAc,CAAA;IACnB,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,qBAAqB,CAAA;IAChC,IAAI,CAAC,EAAE,qBAAqB,CAAA;IAC5B,cAAc,CAAC,EAAE,6BAA6B,CAAC,YAAY,GAAG,QAAQ,GAAG,UAAU,CAAC,CAAA;IACpF,GAAG,CAAC,EAAE,SAAS,CAAA;IACf,QAAQ,CAAC,EAAE,aAAa,CAAA;IACxB,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,UAAU,CAAC,EAAE,aAAa,CAAA;IAC1B,aAAa,CAAC,EAAE,6BAA6B,CAAC,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC,CAAA;IAC9E,UAAU,CAAC,EAAE,eAAe,GAAG,IAAI,CAAA;IACnC,eAAe,CAAC,EAAE,eAAe,GAAG,IAAI,CAAA;IACxC,QAAQ,CAAC,EAAE,aAAa,CAAA;IACxB,QAAQ,CAAC,EAAE,eAAe,GAAG,IAAI,CAAA;IACjC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAKD,QAAA,MAAM,QAAQ,kGAwTZ,CAAA;AAEF,eAAe,QAAQ,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Carousel/register.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Carousel/register.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAKtD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,cAqGtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Countdown/register.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Countdown/register.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAItD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,cA8FtD"}
|
package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ declare type BaseProps = {
|
|
|
8
8
|
};
|
|
9
9
|
declare const _default: import("react").ForwardRefExoticComponent<BaseProps & Omit<Pick<Partial<Pick<FormContextValue, "size" | "contrast" | "brandColor">> & {
|
|
10
10
|
error?: boolean | undefined;
|
|
11
|
-
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "size" | "error" | "contrast" | "brandColor"> & import("react").RefAttributes<HTMLInputElement>, "type" | "property" | "key" | "is" | "id" | "color" | "height" | "translate" | "width" | "style" | "value" | "children" | "
|
|
11
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "size" | "error" | "contrast" | "brandColor"> & import("react").RefAttributes<HTMLInputElement>, "type" | "property" | "key" | "is" | "id" | "color" | "height" | "translate" | "width" | "style" | "value" | "children" | "min" | "max" | "name" | "size" | "hidden" | "defaultValue" | "step" | "resource" | "form" | "slot" | "title" | "pattern" | "error" | "dir" | "list" | "itemProp" | "dangerouslySetInnerHTML" | "crossOrigin" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "multiple" | "disabled" | "alt" | "src" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "accept" | "autoComplete" | "capture" | "checked" | "enterKeyHint" | "maxLength" | "minLength" | "readOnly" | "required" | "contrast" | "brandColor">, keyof BaseProps> & import("react").RefAttributes<HTMLInputElement>>;
|
|
12
12
|
export default _default;
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/components/builtin/Form/components/Field/components/Label/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAG7D,OAAO,EAAkB,IAAI,EAA8B,MAAM,iCAAiC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/components/builtin/Form/components/Field/components/Label/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAG7D,OAAO,EAAkB,IAAI,EAA8B,MAAM,iCAAiC,CAAA;AAQlG,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAchD;AAeD,aAAK,SAAS,CAAC,CAAC,SAAS,WAAW,IAAI;IACtC,EAAE,CAAC,EAAE,CAAC,CAAA;CACP,CAAA;AAED,aAAK,KAAK,CAAC,CAAC,SAAS,WAAW,IAAI,SAAS,CAAC,CAAC,CAAC,GAC9C,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,SAAS,CAAC,CAAC,CAAC,CAAC,CAAA;AAE7D,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,CAAC,SAAS,WAAW,GAAG,OAAO,EAAE,EAC7D,EAAE,EACF,SAAS,EACT,GAAG,WAAW,EACf,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,CAuBxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Form/register.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAKtD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Form/register.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAKtD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,cAyItD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Image/Image.tsx"],"names":[],"mappings":";AAIA,OAAO,EACL,cAAc,EACd,UAAU,EACV,SAAS,EACT,sBAAsB,EACtB,cAAc,EACd,UAAU,EACX,MAAM,uCAAuC,CAAA;
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Image/Image.tsx"],"names":[],"mappings":";AAIA,OAAO,EACL,cAAc,EACd,UAAU,EACV,SAAS,EACT,sBAAsB,EACtB,cAAc,EACd,UAAU,EACX,MAAM,uCAAuC,CAAA;AAa9C,aAAK,KAAK,GAAG;IACX,EAAE,CAAC,EAAE,cAAc,CAAA;IACnB,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,sBAAsB,CAAA;IAChC,WAAW,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAwCD,QAAA,MAAM,cAAc,sHAoFlB,CAAA;AAEF,eAAe,cAAc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAY,MAAM,OAAO,CAAA;AAE1D,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,SAAS,EACV,MAAM,mDAAmD,CAAA;AAS1D,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,MAAM,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../../src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAY,MAAM,OAAO,CAAA;AAE1D,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,SAAS,EACV,MAAM,mDAAmD,CAAA;AAS1D,OAAO,E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../src/components/builtin/Navigation/components/MobileMenu/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,eAAe,EACf,oBAAoB,EAErB,MAAM,6CAA6C,CAAA;AAOpD,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/builtin/Navigation/components/MobileMenu/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,eAAe,EACf,oBAAoB,EAErB,MAAM,6CAA6C,CAAA;AAOpD,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AAoHxE,aAAK,KAAK,GAAG;IACX,SAAS,CAAC,EAAE,eAAe,CAAC,YAAY,GAAG,WAAW,CAAC,CAAA;IACvD,eAAe,CAAC,EAAE,eAAe,GAAG,IAAI,CAAA;IACxC,cAAc,CAAC,EAAE,eAAe,GAAG,IAAI,CAAA;IACvC,KAAK,CAAC,EAAE,oBAAoB,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,OAAO,CAAA;IACvB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,SAAS,EACT,eAAe,EACf,IAAY,EACZ,cAAc,EACd,KAAU,EACV,OAAkB,GACnB,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAsBrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Navigation/register.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAItD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Navigation/register.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAItD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,cA4HtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/SocialLinks/register.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/SocialLinks/register.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAItD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,cAuItD"}
|
|
@@ -10,10 +10,6 @@ declare type EnhancedColor = {
|
|
|
10
10
|
};
|
|
11
11
|
declare type EnhancedTypographyValue = Omit<RichTextTypographyValue, keyof EnhancedColor> & EnhancedColor;
|
|
12
12
|
export declare type EnhancedTypography = Array<DeviceOverride<EnhancedTypographyValue>>;
|
|
13
|
-
export declare function isDeviceOverride(value: {
|
|
14
|
-
deviceId: string;
|
|
15
|
-
value: RichTextTypographyValue;
|
|
16
|
-
}): value is DeviceOverride<RichTextTypographyValue>;
|
|
17
13
|
export declare function getTypographyStyleSwatchIds(style: RichTextTypography['style'] | Typography['style'] | null | undefined): string[];
|
|
18
14
|
/**
|
|
19
15
|
* `enhanced` here just means typography ids have been replaced with the related entity.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leaf.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/builtin/Text/components/Leaf/leaf.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,cAAc,EAAmB,MAAM,iCAAiC,CAAA;
|
|
1
|
+
{"version":3,"file":"leaf.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/builtin/Text/components/Leaf/leaf.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C,OAAO,EAAU,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,EAAE,cAAc,EAAmB,MAAM,iCAAiC,CAAA;AAMjF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAO5D,oBAAY,uBAAuB,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAA;AA2BlF,aAAK,aAAa,GAAG;IACnB,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB,CAAA;AAED,aAAK,uBAAuB,GAAG,IAAI,CAAC,uBAAuB,EAAE,MAAM,aAAa,CAAC,GAAG,aAAa,CAAA;AAEjG,oBAAY,kBAAkB,GAAG,KAAK,CAAC,cAAc,CAAC,uBAAuB,CAAC,CAAC,CAAA;AAE/E,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,kBAAkB,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GAC1E,MAAM,EAAE,CAOV;AA8BD;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,KAAK,CAAC,EAAE,kBAAkB,GAAG,kBAAkB,CA2C5F;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAkCxE;AAED,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,eASvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Text/register.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Text/register.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAItD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,cAqFtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMediaQuery.d.ts","sourceRoot":"","sources":["../../../../../src/components/hooks/useMediaQuery.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useMediaQuery.d.ts","sourceRoot":"","sources":["../../../../../src/components/hooks/useMediaQuery.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAevD,wBAAgB,aAAa,CAAC,CAAC,EAAE,eAAe,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CA+B1F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drop-first.d.ts","sourceRoot":"","sources":["../../../../../src/components/utils/drop-first.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA"}
|