Skip to content

Instantly share code, notes, and snippets.

@sibbng
sibbng / workbench.html
Last active July 4, 2024 08:30
Icon Theme support for File Browser VS Code Extension
<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self' https: data: blob: vscode-remote-resource:; media-src 'none'; frame-src 'self' vscode-webview: https://*.vscode-webview-test.com; object-src 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; connect-src 'self' https: ws:; font-src 'self' https: vscode-remote-resource:;">
</head>
<body aria-label="">
</body>
import { unrefElement, useEventListener } from '@vueuse/core'
const defaultWindow = typeof window !== 'undefined' ? window : undefined
/**
* Listen for clicks outside of an element.
*
* @see https://vueuse.org/onClickOutside
* @param target
* @param handler
import { computed, nextTick, reactive, ref, unref, watch } from 'vue'
import type { MaybeElementRef, MaybeRef } from '@vueuse/core'
import { clamp, createEventHook, tryOnScopeDispose, unrefElement, useEventListener } from '@vueuse/core'
type Edges = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'left' | 'right' | 'top' | 'bottom'
export interface UseResizeOptions {
disabled?: boolean
mode?: MaybeRef<'auto' | 'manual'>
disableCursor?: MaybeRef<boolean>
xMultiplier?: MaybeRef<number>
import { render, Switch, h, useEffect, ObservableReadonly, Observable, If } from 'voby';
import { $, useMemo, useReadonly, store } from 'voby';
// --- Event & Context Types ---
type EventObject = { type: string; payload?: any };
type GuardCondition<TContext, TEvent extends EventObject = EventObject> =
(context: TContext, event: TEvent) => boolean;
// --- Action Types ---
import { $, For, render } from "voby";
import { animate, createTimeline } from "animejs";
const ViewSlider = () => {
const viewsData = [
{ title: "View 1", content: "This is the content of View 1." },
{ title: "View 2", content: "Welcome to View 2!" },
{ title: "View 3", content: "You've reached View 3." },
{ title: "View 4", content: "This is the final view, View 4." },
];
{
"imports": {
"voby": "https://esm.sh/voby",
"oby": "https://esm.sh/oby"
}
}
@sibbng
sibbng / importmap.json
Last active May 7, 2025 17:38
voby todo app
{
"imports": {
"voby": "https://esm.sh/voby",
"oby": "https://esm.sh/oby"
}
}
{
"imports": {
"voby": "https://esm.sh/voby",
"voby-query": "https://esm.sh/voby-query"
}
}
@sibbng
sibbng / importmap.json
Last active May 7, 2025 17:52
voby bookmark app
{
"imports": {
"voby": "https://esm.sh/voby"
}
}
import { type Context, createContext } from 'voby';
import type { QueryClient } from './useQuery.ts';
// #region Context
export const QueryClientContext: Context<QueryClient> =
createContext<QueryClient>();
export const QueryClientProvider =
QueryClientContext.Provider as typeof QueryClientContext.Provider;