index int64 0 0 | repo_id stringlengths 16 181 | file_path stringlengths 28 270 | content stringlengths 1 11.6M | __index_level_0__ int64 0 10k |
|---|---|---|---|---|
0 | petrpan-code/Shopify/react-native-skia/package/src/dom | petrpan-code/Shopify/react-native-skia/package/src/dom/types/SkDOM.ts | import type { ChildrenProps, GroupProps, PaintProps } from "./Common";
import type {
BlendImageFilterProps,
BlurImageFilterProps,
DropShadowImageFilterProps,
OffsetImageFilterProps,
RuntimeShaderImageFilterProps,
DisplacementMapImageFilterProps,
MorphologyImageFilterProps,
BlendProps,
} from "./ImageFil... | 7,300 |
0 | petrpan-code/Shopify/react-native-skia/package/src/dom | petrpan-code/Shopify/react-native-skia/package/src/dom/types/index.ts | export * from "./DrawingContext";
export * from "./DeclarationContext";
export * from "./Node";
export * from "./NodeType";
export * from "./SkDOM";
export * from "./Common";
export * from "./Drawings";
export * from "./ImageFilters";
export * from "./ColorFilters";
export * from "./MaskFilters";
export * from "./PathE... | 7,301 |
0 | petrpan-code/Shopify/react-native-skia/package/src | petrpan-code/Shopify/react-native-skia/package/src/external/index.ts | export * from "./reanimated";
| 7,302 |
0 | petrpan-code/Shopify/react-native-skia/package/src/external | petrpan-code/Shopify/react-native-skia/package/src/external/reanimated/index.ts | export * from "./useAnimatedImageValue";
export * from "./useDerivedValueOnJS";
export * from "./renderHelpers";
export * from "./interpolators";
| 7,303 |
0 | petrpan-code/Shopify/react-native-skia/package/src/external | petrpan-code/Shopify/react-native-skia/package/src/external/reanimated/interpolators.ts | import type { ExtrapolationType, SharedValue } from "react-native-reanimated";
import { useMemo } from "react";
import type { SkPath, SkPoint } from "../../skia/types";
import { interpolatePaths, interpolateVector } from "../../animation";
import { Skia } from "../../skia";
import {
useAnimatedReaction,
useFrameC... | 7,304 |
0 | petrpan-code/Shopify/react-native-skia/package/src/external | petrpan-code/Shopify/react-native-skia/package/src/external/reanimated/moduleWrapper.ts | /* eslint-disable @typescript-eslint/no-explicit-any */
import type { DependencyList } from "react";
import type {
FrameCallback,
FrameInfo,
SharedValue,
} from "react-native-reanimated";
// This one is needed for the deprecated useSharedValue function
// We can remove it once we remove the deprecation
let Rean... | 7,305 |
0 | petrpan-code/Shopify/react-native-skia/package/src/external | petrpan-code/Shopify/react-native-skia/package/src/external/reanimated/renderHelpers.ts | /* eslint-disable @typescript-eslint/no-explicit-any */
import type { Container } from "../../renderer/Container";
import type { AnimatedProps } from "../../renderer/processors";
import type { Node } from "../../dom/types";
import {
startMapper,
stopMapper,
isSharedValue,
HAS_REANIMATED3,
HAS_REANIMATED2,
... | 7,306 |
0 | petrpan-code/Shopify/react-native-skia/package/src/external | petrpan-code/Shopify/react-native-skia/package/src/external/reanimated/useAnimatedImageValue.ts | import type { FrameInfo } from "react-native-reanimated";
import { useAnimatedImage } from "../../skia/core/AnimatedImage";
import type { DataSourceParam, SkImage } from "../../skia/types";
import {
throwOnMissingReanimated,
useFrameCallback,
useSharedValue,
} from "./moduleWrapper";
const DEFAULT_FRAME_DURATI... | 7,307 |
0 | petrpan-code/Shopify/react-native-skia/package/src/external | petrpan-code/Shopify/react-native-skia/package/src/external/reanimated/useDerivedValueOnJS.ts | import { useEffect, useMemo } from "react";
import {
useSharedValue,
runOnJS,
startMapper,
stopMapper,
} from "./moduleWrapper";
export const useDerivedValueOnJS = (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
fn: () => any,
deps: unknown[]
) => {
const init = useMemo(() => fn(), [f... | 7,308 |
0 | petrpan-code/Shopify/react-native-skia/package/src | petrpan-code/Shopify/react-native-skia/package/src/headless/index.ts | // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import CanvasKitInit from "canvaskit-wasm/bin/full/canvaskit";
import type { ReactNode } from "react";
import { JsiSkApi } from "../skia/web";
import { SkiaRoot } from "../renderer/Reconciler";
import { JsiDrawingContext } from "../dom/types";... | 7,309 |
0 | petrpan-code/Shopify/react-native-skia/package/src | petrpan-code/Shopify/react-native-skia/package/src/mock/index.ts | import type { CanvasKit } from "canvaskit-wasm";
import { JsiSkApi } from "../skia/web";
import { ValueApi } from "../values/web";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const Noop: () => any = () => undefined;
const NoopValue = () => ({ current: 0 });
const NoopSharedValue = () => ({ value: 0... | 7,310 |
0 | petrpan-code/Shopify/react-native-skia/package/src | petrpan-code/Shopify/react-native-skia/package/src/renderer/Canvas.tsx | import React, {
useEffect,
useCallback,
useMemo,
forwardRef,
useRef,
useLayoutEffect,
} from "react";
import type {
RefObject,
ReactNode,
MutableRefObject,
ForwardedRef,
FunctionComponent,
} from "react";
import { SkiaDomView, SkiaView } from "../views";
import { Skia } from "../skia/Skia";
impor... | 7,311 |
0 | petrpan-code/Shopify/react-native-skia/package/src | petrpan-code/Shopify/react-native-skia/package/src/renderer/Container.tsx | import { JsiSkDOM } from "../dom/nodes";
import type {
GroupProps,
DrawingContext,
RenderNode,
SkDOM,
} from "../dom/types";
import type { Skia } from "../skia/types";
import type { DependencyManager } from "./DependencyManager";
export class Container {
private _root: RenderNode<GroupProps>;
public Sk: S... | 7,312 |
0 | petrpan-code/Shopify/react-native-skia/package/src | petrpan-code/Shopify/react-native-skia/package/src/renderer/DependencyManager.tsx | import type { Node } from "../dom/types";
import type { SkiaValue } from "../values";
import type { AnimatedProps } from "./processors";
import { isSelector, isValue } from "./processors";
import { mapKeys } from "./typeddash";
type Unsubscribe = () => void;
type Mutator = (value: unknown) => void;
type Subscription... | 7,313 |
0 | petrpan-code/Shopify/react-native-skia/package/src | petrpan-code/Shopify/react-native-skia/package/src/renderer/DrawingContext.ts | import type { DrawingInfo } from "../views";
import type { Skia, SkCanvas, SkPaint } from "../skia/types";
export interface DrawingContext extends Omit<DrawingInfo, "touches"> {
Skia: Skia;
canvas: SkCanvas;
paint: SkPaint;
}
| 7,314 |
0 | petrpan-code/Shopify/react-native-skia/package/src | petrpan-code/Shopify/react-native-skia/package/src/renderer/HostComponents.ts | import { NodeType } from "../dom/types";
import type {
DeclarationNode,
FractalNoiseProps,
RenderNode,
CircleProps,
DrawingNodeProps,
ImageProps,
PaintProps,
PathProps,
CustomDrawingNodeProps,
LineProps,
OvalProps,
DiffRectProps,
PointsProps,
RectProps,
RoundedRectProps,
TextProps,
Ver... | 7,315 |
0 | petrpan-code/Shopify/react-native-skia/package/src | petrpan-code/Shopify/react-native-skia/package/src/renderer/HostConfig.ts | /*global NodeJS*/
import type { HostConfig } from "react-reconciler";
import { DefaultEventPriority } from "react-reconciler/constants";
import type { NodeType, Node } from "../dom/types";
import type { SkiaValue } from "../values";
import {
bindReanimatedProps,
extractReanimatedProps,
unbindReanimatedNode,
} fr... | 7,316 |
0 | petrpan-code/Shopify/react-native-skia/package/src | petrpan-code/Shopify/react-native-skia/package/src/renderer/Offscreen.tsx | import type { ReactElement } from "react";
import { JsiDrawingContext } from "../dom/types";
import { Skia } from "../skia";
import { SkiaRoot } from "./Reconciler";
export const drawAsImage = (
element: ReactElement,
width: number,
height: number
) => {
const surface = Skia.Surface.MakeOffscreen(width, heig... | 7,317 |
0 | petrpan-code/Shopify/react-native-skia/package/src | petrpan-code/Shopify/react-native-skia/package/src/renderer/Reconciler.tsx | import type { ReactNode } from "react";
import type { OpaqueRoot } from "react-reconciler";
import ReactReconciler from "react-reconciler";
import type { Skia } from "../skia/types";
import type { SkiaValue } from "../values/types";
import { DependencyManager } from "./DependencyManager";
import { skHostConfig, debug... | 7,318 |
0 | petrpan-code/Shopify/react-native-skia/package/src | petrpan-code/Shopify/react-native-skia/package/src/renderer/index.ts | export * from "./components";
export * from "./DependencyManager";
| 7,319 |
0 | petrpan-code/Shopify/react-native-skia/package/src | petrpan-code/Shopify/react-native-skia/package/src/renderer/typeddash.ts | export const mapKeys = <T extends object>(obj: T) =>
Object.keys(obj) as (keyof T)[];
export const exhaustiveCheck = (a: never): never => {
"worklet";
throw new Error(`Unexhaustive handling for ${a}`);
};
// Shallow eq on props (without children)
export const shallowEq = <P extends object>(p1: P, p2: P): boolea... | 7,320 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/Animations.spec.tsx | import React from "react";
import { ValueApi } from "../../values/web";
import { processResult } from "../../__tests__/setup";
import { Rect } from "../components";
import * as SkiaRenderer from "../index";
import type { SkiaValue } from "../../values/types";
import { width, mountCanvas } from "./setup";
interface G... | 7,321 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/Data.spec.tsx | import React, { useEffect, useRef, useState } from "react";
import { processResult } from "../../__tests__/setup";
import { Fill, Image } from "../components";
import * as SkiaRenderer from "../index";
import type { EmptyProps } from "./setup";
import { importSkia, mountCanvas, width, height, wait } from "./setup";
... | 7,322 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/DependencyManager.spec.tsx | import { DependencyManager } from "../DependencyManager";
import { Selector } from "../../values";
import { RNSkValue } from "../../values/web/RNSkValue";
import type { Node } from "../../dom/types";
import { NodeType } from "../../dom/types/NodeType";
class TestNode<P> implements Node<P> {
type = NodeType.Circle;
... | 7,323 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/Drawings.spec.tsx | import React, { useEffect, useState } from "react";
import { docPath, processResult } from "../../__tests__/setup";
import { Blur, Circle, DiffRect, Fill, Group, Paint } from "../components";
import {
drawOnNode,
width,
height,
importSkia,
PIXEL_RATIO,
mountCanvas,
wait,
} from "./setup";
const CheckEm... | 7,324 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/FitBox.spec.tsx | import React from "react";
import { processResult } from "../../__tests__/setup";
import { Circle, FitBox, Rect } from "../components";
import { drawOnNode, width, height, importSkia } from "./setup";
describe("FitBox", () => {
it("Should scale the rectangle in half", () => {
const { Skia } = importSkia();
... | 7,325 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/Glyphs.spec.tsx | import fs from "fs";
import path from "path";
import React from "react";
import type { SkFont } from "../../skia/types";
import { processResult } from "../../__tests__/setup";
import { Glyphs } from "../components";
import { drawOnNode, importSkia } from "./setup";
let font: SkFont;
const fontSize = 64;
describe("... | 7,326 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/Image.spec.tsx | import fs from "fs";
import path from "path";
import React from "react";
import { processResult } from "../../__tests__/setup";
import { Fill, ImageShader, Shader } from "../components";
import { drawOnNode, width, height, importSkia } from "./setup";
describe("Test Image Component", () => {
it("Should display th... | 7,327 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/Paths.spec.tsx | import React from "react";
import type { JsiSkPaint } from "../../skia/web/JsiSkPaint";
import { processResult } from "../../__tests__/setup";
import { Drawing, FitBox, Group, LinearGradient, Path } from "../components";
import { drawOnNode, width, height, importSkia } from "./setup";
const size = width;
describe("... | 7,328 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/Picture.spec.tsx | import React, { useEffect, useMemo, useState } from "react";
import { processResult } from "../../__tests__/setup";
import { Fill, Picture, Group } from "../components";
import type { EmptyProps } from "./setup";
import { wait, importSkia, mountCanvas, width } from "./setup";
const CheckPicture = ({}: EmptyProps) =>... | 7,329 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/Simple.spec.tsx | import React from "react";
import { processResult } from "../../__tests__/setup";
import { Group, Line, Points, Rect } from "../components";
import * as SkiaRenderer from "../index";
import { center, drawOnNode, width, importSkia } from "./setup";
const size = width / 2;
describe("Renderer", () => {
it("Loads ren... | 7,330 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/SkiaDOM.spec.tsx | import React from "react";
import { NodeType } from "../../dom/types";
import { Circle, Group, Paint } from "../components";
import { width, height, mountCanvas } from "./setup";
describe("Test introductionary examples from our documentation", () => {
it("Should blend colors using multiplication", () => {
cons... | 7,331 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/Text.spec.tsx | import fs from "fs";
import nodePath from "path";
import React from "react";
import { processResult, docPath } from "../../__tests__/setup";
import { TextPath, Fill, Text, Glyphs, TextBlob, Group } from "../components";
import {
drawOnNode,
width,
fontSize,
importSkia,
loadFont,
height,
} from "./setup";... | 7,332 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/TouchHandler.spec.tsx | import React from "react";
import { TouchType } from "../../views/types";
import type { EmptyProps } from "./setup";
import { mountCanvas, importSkia } from "./setup";
const SimpleActiveTouch = ({}: EmptyProps) => {
const { useTouchHandler } = importSkia();
const touchHandler = useTouchHandler({
onStart: ({ ... | 7,333 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/Transform.spec.tsx | import React from "react";
import { processResult } from "../../__tests__/setup";
import { Group, Rect } from "../components";
import * as SkiaRenderer from "../index";
import { drawOnNode, width, importSkia } from "./setup";
describe("Renderer", () => {
it("Loads renderer without Skia", () => {
expect(SkiaRen... | 7,334 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/setup.tsx | /* eslint-disable @typescript-eslint/no-explicit-any */
import fs from "fs";
import path from "path";
import React from "react";
import type { ReactNode } from "react";
import type { Server, WebSocket } from "ws";
import { DependencyManager } from "../DependencyManager";
import { ValueApi } from "../../values/web";
i... | 7,335 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/documentation/Group.spec.tsx | import React from "react";
import { docPath, processResult } from "../../../__tests__/setup";
import {
Image,
Group,
Fill,
FitBox,
Path,
Paint,
ColorMatrix,
Blur,
Circle,
} from "../../components";
import {
drawOnNode,
width,
loadImage,
importSkia,
height,
PIXEL_RATIO,
} from "../setup";
... | 7,336 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/documentation | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/documentation/getting-started/HelloWorld.spec.tsx | import React from "react";
import { BlendMode } from "../../../../skia/types";
import { setupSkia } from "../../../../skia/__tests__/setup";
import { docPath, processResult } from "../../../../__tests__/setup";
import { Circle, Drawing, Group } from "../../../components";
import { drawOnNode, width, height, importSkia... | 7,337 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/documentation | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/documentation/paint/Overview.spec.tsx | import React from "react";
import {
drawOnNode,
PIXEL_RATIO,
width,
height,
importSkia,
} from "../../setup";
import { Circle, Group, Paint } from "../../../components";
import { docPath, processResult } from "../../../../__tests__/setup";
const TestPaintAssignment = () => {
const { Skia } = importSkia();... | 7,338 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/documentation | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/documentation/shapes/Box.spec.tsx | import React from "react";
import { drawOnNode, PIXEL_RATIO, width, importSkia } from "../../setup";
import { docPath, processResult } from "../../../../__tests__/setup";
import { Box, BoxShadow, Fill } from "../../../components";
describe("Box", () => {
it("should draw a box with inner and outer shadow", () => {
... | 7,339 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/AnimatedImages.spec.tsx | import React from "react";
import { checkImage } from "../../../__tests__/setup";
import { Image } from "../../components";
import { BirdGIF, importSkia, surface } from "../setup";
describe("Animated Images", () => {
it("should decode gifs (1)", async () => {
const result = await surface.eval((Skia) => {
... | 7,340 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/BackdropFilters.spec.tsx | import React from "react";
import { checkImage, docPath } from "../../../__tests__/setup";
import {
BackdropBlur,
BackdropFilter,
Blur,
Circle,
ColorMatrix,
Fill,
Image,
LinearGradient,
} from "../../components";
import { importSkia, surface, images } from "../setup";
import { Group } from "../../compo... | 7,341 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Blending.spec.tsx | import React from "react";
import { importSkia, surface } from "../setup";
import { docPath, checkImage } from "../../../__tests__/setup";
import {
Blend,
ColorShader,
Fill,
Group,
LinearGradient,
RadialGradient,
} from "../../components";
describe("Test Blending", () => {
it("should display a linear gr... | 7,342 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Blur.spec.tsx | import React from "react";
import { checkImage, docPath, processResult } from "../../../__tests__/setup";
import { Blur, Image } from "../../components";
import { PIXEL_RATIO, surface, images } from "../setup";
import { Group } from "../../components/Group";
import { setupSkia } from "../../../skia/__tests__/setup";
i... | 7,343 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Box.spec.tsx | import React from "react";
import { checkImage, docPath } from "../../../__tests__/setup";
import { Box, BoxShadow, Fill, FitBox } from "../../components";
import { surface, importSkia, PIXEL_RATIO } from "../setup";
describe("Box", () => {
it("should draw a box with inner and outer shadow", async () => {
const... | 7,344 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/ColorFilters.spec.tsx | import React from "react";
import { images, surface, width as wWidth, height as wHeight } from "../setup";
import {
BlendColor,
Circle,
ColorMatrix,
Group,
Image,
Lerp,
LinearToSRGBGamma,
SRGBToLinearGamma,
} from "../../components";
import { docPath, checkImage, processResult } from "../../../__tests_... | 7,345 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/CoonPatch.spec.tsx | import React from "react";
import { surface } from "../setup";
import { Fill, Patch } from "../../components";
import * as SkiaRenderer from "../../index";
import { checkImage } from "../../../__tests__/setup";
describe("CoonsPatch", () => {
it("Renderer", () => {
expect(SkiaRenderer).toBeDefined();
});
it(... | 7,346 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/DataEncoding.spec.tsx | import { importSkia, surface } from "../setup";
describe("Data Encoding", () => {
it("encodeToBytes() from CPU image", async () => {
const result = await surface.eval((Skia) => {
const data = Skia.Data.fromBase64(
"R0lGODlhAQABAIAAAGGqHwAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="
);
const i... | 7,347 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Drawings.spec.tsx | import React from "react";
import { checkImage } from "../../../__tests__/setup";
import {
Blur,
Circle,
FitBox,
Group,
LinearGradient,
Path,
Rect,
Image,
Drawing,
} from "../../components";
import { images, importSkia, surface } from "../setup";
describe("Drawings", () => {
it("Should blend color... | 7,348 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/FontMgr.spec.tsx | import { itRunsE2eOnly } from "../../../__tests__/setup";
import { surface, testingFonts } from "../setup";
import { FontStyle } from "../../../skia/types";
// Currently this tests only run on iOS and Android
// We've contributed a patch to CanvasKit to make it work on Web too in the next release:
// https://github.co... | 7,349 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Gradient.spec.tsx | import React from "react";
import { surface } from "../setup";
import { Fill } from "../../components";
import { checkImage } from "../../../__tests__/setup";
import { LinearGradient } from "../../components/shaders/LinearGradient";
describe("Gradient", () => {
it("should display a simple linear gradient", async ()... | 7,350 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Group.spec.tsx | import React from "react";
import { checkImage, docPath } from "../../../__tests__/setup";
import { Image, Group, Fill, FitBox, Path } from "../../components";
import { images, importSkia, PIXEL_RATIO, surface } from "../setup";
describe("Group", () => {
it("Should use a rectangle as a clip", async () => {
cons... | 7,351 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Image.spec.tsx | import React from "react";
import { checkImage } from "../../../__tests__/setup";
import { images, loadImage, surface } from "../setup";
import { Fill, Image as SkiaImage } from "../../components";
import { AlphaType, ColorType } from "../../../skia/types";
describe("Image loading from bundles", () => {
it("should ... | 7,352 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/ImageEncoding.spec.tsx | import { surface } from "../setup";
const MAGIC_BYTES = {
JPEG: "/9j/4",
PNG: "iVBORw0KGgo",
WEBP: "UklGR",
};
const IMAGE_FORMAT = {
JPEG: 3, // ImageFormat.JPEG,
PNG: 4, // ImageFormat.PNG,
WEBP: 6, // ImageFormat.WEBP,
};
const IMAGE_INFO_BASE = {
alphaType: 1, // AlphaType.Opaque,
colorType: 4, /... | 7,353 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/ImageFilters.spec.tsx | import React from "react";
import {
docPath,
checkImage,
itRunsNodeOnly,
itRunsE2eOnly,
} from "../../../__tests__/setup";
import { fonts, images, surface } from "../setup";
import {
Fill,
Image,
Morphology,
Offset,
Path,
RoundedRect,
Shadow,
Text,
DisplacementMap,
Turbulence,
} from "../..... | 7,354 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Mask.spec.tsx | import React from "react";
import { docPath, checkImage } from "../../../__tests__/setup";
import { Group, Mask, Circle, Rect, Image, Paint } from "../../components";
import { importSkia, surface, images } from "../setup";
describe("Mask Documentation Examples", () => {
it("should draw an alpha mask", async () => {... | 7,355 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Offscreen.spec.tsx | import React from "react";
import { checkImage, docPath } from "../../../__tests__/setup";
import { Circle } from "../../components";
import { surface, importSkia } from "../setup";
describe("Offscreen Drawings", () => {
it("Should use the canvas API to build an image", async () => {
const { width, height } = s... | 7,356 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Opacity.spec.tsx | import React from "react";
import {
height as wHeight,
importSkia,
surface,
width as wWidth,
images,
} from "../setup";
import { processResult, checkImage } from "../../../__tests__/setup";
import {
ColorShader,
Fill,
Group,
Image,
ImageShader,
RoundedRect,
} from "../../components";
import { set... | 7,357 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Paint.spec.tsx | /* eslint-disable max-len */
import React from "react";
import { surface, importSkia } from "../setup";
import {
Circle,
Fill,
Group,
LinearGradient,
Paint,
Path,
} from "../../components";
import { checkImage } from "../../../__tests__/setup";
import { fitbox } from "../../components/shapes/FitBox";
cons... | 7,358 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/PathEffects.spec.tsx | import React from "react";
import type { Skia } from "../../../skia/types";
import { checkImage, itRunsE2eOnly } from "../../../__tests__/setup";
import {
DiscretePathEffect,
Fill,
Path,
SumPathEffect,
} from "../../components";
import { surface, importSkia } from "../setup";
const star = (Skia: Skia) => {
... | 7,359 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Paths.spec.tsx | import React from "react";
import { surface, importSkia } from "../setup";
import { Fill, Group, Path, Rect } from "../../components";
import { checkImage, docPath } from "../../../__tests__/setup";
import type { Skia } from "../../../skia/types";
import { PaintStyle } from "../../../skia/types";
const star = (Skia: ... | 7,360 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Point.spec.tsx | import React from "react";
import { checkImage } from "../../../__tests__/setup";
import { Fill, Points } from "../../components";
import { surface, importSkia } from "../setup";
describe("Points", () => {
it("should draw a point without throwing an error", async () => {
const { vec } = importSkia();
const ... | 7,361 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Rect.spec.tsx | import { surface } from "../setup";
describe("Rects and rounded rects", () => {
it("The rounded rectangle radii should be scale to its maximum value", async () => {
const result = await surface.eval((Skia) => {
const rrect = Skia.RRectXY(Skia.XYWHRect(0, 0, 100, 100), 200, 200);
return { rx: rrect.rx... | 7,362 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/RuntimeShader.spec.tsx | /* eslint-disable max-len */
import React from "react";
import { surface, importSkia, fonts } from "../setup";
import {
Circle,
Fill,
Group,
Paint,
RuntimeShader,
Text,
} from "../../components";
import { checkImage, docPath, itRunsE2eOnly } from "../../../__tests__/setup";
const spiral = `
uniform float ... | 7,363 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/SDF.spec.tsx | import React from "react";
import { surface, importSkia } from "../setup";
import { Fill, Shader } from "../../components";
import { checkImage } from "../../../__tests__/setup";
describe("Signed Distance Function", () => {
it("should use the sdf of a circle", async () => {
const { Skia } = importSkia();
co... | 7,364 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/SVG.spec.tsx | import fs from "fs";
import React from "react";
import { checkImage, docPath, itRunsE2eOnly } from "../../../__tests__/setup";
import { importSkia, surface } from "../setup";
import {
Blur,
ColorMatrix,
Fill,
Group,
ImageSVG,
OpacityMatrix,
Paint,
fitbox,
} from "../../components";
import type { SkSVG... | 7,365 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Shader.spec.tsx | import React from "react";
import { checkImage, docPath } from "../../../__tests__/setup";
import {
Fill,
Group,
LinearGradient,
ShaderLib,
Shader,
ColorShader,
} from "../../components";
import { images, importSkia, surface } from "../setup";
import { ImageShader } from "../../components/image/ImageShader... | 7,366 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Text.spec.tsx | import React from "react";
import {
checkImage,
itRunsCIAndNodeOnly,
itRunsE2eOnly,
} from "../../../__tests__/setup";
import { Fill, Group, Rect, Text, TextPath } from "../../components";
import { fonts, importSkia, surface } from "../setup";
describe("Text", () => {
// The NotoColorEmoji font is not support... | 7,367 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/TextPath.spec.tsx | import React from "react";
import { checkImage } from "../../../__tests__/setup";
import { Fill, Group, TextPath, fitbox } from "../../components";
import { fonts, importSkia, surface } from "../setup";
describe("Text Paths", () => {
// The NotoColorEmoji font is not supported on iOS
it("Should draw text along a ... | 7,368 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Transforms.spec.tsx | import React from "react";
import { importSkia, surface } from "../setup";
import { checkImage } from "../../../__tests__/setup";
import { Circle, Fill, Group, RoundedRect } from "../../components";
describe("Transform", () => {
it("Should render a transform with the correct origin", async () => {
const { Skia ... | 7,369 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/e2e/Composition/ColorFilterComposition.spec.tsx | import React from "react";
import {
images,
surface,
width as wWidth,
height as wHeight,
} from "../../setup";
import {
ColorMatrix,
Image,
Lerp,
LinearToSRGBGamma,
} from "../../../components";
import { checkImage, processResult } from "../../../../__tests__/setup";
import { setupSkia } from "../../..... | 7,370 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/examples/BlendModes.spec.tsx | import React from "react";
import { processResult } from "../../../__tests__/setup";
import {
BlendColor,
Image,
ImageShader,
Mask,
Rect,
Shader,
} from "../../components";
import { height, drawOnNode, width, loadImage, importSkia } from "../setup";
describe("Test blend modes", () => {
it("Should nicely... | 7,371 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/examples/Breathe.spec.tsx | import React from "react";
import type { SkiaValue } from "../../../values/types";
import { processResult } from "../../../__tests__/setup";
import {
BlurMask,
Circle,
Fill,
Group,
mix,
polar2Canvas,
} from "../../components";
import { height, importSkia, width, mountCanvas } from "../setup";
const c1 = "... | 7,372 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__ | petrpan-code/Shopify/react-native-skia/package/src/renderer/__tests__/examples/SkiaNeon.spec.tsx | /* eslint-disable max-len */
import React, { useMemo } from "react";
import type { SkiaValue } from "../../../values/types";
import { processResult } from "../../../__tests__/setup";
import {
Blur,
Fill,
Group,
LinearGradient,
Paint,
Path,
} from "../../components";
import { height, importSkia, width, moun... | 7,373 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/Blend.tsx | import React from "react";
import type { BlendProps } from "../../dom/types";
import type { SkiaProps } from "../processors";
export const Blend = (props: SkiaProps<BlendProps>) => {
return <skBlend {...props} />;
};
| 7,374 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/Drawing.tsx | import React from "react";
import type { CustomDrawingNodeProps } from "../../dom/types";
export const Drawing = (props: CustomDrawingNodeProps) => {
return <skDrawing {...props} />;
};
| 7,375 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/Group.tsx | import React, { isValidElement } from "react";
import type { SkiaProps } from "../processors";
import type { GroupProps } from "../../dom/types";
import type { ChildrenProps } from "../../dom/types/Common";
export interface PublicGroupProps extends Omit<GroupProps, "layer"> {
layer?: GroupProps["layer"] | ChildrenP... | 7,376 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/Mask.tsx | import type { ReactNode } from "react";
import React from "react";
import { Group } from "./Group";
import { LumaColorFilter } from "./colorFilters/LumaColorFilter";
import { Paint } from "./Paint";
interface MaskProps {
mode?: "luminance" | "alpha";
clip?: boolean;
mask: ReactNode | ReactNode[];
children: Re... | 7,377 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/Paint.tsx | import React from "react";
import type { SkiaProps } from "../processors";
import type { DrawingNodeProps } from "../../dom/types";
export const Paint = (props: SkiaProps<DrawingNodeProps>) => {
return <skPaint {...props} />;
};
| 7,378 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/Picture.tsx | import React from "react";
import type { PictureProps } from "../../dom/types";
import type { SkiaProps } from "../processors";
export const Picture = (props: SkiaProps<PictureProps>) => {
return <skPicture {...props} />;
};
| 7,379 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/index.ts | export * from "./shapes";
export * from "./backdrop";
export * from "./image";
export * from "./shaders";
export * from "./text";
export * from "./colorFilters";
export * from "./maskFilters";
export * from "./imageFilters";
export * from "./pathEffects";
export * from "../processors";
export * from "./Picture";
expor... | 7,380 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/backdrop/BackdropBlur.tsx | import React from "react";
import { Blur } from "../imageFilters";
import type { AnimatedProps } from "../../processors";
import type { Radius } from "../../../dom/types";
import type { BackdropFilterProps } from "./BackdropFilter";
import { BackdropFilter } from "./BackdropFilter";
interface BackdropBlurProps exten... | 7,381 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/backdrop/BackdropFilter.tsx | import type { ReactNode } from "react";
import React from "react";
import type { GroupProps } from "../../../dom/types";
import type { SkiaProps } from "../../processors/Animations/Animations";
import { Group } from "../Group";
export interface BackdropFilterProps extends GroupProps {
filter: ReactNode | ReactNode[... | 7,382 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/backdrop/index.ts | export * from "./BackdropFilter";
export * from "./BackdropBlur";
| 7,383 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/colorFilters/BlendColor.tsx | import React from "react";
import type { SkiaProps } from "../../processors";
import type { BlendColorFilterProps } from "../../../dom/types";
export const BlendColor = (props: SkiaProps<BlendColorFilterProps>) => {
return <skBlendColorFilter {...props} />;
};
| 7,384 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/colorFilters/Lerp.tsx | import React from "react";
import type { SkiaProps } from "../../processors/Animations/Animations";
import type { LerpColorFilterProps } from "../../../dom/types";
export const Lerp = (props: SkiaProps<LerpColorFilterProps>) => {
return <skLerpColorFilter {...props} />;
};
| 7,385 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/colorFilters/LinearToSRGBGamma.tsx | import React from "react";
import type { ChildrenProps } from "../../../dom/types";
import type { SkiaProps } from "../../processors";
export const LinearToSRGBGamma = (props: SkiaProps<ChildrenProps>) => {
return <skLinearToSRGBGammaColorFilter {...props} />;
};
| 7,386 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/colorFilters/LumaColorFilter.tsx | import React from "react";
import type { ChildrenProps } from "../../../dom/types";
import type { SkiaProps } from "../../processors/Animations/Animations";
export const LumaColorFilter = (props: SkiaProps<ChildrenProps>) => {
return <skLumaColorFilter {...props} />;
};
| 7,387 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/colorFilters/Matrix.tsx | import React from "react";
import type { SkiaProps } from "../../processors";
import type { MatrixColorFilterProps } from "../../../dom/types";
export const ColorMatrix = (props: SkiaProps<MatrixColorFilterProps>) => {
return <skMatrixColorFilter {...props} />;
};
export const OpacityMatrix = (opacity: number) => ... | 7,388 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/colorFilters/SRGBToLinearGamma.tsx | import React from "react";
import type { ChildrenProps } from "../../../dom/types";
import type { SkiaProps } from "../../processors/Animations/Animations";
export const SRGBToLinearGamma = (props: SkiaProps<ChildrenProps>) => {
return <skSRGBToLinearGammaColorFilter {...props} />;
};
| 7,389 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/colorFilters/index.ts | export * from "./Matrix";
export * from "./BlendColor";
export * from "./Lerp";
export * from "./LinearToSRGBGamma";
export * from "./SRGBToLinearGamma";
export * from "./LumaColorFilter";
| 7,390 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/image/Image.tsx | import React from "react";
import type { SkiaProps } from "../../processors";
import type { ImageProps } from "../../../dom/types";
export const Image = (props: SkiaProps<ImageProps>) => {
return <skImage {...props} />;
};
| 7,391 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/image/ImageSVG.tsx | import React from "react";
import type { ImageSVGProps } from "../../../dom/types";
import type { AnimatedProps } from "../../processors";
export const ImageSVG = (props: AnimatedProps<ImageSVGProps>) => {
return <skImageSVG {...props} />;
};
| 7,392 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/image/ImageShader.tsx | import React from "react";
import type { ImageShaderProps } from "../../../dom/types";
import type { SkiaDefaultProps } from "../../processors";
export const ImageShader = ({
tx = "decal",
ty = "decal",
fm = "nearest",
mm = "none",
fit = "none",
transform = [],
...props
}: SkiaDefaultProps<
ImageShade... | 7,393 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/image/index.ts | export * from "./Image";
export * from "./ImageShader";
export * from "./ImageSVG";
| 7,394 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/imageFilters/Blur.tsx | import React from "react";
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
import type { BlurImageFilterProps } from "../../../dom/types";
export const Blur = ({
mode = "decal",
...props
}: SkiaDefaultProps<BlurImageFilterProps, "mode">) => {
return <skBlurImageFilter mode={mode}... | 7,395 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/imageFilters/DisplacementMap.tsx | import React from "react";
import type { SkiaProps } from "../../processors";
import type { DisplacementMapImageFilterProps } from "../../../dom/types";
export const DisplacementMap = (
props: SkiaProps<DisplacementMapImageFilterProps>
) => {
return <skDisplacementMapImageFilter {...props} />;
};
| 7,396 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/imageFilters/Morphology.tsx | import React from "react";
import type { MorphologyImageFilterProps } from "../../../dom/types";
import type { SkiaDefaultProps } from "../../processors";
export const Morphology = ({
operator = "dilate",
...props
}: SkiaDefaultProps<MorphologyImageFilterProps, "operator">) => {
return <skMorphologyImageFilter ... | 7,397 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/imageFilters/Offset.tsx | import React from "react";
import type { SkiaDefaultProps } from "../../processors/Animations/Animations";
import type { OffsetImageFilterProps } from "../../../dom/types";
export const Offset = ({
x = 0,
y = 0,
...props
}: SkiaDefaultProps<OffsetImageFilterProps, "x" | "y">) => {
return <skOffsetImageFilter ... | 7,398 |
0 | petrpan-code/Shopify/react-native-skia/package/src/renderer/components | petrpan-code/Shopify/react-native-skia/package/src/renderer/components/imageFilters/RuntimeShader.tsx | import React from "react";
import type { SkiaProps } from "../../processors/Animations/Animations";
import type { RuntimeShaderImageFilterProps } from "../../../dom/types";
export const RuntimeShader = (
props: SkiaProps<RuntimeShaderImageFilterProps>
) => {
return <skRuntimeShaderImageFilter {...props} />;
};
| 7,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.