@flamingo-stack/openframe-frontend-core 0.0.177 → 0.0.178
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/{chunk-6LDN3CIY.js → chunk-AAX27BCR.js} +189 -348
- package/dist/chunk-AAX27BCR.js.map +1 -0
- package/dist/{chunk-WX7PT5C7.cjs → chunk-ALW3D72O.cjs} +61 -2
- package/dist/chunk-ALW3D72O.cjs.map +1 -0
- package/dist/{chunk-KB2N44BY.js → chunk-FMWHOUFE.js} +61 -2
- package/dist/chunk-FMWHOUFE.js.map +1 -0
- package/dist/{chunk-C6ZMI4UB.cjs → chunk-L4T24AN4.cjs} +113 -272
- package/dist/chunk-L4T24AN4.cjs.map +1 -0
- package/dist/components/features/index.cjs +3 -5
- package/dist/components/features/index.cjs.map +1 -1
- package/dist/components/features/index.js +2 -4
- package/dist/components/features/video-player.d.ts +17 -20
- package/dist/components/features/video-player.d.ts.map +1 -1
- package/dist/components/features/youtube-embed.d.ts +18 -4
- package/dist/components/features/youtube-embed.d.ts.map +1 -1
- package/dist/components/index.cjs +3 -5
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +2 -4
- package/dist/components/navigation/index.cjs +3 -3
- package/dist/components/navigation/index.js +2 -2
- package/dist/components/ui/index.cjs +3 -3
- package/dist/components/ui/index.js +2 -2
- package/dist/hooks/index.cjs +4 -2
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +3 -1
- package/dist/hooks/use-near-viewport.d.ts +42 -0
- package/dist/hooks/use-near-viewport.d.ts.map +1 -0
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -4
- package/package.json +1 -1
- package/src/components/features/video-player.tsx +39 -176
- package/src/components/features/youtube-embed.tsx +107 -224
- package/src/hooks/index.ts +3 -0
- package/src/hooks/use-near-viewport.ts +118 -0
- package/dist/chunk-6LDN3CIY.js.map +0 -1
- package/dist/chunk-C6ZMI4UB.cjs.map +0 -1
- package/dist/chunk-KB2N44BY.js.map +0 -1
- package/dist/chunk-WX7PT5C7.cjs.map +0 -1
- package/src/components/features/__tests__/video-player.test.tsx +0 -142
|
@@ -3052,6 +3052,65 @@ function useNatsClient(clientOptions, options = {}) {
|
|
|
3052
3052
|
};
|
|
3053
3053
|
}
|
|
3054
3054
|
|
|
3055
|
+
// src/hooks/use-near-viewport.ts
|
|
3056
|
+
|
|
3057
|
+
var observers = /* @__PURE__ */ new Map();
|
|
3058
|
+
var subscribers = /* @__PURE__ */ new WeakMap();
|
|
3059
|
+
function getObserverFor(rootMargin) {
|
|
3060
|
+
const existing = observers.get(rootMargin);
|
|
3061
|
+
if (existing) return existing;
|
|
3062
|
+
const io = new IntersectionObserver(
|
|
3063
|
+
(entries) => {
|
|
3064
|
+
entries.forEach((entry) => {
|
|
3065
|
+
if (!entry.isIntersecting) return;
|
|
3066
|
+
const cb = subscribers.get(entry.target);
|
|
3067
|
+
if (cb) {
|
|
3068
|
+
cb();
|
|
3069
|
+
io.unobserve(entry.target);
|
|
3070
|
+
subscribers.delete(entry.target);
|
|
3071
|
+
}
|
|
3072
|
+
});
|
|
3073
|
+
},
|
|
3074
|
+
{ rootMargin }
|
|
3075
|
+
);
|
|
3076
|
+
observers.set(rootMargin, io);
|
|
3077
|
+
return io;
|
|
3078
|
+
}
|
|
3079
|
+
function useNearViewport(rootMargin = "500px") {
|
|
3080
|
+
const [isNear, setIsNear] = _react.useState.call(void 0, false);
|
|
3081
|
+
const elRef = _react.useRef.call(void 0, null);
|
|
3082
|
+
const ref = _react.useCallback.call(void 0,
|
|
3083
|
+
(node) => {
|
|
3084
|
+
const prev = elRef.current;
|
|
3085
|
+
if (prev) {
|
|
3086
|
+
const stillOurs = subscribers.get(prev);
|
|
3087
|
+
if (stillOurs) {
|
|
3088
|
+
subscribers.delete(prev);
|
|
3089
|
+
_optionalChain([observers, 'access', _20 => _20.get, 'call', _21 => _21(rootMargin), 'optionalAccess', _22 => _22.unobserve, 'call', _23 => _23(prev)]);
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
elRef.current = node;
|
|
3093
|
+
if (!node) return;
|
|
3094
|
+
const cb = () => setIsNear(true);
|
|
3095
|
+
subscribers.set(node, cb);
|
|
3096
|
+
getObserverFor(rootMargin).observe(node);
|
|
3097
|
+
},
|
|
3098
|
+
[rootMargin]
|
|
3099
|
+
);
|
|
3100
|
+
_react.useEffect.call(void 0, () => {
|
|
3101
|
+
return () => {
|
|
3102
|
+
const el = elRef.current;
|
|
3103
|
+
if (!el) return;
|
|
3104
|
+
if (subscribers.get(el)) {
|
|
3105
|
+
subscribers.delete(el);
|
|
3106
|
+
_optionalChain([observers, 'access', _24 => _24.get, 'call', _25 => _25(rootMargin), 'optionalAccess', _26 => _26.unobserve, 'call', _27 => _27(el)]);
|
|
3107
|
+
}
|
|
3108
|
+
};
|
|
3109
|
+
}, [rootMargin]);
|
|
3110
|
+
return { ref, isNear };
|
|
3111
|
+
}
|
|
3112
|
+
|
|
3113
|
+
|
|
3055
3114
|
|
|
3056
3115
|
|
|
3057
3116
|
|
|
@@ -3134,5 +3193,5 @@ function useNatsClient(clientOptions, options = {}) {
|
|
|
3134
3193
|
|
|
3135
3194
|
|
|
3136
3195
|
|
|
3137
|
-
exports.useAutoLimitTags = useAutoLimitTags; exports.platformIcons = platformIcons; exports.platformColors = platformColors; exports.platformDisplayNames = platformDisplayNames; exports.platformDescriptions = platformDescriptions; exports.platformSlogans = platformSlogans; exports.platformHexColors = platformHexColors; exports.platformIconNames = platformIconNames; exports.getDefaultColorForPlatform = getDefaultColorForPlatform; exports.getDefaultIconForPlatform = getDefaultIconForPlatform; exports.transformPlatformConfigsToOptions = transformPlatformConfigsToOptions; exports.getPlatformIcon = getPlatformIcon; exports.getPlatformColor = getPlatformColor; exports.getPlatformDisplayName = getPlatformDisplayName; exports.getPlatformDescription = getPlatformDescription; exports.getPlatformSlogan = getPlatformSlogan; exports.getSmallPlatformIcon = getSmallPlatformIcon; exports.getPlatformIconComponent = getPlatformIconComponent; exports.ToolTypeValues = ToolTypeValues; exports.toolLabels = toolLabels; exports.useDebounce = useDebounce; exports.useLocalStorage = useLocalStorage; exports.useMediaQuery = useMediaQuery; exports.breakpoints = breakpoints; exports.useSmUp = useSmUp; exports.useMdUp = useMdUp; exports.useLgUp = useLgUp; exports.useMemoizedCallback = useMemoizedCallback; exports.useOnboardingState = useOnboardingState; exports.useTablePagination = useTablePagination; exports.useThrottle = useThrottle; exports.useWindowSize = useWindowSize; exports.useHorizontalScrollbar = useHorizontalScrollbar; exports.useImageEdgeColor = useImageEdgeColor; exports.useSearch = useSearch; exports.usePlatformConfig = usePlatformConfig; exports.usePlatformByValue = usePlatformByValue; exports.useValidatePlatform = useValidatePlatform; exports.ToolIcon = ToolIcon; exports.dotColorByVariant = dotColorByVariant; exports.progressColorByVariant = progressColorByVariant; exports.ToastCard = ToastCard; exports.CommandApprovalToast = CommandApprovalToast; exports.Toaster = Toaster; exports.showToast = showToast; exports.showCommandApprovalToast = showCommandApprovalToast; exports.toast = toast; exports.useToast = useToast; exports.useContactSubmission = useContactSubmission; exports.useQuickActionHint = useQuickActionHint; exports.useCopyToClipboard = useCopyToClipboard; exports.configureBatchImageFetch = configureBatchImageFetch; exports.batchFetchAuthenticatedImages = batchFetchAuthenticatedImages; exports.useBatchImages = useBatchImages; exports.configureAuthenticatedImage = configureAuthenticatedImage; exports.useAuthenticatedImage = useAuthenticatedImage; exports.extractVariablesFromQuery = extractVariablesFromQuery; exports.isScalarType = isScalarType; exports.isInputObjectType = isInputObjectType; exports.flattenQueryVariables = flattenQueryVariables; exports.mergeDefaults = mergeDefaults; exports.validateSchema = validateSchema; exports.getArrayParams = getArrayParams; exports.getRequiredParams = getRequiredParams; exports.shouldIncludeInUrl = shouldIncludeInUrl; exports.urlParamsToVariables = urlParamsToVariables; exports.variablesToUrlParams = variablesToUrlParams; exports.coerceValue = coerceValue; exports.setNestedValue = setNestedValue; exports.getNestedValue = getNestedValue; exports.mergeVariables = mergeVariables; exports.clearParams = clearParams; exports.validateVariables = validateVariables; exports.GraphQLIntrospector = GraphQLIntrospector; exports.introspector = introspector; exports.useQueryParams = useQueryParams; exports.useApiParams = useApiParams; exports.createSearchParams = createSearchParams; exports.useCursorPaginationState = useCursorPaginationState; exports.createNatsClient = createNatsClient; exports.useNatsClient = useNatsClient;
|
|
3138
|
-
//# sourceMappingURL=chunk-
|
|
3196
|
+
exports.useAutoLimitTags = useAutoLimitTags; exports.platformIcons = platformIcons; exports.platformColors = platformColors; exports.platformDisplayNames = platformDisplayNames; exports.platformDescriptions = platformDescriptions; exports.platformSlogans = platformSlogans; exports.platformHexColors = platformHexColors; exports.platformIconNames = platformIconNames; exports.getDefaultColorForPlatform = getDefaultColorForPlatform; exports.getDefaultIconForPlatform = getDefaultIconForPlatform; exports.transformPlatformConfigsToOptions = transformPlatformConfigsToOptions; exports.getPlatformIcon = getPlatformIcon; exports.getPlatformColor = getPlatformColor; exports.getPlatformDisplayName = getPlatformDisplayName; exports.getPlatformDescription = getPlatformDescription; exports.getPlatformSlogan = getPlatformSlogan; exports.getSmallPlatformIcon = getSmallPlatformIcon; exports.getPlatformIconComponent = getPlatformIconComponent; exports.ToolTypeValues = ToolTypeValues; exports.toolLabels = toolLabels; exports.useDebounce = useDebounce; exports.useLocalStorage = useLocalStorage; exports.useMediaQuery = useMediaQuery; exports.breakpoints = breakpoints; exports.useSmUp = useSmUp; exports.useMdUp = useMdUp; exports.useLgUp = useLgUp; exports.useMemoizedCallback = useMemoizedCallback; exports.useOnboardingState = useOnboardingState; exports.useTablePagination = useTablePagination; exports.useThrottle = useThrottle; exports.useWindowSize = useWindowSize; exports.useHorizontalScrollbar = useHorizontalScrollbar; exports.useImageEdgeColor = useImageEdgeColor; exports.useSearch = useSearch; exports.usePlatformConfig = usePlatformConfig; exports.usePlatformByValue = usePlatformByValue; exports.useValidatePlatform = useValidatePlatform; exports.ToolIcon = ToolIcon; exports.dotColorByVariant = dotColorByVariant; exports.progressColorByVariant = progressColorByVariant; exports.ToastCard = ToastCard; exports.CommandApprovalToast = CommandApprovalToast; exports.Toaster = Toaster; exports.showToast = showToast; exports.showCommandApprovalToast = showCommandApprovalToast; exports.toast = toast; exports.useToast = useToast; exports.useContactSubmission = useContactSubmission; exports.useQuickActionHint = useQuickActionHint; exports.useCopyToClipboard = useCopyToClipboard; exports.configureBatchImageFetch = configureBatchImageFetch; exports.batchFetchAuthenticatedImages = batchFetchAuthenticatedImages; exports.useBatchImages = useBatchImages; exports.configureAuthenticatedImage = configureAuthenticatedImage; exports.useAuthenticatedImage = useAuthenticatedImage; exports.extractVariablesFromQuery = extractVariablesFromQuery; exports.isScalarType = isScalarType; exports.isInputObjectType = isInputObjectType; exports.flattenQueryVariables = flattenQueryVariables; exports.mergeDefaults = mergeDefaults; exports.validateSchema = validateSchema; exports.getArrayParams = getArrayParams; exports.getRequiredParams = getRequiredParams; exports.shouldIncludeInUrl = shouldIncludeInUrl; exports.urlParamsToVariables = urlParamsToVariables; exports.variablesToUrlParams = variablesToUrlParams; exports.coerceValue = coerceValue; exports.setNestedValue = setNestedValue; exports.getNestedValue = getNestedValue; exports.mergeVariables = mergeVariables; exports.clearParams = clearParams; exports.validateVariables = validateVariables; exports.GraphQLIntrospector = GraphQLIntrospector; exports.introspector = introspector; exports.useQueryParams = useQueryParams; exports.useApiParams = useApiParams; exports.createSearchParams = createSearchParams; exports.useCursorPaginationState = useCursorPaginationState; exports.createNatsClient = createNatsClient; exports.useNatsClient = useNatsClient; exports.useNearViewport = useNearViewport;
|
|
3197
|
+
//# sourceMappingURL=chunk-ALW3D72O.cjs.map
|