mtxuilib 0.1.80 → 0.1.83
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.
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { HtmlDiffer } from "html-differ";
|
|
4
|
+
import { useEffect, useRef } from "react";
|
|
5
|
+
const styles = {
|
|
6
|
+
none: "background: transparent; color:black",
|
|
7
|
+
gray: "background: transparent; color: gray",
|
|
8
|
+
bgGreen: "background: green; color:black",
|
|
9
|
+
bgRed: "background: red; color:black",
|
|
10
|
+
};
|
|
11
|
+
export function HtmlChangesObserver({ children }) {
|
|
12
|
+
const targetNode = useRef(null);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const differ = new HtmlDiffer();
|
|
15
|
+
let lastHtml = targetNode.current.innerHTML;
|
|
16
|
+
function observeChanges() {
|
|
17
|
+
const newHtml = targetNode.current.innerHTML;
|
|
18
|
+
if (newHtml != lastHtml) {
|
|
19
|
+
const diff = differ.diffHtml(lastHtml, newHtml);
|
|
20
|
+
lastHtml = newHtml;
|
|
21
|
+
logDiff(diff);
|
|
22
|
+
}
|
|
23
|
+
if (running) {
|
|
24
|
+
requestAnimationFrame(observeChanges);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
let running = true;
|
|
28
|
+
requestAnimationFrame(observeChanges);
|
|
29
|
+
return () => {
|
|
30
|
+
running = false;
|
|
31
|
+
};
|
|
32
|
+
}, []);
|
|
33
|
+
return _jsx("div", { ref: targetNode, children: children });
|
|
34
|
+
}
|
|
35
|
+
function logDiff(diff) {
|
|
36
|
+
let output = "", styleArr = [];
|
|
37
|
+
if (diff.length === 1 && !diff[0].added && !diff[0].removed)
|
|
38
|
+
return output;
|
|
39
|
+
for (const part of diff) {
|
|
40
|
+
var index = diff.indexOf(part), partValue = part.value;
|
|
41
|
+
if (part.added || part.removed) {
|
|
42
|
+
output += index === 0 ? "\n" : "";
|
|
43
|
+
output += "%c" + partValue;
|
|
44
|
+
styleArr.push(part.added ? styles.bgGreen : styles.bgRed);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
output += index !== 0 ? "" : "\n";
|
|
48
|
+
output += "%c" + partValue;
|
|
49
|
+
styleArr.push(styles.gray);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
console.log(performance.now() + "ms DOM changes: " + output, ...styleArr);
|
|
53
|
+
}
|
|
@@ -11,6 +11,6 @@ export declare class MtErrorBoundary extends Component<Props, State> {
|
|
|
11
11
|
state: State;
|
|
12
12
|
static getDerivedStateFromError(error: Error): State;
|
|
13
13
|
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
14
|
-
render(): string | number |
|
|
14
|
+
render(): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | null | undefined;
|
|
15
15
|
}
|
|
16
16
|
export default MtErrorBoundary;
|
package/dist/ui/skeleton.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { PropsWithChildren } from "react";
|
|
2
2
|
export declare const WithLinkIf: (props: {
|
|
3
3
|
href?: string;
|
|
4
|
-
} & PropsWithChildren) => string | number |
|
|
4
|
+
} & PropsWithChildren) => string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import("react").ReactNode> | null | undefined;
|
|
@@ -5,7 +5,7 @@ export declare function DropdownMenu({ ...props }: DropdownMenuProps): import("r
|
|
|
5
5
|
export declare namespace DropdownMenu {
|
|
6
6
|
var Trigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
7
|
var Portal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
8
|
-
var Content: React.ForwardRefExoticComponent<Pick<import("@radix-ui/react-menu").MenuContentProps & React.RefAttributes<HTMLDivElement>, "prefix" | "translate" | "content" | "
|
|
8
|
+
var Content: React.ForwardRefExoticComponent<Pick<import("@radix-ui/react-menu").MenuContentProps & React.RefAttributes<HTMLDivElement>, "prefix" | "translate" | "content" | "style" | "slot" | "title" | "className" | "asChild" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoFocus" | "contentEditable" | "contextMenu" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "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-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "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" | "onResize" | "onResizeCapture" | "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" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key" | "forceMount" | "loop" | "align" | "onEscapeKeyDown" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside" | "onCloseAutoFocus" | "side" | "sideOffset" | "alignOffset" | "arrowPadding" | "collisionBoundary" | "collisionPadding" | "sticky" | "hideWhenDetached" | "avoidCollisions" | "onEntryFocus" | "updatePositionStrategy"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
var Item: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
10
|
var Separator: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
11
|
}
|