Glancerglancer.tsx2 matches
4647const sessionScript = `
48function startSession() {
49GLANCE.Cobrowse.Visitor.startSession("GLANCE_KEYTYPE_RANDOM");
50}
180181<script>
182function startSession(){
183GLANCE.Cobrowse.Visitor.startSession("GLANCE_KEYTYPE_RANDOM");
184}
GitHubSyncvaltown-deploy6 matches
17////
1819export default async function valTownDeploy(c: Context) {
20console.log("deploy to valtown");
21const body = await c.req.json();
45}
4647async function getContents(repo: Repo, after: string, commits: Commit[]) {
48const filenames = config.vals.map((name: string) => name + ".tsx");
49console.log(`${filenames.length} val files updated`);
55}
5657function getModified(commits: Commit[], filenames: string[]) {
58return commits.reduce((a: string[], b: Commit) => {
59return [...a, ...b.modified];
61}
6263function getFileContent(repo: Repo, after: string) {
64return async (path: string): Promise<{
65name: string;
81}
8283async function updateVals(user: ValUser, updates: { name: string; code: string; }[]) {
84console.log("updateVals");
85await Promise.all(updates.map(async (update) => {
88}
8990async function updateVal(username: string, update: { name: string; code: string; }) {
91const { name, code } = update;
92const val = await valtown.alias.username.valName.retrieve(username, name);
GitHubSyncsign-webhook1 match
1/**
2* Use this function along with your valtown webhook secret to create
3* the x-val-signature header when posting to the /export webhook
4*/
GitHubSyncREADME.md1 match
42const url = Deno.env.get("PUSH_URL") as string;
4344async function pushValsToGitHub() {
45const body = "hello";
46const signature = await sign(body, secret);
GitHubSynchome1 match
4import type { Context } from "npm:hono";
56export default async function(c: Context) {
7return c.html(
8<html>
GitHubSyncgithub-push1 match
12const valtown = new ValTown();
1314export default async function GitHubPush(c: Context) {
15// auth check in /index
16const user = await valtown.me.profile.retrieve();
GitHubSynccommit-files2 matches
1819/**
20* General use function to commit files to GitHub
21*/
22export async function commitFiles({
23token,
24owner,
blob_adminapp.tsx7 matches
10}
1112function Tooltip({ children, content }: TooltipProps) {
13const [isVisible, setIsVisible] = useState(false);
14const tooltipRef = useRef<HTMLDivElement>(null);
49}
5051function formatBytes(bytes: number, decimals = 2) {
52if (bytes === 0) return "0 Bytes";
53const k = 1024;
58}
5960function copyToClipboard(text: string) {
61navigator.clipboard.writeText(text).then(() => {
62console.log("Text copied to clipboard");
66}
6768function ActionMenu({ blob, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
69const [isOpen, setIsOpen] = useState(false);
70const menuRef = useRef(null);
7374useEffect(() => {
75function handleClickOutside(event) {
76if (menuRef.current && !menuRef.current.contains(event.target)) {
77event.stopPropagation();
155}
156157function BlobItem({ blob, onSelect, isSelected, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
158const [isLoading, setIsLoading] = useState(false);
159const decodedKey = decodeURIComponent(blob.key);
216}
217218function App({ initialEmail, initialProfile, sourceURL }) {
219const encodeKey = (key: string) => encodeURIComponent(key);
220const decodeKey = (key: string) => decodeURIComponent(key);
1920This points to the `jsx/jsx-runtime` module (the `jsx-runtime` name is important),
21which wraps the default React JSX runtime with a function that extracts an `sx` prop and applies it as the `style` prop.
2223When the client module requests the `App.tsx` file from Val Town, the JSX is compiled to vanilla JavaScript to run in the browser.