@micromag/core 0.4.100 → 0.4.109
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/es/components.d.ts +67 -67
- package/es/components.js +46 -40
- package/es/contexts.d.ts +27 -27
- package/es/contexts.js +126 -123
- package/es/hooks.d.ts +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +2 -3
- package/es/utils.d.ts +1 -1
- package/package.json +2 -2
package/es/components.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React$1 from 'react';
|
|
3
2
|
import React__default, { ReactNode, ElementType, CSSProperties, MouseEventHandler, ForwardedRef, JSX, MouseEvent, HTMLAttributes, Component as Component$2 } from 'react';
|
|
4
3
|
import { MessageDescriptor } from 'react-intl';
|
|
@@ -89,7 +88,7 @@ interface ButtonProps {
|
|
|
89
88
|
onClick?: MouseEventHandler<ButtonElement> | null;
|
|
90
89
|
refButton?: ForwardedRef<ButtonElement> | null;
|
|
91
90
|
}
|
|
92
|
-
declare function Button$1({ type, theme, size, href, external, direct, target, label, children, focusable, active, icon, iconPosition, disabled, loading, disableOnLoading, withoutStyle, withoutBootstrapStyles, withoutTheme, outline, onClick, className, iconClassName, labelClassName, refButton, ...props }: ButtonProps):
|
|
91
|
+
declare function Button$1({ type, theme, size, href, external, direct, target, label, children, focusable, active, icon, iconPosition, disabled, loading, disableOnLoading, withoutStyle, withoutBootstrapStyles, withoutTheme, outline, onClick, className, iconClassName, labelClassName, refButton, ...props }: ButtonProps): React$1.JSX.Element;
|
|
93
92
|
|
|
94
93
|
interface ButtonsProps {
|
|
95
94
|
buttons?: Button$2[];
|
|
@@ -100,12 +99,12 @@ interface ButtonsProps {
|
|
|
100
99
|
className?: string | null;
|
|
101
100
|
buttonClassName?: string | null;
|
|
102
101
|
}
|
|
103
|
-
declare function Buttons({ buttons, size, theme, renderButton, onClickButton, buttonClassName, className, }: ButtonsProps):
|
|
102
|
+
declare function Buttons({ buttons, size, theme, renderButton, onClickButton, buttonClassName, className, }: ButtonsProps): JSX.Element;
|
|
104
103
|
|
|
105
104
|
interface BackButtonProps extends ButtonProps {
|
|
106
105
|
className?: string | null;
|
|
107
106
|
}
|
|
108
|
-
declare function BackButton({ ...props }: BackButtonProps):
|
|
107
|
+
declare function BackButton({ ...props }: BackButtonProps): React$1.JSX.Element;
|
|
109
108
|
|
|
110
109
|
interface ClearButtonProps extends HTMLAttributes<HTMLButtonElement> {
|
|
111
110
|
onClick?: MouseEventHandler<HTMLButtonElement> | null;
|
|
@@ -113,7 +112,7 @@ interface ClearButtonProps extends HTMLAttributes<HTMLButtonElement> {
|
|
|
113
112
|
className?: string | null;
|
|
114
113
|
disabled?: boolean;
|
|
115
114
|
}
|
|
116
|
-
declare function ClearButton({ onClick, className, iconOnly, disabled, ...props }: ClearButtonProps):
|
|
115
|
+
declare function ClearButton({ onClick, className, iconOnly, disabled, ...props }: ClearButtonProps): React$1.JSX.Element;
|
|
117
116
|
|
|
118
117
|
interface FormProps {
|
|
119
118
|
action: string;
|
|
@@ -143,7 +142,7 @@ interface FormProps {
|
|
|
143
142
|
actionsClassName?: string | null;
|
|
144
143
|
cancelClassName?: string | null;
|
|
145
144
|
}
|
|
146
|
-
declare function Form({ action, method, fields: initialFields, initialValue, postForm, submitButtonLabel, submitButtonLoadingLabel, submitButtonTheme, cancelButtonTheme, buttons, children, actionsAlign, withoutActions, withoutComplete, withoutBackButton, onComplete, onResponse, onMessage, onCancel, onCancelHref, onOpenFieldForm, onCloseFieldForm, className, fieldsClassName, actionsClassName, cancelClassName, }: FormProps):
|
|
145
|
+
declare function Form({ action, method, fields: initialFields, initialValue, postForm, submitButtonLabel, submitButtonLoadingLabel, submitButtonTheme, cancelButtonTheme, buttons, children, actionsAlign, withoutActions, withoutComplete, withoutBackButton, onComplete, onResponse, onMessage, onCancel, onCancelHref, onOpenFieldForm, onCloseFieldForm, className, fieldsClassName, actionsClassName, cancelClassName, }: FormProps): React__default.JSX.Element;
|
|
147
146
|
|
|
148
147
|
interface FormPanelProps {
|
|
149
148
|
description?: React__default.ReactNode | null;
|
|
@@ -151,7 +150,7 @@ interface FormPanelProps {
|
|
|
151
150
|
children?: React__default.ReactNode | null;
|
|
152
151
|
className?: string | null;
|
|
153
152
|
}
|
|
154
|
-
declare function FormPanel({ description, loading, children, className, ...props }: FormPanelProps):
|
|
153
|
+
declare function FormPanel({ description, loading, children, className, ...props }: FormPanelProps): React__default.JSX.Element;
|
|
155
154
|
|
|
156
155
|
interface FieldFormProps {
|
|
157
156
|
name?: string | null;
|
|
@@ -165,55 +164,55 @@ interface FieldFormProps {
|
|
|
165
164
|
closeFieldForm: (...args: unknown[]) => void;
|
|
166
165
|
fieldContext?: unknown | null;
|
|
167
166
|
}
|
|
168
|
-
declare function FieldForm({ name, value, form, formComponents, fields, className, onChange, gotoFieldForm, closeFieldForm, fieldContext, }: FieldFormProps):
|
|
167
|
+
declare function FieldForm({ name, value, form, formComponents, fields, className, onChange, gotoFieldForm, closeFieldForm, fieldContext, }: FieldFormProps): React$1.JSX.Element | null;
|
|
169
168
|
|
|
170
169
|
interface ArrowIconProps {
|
|
171
170
|
className?: string | null;
|
|
172
171
|
color?: string;
|
|
173
172
|
}
|
|
174
|
-
declare function ArrowIcon({ color, className }: ArrowIconProps):
|
|
173
|
+
declare function ArrowIcon({ color, className }: ArrowIconProps): React__default.JSX.Element;
|
|
175
174
|
|
|
176
175
|
interface CloseIconProps {
|
|
177
176
|
className?: string | null;
|
|
178
177
|
color?: string;
|
|
179
178
|
}
|
|
180
|
-
declare function CloseIcon({ color, className }: CloseIconProps):
|
|
179
|
+
declare function CloseIcon({ color, className }: CloseIconProps): React__default.JSX.Element;
|
|
181
180
|
|
|
182
181
|
interface FullscreenIconProps {
|
|
183
182
|
className?: string | null;
|
|
184
183
|
color?: string;
|
|
185
184
|
}
|
|
186
|
-
declare function FullscreenIcon({ color, className }: FullscreenIconProps):
|
|
185
|
+
declare function FullscreenIcon({ color, className }: FullscreenIconProps): React__default.JSX.Element;
|
|
187
186
|
|
|
188
187
|
interface LinkIconProps {
|
|
189
188
|
className?: string | null;
|
|
190
189
|
color?: string;
|
|
191
190
|
}
|
|
192
|
-
declare function LinkIcon({ color, className }: LinkIconProps):
|
|
191
|
+
declare function LinkIcon({ color, className }: LinkIconProps): React__default.JSX.Element;
|
|
193
192
|
|
|
194
193
|
interface MuteIconProps {
|
|
195
194
|
className?: string | null;
|
|
196
195
|
color?: string;
|
|
197
196
|
}
|
|
198
|
-
declare function MuteIcon({ color, className }: MuteIconProps):
|
|
197
|
+
declare function MuteIcon({ color, className }: MuteIconProps): React__default.JSX.Element;
|
|
199
198
|
|
|
200
199
|
interface PauseIconProps {
|
|
201
200
|
className?: string | null;
|
|
202
201
|
color?: string;
|
|
203
202
|
}
|
|
204
|
-
declare function PauseIcon({ color, className }: PauseIconProps):
|
|
203
|
+
declare function PauseIcon({ color, className }: PauseIconProps): React__default.JSX.Element;
|
|
205
204
|
|
|
206
205
|
interface PlayIconProps {
|
|
207
206
|
className?: string | null;
|
|
208
207
|
color?: string | null;
|
|
209
208
|
}
|
|
210
|
-
declare function PlayIcon({ color, className }: PlayIconProps):
|
|
209
|
+
declare function PlayIcon({ color, className }: PlayIconProps): React__default.JSX.Element;
|
|
211
210
|
|
|
212
211
|
interface UnmuteIconProps {
|
|
213
212
|
className?: string | null;
|
|
214
213
|
color?: string;
|
|
215
214
|
}
|
|
216
|
-
declare function UnmuteIcon({ color, className }: UnmuteIconProps):
|
|
215
|
+
declare function UnmuteIcon({ color, className }: UnmuteIconProps): React__default.JSX.Element;
|
|
217
216
|
|
|
218
217
|
interface BreadcrumbProps {
|
|
219
218
|
items?: MenuItem$1[];
|
|
@@ -223,7 +222,7 @@ interface BreadcrumbProps {
|
|
|
223
222
|
noWrap?: boolean;
|
|
224
223
|
className?: string | null;
|
|
225
224
|
}
|
|
226
|
-
declare function Breadcrumb({ items, theme, separator, withoutBar, noWrap, className, }: BreadcrumbProps):
|
|
225
|
+
declare function Breadcrumb({ items, theme, separator, withoutBar, noWrap, className, }: BreadcrumbProps): React$1.JSX.Element;
|
|
227
226
|
|
|
228
227
|
interface DropdownProps {
|
|
229
228
|
items?: MenuItem$1[];
|
|
@@ -235,7 +234,7 @@ interface DropdownProps {
|
|
|
235
234
|
onClickItem?: ((...args: unknown[]) => void) | null;
|
|
236
235
|
onClickOutside?: ((...args: unknown[]) => void) | null;
|
|
237
236
|
}
|
|
238
|
-
declare function Dropdown({ items, children, visible, align, className, itemClassName, onClickItem, onClickOutside, }: DropdownProps):
|
|
237
|
+
declare function Dropdown({ items, children, visible, align, className, itemClassName, onClickItem, onClickOutside, }: DropdownProps): React$1.JSX.Element;
|
|
239
238
|
|
|
240
239
|
interface MenuProps {
|
|
241
240
|
items?: MenuItem[];
|
|
@@ -256,7 +255,7 @@ interface MenuProps {
|
|
|
256
255
|
dropdownLinkClassName?: string | null;
|
|
257
256
|
dropdownAlign?: DropdownAlign | null;
|
|
258
257
|
}
|
|
259
|
-
declare function Menu({ items, tagName, itemTagName, children, linkAsItem, className, itemClassName, linkClassName, hasSubMenuClassName, subMenuClassName, subMenuItemClassName, subMenuLinkClassName, hasDropdownClassName, dropdownClassName, dropdownItemClassName, dropdownLinkClassName, dropdownAlign, }: MenuProps):
|
|
258
|
+
declare function Menu({ items, tagName, itemTagName, children, linkAsItem, className, itemClassName, linkClassName, hasSubMenuClassName, subMenuClassName, subMenuItemClassName, subMenuLinkClassName, hasDropdownClassName, dropdownClassName, dropdownItemClassName, dropdownLinkClassName, dropdownAlign, }: MenuProps): React__default.JSX.Element;
|
|
260
259
|
|
|
261
260
|
interface NavbarProps {
|
|
262
261
|
brand?: React__default.ReactNode | null;
|
|
@@ -274,7 +273,7 @@ interface NavbarProps {
|
|
|
274
273
|
breadCrumbsClassName?: string | null;
|
|
275
274
|
collapseClassName?: string | null;
|
|
276
275
|
}
|
|
277
|
-
declare function Navbar({ brand, brandLink, breadcrumbs, theme, size, compact, noWrap, withoutCollapse, withoutCollapseToggle, children, className, brandClassName, breadCrumbsClassName, collapseClassName, }: NavbarProps):
|
|
276
|
+
declare function Navbar({ brand, brandLink, breadcrumbs, theme, size, compact, noWrap, withoutCollapse, withoutCollapseToggle, children, className, brandClassName, breadCrumbsClassName, collapseClassName, }: NavbarProps): React__default.JSX.Element;
|
|
278
277
|
|
|
279
278
|
interface PaginationMenuProps {
|
|
280
279
|
page?: number;
|
|
@@ -290,7 +289,7 @@ interface PaginationMenuProps {
|
|
|
290
289
|
linkClassName?: string | null;
|
|
291
290
|
onClickPage?: ((...args: unknown[]) => void) | null;
|
|
292
291
|
}
|
|
293
|
-
declare function PaginationMenu({ page: parentPage, lastPage: parentLastPage, maxPages: parentMaxPages, total: parentTotal, url, query, withPreviousNext, className, paginationClassName, itemClassName, linkClassName, onClickPage, }: PaginationMenuProps):
|
|
292
|
+
declare function PaginationMenu({ page: parentPage, lastPage: parentLastPage, maxPages: parentMaxPages, total: parentTotal, url, query, withPreviousNext, className, paginationClassName, itemClassName, linkClassName, onClickPage, }: PaginationMenuProps): React$1.JSX.Element;
|
|
294
293
|
|
|
295
294
|
interface TabsMenuProps {
|
|
296
295
|
items?: MenuItem$1[];
|
|
@@ -301,7 +300,7 @@ interface TabsMenuProps {
|
|
|
301
300
|
className?: string | null;
|
|
302
301
|
onClickItem?: ((...args: unknown[]) => void) | null;
|
|
303
302
|
}
|
|
304
|
-
declare function TabsMenu({ items, size, theme, renderItemButton, buttonClassName, className, onClickItem, }: TabsMenuProps):
|
|
303
|
+
declare function TabsMenu({ items, size, theme, renderItemButton, buttonClassName, className, onClickItem, }: TabsMenuProps): React$1.JSX.Element;
|
|
305
304
|
|
|
306
305
|
interface UploadModalProps {
|
|
307
306
|
type?: MediaType | unknown[] | null;
|
|
@@ -310,10 +309,10 @@ interface UploadModalProps {
|
|
|
310
309
|
onUploaded?: ((...args: unknown[]) => void) | null;
|
|
311
310
|
onRequestClose?: ((...args: unknown[]) => void) | null;
|
|
312
311
|
}
|
|
313
|
-
declare function UploadModal({ type, opened, sources, onUploaded, onRequestClose, }: UploadModalProps):
|
|
312
|
+
declare function UploadModal({ type, opened, sources, onUploaded, onRequestClose, }: UploadModalProps): React__default.JSX.Element | null;
|
|
314
313
|
|
|
315
314
|
declare const _default: {
|
|
316
|
-
(props: any):
|
|
315
|
+
(props: any): React__default.JSX.Element;
|
|
317
316
|
displayName: string;
|
|
318
317
|
};
|
|
319
318
|
|
|
@@ -322,14 +321,14 @@ interface PanelProps {
|
|
|
322
321
|
title?: string | null;
|
|
323
322
|
children?: React__default.ReactNode | null;
|
|
324
323
|
}
|
|
325
|
-
declare function Panel({ id, children, title }: PanelProps):
|
|
324
|
+
declare function Panel({ id, children, title }: PanelProps): React__default.JSX.Element;
|
|
326
325
|
|
|
327
326
|
interface PanelPortalProps {
|
|
328
327
|
id?: string | null;
|
|
329
328
|
data?: Record<string, unknown> | null;
|
|
330
329
|
children?: React__default.ReactNode | null;
|
|
331
330
|
}
|
|
332
|
-
declare function PanelPortal({ id, data, children }: PanelPortalProps): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> |
|
|
331
|
+
declare function PanelPortal({ id, data, children }: PanelPortalProps): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | React__default.JSX.Element | null;
|
|
333
332
|
|
|
334
333
|
interface CardProps {
|
|
335
334
|
href?: string | null;
|
|
@@ -360,7 +359,7 @@ interface CardProps {
|
|
|
360
359
|
onClickBody?: ((...args: unknown[]) => void) | null;
|
|
361
360
|
onClickFooter?: ((...args: unknown[]) => void) | null;
|
|
362
361
|
}
|
|
363
|
-
declare function Card({ href, header, image, imageAlt, imageOverlay, beforeBody, title, subtitle, children, afterBody, links, linksInSameBody, footer, theme, className, imageClassName, headerClassName, titleClassName, subtitleClassName, bodyClassName, footerClassName, onClick, onClickBody, onClickFooter, }: CardProps):
|
|
362
|
+
declare function Card({ href, header, image, imageAlt, imageOverlay, beforeBody, title, subtitle, children, afterBody, links, linksInSameBody, footer, theme, className, imageClassName, headerClassName, titleClassName, subtitleClassName, bodyClassName, footerClassName, onClick, onClickBody, onClickFooter, }: CardProps): React__default.JSX.Element;
|
|
364
363
|
|
|
365
364
|
interface CollapsablePanelProps {
|
|
366
365
|
title?: React__default.ReactNode | null;
|
|
@@ -371,7 +370,7 @@ interface CollapsablePanelProps {
|
|
|
371
370
|
openedClassName?: string | null;
|
|
372
371
|
buttonClassName?: string | null;
|
|
373
372
|
}
|
|
374
|
-
declare function CollapsablePanel({ title, children, className, topClassName, contentClassName, openedClassName, buttonClassName, }: CollapsablePanelProps):
|
|
373
|
+
declare function CollapsablePanel({ title, children, className, topClassName, contentClassName, openedClassName, buttonClassName, }: CollapsablePanelProps): React__default.JSX.Element;
|
|
375
374
|
|
|
376
375
|
interface CloseProps {
|
|
377
376
|
stroke?: string;
|
|
@@ -379,14 +378,14 @@ interface CloseProps {
|
|
|
379
378
|
fill?: string;
|
|
380
379
|
className?: string | null;
|
|
381
380
|
}
|
|
382
|
-
declare function Close({ stroke, border, fill, className, }: CloseProps):
|
|
381
|
+
declare function Close({ stroke, border, fill, className, }: CloseProps): React__default.JSX.Element;
|
|
383
382
|
|
|
384
383
|
interface DateProps {
|
|
385
384
|
date?: string | null;
|
|
386
385
|
withTime?: boolean;
|
|
387
386
|
timeSeparator?: ReactNode;
|
|
388
387
|
}
|
|
389
|
-
declare function Date({ date, withTime, timeSeparator }: DateProps):
|
|
388
|
+
declare function Date({ date, withTime, timeSeparator }: DateProps): React$1.JSX.Element;
|
|
390
389
|
|
|
391
390
|
interface DetectorProps {
|
|
392
391
|
throttleDelay?: number | null;
|
|
@@ -398,7 +397,7 @@ interface DetectorProps {
|
|
|
398
397
|
children?: React__default.ReactNode | null;
|
|
399
398
|
className?: string | null;
|
|
400
399
|
}
|
|
401
|
-
declare function Detector({ throttleDelay, threshold, onEnter, onLeave, onChange, disabled, children, className, }: DetectorProps):
|
|
400
|
+
declare function Detector({ throttleDelay, threshold, onEnter, onLeave, onChange, disabled, children, className, }: DetectorProps): React__default.JSX.Element;
|
|
402
401
|
|
|
403
402
|
interface ElementComponentProps {
|
|
404
403
|
name: string;
|
|
@@ -408,14 +407,14 @@ interface ElementComponentProps {
|
|
|
408
407
|
className?: string | null;
|
|
409
408
|
placeholderProps?: Record<string, unknown> | null;
|
|
410
409
|
}
|
|
411
|
-
declare function ElementComponent({ name, components, props, isPlaceholder, className, placeholderProps, }: ElementComponentProps):
|
|
410
|
+
declare function ElementComponent({ name, components, props, isPlaceholder, className, placeholderProps, }: ElementComponentProps): React__default.JSX.Element | "Bad component name" | "Bad component";
|
|
412
411
|
|
|
413
412
|
interface EmptyProps {
|
|
414
413
|
children?: React__default.ReactNode | null;
|
|
415
414
|
withoutBorder?: boolean;
|
|
416
415
|
className?: string | null;
|
|
417
416
|
}
|
|
418
|
-
declare function Empty({ children, withoutBorder, className }: EmptyProps):
|
|
417
|
+
declare function Empty({ children, withoutBorder, className }: EmptyProps): React__default.JSX.Element;
|
|
419
418
|
|
|
420
419
|
interface FontFacesProps {
|
|
421
420
|
fonts?: Font[];
|
|
@@ -424,14 +423,14 @@ interface FontFacesProps {
|
|
|
424
423
|
format?: string;
|
|
425
424
|
})[];
|
|
426
425
|
}
|
|
427
|
-
declare function FontFaces({ fonts, formats, }: FontFacesProps):
|
|
426
|
+
declare function FontFaces({ fonts, formats, }: FontFacesProps): React__default.JSX.Element | null;
|
|
428
427
|
|
|
429
428
|
interface LabelProps {
|
|
430
429
|
children: Label$2;
|
|
431
430
|
isHtml?: boolean;
|
|
432
431
|
values?: Record<string, unknown>;
|
|
433
432
|
}
|
|
434
|
-
declare function Label$1({ children, isHtml, values }: LabelProps): string | number | bigint | boolean | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> |
|
|
433
|
+
declare function Label$1({ children, isHtml, values }: LabelProps): string | number | bigint | boolean | Iterable<React$1.ReactNode> | Promise<string | number | bigint | boolean | React$1.ReactPortal | React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | Iterable<React$1.ReactNode> | null | undefined> | React$1.JSX.Element | null | undefined;
|
|
435
434
|
|
|
436
435
|
interface LinkProps {
|
|
437
436
|
href?: string;
|
|
@@ -442,7 +441,7 @@ interface LinkProps {
|
|
|
442
441
|
withoutStyle?: boolean;
|
|
443
442
|
className?: string | null;
|
|
444
443
|
}
|
|
445
|
-
declare function Link({ href, external, children, target, rel, className, withoutStyle, ...props }: LinkProps):
|
|
444
|
+
declare function Link({ href, external, children, target, rel, className, withoutStyle, ...props }: LinkProps): React__default.JSX.Element;
|
|
446
445
|
|
|
447
446
|
interface MediaProps {
|
|
448
447
|
thumbnail?: React__default.ReactNode | null;
|
|
@@ -454,7 +453,7 @@ interface MediaProps {
|
|
|
454
453
|
bodyClassName?: string | null;
|
|
455
454
|
titleClassName?: string | null;
|
|
456
455
|
}
|
|
457
|
-
declare function Media({ thumbnail, thumbnailAlign, children, title, className, thumbnailClassName, bodyClassName, titleClassName, }: MediaProps):
|
|
456
|
+
declare function Media({ thumbnail, thumbnailAlign, children, title, className, thumbnailClassName, bodyClassName, titleClassName, }: MediaProps): React__default.JSX.Element;
|
|
458
457
|
|
|
459
458
|
interface MetaProps {
|
|
460
459
|
title?: string | null;
|
|
@@ -464,7 +463,7 @@ interface MetaProps {
|
|
|
464
463
|
suffix?: string;
|
|
465
464
|
children?: React__default.ReactNode | null;
|
|
466
465
|
}
|
|
467
|
-
declare function Meta({ title, url, metadata, fullTitle, suffix, children, }: MetaProps):
|
|
466
|
+
declare function Meta({ title, url, metadata, fullTitle, suffix, children, }: MetaProps): React__default.JSX.Element;
|
|
468
467
|
|
|
469
468
|
interface SlideshowProps {
|
|
470
469
|
items?: React__default.ReactNode[];
|
|
@@ -475,7 +474,7 @@ interface SlideshowProps {
|
|
|
475
474
|
className?: string | null;
|
|
476
475
|
children?: React__default.ReactNode | null;
|
|
477
476
|
}
|
|
478
|
-
declare function Slideshow({ items, auto, delay, width, height, className, children, }: SlideshowProps):
|
|
477
|
+
declare function Slideshow({ items, auto, delay, width, height, className, children, }: SlideshowProps): React__default.JSX.Element;
|
|
479
478
|
|
|
480
479
|
interface SpinnerProps {
|
|
481
480
|
animated?: boolean;
|
|
@@ -483,7 +482,7 @@ interface SpinnerProps {
|
|
|
483
482
|
strokeWidth?: number;
|
|
484
483
|
className?: string | null;
|
|
485
484
|
}
|
|
486
|
-
declare function Spinner({ animated, color, strokeWidth, className, }: SpinnerProps):
|
|
485
|
+
declare function Spinner({ animated, color, strokeWidth, className, }: SpinnerProps): React__default.JSX.Element;
|
|
487
486
|
|
|
488
487
|
interface PlaceholderBlockProps {
|
|
489
488
|
width?: number | string;
|
|
@@ -495,29 +494,29 @@ interface PlaceholderBlockProps {
|
|
|
495
494
|
withInvertedColors?: boolean;
|
|
496
495
|
}
|
|
497
496
|
|
|
498
|
-
declare function AdFrame({ width, height, ...props }: PlaceholderBlockProps):
|
|
497
|
+
declare function AdFrame({ width, height, ...props }: PlaceholderBlockProps): React$1.JSX.Element;
|
|
499
498
|
|
|
500
|
-
declare function AdImage({ width, height, ...props }: PlaceholderBlockProps):
|
|
499
|
+
declare function AdImage({ width, height, ...props }: PlaceholderBlockProps): React$1.JSX.Element;
|
|
501
500
|
|
|
502
|
-
declare function Audio({ width, height, ...props }: PlaceholderBlockProps):
|
|
501
|
+
declare function Audio({ width, height, ...props }: PlaceholderBlockProps): React$1.JSX.Element;
|
|
503
502
|
|
|
504
|
-
declare function Button({ className, ...props }: PlaceholderBlockProps):
|
|
503
|
+
declare function Button({ className, ...props }: PlaceholderBlockProps): React$1.JSX.Element;
|
|
505
504
|
|
|
506
505
|
interface PlaceholderImageProps extends PlaceholderBlockProps {
|
|
507
506
|
width?: number | string;
|
|
508
507
|
height?: number | string;
|
|
509
508
|
className?: string | null;
|
|
510
509
|
}
|
|
511
|
-
declare function PlaceholderImage({ width, height, className, ...props }: PlaceholderImageProps):
|
|
510
|
+
declare function PlaceholderImage({ width, height, className, ...props }: PlaceholderImageProps): React$1.JSX.Element;
|
|
512
511
|
|
|
513
|
-
declare function Line(props: any):
|
|
512
|
+
declare function Line(props: any): React__default.JSX.Element;
|
|
514
513
|
|
|
515
514
|
interface MapPlaceholderProps extends PlaceholderBlockProps {
|
|
516
515
|
withImages?: boolean;
|
|
517
516
|
}
|
|
518
|
-
declare function Map({ withImages, className, ...props }: MapPlaceholderProps):
|
|
517
|
+
declare function Map({ withImages, className, ...props }: MapPlaceholderProps): React$1.JSX.Element;
|
|
519
518
|
|
|
520
|
-
declare function MapPath({ width, height, ...props }: PlaceholderBlockProps):
|
|
519
|
+
declare function MapPath({ width, height, ...props }: PlaceholderBlockProps): React$1.JSX.Element;
|
|
521
520
|
|
|
522
521
|
interface PlaceholderTextProps {
|
|
523
522
|
lines?: number;
|
|
@@ -528,23 +527,23 @@ interface PlaceholderTextProps {
|
|
|
528
527
|
className?: string | null;
|
|
529
528
|
}
|
|
530
529
|
|
|
531
|
-
declare function Quote({ height, lines, ...props }: PlaceholderTextProps):
|
|
530
|
+
declare function Quote({ height, lines, ...props }: PlaceholderTextProps): React$1.JSX.Element;
|
|
532
531
|
|
|
533
|
-
declare function ShortText({ height, lines, ...props }: PlaceholderTextProps):
|
|
532
|
+
declare function ShortText({ height, lines, ...props }: PlaceholderTextProps): React$1.JSX.Element;
|
|
534
533
|
|
|
535
|
-
declare function Subtitle({ height, lines, ...props }: PlaceholderTextProps):
|
|
534
|
+
declare function Subtitle({ height, lines, ...props }: PlaceholderTextProps): React$1.JSX.Element;
|
|
536
535
|
|
|
537
|
-
declare function TextPlaceholder({ height, lines, ...props }: PlaceholderTextProps):
|
|
536
|
+
declare function TextPlaceholder({ height, lines, ...props }: PlaceholderTextProps): React$1.JSX.Element;
|
|
538
537
|
|
|
539
|
-
declare function Timeline(props: any):
|
|
538
|
+
declare function Timeline(props: any): React$1.JSX.Element;
|
|
540
539
|
|
|
541
|
-
declare function Title({ height, lines, ...props }: PlaceholderTextProps):
|
|
540
|
+
declare function Title({ height, lines, ...props }: PlaceholderTextProps): React$1.JSX.Element;
|
|
542
541
|
|
|
543
|
-
declare function Video({ width, height, ...props }: PlaceholderBlockProps):
|
|
542
|
+
declare function Video({ width, height, ...props }: PlaceholderBlockProps): React$1.JSX.Element;
|
|
544
543
|
|
|
545
|
-
declare function Video360({ width, height, className, ...props }: PlaceholderBlockProps):
|
|
544
|
+
declare function Video360({ width, height, className, ...props }: PlaceholderBlockProps): React$1.JSX.Element;
|
|
546
545
|
|
|
547
|
-
declare function VideoLoop({ width, height, ...props }: PlaceholderBlockProps):
|
|
546
|
+
declare function VideoLoop({ width, height, ...props }: PlaceholderBlockProps): React$1.JSX.Element;
|
|
548
547
|
|
|
549
548
|
interface ScreenSizerProps {
|
|
550
549
|
width?: number | null;
|
|
@@ -555,7 +554,7 @@ interface ScreenSizerProps {
|
|
|
555
554
|
className?: string | null;
|
|
556
555
|
children: ReactNode;
|
|
557
556
|
}
|
|
558
|
-
declare function ScreenSizer({ width, height, fit, screenWidth, screenHeight, className, children, }: ScreenSizerProps):
|
|
557
|
+
declare function ScreenSizer({ width, height, fit, screenWidth, screenHeight, className, children, }: ScreenSizerProps): React$1.JSX.Element;
|
|
559
558
|
|
|
560
559
|
interface ScreenProps {
|
|
561
560
|
screen: StoryComponent$1;
|
|
@@ -564,13 +563,14 @@ interface ScreenProps {
|
|
|
564
563
|
index?: number | null;
|
|
565
564
|
active?: boolean;
|
|
566
565
|
preload?: boolean;
|
|
566
|
+
focusable?: boolean;
|
|
567
567
|
current?: boolean;
|
|
568
568
|
component?: React__default.ReactNode | null;
|
|
569
569
|
components?: Record<string, ElementType> | null;
|
|
570
570
|
className?: string | null;
|
|
571
571
|
mediaRef?: ForwardedRef<MediaElement> | null;
|
|
572
572
|
}
|
|
573
|
-
declare function Screen({ screen, renderContext, screenState, index, active, current, preload, components, component, className, mediaRef, }: ScreenProps):
|
|
573
|
+
declare function Screen({ screen, renderContext, screenState, index, active, current, preload, focusable, components, component, className, mediaRef, }: ScreenProps): React__default.JSX.Element;
|
|
574
574
|
|
|
575
575
|
interface ScreenPlaceholderProps {
|
|
576
576
|
screen: Component;
|
|
@@ -581,7 +581,7 @@ interface ScreenPlaceholderProps {
|
|
|
581
581
|
withSize?: boolean;
|
|
582
582
|
className?: string | null;
|
|
583
583
|
}
|
|
584
|
-
declare function ScreenPlaceholder({ screen, layout, screenWidth, screenHeight, screenState, withSize, className, ...props }: ScreenPlaceholderProps):
|
|
584
|
+
declare function ScreenPlaceholder({ screen, layout, screenWidth, screenHeight, screenState, withSize, className, ...props }: ScreenPlaceholderProps): React__default.JSX.Element;
|
|
585
585
|
|
|
586
586
|
interface ScreenPreviewProps {
|
|
587
587
|
screen: Component;
|
|
@@ -594,7 +594,7 @@ interface ScreenPreviewProps {
|
|
|
594
594
|
withSize?: boolean;
|
|
595
595
|
hidden?: boolean;
|
|
596
596
|
}
|
|
597
|
-
declare function ScreenPreview({ screen, screenState, width, height, screenWidth, screenHeight, className, withSize, fit, hidden, ...props }: ScreenPreviewProps):
|
|
597
|
+
declare function ScreenPreview({ screen, screenState, width, height, screenWidth, screenHeight, className, withSize, fit, hidden, ...props }: ScreenPreviewProps): React__default.JSX.Element;
|
|
598
598
|
|
|
599
599
|
interface ScreenElementProps {
|
|
600
600
|
children?: React__default.ReactNode | null;
|
|
@@ -607,14 +607,14 @@ interface ScreenElementProps {
|
|
|
607
607
|
emptyClassName?: string | null;
|
|
608
608
|
placeholderClassName?: string | null;
|
|
609
609
|
}
|
|
610
|
-
declare function ScreenElement({ children, placeholder, empty, emptyLabel, preview, isEmpty, placeholderProps, emptyClassName, placeholderClassName, }: ScreenElementProps): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> |
|
|
610
|
+
declare function ScreenElement({ children, placeholder, empty, emptyLabel, preview, isEmpty, placeholderProps, emptyClassName, placeholderClassName, }: ScreenElementProps): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | React__default.JSX.Element | null;
|
|
611
611
|
|
|
612
612
|
interface ScreensProps {
|
|
613
613
|
screens: StoryComponent[];
|
|
614
614
|
screen?: string | null;
|
|
615
615
|
className?: string | null;
|
|
616
616
|
}
|
|
617
|
-
declare function Screens({ screens, screen: screenId, className }: ScreensProps):
|
|
617
|
+
declare function Screens({ screens, screen: screenId, className }: ScreensProps): React__default.JSX.Element;
|
|
618
618
|
|
|
619
619
|
interface TransitionsProps {
|
|
620
620
|
fullscreen?: boolean;
|
|
@@ -625,7 +625,7 @@ interface TransitionsProps {
|
|
|
625
625
|
disabled?: boolean;
|
|
626
626
|
children?: React__default.ReactNode | null;
|
|
627
627
|
}
|
|
628
|
-
declare function Transitions$1({ fullscreen, playing, delay, transitions, onComplete, disabled, children, }: TransitionsProps): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> |
|
|
628
|
+
declare function Transitions$1({ fullscreen, playing, delay, transitions, onComplete, disabled, children, }: TransitionsProps): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | React__default.JSX.Element | null;
|
|
629
629
|
|
|
630
630
|
interface TransitionsStaggerProps {
|
|
631
631
|
transitions?: Transitions | null;
|
|
@@ -636,21 +636,21 @@ interface TransitionsStaggerProps {
|
|
|
636
636
|
fullscreen?: boolean;
|
|
637
637
|
children?: React__default.ReactNode | null;
|
|
638
638
|
}
|
|
639
|
-
declare function TransitionsStagger({ transitions, stagger, playing, disabled, delay, fullscreen, children, }: TransitionsStaggerProps): (string | number | bigint | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> |
|
|
639
|
+
declare function TransitionsStagger({ transitions, stagger, playing, disabled, delay, fullscreen, children, }: TransitionsStaggerProps): (string | number | bigint | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | React__default.JSX.Element)[] | null | undefined;
|
|
640
640
|
|
|
641
641
|
interface HighlightStyleProps {
|
|
642
642
|
selector?: string | null;
|
|
643
643
|
highlightSelector?: string;
|
|
644
644
|
style?: Record<string, string | number> | null;
|
|
645
645
|
}
|
|
646
|
-
declare function HighlightStyle({ selector, highlightSelector, style, }: HighlightStyleProps):
|
|
646
|
+
declare function HighlightStyle({ selector, highlightSelector, style, }: HighlightStyleProps): React__default.JSX.Element | null;
|
|
647
647
|
|
|
648
648
|
interface LinkStyleProps {
|
|
649
649
|
selector?: string | null;
|
|
650
650
|
linkSelector?: string;
|
|
651
651
|
style?: Record<string, string | number> | null;
|
|
652
652
|
}
|
|
653
|
-
declare function LinkStyle({ selector, linkSelector, style }: LinkStyleProps):
|
|
653
|
+
declare function LinkStyle({ selector, linkSelector, style }: LinkStyleProps): React__default.JSX.Element | null;
|
|
654
654
|
|
|
655
655
|
export { ArrowIcon, BackButton, Breadcrumb, Button$1 as Button, Buttons, Card, ClearButton, Close, CloseIcon, CollapsablePanel, Date, Detector, Dropdown as DropdownMenu, ElementComponent as Element, Empty, FieldForm, FontFaces, Form, FormPanel, FullscreenIcon, HighlightStyle, Label$1 as Label, Link, LinkIcon, LinkStyle, Media, Menu, Meta, MuteIcon, Navbar, PaginationMenu as Pagination, Panel, PanelPortal, _default as Panels, PauseIcon, AdFrame as PlaceholderAdFrame, AdImage as PlaceholderAdImage, Audio as PlaceholderAudio, Button as PlaceholderButton, PlaceholderImage, Line as PlaceholderLine, Map as PlaceholderMap, MapPath as PlaceholderMapPath, Quote as PlaceholderQuote, ShortText as PlaceholderShortText, Subtitle as PlaceholderSubtitle, TextPlaceholder as PlaceholderText, Timeline as PlaceholderTimeline, Title as PlaceholderTitle, Video as PlaceholderVideo, Video360 as PlaceholderVideo360, VideoLoop as PlaceholderVideoLoop, PlayIcon, Screen, ScreenElement, ScreenPlaceholder, ScreenPreview, ScreenSizer, Screens, Slideshow, Spinner, TabsMenu as Tabs, Transitions$1 as Transitions, TransitionsStagger, UnmuteIcon, UploadModal };
|
|
656
656
|
export type { ButtonProps };
|
package/es/components.js
CHANGED
|
@@ -5086,7 +5086,7 @@ function ScreenSizer(t0) {
|
|
|
5086
5086
|
var styles$4 = {"container":"micromag-core-screens-screen-container"};
|
|
5087
5087
|
|
|
5088
5088
|
function Screen(t0) {
|
|
5089
|
-
const $ = c(
|
|
5089
|
+
const $ = c(21);
|
|
5090
5090
|
const {
|
|
5091
5091
|
screen,
|
|
5092
5092
|
renderContext: t1,
|
|
@@ -5095,10 +5095,11 @@ function Screen(t0) {
|
|
|
5095
5095
|
active: t4,
|
|
5096
5096
|
current: t5,
|
|
5097
5097
|
preload: t6,
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5098
|
+
focusable: t7,
|
|
5099
|
+
components: t8,
|
|
5100
|
+
component: t9,
|
|
5101
|
+
className: t10,
|
|
5102
|
+
mediaRef: t11
|
|
5102
5103
|
} = t0;
|
|
5103
5104
|
const renderContext = t1 === undefined ? null : t1;
|
|
5104
5105
|
const screenState = t2 === undefined ? null : t2;
|
|
@@ -5106,38 +5107,41 @@ function Screen(t0) {
|
|
|
5106
5107
|
const active = t4 === undefined ? true : t4;
|
|
5107
5108
|
const current = t5 === undefined ? false : t5;
|
|
5108
5109
|
const preload = t6 === undefined ? true : t6;
|
|
5109
|
-
const
|
|
5110
|
-
const
|
|
5111
|
-
const
|
|
5112
|
-
const
|
|
5113
|
-
|
|
5110
|
+
const focusable = t7 === undefined ? true : t7;
|
|
5111
|
+
const components = t8 === undefined ? null : t8;
|
|
5112
|
+
const component = t9 === undefined ? null : t9;
|
|
5113
|
+
const className = t10 === undefined ? null : t10;
|
|
5114
|
+
const mediaRef = t11 === undefined ? null : t11;
|
|
5115
|
+
let t12;
|
|
5114
5116
|
if ($[0] !== screen) {
|
|
5115
|
-
|
|
5117
|
+
t12 = screen || {};
|
|
5116
5118
|
$[0] = screen;
|
|
5117
|
-
$[1] =
|
|
5119
|
+
$[1] = t12;
|
|
5118
5120
|
} else {
|
|
5119
|
-
|
|
5121
|
+
t12 = $[1];
|
|
5120
5122
|
}
|
|
5121
5123
|
const {
|
|
5122
|
-
type:
|
|
5123
|
-
} =
|
|
5124
|
-
const type =
|
|
5125
|
-
let
|
|
5124
|
+
type: t13
|
|
5125
|
+
} = t12;
|
|
5126
|
+
const type = t13 === undefined ? null : t13;
|
|
5127
|
+
let t14;
|
|
5126
5128
|
if ($[2] !== components || $[3] !== type) {
|
|
5127
|
-
|
|
5129
|
+
t14 = components !== null ? getComponentFromName(type, components) || null : null;
|
|
5128
5130
|
$[2] = components;
|
|
5129
5131
|
$[3] = type;
|
|
5130
|
-
$[4] =
|
|
5132
|
+
$[4] = t14;
|
|
5131
5133
|
} else {
|
|
5132
|
-
|
|
5134
|
+
t14 = $[4];
|
|
5133
5135
|
}
|
|
5134
|
-
const CustomScreenComponent =
|
|
5136
|
+
const CustomScreenComponent = t14;
|
|
5135
5137
|
const ContextScreenComponent = useScreenComponent(type);
|
|
5136
5138
|
const ScreenComponent = CustomScreenComponent || ContextScreenComponent;
|
|
5137
|
-
let
|
|
5138
|
-
if ($[5] !== ScreenComponent || $[6] !== active || $[7] !== className || $[8] !== component || $[9] !== current || $[10] !==
|
|
5139
|
-
|
|
5139
|
+
let t15;
|
|
5140
|
+
if ($[5] !== ScreenComponent || $[6] !== active || $[7] !== className || $[8] !== component || $[9] !== current || $[10] !== focusable || $[11] !== index || $[12] !== mediaRef || $[13] !== preload || $[14] !== screen) {
|
|
5141
|
+
t15 = ScreenComponent !== null ? /*#__PURE__*/jsx("div", {
|
|
5140
5142
|
className: classNames([styles$4.container, className]),
|
|
5143
|
+
tabIndex: focusable ? 0 : -1,
|
|
5144
|
+
"aria-hidden": current || active ? "false" : "true",
|
|
5141
5145
|
children: /*#__PURE__*/jsx(ScreenComponent, {
|
|
5142
5146
|
...screen,
|
|
5143
5147
|
index: index,
|
|
@@ -5148,6 +5152,7 @@ function Screen(t0) {
|
|
|
5148
5152
|
})
|
|
5149
5153
|
}) : /*#__PURE__*/jsx("div", {
|
|
5150
5154
|
className: className,
|
|
5155
|
+
tabIndex: focusable ? 0 : -1,
|
|
5151
5156
|
children: component
|
|
5152
5157
|
});
|
|
5153
5158
|
$[5] = ScreenComponent;
|
|
@@ -5155,31 +5160,32 @@ function Screen(t0) {
|
|
|
5155
5160
|
$[7] = className;
|
|
5156
5161
|
$[8] = component;
|
|
5157
5162
|
$[9] = current;
|
|
5158
|
-
$[10] =
|
|
5159
|
-
$[11] =
|
|
5160
|
-
$[12] =
|
|
5161
|
-
$[13] =
|
|
5162
|
-
$[14] =
|
|
5163
|
+
$[10] = focusable;
|
|
5164
|
+
$[11] = index;
|
|
5165
|
+
$[12] = mediaRef;
|
|
5166
|
+
$[13] = preload;
|
|
5167
|
+
$[14] = screen;
|
|
5168
|
+
$[15] = t15;
|
|
5163
5169
|
} else {
|
|
5164
|
-
|
|
5170
|
+
t15 = $[15];
|
|
5165
5171
|
}
|
|
5166
|
-
let
|
|
5167
|
-
if ($[
|
|
5168
|
-
|
|
5172
|
+
let t16;
|
|
5173
|
+
if ($[16] !== renderContext || $[17] !== screen || $[18] !== screenState || $[19] !== t15) {
|
|
5174
|
+
t16 = /*#__PURE__*/jsx(ScreenProvider, {
|
|
5169
5175
|
data: screen,
|
|
5170
5176
|
renderContext: renderContext,
|
|
5171
5177
|
screenState: screenState,
|
|
5172
|
-
children:
|
|
5178
|
+
children: t15
|
|
5173
5179
|
});
|
|
5174
|
-
$[
|
|
5175
|
-
$[
|
|
5176
|
-
$[
|
|
5177
|
-
$[18] = t14;
|
|
5180
|
+
$[16] = renderContext;
|
|
5181
|
+
$[17] = screen;
|
|
5182
|
+
$[18] = screenState;
|
|
5178
5183
|
$[19] = t15;
|
|
5184
|
+
$[20] = t16;
|
|
5179
5185
|
} else {
|
|
5180
|
-
|
|
5186
|
+
t16 = $[20];
|
|
5181
5187
|
}
|
|
5182
|
-
return
|
|
5188
|
+
return t16;
|
|
5183
5189
|
}
|
|
5184
5190
|
|
|
5185
5191
|
var styles$3 = {"screen":"micromag-core-screens-screen-placeholder-screen"};
|
package/es/contexts.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
1
|
import * as React from 'react';
|
|
3
2
|
import React__default, { ReactNode, ElementType, ComponentType } from 'react';
|
|
4
3
|
import EventEmitter from 'wolfy87-eventemitter';
|
|
@@ -293,7 +292,7 @@ interface ComponentsProviderProps {
|
|
|
293
292
|
manager?: ComponentsManager | null;
|
|
294
293
|
components?: Record<string, Record<string, ElementType>> | Record<string, ElementType>;
|
|
295
294
|
}
|
|
296
|
-
declare function ComponentsProvider({ components, manager, namespace, children, }: ComponentsProviderProps):
|
|
295
|
+
declare function ComponentsProvider({ components, manager, namespace, children, }: ComponentsProviderProps): React__default.JSX.Element;
|
|
297
296
|
|
|
298
297
|
declare const ConsentContext: React__default.Context<{
|
|
299
298
|
consent: null;
|
|
@@ -310,7 +309,7 @@ interface ConsentProviderProps {
|
|
|
310
309
|
expiration?: number;
|
|
311
310
|
children?: React__default.ReactNode | null;
|
|
312
311
|
}
|
|
313
|
-
declare function ConsentProvider({ consent: providedConsent, consented: initialConsented, expiration, children, }: ConsentProviderProps):
|
|
312
|
+
declare function ConsentProvider({ consent: providedConsent, consented: initialConsented, expiration, children, }: ConsentProviderProps): React__default.JSX.Element;
|
|
314
313
|
|
|
315
314
|
declare const EditorContext: React__default.Context<null>;
|
|
316
315
|
declare const useEditor: () => null;
|
|
@@ -318,7 +317,7 @@ declare const useGetColors: () => () => never[];
|
|
|
318
317
|
interface EditorProviderProps {
|
|
319
318
|
children: React__default.ReactNode;
|
|
320
319
|
}
|
|
321
|
-
declare function EditorProvider({ children }: EditorProviderProps):
|
|
320
|
+
declare function EditorProvider({ children }: EditorProviderProps): React__default.JSX.Element;
|
|
322
321
|
|
|
323
322
|
declare const FieldsContext: React.Context<FieldsManager | null>;
|
|
324
323
|
declare const useFieldsManager: () => FieldsManager | null;
|
|
@@ -328,7 +327,7 @@ interface FieldsProviderProps {
|
|
|
328
327
|
manager?: FieldsManager | null;
|
|
329
328
|
children: ReactNode;
|
|
330
329
|
}
|
|
331
|
-
declare function FieldsProvider({ fields, manager, children }: FieldsProviderProps):
|
|
330
|
+
declare function FieldsProvider({ fields, manager, children }: FieldsProviderProps): React.JSX.Element;
|
|
332
331
|
|
|
333
332
|
declare const FieldsValueContext: React__default.Context<null>;
|
|
334
333
|
declare const useFieldsValue: () => null;
|
|
@@ -336,7 +335,7 @@ interface FieldsValueContextProviderProps {
|
|
|
336
335
|
value?: unknown;
|
|
337
336
|
children: React__default.ReactNode;
|
|
338
337
|
}
|
|
339
|
-
declare function FieldsValueContextProvider({ value, children }: FieldsValueContextProviderProps):
|
|
338
|
+
declare function FieldsValueContextProvider({ value, children }: FieldsValueContextProviderProps): React__default.JSX.Element;
|
|
340
339
|
|
|
341
340
|
declare const FieldContext: React__default.Context<null>;
|
|
342
341
|
declare const useFieldContext: () => null;
|
|
@@ -344,36 +343,37 @@ interface FieldContextProviderProps {
|
|
|
344
343
|
context?: unknown;
|
|
345
344
|
children: React__default.ReactNode;
|
|
346
345
|
}
|
|
347
|
-
declare function FieldContextProvider({ context, children }: FieldContextProviderProps):
|
|
346
|
+
declare function FieldContextProvider({ context, children }: FieldContextProviderProps): React__default.JSX.Element;
|
|
348
347
|
|
|
349
|
-
declare const FontsContext:
|
|
348
|
+
declare const FontsContext: React.Context<{
|
|
350
349
|
systemFonts: null;
|
|
351
350
|
googleFonts: null;
|
|
352
351
|
customFonts: null;
|
|
352
|
+
loadGoogleFonts: null;
|
|
353
353
|
}>;
|
|
354
354
|
declare const useGoogleFonts: (options?: null) => null;
|
|
355
|
-
declare const useFonts: (
|
|
355
|
+
declare const useFonts: () => {
|
|
356
356
|
systemFonts: null;
|
|
357
357
|
googleFonts: null;
|
|
358
358
|
customFonts: null;
|
|
359
359
|
};
|
|
360
360
|
interface FontsProviderProps {
|
|
361
|
-
children:
|
|
361
|
+
children: ReactNode;
|
|
362
362
|
systemFonts?: Font[];
|
|
363
363
|
customFonts?: Font[];
|
|
364
364
|
}
|
|
365
|
-
declare function FontsProvider({ systemFonts, customFonts, children, }: FontsProviderProps):
|
|
365
|
+
declare function FontsProvider({ systemFonts, customFonts, children, }: FontsProviderProps): React.JSX.Element;
|
|
366
366
|
|
|
367
367
|
declare const GoogleApiClientContext: React__default.Context<null>;
|
|
368
368
|
declare const useGoogleApiClient: () => null;
|
|
369
369
|
declare const withGoogleApiClient: (WrappedComponent: any) => {
|
|
370
|
-
(props: any):
|
|
370
|
+
(props: any): React__default.JSX.Element;
|
|
371
371
|
displayName: string;
|
|
372
372
|
};
|
|
373
373
|
interface GoogleApiClientProviderProps {
|
|
374
374
|
children: React__default.ReactNode;
|
|
375
375
|
}
|
|
376
|
-
declare function GoogleApiClientProvider({ children }: GoogleApiClientProviderProps):
|
|
376
|
+
declare function GoogleApiClientProvider({ children }: GoogleApiClientProviderProps): React__default.JSX.Element;
|
|
377
377
|
|
|
378
378
|
declare const GoogleKeysContext: React.Context<{
|
|
379
379
|
apiKey: null;
|
|
@@ -385,12 +385,12 @@ interface GoogleKeysProviderProps {
|
|
|
385
385
|
children: ReactNode;
|
|
386
386
|
apiKey?: string | null;
|
|
387
387
|
}
|
|
388
|
-
declare function GoogleKeysProvider({ children, apiKey }: GoogleKeysProviderProps):
|
|
388
|
+
declare function GoogleKeysProvider({ children, apiKey }: GoogleKeysProviderProps): React.JSX.Element;
|
|
389
389
|
|
|
390
390
|
declare const GoogleMapsClientContext: React__default.Context<null>;
|
|
391
391
|
declare const useGoogleMapsClient: () => null;
|
|
392
392
|
declare const withGoogleMapsClient: (WrappedComponent: any) => {
|
|
393
|
-
(props: any):
|
|
393
|
+
(props: any): React__default.JSX.Element;
|
|
394
394
|
displayName: string;
|
|
395
395
|
};
|
|
396
396
|
interface GoogleMapsClientProviderProps {
|
|
@@ -398,7 +398,7 @@ interface GoogleMapsClientProviderProps {
|
|
|
398
398
|
locale?: string;
|
|
399
399
|
libraries?: string[];
|
|
400
400
|
}
|
|
401
|
-
declare function GoogleMapsClientProvider({ children, locale, libraries }: GoogleMapsClientProviderProps):
|
|
401
|
+
declare function GoogleMapsClientProvider({ children, locale, libraries }: GoogleMapsClientProviderProps): React__default.JSX.Element;
|
|
402
402
|
|
|
403
403
|
declare const PanelsContext: React__default.Context<{
|
|
404
404
|
container: null;
|
|
@@ -407,14 +407,14 @@ declare const usePanels: () => {
|
|
|
407
407
|
container: null;
|
|
408
408
|
};
|
|
409
409
|
declare const withPanels: (WrappedComponent: any) => {
|
|
410
|
-
(props: any):
|
|
410
|
+
(props: any): React__default.JSX.Element;
|
|
411
411
|
displayName: string;
|
|
412
412
|
};
|
|
413
413
|
interface PanelsProviderProps {
|
|
414
414
|
children: React__default.ReactNode;
|
|
415
415
|
container?: Record<string, unknown>;
|
|
416
416
|
}
|
|
417
|
-
declare function PanelsProvider({ children, container: initialContainer }: PanelsProviderProps):
|
|
417
|
+
declare function PanelsProvider({ children, container: initialContainer }: PanelsProviderProps): React__default.JSX.Element;
|
|
418
418
|
|
|
419
419
|
interface PlaybackControlsTheme {
|
|
420
420
|
seekBarOnly?: boolean;
|
|
@@ -468,7 +468,7 @@ interface PlaybackProviderProps {
|
|
|
468
468
|
paused?: boolean;
|
|
469
469
|
currentQualityLevel?: number | null;
|
|
470
470
|
}
|
|
471
|
-
declare function PlaybackProvider({ muted: initialMuted, playing: initialPlaying, paused, controls: initialControls, controlsSuggestPlay: initialControlsSuggestPlay, controlsVisible: initialControlsVisible, controlsTheme: initialControlsTheme, currentQualityLevel: initialCurrentQualityLevel, children, }: PlaybackProviderProps):
|
|
471
|
+
declare function PlaybackProvider({ muted: initialMuted, playing: initialPlaying, paused, controls: initialControls, controlsSuggestPlay: initialControlsSuggestPlay, controlsVisible: initialControlsVisible, controlsTheme: initialControlsTheme, currentQualityLevel: initialCurrentQualityLevel, children, }: PlaybackProviderProps): React.JSX.Element;
|
|
472
472
|
|
|
473
473
|
declare const useRoutePush: () => (route: any, data: any, ...args: any[]) => void;
|
|
474
474
|
declare const useRouteBack: () => () => void;
|
|
@@ -480,7 +480,7 @@ interface SettingsProviderProps {
|
|
|
480
480
|
children: React__default.ReactNode;
|
|
481
481
|
settings?: Record<string, unknown>;
|
|
482
482
|
}
|
|
483
|
-
declare function SettingsProvider({ children, settings }: SettingsProviderProps):
|
|
483
|
+
declare function SettingsProvider({ children, settings }: SettingsProviderProps): React__default.JSX.Element;
|
|
484
484
|
|
|
485
485
|
declare const ScreenContext: React__default.Context<{
|
|
486
486
|
data: null;
|
|
@@ -511,7 +511,7 @@ interface ScreenProviderProps {
|
|
|
511
511
|
renderContext?: RenderContext;
|
|
512
512
|
screenState?: string;
|
|
513
513
|
}
|
|
514
|
-
declare function ScreenProvider({ data, definition, renderContext, screenState, children, }: ScreenProviderProps):
|
|
514
|
+
declare function ScreenProvider({ data, definition, renderContext, screenState, children, }: ScreenProviderProps): React__default.JSX.Element;
|
|
515
515
|
|
|
516
516
|
declare const ScreensContext: React.Context<null>;
|
|
517
517
|
declare const useScreensManager: () => null;
|
|
@@ -522,7 +522,7 @@ interface ScreensProviderProps {
|
|
|
522
522
|
manager?: ScreensManager | null;
|
|
523
523
|
children: ReactNode;
|
|
524
524
|
}
|
|
525
|
-
declare function ScreensProvider({ screens, namespaces, filterNamespaces, manager, children, }: ScreensProviderProps):
|
|
525
|
+
declare function ScreensProvider({ screens, namespaces, filterNamespaces, manager, children, }: ScreensProviderProps): React.JSX.Element;
|
|
526
526
|
|
|
527
527
|
declare const ScreenSizeContext: React__default.Context<{
|
|
528
528
|
screen: null;
|
|
@@ -544,7 +544,7 @@ interface ScreenSizeProviderProps {
|
|
|
544
544
|
children: React__default.ReactNode;
|
|
545
545
|
size?: ScreenSize;
|
|
546
546
|
}
|
|
547
|
-
declare function ScreenSizeProvider({ size, children }: ScreenSizeProviderProps):
|
|
547
|
+
declare function ScreenSizeProvider({ size, children }: ScreenSizeProviderProps): React__default.JSX.Element;
|
|
548
548
|
|
|
549
549
|
declare const StoryContext: React__default.Context<Story | null>;
|
|
550
550
|
declare const useStoryContext: () => Story | null;
|
|
@@ -553,10 +553,10 @@ interface StoryProviderProps {
|
|
|
553
553
|
story?: Story | null;
|
|
554
554
|
children: ReactNode;
|
|
555
555
|
}
|
|
556
|
-
declare function StoryProvider({ story, children }: StoryProviderProps):
|
|
556
|
+
declare function StoryProvider({ story, children }: StoryProviderProps): React__default.JSX.Element;
|
|
557
557
|
|
|
558
558
|
declare const useTracking: () => _folklore_tracking.Tracking;
|
|
559
|
-
declare function TrackingProvider(options?: null):
|
|
559
|
+
declare function TrackingProvider(options?: null): React__default.JSX.Element;
|
|
560
560
|
|
|
561
561
|
interface ViewerContextType {
|
|
562
562
|
events: EventEmitter;
|
|
@@ -620,7 +620,7 @@ interface ViewerProviderProps {
|
|
|
620
620
|
disableInteraction?: (...args: unknown[]) => void;
|
|
621
621
|
enableInteraction?: (...args: unknown[]) => void;
|
|
622
622
|
}
|
|
623
|
-
declare function ViewerProvider({ children, events, menuVisible, menuOverScreen, activityDetected, width, height, topHeight, bottomHeight, bottomSidesWidth, gotoNextScreen, gotoPreviousScreen, disableInteraction, enableInteraction, }: ViewerProviderProps):
|
|
623
|
+
declare function ViewerProvider({ children, events, menuVisible, menuOverScreen, activityDetected, width, height, topHeight, bottomHeight, bottomSidesWidth, gotoNextScreen, gotoPreviousScreen, disableInteraction, enableInteraction, }: ViewerProviderProps): React.JSX.Element;
|
|
624
624
|
|
|
625
625
|
type VisitorContextType = {
|
|
626
626
|
visitor: Visitor | null;
|
|
@@ -637,7 +637,7 @@ interface VisitorProviderProps {
|
|
|
637
637
|
children: React__default.ReactNode;
|
|
638
638
|
visitor?: Visitor | string | null;
|
|
639
639
|
}
|
|
640
|
-
declare function VisitorProvider({ visitor: providedVisitor, children, }: VisitorProviderProps):
|
|
640
|
+
declare function VisitorProvider({ visitor: providedVisitor, children, }: VisitorProviderProps): React__default.JSX.Element;
|
|
641
641
|
|
|
642
642
|
export { ComponentsContext, ComponentsProvider, ConsentContext, ConsentProvider, ELEMENTS_NAMESPACE, EditorContext, EditorProvider, FIELDS_NAMESPACE, FORMS_NAMESPACE, FieldContext, FieldContextProvider, FieldsContext, FieldsProvider, FieldsValueContext, FieldsValueContextProvider, FontsContext, FontsProvider, GoogleApiClientContext, GoogleApiClientProvider, GoogleKeysContext, GoogleKeysProvider, GoogleMapsClientContext, GoogleMapsClientProvider, MODALS_NAMESPACE, PanelsContext, PanelsProvider, PlaybackContext, PlaybackProvider, SCREENS_NAMESPACE, ScreenContext, ScreenProvider, ScreenSizeContext, ScreenSizeProvider, ScreensContext, ScreensProvider, SettingsContext, SettingsProvider, StoryContext, StoryProvider, TrackingProvider, ViewerContext, ViewerProvider, VisitorContext, VisitorProvider, useComponent, useComponents, useComponentsManager, useConsent, useEditor, useElementComponent, useElementsComponents, useElementsComponentsManager, useFieldComponent, useFieldContext, useFieldDefinition, useFieldsComponents, useFieldsComponentsManager, useFieldsManager, useFieldsValue, useFonts, useFormComponent, useFormsComponents, useFormsComponentsManager, useGetColors, useGoogleApiClient, useGoogleFonts, useGoogleKeys, useGoogleMapsClient, useModalComponent, useModalsComponents, useModalsComponentsManager, usePanels, usePlaybackContext, usePlaybackMediaRef, useRouteBack, useRoutePush, useScreen, useScreenComponent, useScreenData, useScreenDefinition, useScreenRenderContext, useScreenSize, useScreenState, useScreensComponents, useScreensComponentsManager, useScreensManager, useSetVisitor, useSetting, useSettings, useStory, useStoryContext, useTracking, useViewerActivityDetected, useViewerContext, useViewerEvents, useViewerInteraction, useViewerNavigation, useViewerSize, useViewerWebView, useVisitor, useVisitorContext, withGoogleApiClient, withGoogleMapsClient, withPanels };
|
|
643
643
|
export type { ScreensProviderProps };
|
package/es/contexts.js
CHANGED
|
@@ -7,7 +7,6 @@ import JSCookie from 'js-cookie';
|
|
|
7
7
|
import { defineMessages, useIntl } from 'react-intl';
|
|
8
8
|
import uniqBy from 'lodash-es/uniqBy';
|
|
9
9
|
import { getJSON } from '@folklore/fetch';
|
|
10
|
-
import isObject from 'lodash-es/isObject';
|
|
11
10
|
import { loadGoogleApi, loadGoogleMaps } from '@folklore/services';
|
|
12
11
|
export { ModalContext, ModalProvider as ModalsProvider } from '@panneau/core/contexts';
|
|
13
12
|
import { getDisplayName, getMediaSrc, getMediaHasAudio, getMediaFilename, getMediaDuration, getScreenExtraField } from '@micromag/core/utils';
|
|
@@ -890,10 +889,11 @@ function GoogleKeysProvider(t0) {
|
|
|
890
889
|
return t4;
|
|
891
890
|
}
|
|
892
891
|
|
|
893
|
-
const FontsContext = /*#__PURE__*/
|
|
892
|
+
const FontsContext = /*#__PURE__*/createContext({
|
|
894
893
|
systemFonts: null,
|
|
895
894
|
googleFonts: null,
|
|
896
|
-
customFonts: null
|
|
895
|
+
customFonts: null,
|
|
896
|
+
loadGoogleFonts: null
|
|
897
897
|
});
|
|
898
898
|
const useGoogleFonts = t0 => {
|
|
899
899
|
const $ = c(7);
|
|
@@ -908,25 +908,28 @@ const useGoogleFonts = t0 => {
|
|
|
908
908
|
}
|
|
909
909
|
const {
|
|
910
910
|
disabled: t2,
|
|
911
|
-
setFonts: t3
|
|
911
|
+
setFonts: t3,
|
|
912
|
+
apiKey: t4
|
|
912
913
|
} = t1;
|
|
913
914
|
const disabled = t2 === undefined ? false : t2;
|
|
914
915
|
const setFonts = t3 === undefined ? null : t3;
|
|
916
|
+
const optionsApiKey = t4 === undefined ? null : t4;
|
|
915
917
|
const {
|
|
916
|
-
apiKey
|
|
918
|
+
apiKey: contextApiKey
|
|
917
919
|
} = useGoogleKeys();
|
|
920
|
+
const apiKey = optionsApiKey || contextApiKey;
|
|
918
921
|
const [googleFonts, setGoogleFonts] = useState(null);
|
|
919
|
-
let t4;
|
|
920
922
|
let t5;
|
|
923
|
+
let t6;
|
|
921
924
|
if ($[2] !== apiKey || $[3] !== disabled || $[4] !== setFonts) {
|
|
922
|
-
|
|
925
|
+
t5 = () => {
|
|
923
926
|
let canceled = false;
|
|
924
927
|
if (apiKey !== null && !disabled) {
|
|
925
|
-
getJSON(`https://www.googleapis.com/webfonts/v1/webfonts?key=${apiKey}&sort=popularity`).then(
|
|
928
|
+
getJSON(`https://www.googleapis.com/webfonts/v1/webfonts?key=${apiKey}&sort=popularity`).then(t7 => {
|
|
926
929
|
const {
|
|
927
|
-
items:
|
|
928
|
-
} =
|
|
929
|
-
const items =
|
|
930
|
+
items: t8
|
|
931
|
+
} = t7;
|
|
932
|
+
const items = t8 === undefined ? [] : t8;
|
|
930
933
|
if (!canceled) {
|
|
931
934
|
const newFonts = items.map(_temp$1);
|
|
932
935
|
if (setFonts !== null) {
|
|
@@ -941,74 +944,63 @@ const useGoogleFonts = t0 => {
|
|
|
941
944
|
canceled = true;
|
|
942
945
|
};
|
|
943
946
|
};
|
|
944
|
-
|
|
947
|
+
t6 = [apiKey, disabled, setFonts, setGoogleFonts];
|
|
945
948
|
$[2] = apiKey;
|
|
946
949
|
$[3] = disabled;
|
|
947
950
|
$[4] = setFonts;
|
|
948
|
-
$[5] =
|
|
949
|
-
$[6] =
|
|
951
|
+
$[5] = t5;
|
|
952
|
+
$[6] = t6;
|
|
950
953
|
} else {
|
|
951
|
-
|
|
952
|
-
|
|
954
|
+
t5 = $[5];
|
|
955
|
+
t6 = $[6];
|
|
953
956
|
}
|
|
954
|
-
useEffect(
|
|
957
|
+
useEffect(t5, t6);
|
|
955
958
|
return googleFonts;
|
|
956
959
|
};
|
|
957
|
-
const useFonts =
|
|
958
|
-
const $ = c(
|
|
959
|
-
const options = t0 === undefined ? null : t0;
|
|
960
|
-
let t1;
|
|
961
|
-
if ($[0] !== options) {
|
|
962
|
-
t1 = options || {};
|
|
963
|
-
$[0] = options;
|
|
964
|
-
$[1] = t1;
|
|
965
|
-
} else {
|
|
966
|
-
t1 = $[1];
|
|
967
|
-
}
|
|
968
|
-
const {
|
|
969
|
-
withoutGoogleFonts: t2
|
|
970
|
-
} = t1;
|
|
971
|
-
const withoutGoogleFonts = t2 === undefined ? false : t2;
|
|
960
|
+
const useFonts = () => {
|
|
961
|
+
const $ = c(7);
|
|
972
962
|
const {
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
} =
|
|
978
|
-
const
|
|
979
|
-
const
|
|
980
|
-
const
|
|
981
|
-
const
|
|
982
|
-
|
|
983
|
-
let
|
|
984
|
-
if ($[
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
963
|
+
systemFonts: t0,
|
|
964
|
+
googleFonts: t1,
|
|
965
|
+
customFonts: t2,
|
|
966
|
+
loadGoogleFonts: t3
|
|
967
|
+
} = use(FontsContext);
|
|
968
|
+
const systemFonts = t0 === undefined ? null : t0;
|
|
969
|
+
const googleFonts = t1 === undefined ? null : t1;
|
|
970
|
+
const customFonts = t2 === undefined ? null : t2;
|
|
971
|
+
const loadGoogleFonts = t3 === undefined ? null : t3;
|
|
972
|
+
let t4;
|
|
973
|
+
let t5;
|
|
974
|
+
if ($[0] !== loadGoogleFonts) {
|
|
975
|
+
t4 = () => {
|
|
976
|
+
if (loadGoogleFonts !== null) {
|
|
977
|
+
loadGoogleFonts();
|
|
978
|
+
}
|
|
988
979
|
};
|
|
989
|
-
|
|
990
|
-
$[
|
|
991
|
-
$[
|
|
980
|
+
t5 = [loadGoogleFonts];
|
|
981
|
+
$[0] = loadGoogleFonts;
|
|
982
|
+
$[1] = t4;
|
|
983
|
+
$[2] = t5;
|
|
992
984
|
} else {
|
|
993
|
-
|
|
985
|
+
t4 = $[1];
|
|
986
|
+
t5 = $[2];
|
|
994
987
|
}
|
|
995
|
-
|
|
996
|
-
let
|
|
997
|
-
if ($[
|
|
998
|
-
|
|
988
|
+
useEffect(t4, t5);
|
|
989
|
+
let t6;
|
|
990
|
+
if ($[3] !== customFonts || $[4] !== googleFonts || $[5] !== systemFonts) {
|
|
991
|
+
t6 = {
|
|
999
992
|
systemFonts,
|
|
1000
993
|
googleFonts,
|
|
1001
994
|
customFonts
|
|
1002
995
|
};
|
|
1003
|
-
$[
|
|
1004
|
-
$[
|
|
1005
|
-
$[
|
|
1006
|
-
$[
|
|
996
|
+
$[3] = customFonts;
|
|
997
|
+
$[4] = googleFonts;
|
|
998
|
+
$[5] = systemFonts;
|
|
999
|
+
$[6] = t6;
|
|
1007
1000
|
} else {
|
|
1008
|
-
|
|
1001
|
+
t6 = $[6];
|
|
1009
1002
|
}
|
|
1010
|
-
|
|
1011
|
-
return fonts;
|
|
1003
|
+
return t6;
|
|
1012
1004
|
};
|
|
1013
1005
|
function FontsProvider(t0) {
|
|
1014
1006
|
const $ = c(18);
|
|
@@ -1017,89 +1009,100 @@ function FontsProvider(t0) {
|
|
|
1017
1009
|
customFonts: t2,
|
|
1018
1010
|
children
|
|
1019
1011
|
} = t0;
|
|
1020
|
-
|
|
1021
|
-
if ($[0] !== t1) {
|
|
1022
|
-
t3 = t1 === undefined ? ["Arial", "Courier New", "Georgia", "Times New Roman", "Verdana"] : t1;
|
|
1023
|
-
$[0] = t1;
|
|
1024
|
-
$[1] = t3;
|
|
1025
|
-
} else {
|
|
1026
|
-
t3 = $[1];
|
|
1027
|
-
}
|
|
1028
|
-
const systemFonts = t3;
|
|
1012
|
+
const systemFonts = t1 === undefined ? ["Arial", "Courier New", "Georgia", "Times New Roman", "Verdana"] : t1;
|
|
1029
1013
|
const customFonts = t2 === undefined ? null : t2;
|
|
1030
1014
|
const {
|
|
1031
|
-
systemFonts:
|
|
1032
|
-
googleFonts:
|
|
1033
|
-
customFonts: previousCustomFonts
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
const
|
|
1037
|
-
const
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
$[2] = previousSystemFonts;
|
|
1042
|
-
$[3] = systemFonts;
|
|
1043
|
-
$[4] = t6;
|
|
1044
|
-
} else {
|
|
1045
|
-
t6 = $[4];
|
|
1046
|
-
}
|
|
1015
|
+
systemFonts: t3,
|
|
1016
|
+
googleFonts: t4,
|
|
1017
|
+
customFonts: previousCustomFonts,
|
|
1018
|
+
loadGoogleFonts: t5
|
|
1019
|
+
} = use(FontsContext);
|
|
1020
|
+
const previousSystemFonts = t3 === undefined ? null : t3;
|
|
1021
|
+
const previousGoogleFonts = t4 === undefined ? null : t4;
|
|
1022
|
+
const previousLoadGoogleFonts = t5 === undefined ? null : t5;
|
|
1023
|
+
const [shouldLoadGoogleFonts, setShouldLoadGoogleFonts] = useState(false);
|
|
1024
|
+
const t6 = previousGoogleFonts !== null && previousGoogleFonts.length > 0 || !shouldLoadGoogleFonts;
|
|
1047
1025
|
let t7;
|
|
1048
|
-
if ($[
|
|
1049
|
-
t7 =
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
$[
|
|
1026
|
+
if ($[0] !== t6) {
|
|
1027
|
+
t7 = {
|
|
1028
|
+
disabled: t6
|
|
1029
|
+
};
|
|
1030
|
+
$[0] = t6;
|
|
1031
|
+
$[1] = t7;
|
|
1053
1032
|
} else {
|
|
1054
|
-
t7 = $[
|
|
1033
|
+
t7 = $[1];
|
|
1055
1034
|
}
|
|
1035
|
+
const googleFonts = useGoogleFonts(t7);
|
|
1056
1036
|
let t8;
|
|
1057
|
-
if ($[
|
|
1058
|
-
t8 =
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
$[
|
|
1037
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1038
|
+
t8 = () => {
|
|
1039
|
+
setShouldLoadGoogleFonts(true);
|
|
1040
|
+
};
|
|
1041
|
+
$[2] = t8;
|
|
1062
1042
|
} else {
|
|
1063
|
-
t8 = $[
|
|
1043
|
+
t8 = $[2];
|
|
1064
1044
|
}
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1045
|
+
const loadGoogleFonts = t8;
|
|
1046
|
+
const T0 = FontsContext;
|
|
1047
|
+
const t9 = uniqBy([...(previousSystemFonts || []), ...(systemFonts || [])], _temp2$1);
|
|
1048
|
+
let t10;
|
|
1049
|
+
if ($[3] !== googleFonts || $[4] !== previousGoogleFonts) {
|
|
1050
|
+
t10 = uniqBy([...(previousGoogleFonts || []), ...(googleFonts || [])], _temp3$1);
|
|
1051
|
+
$[3] = googleFonts;
|
|
1052
|
+
$[4] = previousGoogleFonts;
|
|
1053
|
+
$[5] = t10;
|
|
1054
|
+
} else {
|
|
1055
|
+
t10 = $[5];
|
|
1056
|
+
}
|
|
1057
|
+
let t11;
|
|
1058
|
+
if ($[6] !== customFonts || $[7] !== previousCustomFonts) {
|
|
1059
|
+
t11 = uniqBy([...(previousCustomFonts || []), ...(customFonts || [])], _temp4$1);
|
|
1060
|
+
$[6] = customFonts;
|
|
1061
|
+
$[7] = previousCustomFonts;
|
|
1062
|
+
$[8] = t11;
|
|
1063
|
+
} else {
|
|
1064
|
+
t11 = $[8];
|
|
1065
|
+
}
|
|
1066
|
+
const t12 = previousLoadGoogleFonts || loadGoogleFonts;
|
|
1067
|
+
let t13;
|
|
1068
|
+
if ($[9] !== t10 || $[10] !== t11 || $[11] !== t12 || $[12] !== t9) {
|
|
1069
|
+
t13 = {
|
|
1070
|
+
systemFonts: t9,
|
|
1071
|
+
googleFonts: t10,
|
|
1072
|
+
customFonts: t11,
|
|
1073
|
+
loadGoogleFonts: t12
|
|
1072
1074
|
};
|
|
1073
|
-
$[
|
|
1074
|
-
$[
|
|
1075
|
-
$[
|
|
1076
|
-
$[
|
|
1075
|
+
$[9] = t10;
|
|
1076
|
+
$[10] = t11;
|
|
1077
|
+
$[11] = t12;
|
|
1078
|
+
$[12] = t9;
|
|
1079
|
+
$[13] = t13;
|
|
1077
1080
|
} else {
|
|
1078
|
-
|
|
1081
|
+
t13 = $[13];
|
|
1079
1082
|
}
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
value: fonts,
|
|
1083
|
+
let t14;
|
|
1084
|
+
if ($[14] !== T0 || $[15] !== children || $[16] !== t13) {
|
|
1085
|
+
t14 = /*#__PURE__*/jsx(T0, {
|
|
1086
|
+
value: t13,
|
|
1085
1087
|
children: children
|
|
1086
1088
|
});
|
|
1089
|
+
$[14] = T0;
|
|
1087
1090
|
$[15] = children;
|
|
1088
|
-
$[16] =
|
|
1089
|
-
$[17] =
|
|
1091
|
+
$[16] = t13;
|
|
1092
|
+
$[17] = t14;
|
|
1090
1093
|
} else {
|
|
1091
|
-
|
|
1094
|
+
t14 = $[17];
|
|
1092
1095
|
}
|
|
1093
|
-
return
|
|
1096
|
+
return t14;
|
|
1094
1097
|
}
|
|
1095
1098
|
function _temp4$1(font_1) {
|
|
1096
|
-
return
|
|
1099
|
+
return isString(font_1) ? font_1 : font_1.name;
|
|
1097
1100
|
}
|
|
1098
1101
|
function _temp3$1(font_0) {
|
|
1099
|
-
return
|
|
1102
|
+
return isString(font_0) ? font_0 : font_0.name;
|
|
1100
1103
|
}
|
|
1101
1104
|
function _temp2$1(font) {
|
|
1102
|
-
return
|
|
1105
|
+
return isString(font) ? font : font.name;
|
|
1103
1106
|
}
|
|
1104
1107
|
function _temp$1(it) {
|
|
1105
1108
|
return {
|
package/es/hooks.d.ts
CHANGED
|
@@ -186,7 +186,7 @@ declare class MediasParser {
|
|
|
186
186
|
static replaceMediasWithPaths(data: any, patterns: any, medias?: null, keyPrefix?: null): any;
|
|
187
187
|
static getMediaPatternsFromData(obj: any): RegExp[];
|
|
188
188
|
static dot(obj: any): any;
|
|
189
|
-
static keys(obj: any):
|
|
189
|
+
static keys(obj: any): string[] | number[];
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
declare const useMediasParser: () => {
|
package/es/index.d.ts
CHANGED
|
@@ -557,7 +557,7 @@ declare class MediasParser {
|
|
|
557
557
|
static replaceMediasWithPaths(data: any, patterns: any, medias?: null, keyPrefix?: null): any;
|
|
558
558
|
static getMediaPatternsFromData(obj: any): RegExp[];
|
|
559
559
|
static dot(obj: any): any;
|
|
560
|
-
static keys(obj: any):
|
|
560
|
+
static keys(obj: any): string[] | number[];
|
|
561
561
|
}
|
|
562
562
|
|
|
563
563
|
type ScreensFieldsPattern = {
|
package/es/index.js
CHANGED
|
@@ -5,7 +5,6 @@ import sortBy from 'lodash-es/sortBy';
|
|
|
5
5
|
import EventEmitter from 'wolfy87-eventemitter';
|
|
6
6
|
import { pascalCase } from 'change-case';
|
|
7
7
|
import uniqBy from 'lodash-es/uniqBy';
|
|
8
|
-
import uniq from 'lodash-es/uniq';
|
|
9
8
|
import isString from 'lodash-es/isString';
|
|
10
9
|
import isEmpty from 'lodash-es/isEmpty';
|
|
11
10
|
import { Tracking as Tracking$1 } from '@folklore/tracking';
|
|
@@ -663,7 +662,7 @@ class FontsParser {
|
|
|
663
662
|
theme = null,
|
|
664
663
|
components = []
|
|
665
664
|
} = story || {};
|
|
666
|
-
const fonts =
|
|
665
|
+
const fonts = uniqBy(components.reduce((currentFonts, screen) => {
|
|
667
666
|
const {
|
|
668
667
|
type
|
|
669
668
|
} = screen;
|
|
@@ -681,7 +680,7 @@ class FontsParser {
|
|
|
681
680
|
return fonts.length > 0 || themeFonts.length > 0 ? {
|
|
682
681
|
...story,
|
|
683
682
|
theme: newTheme,
|
|
684
|
-
fonts:
|
|
683
|
+
fonts: uniqBy([...themeFonts, ...fonts], 'name')
|
|
685
684
|
} : story;
|
|
686
685
|
}
|
|
687
686
|
return fonts.length > 0 ? {
|
package/es/utils.d.ts
CHANGED
|
@@ -220,7 +220,7 @@ declare const largestRemainderRound: (numbers: any, desiredTotal: any) => any;
|
|
|
220
220
|
|
|
221
221
|
declare const getLayersFromBackground: (background?: null) => never[];
|
|
222
222
|
|
|
223
|
-
declare const getMediaFilesAsArray: (files: any) => any;
|
|
223
|
+
declare const getMediaFilesAsArray: (files: any) => string | any[];
|
|
224
224
|
|
|
225
225
|
declare function getMediaThumbnail(media: any, thumbnail?: MediaFile | ImageMedia | string): {
|
|
226
226
|
metadata?: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.109",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -161,5 +161,5 @@
|
|
|
161
161
|
"access": "public",
|
|
162
162
|
"registry": "https://registry.npmjs.org/"
|
|
163
163
|
},
|
|
164
|
-
"gitHead": "
|
|
164
|
+
"gitHead": "0eb452de33304b91642b48c12088758a8f0573a5"
|
|
165
165
|
}
|