This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
Slot, | |
component$, | |
createContextId, | |
useContextProvider, | |
useSignal, | |
useStore, | |
type Signal, | |
} from '@builder.io/qwik'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { component$, useVisibleTask$, useStore, useSignal, noSerialize } from '@builder.io/qwik'; | |
import lottie from 'lottie-web'; | |
import { Options } from './types'; | |
export interface OptionsProps { | |
options: Options; | |
} | |
export const QwikLottie = component$(({ options }: OptionsProps) => { | |
const store = useStore({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let data = Array.from({ length: 10 }, (_, i) => `item${i + 1}`); | |
let packageNameCounter = 0; | |
// Function to group array elements into packages | |
function groupArrayElements(list, groupSize) { | |
// Base case: if the list is small enough, return it as a single package | |
if (list.length <= groupSize) { | |
return [{ | |
packageName: 'Pkg' + packageNameCounter++, | |
items: list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "everything", | |
"version": "2.0.0", | |
"description": "npm install undefined", | |
"main": "index.js", | |
"contributors": [ | |
"PatrickJS <github@patrickjs.com>", | |
"uncenter <hi@uncenter.dev>" | |
], | |
"keywords": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
// Function to get a file size | |
function getFileSize(filePath) { | |
return new Promise((resolve, reject) => { | |
fs.stat(filePath, (err, stats) => { | |
if(err) { | |
reject(err); | |
} else { | |
let fileSizeInBytes = stats.size; // size in bytes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isNode = (value) => { | |
return value && typeof value.nodeType === 'number'; | |
}; | |
const isDocument = (value) => { | |
return value.nodeType === 9; | |
}; | |
const isElement = (value) => { | |
return value.nodeType === 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { component$, useSignal } from '@builder.io/qwik'; | |
import { server$ } from '@builder.io/qwik-city'; | |
import { worker$ } from '@builder.io/qwik-worker'; | |
function streamFileToServer() { | |
throw new Error('Function not implemented.'); | |
} | |
export default component$(() => { | |
const fileRef = useSignal<HTMLInputElement>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/TileTemplate.tsx | |
15:23 warning Using "onDragStart$" as an event handler, however functions are not serializable. | |
Did you mean to wrap it in `$()`? | |
Fix the type of onDragStart$ to be PropFunction | |
Check out https://qwik.builder.io/docs/advanced/dollar/ for more details qwik/valid-lexical-scope | |
16:21 warning Using "onDragEnd$" as an event handler, however functions are not serializable. | |
Did you mean to wrap it in `$()`? | |
Fix the type of onDragEnd$ to be PropFunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { o as ol, P as Pn, h as jn, g as gs, X as Xi, L as Ln, _ as __vitePreload, f as fe, v as ve } from "./q-gg-S9lY2QP2.js"; | |
const s_akSovCvkdhw = () => alert("hi!"); | |
const s_B0lqk5IDDy4 = () => { | |
const yo = ol("hi"); | |
return /* @__PURE__ */ Pn(Ln, { | |
children: [ | |
/* @__PURE__ */ jn("h1", null, null, "Hi 👋", 3, null), | |
/* @__PURE__ */ jn("div", null, null, [ | |
"Can't wait to see what you build with qwik!", | |
/* @__PURE__ */ jn("br", null, null, null, 3, null), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let funcCode = '(n) => { "ArrowDown" === n.key && n.preventDefault() }'; | |
let { needsNormalization, normalizedCode } = normalizeFunction(funcCode, 'e'); | |
console.log(needsNormalization); | |
console.log(normalizedCode); |