@panneau/core 4.0.78 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contexts.d.ts +266 -168
- package/dist/contexts.js +46 -31
- package/dist/hooks.d.ts +78 -40
- package/dist/hooks.js +780 -338
- package/dist/index.d.ts +299 -201
- package/dist/index.js +23 -29
- package/dist/utils.d.ts +192 -15
- package/dist/utils.js +106 -31
- package/package.json +3 -3
package/dist/contexts.js
CHANGED
|
@@ -37,7 +37,7 @@ function useComponentsManager(t0) {
|
|
|
37
37
|
const manager = useContext(ComponentsContext);
|
|
38
38
|
let t1;
|
|
39
39
|
if ($[0] !== manager || $[1] !== namespace) {
|
|
40
|
-
t1 = namespace !== null ? new ComponentsManager(manager
|
|
40
|
+
t1 = namespace !== null ? new ComponentsManager(manager?.getComponents(namespace) ?? {}) : manager;
|
|
41
41
|
$[0] = manager;
|
|
42
42
|
$[1] = namespace;
|
|
43
43
|
$[2] = t1;
|
|
@@ -62,7 +62,7 @@ function useComponents(t0, t1) {
|
|
|
62
62
|
const manager = useComponentsManager();
|
|
63
63
|
let t3;
|
|
64
64
|
if ($[2] !== defaultComponents || $[3] !== manager || $[4] !== namespace) {
|
|
65
|
-
t3 = manager
|
|
65
|
+
t3 = manager?.getComponents(namespace) || defaultComponents;
|
|
66
66
|
$[2] = defaultComponents;
|
|
67
67
|
$[3] = manager;
|
|
68
68
|
$[4] = namespace;
|
|
@@ -85,7 +85,7 @@ function useComponent(name, t0, t1) {
|
|
|
85
85
|
}
|
|
86
86
|
let t3;
|
|
87
87
|
if ($[0] !== defaultComponent || $[1] !== manager || $[2] !== name) {
|
|
88
|
-
t3 = manager
|
|
88
|
+
t3 = manager?.getComponent(name) || defaultComponent;
|
|
89
89
|
$[0] = defaultComponent;
|
|
90
90
|
$[1] = manager;
|
|
91
91
|
$[2] = name;
|
|
@@ -482,7 +482,7 @@ function FieldsProvider(t0) {
|
|
|
482
482
|
const previousManager = useFieldsManager() || null;
|
|
483
483
|
let t3;
|
|
484
484
|
if ($[0] !== fields || $[1] !== manager || $[2] !== previousManager) {
|
|
485
|
-
const newFields = uniqBy([...(fields || []), ...(manager !== null ? manager.getDefinitions() : []), ...(previousManager !== null ? previousManager.getDefinitions() : [])], _temp$
|
|
485
|
+
const newFields = uniqBy([...(fields || []), ...(manager !== null ? manager.getDefinitions() : []), ...(previousManager !== null ? previousManager.getDefinitions() : [])], _temp$3).reverse();
|
|
486
486
|
t3 = new FieldsManager(newFields);
|
|
487
487
|
$[0] = fields;
|
|
488
488
|
$[1] = manager;
|
|
@@ -535,7 +535,7 @@ function FieldsProvider(t0) {
|
|
|
535
535
|
}
|
|
536
536
|
return t6;
|
|
537
537
|
}
|
|
538
|
-
function _temp$
|
|
538
|
+
function _temp$3(t0) {
|
|
539
539
|
const {
|
|
540
540
|
id
|
|
541
541
|
} = t0;
|
|
@@ -622,7 +622,7 @@ function useGoogleFonts(t0) {
|
|
|
622
622
|
} = t6;
|
|
623
623
|
const items = t7 === undefined ? [] : t7;
|
|
624
624
|
if (!canceled) {
|
|
625
|
-
const newFonts = items.map(_temp$
|
|
625
|
+
const newFonts = items.map(_temp$2);
|
|
626
626
|
if (setFonts !== null) {
|
|
627
627
|
setFonts(newFonts);
|
|
628
628
|
} else {
|
|
@@ -648,7 +648,7 @@ function useGoogleFonts(t0) {
|
|
|
648
648
|
useEffect(t4, t5);
|
|
649
649
|
return googleFonts;
|
|
650
650
|
}
|
|
651
|
-
function _temp$
|
|
651
|
+
function _temp$2(it) {
|
|
652
652
|
return {
|
|
653
653
|
type: "google",
|
|
654
654
|
name: it.family,
|
|
@@ -890,7 +890,7 @@ function FormsProvider(t0) {
|
|
|
890
890
|
const previousManager = useFormsManager() || null;
|
|
891
891
|
let t3;
|
|
892
892
|
if ($[0] !== forms || $[1] !== manager || $[2] !== previousManager) {
|
|
893
|
-
const newForms = uniqBy([...(forms || []), ...(manager !== null ? manager.getDefinitions() : []), ...(previousManager !== null ? previousManager.getDefinitions() : [])], _temp).reverse();
|
|
893
|
+
const newForms = uniqBy([...(forms || []), ...(manager !== null ? manager.getDefinitions() : []), ...(previousManager !== null ? previousManager.getDefinitions() : [])], _temp$1).reverse();
|
|
894
894
|
t3 = new FormsManager(newForms);
|
|
895
895
|
$[0] = forms;
|
|
896
896
|
$[1] = manager;
|
|
@@ -943,7 +943,7 @@ function FormsProvider(t0) {
|
|
|
943
943
|
}
|
|
944
944
|
return t6;
|
|
945
945
|
}
|
|
946
|
-
function _temp(t0) {
|
|
946
|
+
function _temp$1(t0) {
|
|
947
947
|
const {
|
|
948
948
|
id
|
|
949
949
|
} = t0;
|
|
@@ -981,6 +981,9 @@ function withGoogleApiClient(WrappedComponent) {
|
|
|
981
981
|
WithGoogleApiClientComponent.displayName = `WithGoogleApiClient(${getDisplayName(WrappedComponent)})`;
|
|
982
982
|
return WithGoogleApiClientComponent;
|
|
983
983
|
}
|
|
984
|
+
|
|
985
|
+
// Minimal shape of the Google API (gapi) object used here, @folklore/services types it as unknown
|
|
986
|
+
|
|
984
987
|
function GoogleApiClientProvider(t0) {
|
|
985
988
|
const $ = c(6);
|
|
986
989
|
const {
|
|
@@ -1039,7 +1042,7 @@ function withGoogleMapsClient(WrappedComponent) {
|
|
|
1039
1042
|
if ($[0] !== props) {
|
|
1040
1043
|
t0 = /*#__PURE__*/jsx(GoogleMapsClientContext.Consumer, {
|
|
1041
1044
|
children: client => /*#__PURE__*/jsx(WrappedComponent, {
|
|
1042
|
-
|
|
1045
|
+
googleMapsClient: client,
|
|
1043
1046
|
...props
|
|
1044
1047
|
})
|
|
1045
1048
|
});
|
|
@@ -1342,7 +1345,7 @@ const PanelsContext = /*#__PURE__*/createContext({
|
|
|
1342
1345
|
unregister: () => {}
|
|
1343
1346
|
});
|
|
1344
1347
|
function usePanels() {
|
|
1345
|
-
return useContext(PanelsContext)
|
|
1348
|
+
return useContext(PanelsContext);
|
|
1346
1349
|
}
|
|
1347
1350
|
function withPanels(WrappedComponent) {
|
|
1348
1351
|
function WithPanelsComponent(props) {
|
|
@@ -1554,6 +1557,8 @@ function usePanneauColorScheme() {
|
|
|
1554
1557
|
return t3;
|
|
1555
1558
|
}
|
|
1556
1559
|
const DEFAULT_COMPONENTS = {};
|
|
1560
|
+
|
|
1561
|
+
/** @deprecated The `components` key of the definition is not supported */
|
|
1557
1562
|
function usePanneauComponents() {
|
|
1558
1563
|
const {
|
|
1559
1564
|
components: t0
|
|
@@ -1561,6 +1566,8 @@ function usePanneauComponents() {
|
|
|
1561
1566
|
const components = t0 === undefined ? DEFAULT_COMPONENTS : t0;
|
|
1562
1567
|
return components;
|
|
1563
1568
|
}
|
|
1569
|
+
|
|
1570
|
+
/** @deprecated The `components` key of the definition is not supported */
|
|
1564
1571
|
function usePanneauComponent(namespace, name) {
|
|
1565
1572
|
const $ = c(2);
|
|
1566
1573
|
const {
|
|
@@ -1618,24 +1625,38 @@ function usePanneauSettings() {
|
|
|
1618
1625
|
return settings;
|
|
1619
1626
|
}
|
|
1620
1627
|
function PanneauProvider(t0) {
|
|
1621
|
-
const $ = c(
|
|
1628
|
+
const $ = c(6);
|
|
1622
1629
|
const {
|
|
1623
1630
|
definition,
|
|
1624
1631
|
children
|
|
1625
1632
|
} = t0;
|
|
1626
1633
|
let t1;
|
|
1627
|
-
|
|
1628
|
-
|
|
1634
|
+
let t2;
|
|
1635
|
+
if ($[0] !== definition) {
|
|
1636
|
+
t1 = () => {
|
|
1637
|
+
};
|
|
1638
|
+
t2 = [definition];
|
|
1639
|
+
$[0] = definition;
|
|
1640
|
+
$[1] = t1;
|
|
1641
|
+
$[2] = t2;
|
|
1642
|
+
} else {
|
|
1643
|
+
t1 = $[1];
|
|
1644
|
+
t2 = $[2];
|
|
1645
|
+
}
|
|
1646
|
+
useEffect(t1, t2);
|
|
1647
|
+
let t3;
|
|
1648
|
+
if ($[3] !== children || $[4] !== definition) {
|
|
1649
|
+
t3 = /*#__PURE__*/jsx(PanneauContext, {
|
|
1629
1650
|
value: definition,
|
|
1630
1651
|
children: children
|
|
1631
1652
|
});
|
|
1632
|
-
$[
|
|
1633
|
-
$[
|
|
1634
|
-
$[
|
|
1653
|
+
$[3] = children;
|
|
1654
|
+
$[4] = definition;
|
|
1655
|
+
$[5] = t3;
|
|
1635
1656
|
} else {
|
|
1636
|
-
|
|
1657
|
+
t3 = $[5];
|
|
1637
1658
|
}
|
|
1638
|
-
return
|
|
1659
|
+
return t3;
|
|
1639
1660
|
}
|
|
1640
1661
|
|
|
1641
1662
|
const ResourceContext = /*#__PURE__*/createContext(null);
|
|
@@ -1693,20 +1714,14 @@ function useRoutePush() {
|
|
|
1693
1714
|
return push;
|
|
1694
1715
|
}
|
|
1695
1716
|
function useRouteBack() {
|
|
1696
|
-
const
|
|
1697
|
-
useUrlGenerator();
|
|
1698
|
-
const [, navigate] = useLocation();
|
|
1699
|
-
let t0;
|
|
1700
|
-
if ($[0] !== navigate) {
|
|
1701
|
-
t0 = () => navigate(-1);
|
|
1702
|
-
$[0] = navigate;
|
|
1703
|
-
$[1] = t0;
|
|
1704
|
-
} else {
|
|
1705
|
-
t0 = $[1];
|
|
1706
|
-
}
|
|
1707
|
-
const back = t0;
|
|
1717
|
+
const back = _temp;
|
|
1708
1718
|
return back;
|
|
1709
1719
|
}
|
|
1720
|
+
function _temp() {
|
|
1721
|
+
if (typeof window !== "undefined") {
|
|
1722
|
+
window.history.back();
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1710
1725
|
|
|
1711
1726
|
function useTracking() {
|
|
1712
1727
|
return useContext(TrackingContext);
|
package/dist/hooks.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Dayjs } from 'dayjs';
|
|
2
|
-
import { ReactNode, ElementType,
|
|
3
|
-
import { MessageDescriptor } from 'react-intl';
|
|
2
|
+
import { ReactNode, ComponentProps, ElementType, SyntheticEvent, RefObject } from 'react';
|
|
3
|
+
import { MessageDescriptor, FormattedMessage } from 'react-intl';
|
|
4
4
|
|
|
5
5
|
interface UseAnimationFrameOptions {
|
|
6
6
|
disabled?: boolean;
|
|
@@ -29,6 +29,12 @@ declare const useDocumentEvent: (event: string, callback: (...args: unknown[]) =
|
|
|
29
29
|
* Internationalization message definition
|
|
30
30
|
*/
|
|
31
31
|
type Message = MessageDescriptor;
|
|
32
|
+
/**
|
|
33
|
+
* Values that can be interpolated in an internationalization message
|
|
34
|
+
* (the `values` prop of FormattedMessage)
|
|
35
|
+
*/
|
|
36
|
+
type MessageValues = NonNullable<ComponentProps<typeof FormattedMessage>['values']>;
|
|
37
|
+
type MessageValue = MessageValues[string];
|
|
32
38
|
/**
|
|
33
39
|
* Label can be either a message object or any React node
|
|
34
40
|
*/
|
|
@@ -37,14 +43,6 @@ type Label = Message | ReactNode;
|
|
|
37
43
|
* Form control size
|
|
38
44
|
*/
|
|
39
45
|
type ControlSize = 'lg' | 'sm' | null;
|
|
40
|
-
/**
|
|
41
|
-
* Generic definition
|
|
42
|
-
*/
|
|
43
|
-
interface Definition {
|
|
44
|
-
id: string;
|
|
45
|
-
component?: string | ElementType;
|
|
46
|
-
[key: string]: unknown;
|
|
47
|
-
}
|
|
48
46
|
interface RouteDefinition {
|
|
49
47
|
path?: string;
|
|
50
48
|
route?: string;
|
|
@@ -82,8 +80,6 @@ interface Form {
|
|
|
82
80
|
submitButtonLabel?: Label | null;
|
|
83
81
|
[key: string]: unknown;
|
|
84
82
|
}
|
|
85
|
-
interface FormDefinition extends Form, Definition {
|
|
86
|
-
}
|
|
87
83
|
|
|
88
84
|
/**
|
|
89
85
|
* Resource Types
|
|
@@ -96,6 +92,7 @@ interface FormDefinition extends Form, Definition {
|
|
|
96
92
|
type TableColumn = string | Column;
|
|
97
93
|
interface Column extends Record<string, unknown> {
|
|
98
94
|
id?: string | null;
|
|
95
|
+
name?: string | null;
|
|
99
96
|
label?: unknown;
|
|
100
97
|
path?: string;
|
|
101
98
|
valueKey?: string;
|
|
@@ -121,7 +118,7 @@ type ActionDefinition = string | Action;
|
|
|
121
118
|
interface ResourceIntlValues {
|
|
122
119
|
a_singular?: string;
|
|
123
120
|
a_plural?: string;
|
|
124
|
-
[key: string]:
|
|
121
|
+
[key: string]: MessageValue;
|
|
125
122
|
}
|
|
126
123
|
/**
|
|
127
124
|
* Internationalization configuration
|
|
@@ -140,6 +137,11 @@ interface ResourceIndex {
|
|
|
140
137
|
fields?: Field$1[];
|
|
141
138
|
[key: string]: unknown;
|
|
142
139
|
}
|
|
140
|
+
/**
|
|
141
|
+
* Overrides of the built-in resource pages, ex: `{ show: { component: 'my-page' } }`.
|
|
142
|
+
* Used on a resource (`resource.pages`) and on the panneau definition (`definition.pages`),
|
|
143
|
+
* the resource taking precedence.
|
|
144
|
+
*/
|
|
143
145
|
interface ResourcePages {
|
|
144
146
|
index?: PageDefinition;
|
|
145
147
|
show?: PageDefinition;
|
|
@@ -147,15 +149,49 @@ interface ResourcePages {
|
|
|
147
149
|
edit?: PageDefinition;
|
|
148
150
|
delete?: PageDefinition;
|
|
149
151
|
duplicate?: PageDefinition;
|
|
152
|
+
/** @deprecated Legacy resource keys, use `index`, `show`, `create`, etc. */
|
|
153
|
+
resourceIndexPage?: PageDefinition;
|
|
154
|
+
resourceShowPage?: PageDefinition;
|
|
155
|
+
resourceCreatePage?: PageDefinition;
|
|
156
|
+
resourceEditPage?: PageDefinition;
|
|
157
|
+
resourceDeletePage?: PageDefinition;
|
|
158
|
+
resourceDuplicatePage?: PageDefinition;
|
|
159
|
+
/** @deprecated Legacy panneau keys, use `index`, `show`, `create`, etc. */
|
|
160
|
+
indexPage?: PageDefinition;
|
|
161
|
+
showPage?: PageDefinition;
|
|
162
|
+
createPage?: PageDefinition;
|
|
163
|
+
editPage?: PageDefinition;
|
|
164
|
+
deletePage?: PageDefinition;
|
|
165
|
+
duplicatePage?: PageDefinition;
|
|
150
166
|
[key: string]: PageDefinition | undefined;
|
|
151
167
|
}
|
|
168
|
+
/**
|
|
169
|
+
* Form definition of a resource (the id is optional, the form is identified by its key)
|
|
170
|
+
*/
|
|
171
|
+
interface ResourceForm extends Form {
|
|
172
|
+
id?: string;
|
|
173
|
+
component?: string | ElementType;
|
|
174
|
+
}
|
|
152
175
|
interface ResourceForms {
|
|
153
|
-
default
|
|
154
|
-
create
|
|
155
|
-
edit
|
|
156
|
-
delete
|
|
157
|
-
|
|
158
|
-
|
|
176
|
+
default?: ResourceForm | null;
|
|
177
|
+
create?: ResourceForm | null;
|
|
178
|
+
edit?: ResourceForm | null;
|
|
179
|
+
delete?: ResourceForm | null;
|
|
180
|
+
duplicate?: ResourceForm | null;
|
|
181
|
+
modal?: ResourceForm | null;
|
|
182
|
+
[key: string]: ResourceForm | null | undefined;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Resource type (sub-type of a resource, ex: page types)
|
|
186
|
+
*/
|
|
187
|
+
interface ResourceType$1 {
|
|
188
|
+
id?: string;
|
|
189
|
+
name?: string;
|
|
190
|
+
fields?: Field$1[];
|
|
191
|
+
settings?: {
|
|
192
|
+
canCreate?: boolean;
|
|
193
|
+
[key: string]: unknown;
|
|
194
|
+
};
|
|
159
195
|
}
|
|
160
196
|
interface Resource {
|
|
161
197
|
id: string;
|
|
@@ -167,6 +203,7 @@ interface Resource {
|
|
|
167
203
|
settings?: Record<string, unknown>;
|
|
168
204
|
extraRoutes?: RouteDefinition[];
|
|
169
205
|
pages?: ResourcePages;
|
|
206
|
+
types?: ResourceType$1[];
|
|
170
207
|
}
|
|
171
208
|
/**
|
|
172
209
|
* Filter definition
|
|
@@ -197,7 +234,7 @@ interface RequestState {
|
|
|
197
234
|
loading: boolean;
|
|
198
235
|
error: boolean;
|
|
199
236
|
}
|
|
200
|
-
interface UseFormOptions {
|
|
237
|
+
interface UseFormOptions<T extends FieldValue = FieldValue> {
|
|
201
238
|
fields?: FieldInput[];
|
|
202
239
|
action?: string | null;
|
|
203
240
|
postForm?: ((action: string, data: Record<string, unknown>) => Promise<unknown>) | null;
|
|
@@ -207,28 +244,28 @@ interface UseFormOptions {
|
|
|
207
244
|
initialGeneralError?: string | null;
|
|
208
245
|
generalError?: string | null;
|
|
209
246
|
setGeneralError?: ((error: string | null) => void) | null;
|
|
210
|
-
initialValue?:
|
|
211
|
-
value?:
|
|
212
|
-
setValue?: ((value:
|
|
247
|
+
initialValue?: T | null;
|
|
248
|
+
value?: T | null;
|
|
249
|
+
setValue?: ((value: T) => void) | null;
|
|
213
250
|
withoutDefault?: boolean;
|
|
214
251
|
withoutPropagation?: boolean;
|
|
215
252
|
onComplete?: ((response: unknown) => void) | null;
|
|
216
253
|
onError?: ((error: Error) => void) | null;
|
|
217
254
|
locales?: string[];
|
|
218
255
|
}
|
|
219
|
-
interface UseFormReturn extends RequestState {
|
|
220
|
-
value:
|
|
221
|
-
setValue: (value:
|
|
256
|
+
interface UseFormReturn<T extends FieldValue = FieldValue> extends RequestState {
|
|
257
|
+
value: T | null;
|
|
258
|
+
setValue: (value: T) => void;
|
|
222
259
|
csrfToken: string | null;
|
|
223
|
-
submit: (submitValue?:
|
|
224
|
-
onSubmit: (e:
|
|
260
|
+
submit: (submitValue?: T | null) => void;
|
|
261
|
+
onSubmit: (e: SyntheticEvent) => void;
|
|
225
262
|
status: 'loading' | 'success' | 'error' | null;
|
|
226
263
|
response: unknown;
|
|
227
264
|
fields: ProcessedField[];
|
|
228
265
|
errors: FieldErrors | null;
|
|
229
266
|
generalError: string | null;
|
|
230
267
|
}
|
|
231
|
-
declare function useForm(opts?: UseFormOptions): UseFormReturn
|
|
268
|
+
declare function useForm<T extends FieldValue = FieldValue>(opts?: UseFormOptions<T>): UseFormReturn<T>;
|
|
232
269
|
|
|
233
270
|
interface UseIsVisibleOptions {
|
|
234
271
|
rootMargin?: string;
|
|
@@ -236,7 +273,7 @@ interface UseIsVisibleOptions {
|
|
|
236
273
|
persist?: boolean;
|
|
237
274
|
}
|
|
238
275
|
interface UseIsVisibleResult {
|
|
239
|
-
ref: RefObject<
|
|
276
|
+
ref: RefObject<Element>;
|
|
240
277
|
visible: boolean;
|
|
241
278
|
}
|
|
242
279
|
declare function useIsVisible({ rootMargin, threshold, persist, }?: UseIsVisibleOptions): UseIsVisibleResult;
|
|
@@ -304,7 +341,7 @@ interface Manager {
|
|
|
304
341
|
}
|
|
305
342
|
interface MediasParserOptions {
|
|
306
343
|
fieldsManager: Manager;
|
|
307
|
-
screensManager
|
|
344
|
+
screensManager?: Manager | null;
|
|
308
345
|
}
|
|
309
346
|
interface Media$1 {
|
|
310
347
|
id?: string | null;
|
|
@@ -324,18 +361,18 @@ interface Screen$1 {
|
|
|
324
361
|
type: string;
|
|
325
362
|
[key: string]: unknown;
|
|
326
363
|
}
|
|
327
|
-
interface Story {
|
|
328
|
-
theme?: Story | null;
|
|
364
|
+
interface Story$1 {
|
|
365
|
+
theme?: Story$1 | null;
|
|
329
366
|
components?: Screen$1[];
|
|
330
367
|
medias?: Record<string, Media$1> | null;
|
|
331
368
|
[key: string]: unknown;
|
|
332
369
|
}
|
|
333
370
|
declare class MediasParser {
|
|
334
371
|
fieldsManager: Manager;
|
|
335
|
-
screensManager: Manager;
|
|
372
|
+
screensManager: Manager | null;
|
|
336
373
|
constructor({ fieldsManager, screensManager }: MediasParserOptions);
|
|
337
|
-
toPath(story: Story | null): Story | null;
|
|
338
|
-
fromPath(story: Story | null, defaultMedias?: Record<string, Media$1> | null): Story | null;
|
|
374
|
+
toPath(story: Story$1 | null): Story$1 | null;
|
|
375
|
+
fromPath(story: Story$1 | null, defaultMedias?: Record<string, Media$1> | null): Story$1 | null;
|
|
339
376
|
getMediaFieldsPattern(fields: Field[], namePrefix?: string | null): RegExp[];
|
|
340
377
|
static fieldIsMedia({ media }: Field): boolean;
|
|
341
378
|
static fieldIsFontFamily({ id }: Field): boolean;
|
|
@@ -347,9 +384,10 @@ declare class MediasParser {
|
|
|
347
384
|
};
|
|
348
385
|
}
|
|
349
386
|
|
|
387
|
+
type Story = Parameters<MediasParser['toPath']>[0];
|
|
350
388
|
interface UseMediasParserReturn {
|
|
351
|
-
toPath: (story:
|
|
352
|
-
fromPath: (story:
|
|
389
|
+
toPath: (story: Story) => Story;
|
|
390
|
+
fromPath: (story: Story) => Story;
|
|
353
391
|
parser: MediasParser;
|
|
354
392
|
}
|
|
355
393
|
declare function useMediasParser(): UseMediasParserReturn;
|
|
@@ -362,7 +400,7 @@ type ObserverConstructor<T> = (new (callback: (entries: T[]) => void, options?:
|
|
|
362
400
|
interface ObserverWrapper<T> {
|
|
363
401
|
subscribe: (element: Element, callback: (entry: T) => void) => void;
|
|
364
402
|
unsubscribe: (element: Element, callback?: ((entry: T) => void) | null) => void;
|
|
365
|
-
observer:
|
|
403
|
+
observer: InstanceType<NonNullable<ObserverConstructor<T>>>;
|
|
366
404
|
}
|
|
367
405
|
interface ObserverOptions {
|
|
368
406
|
root?: Element | null;
|
|
@@ -379,7 +417,7 @@ declare function useObserver<T>(Observer: ObserverConstructor<T>, opts?: Observe
|
|
|
379
417
|
interface IntersectionObserverEntry {
|
|
380
418
|
target: Element | null;
|
|
381
419
|
time: number | null;
|
|
382
|
-
isVisible
|
|
420
|
+
isVisible?: boolean;
|
|
383
421
|
isIntersecting: boolean;
|
|
384
422
|
intersectionRatio: number;
|
|
385
423
|
intersectionRect: DOMRectReadOnly | null;
|