@thisway/next
Advanced tools
Comparing version 0.15.2 to 0.15.3-beta.0
45
index.js
@@ -9,5 +9,5 @@ var __defProp = Object.defineProperty; | ||
import { onMount, onDestroy, mount, unmount } from "svelte"; | ||
import { isValidNumber, isElement, isTextInputElement, defaults, deltaTransform, transformX, transformY, NOOP_TRANSFORM, pick$, noop, toPx, clamp, finite, transformDOMRect, transformNestedBounding, getElementsBounding, buildScrollHierarchy, getFrameElement, computeFrameScrollActions, animationFrameThrottle, observeElementBounding, reverseX, reverseY, isReadable, EMPTY_SIZE, resizeObserver } from "@thisway/utils"; | ||
import { isValidNumber, isElement, isTextInputElement, defaults, deltaTransform, transformX, transformY, NOOP_TRANSFORM, pick$, noop, toPx, clamp, finite, getElementsBounding, transformDOMRect, transformNestedBounding, buildScrollHierarchy, getFrameElement, computeFrameScrollActions, animationFrameThrottle, observeElementBounding, reverseX, reverseY, isReadable, EMPTY_SIZE, resizeObserver } from "@thisway/utils"; | ||
import { get, writable, derived, readable, fromStore } from "svelte/store"; | ||
import { CLICK_MASK_ACTION_NEXT, CLICK_MASK_ACTION_NONE, COMPONENT_SLOT_POPOVER, COMPONENT_SLOT_HIGHLIGHT, POSITION_AUTO, ORIENTATIONS, ALIGNMENTS, isNoElement, EMPTY_POINT, NO_ELEMENT, ORIENTATIONS_TO_START_END, popoverDefaultValues, highlightDefaultValues, normalizeTheme, LAYOUT_MODE_1, LAYOUT_MODE_3 } from "@thisway/base"; | ||
import { CLICK_MASK_ACTION_NEXT, CLICK_MASK_ACTION_NONE, COMPONENT_SLOT_POPOVER, COMPONENT_SLOT_HIGHLIGHT, POSITION_AUTO, ORIENTATIONS, ALIGNMENTS, isNoElement, EMPTY_POINT, ORIENTATIONS_TO_START_END, popoverDefaultValues, highlightDefaultValues, normalizeTheme, NO_ELEMENT, LAYOUT_MODE_1, LAYOUT_MODE_3 } from "@thisway/base"; | ||
export * from "@thisway/base"; | ||
@@ -17,2 +17,3 @@ import "svelte/internal/disclose-version"; | ||
import { cubicOut } from "svelte/easing"; | ||
import { on } from "svelte/events"; | ||
import { tweened } from "svelte/motion"; | ||
@@ -420,4 +421,4 @@ import "svelte/internal/flags/legacy"; | ||
}); | ||
on(window, "keydown", handleKeydown); | ||
var div = root$3(); | ||
$.event("keydown", $.window, handleKeydown); | ||
var node = $.child(div); | ||
@@ -453,2 +454,5 @@ Mask_view(node, {}); | ||
function tryGetOrientation(preferredOrientation, elementRect, popoverRect, offsetX, offsetY, viewport) { | ||
if (!elementRect) { | ||
return "SCREEN"; | ||
} | ||
const right = elementRect.x + elementRect.width; | ||
@@ -776,3 +780,9 @@ const bottom = elementRect.y + elementRect.height; | ||
const [offsetX, offsetY] = computeHighlightOffset(highlightOptions.padding, highlightOptions, transform); | ||
const getBounding = elements.length > 0 ? () => transformDOMRect(transformNestedBounding(getElementsBounding(elements), iframes), transform) : () => new DOMRectReadOnly(0, 0, 0, 0); | ||
const getBounding = elements.length > 0 ? () => { | ||
const box = getElementsBounding(elements); | ||
if (!box) { | ||
return void 0; | ||
} | ||
return transformDOMRect(transformNestedBounding(box, iframes), transform); | ||
} : () => void 0; | ||
if (element && !isNoElement(element)) { | ||
@@ -794,2 +804,5 @@ [scrollHierarchy, iframes] = buildScrollHierarchy(element, getFrameElement(delegate.window)); | ||
const rect = getBounding(); | ||
if (!rect) { | ||
return; | ||
} | ||
const zeroSized = rect.width === 0 || rect.height === 0; | ||
@@ -800,7 +813,3 @@ if (previous && eq(rect.width, previous.width) && eq(rect.height, previous.height) && (zeroSized || eq(rect.x, previous.x) && eq(rect.y, previous.y))) { | ||
previous = rect; | ||
if (zeroSized) { | ||
set2(NO_ELEMENT); | ||
} else { | ||
set2(rect); | ||
} | ||
set2(rect); | ||
}); | ||
@@ -1174,10 +1183,10 @@ const disposers = [ | ||
} | ||
var root_1 = $.template(`<button class="thisway-popover-close svelte-xpopjz">×</button>`); | ||
var root_2 = $.template(`<header class="thisway-popover-title svelte-xpopjz"><!></header>`); | ||
var root_5 = $.template(`<div class="thisway-popover-description svelte-xpopjz"><!></div>`); | ||
var root_15 = $.ns_template(`<svg style="pointer-events: none;" width="20" height="14" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-xpopjz"><path d="M19 12H6M12 5l-7 7 7 7" class="svelte-xpopjz"></path></svg>`); | ||
var root_11 = $.template(`<button class="thisway-popover-prev svelte-xpopjz"><!></button>`); | ||
var root_16 = $.template(`<button class="thisway-popover-next svelte-xpopjz"><!></button>`); | ||
var root_1 = $.template(`<button class="thisway-popover-close svelte-1eb9y3d">×</button>`); | ||
var root_2 = $.template(`<header class="thisway-popover-title svelte-1eb9y3d"><!></header>`); | ||
var root_5 = $.template(`<div class="thisway-popover-description svelte-1eb9y3d"><!></div>`); | ||
var root_15 = $.ns_template(`<svg style="pointer-events: none;" width="20" height="14" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1eb9y3d"><path d="M19 12H6M12 5l-7 7 7 7" class="svelte-1eb9y3d"></path></svg>`); | ||
var root_11 = $.template(`<button class="thisway-popover-prev svelte-1eb9y3d"><!></button>`); | ||
var root_16 = $.template(`<button class="thisway-popover-next svelte-1eb9y3d"><!></button>`); | ||
var root_10 = $.template(`<!> <!>`, 1); | ||
var root = $.template(`<div><div></div> <!> <!> <!> <!> <!> <div class="thisway-popover-footer svelte-xpopjz"><!> <!> <div class="thisway-stretch svelte-xpopjz"></div> <!></div></div>`); | ||
var root = $.template(`<div><div></div> <!> <!> <!> <!> <!> <div class="thisway-popover-footer svelte-1eb9y3d"><!> <!> <div class="thisway-stretch svelte-1eb9y3d"></div> <!></div></div>`); | ||
function Popover($$anchor, $$props) { | ||
@@ -1446,5 +1455,5 @@ $.push($$props, true); | ||
$.template_effect(() => { | ||
$.set_class(div, $.clsx($class$()), "svelte-xpopjz"); | ||
$.set_class(div, $.clsx($class$()), "svelte-1eb9y3d"); | ||
$.set_style(div, "display", $title$() || $description$() || $$props.title || $$props.description ? "flex" : "none"); | ||
$.set_class(div_1, $.clsx($arrowClass$()), "svelte-xpopjz"); | ||
$.set_class(div_1, $.clsx($arrowClass$()), "svelte-1eb9y3d"); | ||
}); | ||
@@ -1451,0 +1460,0 @@ $.append($$anchor, div); |
import { Orientation, Rect } from '@thisway/base'; | ||
import { Size } from '@thisway/utils'; | ||
export declare function tryGetOrientation(preferredOrientation: Orientation | undefined, elementRect: Rect, popoverRect: Size, offsetX: number, offsetY: number, viewport: Size): Orientation | undefined; | ||
export declare function tryGetOrientation(preferredOrientation: Orientation | undefined, elementRect: Rect | undefined, popoverRect: Size, offsetX: number, offsetY: number, viewport: Size): Orientation | undefined; | ||
export declare function getOrientation(...arguments_: Parameters<typeof tryGetOrientation>): Orientation; |
{ | ||
"name": "@thisway/next", | ||
"version": "0.15.2", | ||
"version": "0.15.3-beta.0", | ||
"type": "module", | ||
"sideEffects": false, | ||
"dependencies": { | ||
"@thisway/base": "^0.13.0", | ||
"@thisway/utils": "^0.8.0", | ||
"@thisway/base": "0.13.1-beta.0", | ||
"@thisway/utils": "0.8.1-beta.0", | ||
"svelte": "^5.17.3" | ||
@@ -10,0 +10,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
140612
3746
0
+ Added@thisway/base@0.13.1-beta.0(transitive)
+ Added@thisway/utils@0.8.1-beta.0(transitive)
+ Addedsvelte@5.19.9(transitive)
+ Addedtype-fest@4.34.1(transitive)
- Removed@thisway/base@0.13.0(transitive)
- Removed@thisway/utils@0.8.0(transitive)
- Removedsvelte@5.19.8(transitive)
- Removedtype-fest@4.33.0(transitive)
Updated@thisway/base@0.13.1-beta.0
Updated@thisway/utils@0.8.1-beta.0