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
petrpan-code/Shopify/react-native-skia/package/src/index.ts
import "./skia/NativeSetup"; export { JsiSkImage } from "./skia/web/JsiSkImage"; export * from "./renderer"; export * from "./renderer/Canvas"; export * from "./renderer/Offscreen"; export * from "./views"; export * from "./skia"; export * from "./external"; export * from "./values"; export * from "./animation"; export...
7,200
0
petrpan-code/Shopify/react-native-skia/package/src
petrpan-code/Shopify/react-native-skia/package/src/Platform/IPlatform.ts
/* eslint-disable @typescript-eslint/no-explicit-any */ import type { NodeHandle, ViewComponent } from "react-native"; import type { DataModule } from "../skia/types"; export interface IPlatform { OS: string; PixelRatio: number; findNodeHandle: ( componentOrHandle: | null | number | React....
7,201
0
petrpan-code/Shopify/react-native-skia/package/src
petrpan-code/Shopify/react-native-skia/package/src/Platform/Platform.ts
import { Image, PixelRatio, Platform as RNPlatform, findNodeHandle, View, } from "react-native"; import type { DataModule } from "../skia/types"; import { isRNModule } from "../skia/types"; import type { IPlatform } from "./IPlatform"; export const Platform: IPlatform = { OS: RNPlatform.OS, PixelRatio:...
7,202
0
petrpan-code/Shopify/react-native-skia/package/src
petrpan-code/Shopify/react-native-skia/package/src/Platform/Platform.web.tsx
import type { RefObject, CSSProperties } from "react"; import React, { useLayoutEffect, useMemo, useRef } from "react"; import type { LayoutChangeEvent, ViewComponent, ViewProps } from "react-native"; import type { DataModule } from "../skia/types"; import { isRNModule } from "../skia/types"; import type { IPlatform ...
7,203
0
petrpan-code/Shopify/react-native-skia/package/src
petrpan-code/Shopify/react-native-skia/package/src/Platform/index.ts
export * from "./Platform";
7,204
0
petrpan-code/Shopify/react-native-skia/package/src
petrpan-code/Shopify/react-native-skia/package/src/__tests__/globalSetup.ts
import { WebSocketServer } from "ws"; import type { Server, WebSocket } from "ws"; declare global { var testServer: Server; var testClient: WebSocket; var testOS: "ios" | "android" | "web" | "node"; } const isOS = (os: string): os is "android" | "ios" | "web" => { return ["ios", "android", "web"].indexOf(os) ...
7,205
0
petrpan-code/Shopify/react-native-skia/package/src
petrpan-code/Shopify/react-native-skia/package/src/__tests__/globalTeardown.ts
const globalTeardown = () => { if (global.testClient) { global.testClient.close(); } if (global.testServer) { global.testServer.close(); } }; // eslint-disable-next-line import/no-default-export export default globalTeardown;
7,206
0
petrpan-code/Shopify/react-native-skia/package/src
petrpan-code/Shopify/react-native-skia/package/src/__tests__/setup.ts
import path from "path"; import fs from "fs"; import { PNG } from "pngjs"; import pixelmatch from "pixelmatch"; import type { SkSurface, SkImage } from "../skia/types"; export const E2E = process.env.E2E === "true"; export const CI = process.env.CI === "true"; export const itFailsE2e = E2E ? it.failing : it; export ...
7,207
0
petrpan-code/Shopify/react-native-skia/package/src
petrpan-code/Shopify/react-native-skia/package/src/animation/index.ts
export * from "./timing"; export * from "./spring"; export * from "./decay"; export * from "./functions";
7,208
0
petrpan-code/Shopify/react-native-skia/package/src
petrpan-code/Shopify/react-native-skia/package/src/animation/types.ts
export interface SpringConfig { mass?: number; stiffness?: number; damping?: number; velocity?: number; } export interface TimingConfig { duration?: number; easing?: (t: number) => number; } export interface AnimationParams { from?: number; to?: number; loop?: boolean; yoyo?: boolean; } export ty...
7,209
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/decay/decay.ts
import type { DecayState, DefaultDecayConfig } from "./types"; const VELOCITY_EPS = 1; const SLOPE_FACTOR = 0.1; export const decay = ( now: number, state: DecayState, config: DefaultDecayConfig ): DecayState => { const { lastTimestamp, startTimestamp, initialVelocity, current, velocity } = state; const...
7,210
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/decay/index.ts
export { runDecay } from "./runDecay";
7,211
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/decay/runDecay.ts
import { ValueApi } from "../../values/api"; import type { SkiaMutableValue } from "../../values/types"; import { decay } from "./decay"; import type { DecayConfig, DefaultDecayConfig, DecayState } from "./types"; /** * Runs a decay animation from the current value to zero with the given decay * configuration. * @...
7,212
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/decay/types.ts
import type { AnimationState } from "../../values/types"; export interface DecayConfig { from?: number; deceleration?: number; velocityFactor?: number; clamp?: number[]; velocity?: number; } export interface DefaultDecayConfig { from: number; deceleration: number; velocityFactor: number; clamp?: num...
7,213
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/functions/index.ts
export * from "./interpolate"; export * from "./interpolateColors"; export * from "./interpolateVector"; export * from "./interpolatePaths";
7,214
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/functions/interpolate.ts
/* eslint-disable max-len */ export enum Extrapolate { IDENTITY = "identity", CLAMP = "clamp", EXTEND = "extend", } interface InterpolationNarrowedInput { leftEdgeInput: number; rightEdgeInput: number; leftEdgeOutput: number; rightEdgeOutput: number; } export interface ExtrapolationConfig { extrapolat...
7,215
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/functions/interpolateColors.ts
import { mix } from "../../renderer/processors/math"; import type { Color, SkColor } from "../../skia"; import { Skia } from "../../skia"; import { interpolate } from "./interpolate"; const interpolateColorsRGB = ( value: number, inputRange: number[], outputRange: SkColor[] ) => { "worklet"; const r = inter...
7,216
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/functions/interpolatePaths.ts
import type { SkPath } from "../../skia/types"; import { exhaustiveCheck } from "../../renderer/typeddash"; import type { ExtrapolationType } from "./interpolate"; import { validateInterpolationOptions, Extrapolate } from "./interpolate"; const lerp = ( value: number, from: number, to: number, p1: SkPath, p...
7,217
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/functions/interpolateVector.ts
import type { Vector } from "../../skia/types"; import { interpolate } from "./interpolate"; export const interpolateVector = ( value: number, inputRange: readonly number[], outputRange: readonly Vector[], options?: Parameters<typeof interpolate>[3] ) => { "worklet"; return { x: interpolate( val...
7,218
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/spring/Spring.ts
import type { SpringConfig } from "./types"; /* Spring animation configurations */ const Config = { Gentle: { mass: 1, stiffness: 170, damping: 19, velocity: 0, }, Wobbly: { mass: 1, stiffness: 180, damping: 12, velocity: 0, }, WobblySlow: { mass: 4, stiffness: 180, ...
7,219
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/spring/index.ts
export { Spring } from "./Spring"; export { runSpring } from "./runSpring"; export { useSpring } from "./useSpring";
7,220
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/spring/runSpring.ts
import type { SkiaMutableValue, SkiaAnimation } from "../../values/types"; import type { AnimationParams, SpringConfig, AnimationCallback, } from "../types"; import { runTiming } from "../timing/runTiming"; import { Spring } from "./Spring"; import { createSpringEasing } from "./functions/spring"; /** * Create...
7,221
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/spring/types.ts
export interface SpringConfig { mass?: number; stiffness?: number; velocity?: number; damping?: number; }
7,222
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/spring/useSpring.ts
import type { SkiaValue } from "../../values/types"; import type { SpringConfig, AnimationParams, AnimationCallback, } from "../types"; import { useTiming } from "../timing"; import { Spring } from "./Spring"; import { createSpringEasing } from "./functions/spring"; /** * Creats a spring based animation value ...
7,223
0
petrpan-code/Shopify/react-native-skia/package/src/animation/spring
petrpan-code/Shopify/react-native-skia/package/src/animation/spring/functions/index.ts
export { createSpringEasing } from "./spring";
7,224
0
petrpan-code/Shopify/react-native-skia/package/src/animation/spring
petrpan-code/Shopify/react-native-skia/package/src/animation/spring/functions/spring.ts
import type { SpringConfig } from "../types"; import type { TimingConfig } from "../../types"; /** * @description Returns a cached jsContext function for a spring with duration * @param mass The mass of the spring * @param stiffness The stiffness of the spring * @param damping Spring damping * @param velocity The...
7,225
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/timing/Easing.ts
// eslint-disable-next-line max-len // Taken from https://github.com/facebook/react-native/blob/0b9ea60b4fee8cacc36e7160e31b91fc114dbc0d/Libraries/Animated/src/Easing.js import { bezier } from "./functions"; export class Easing { static step0(n: number): number { return n > 0 ? 1 : 0; } static step1(n: num...
7,226
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/timing/createTiming.ts
import type { TimingConfig, RequiredAnimationParams, AnimationCallback, } from "../types"; import type { AnimationState, SkiaMutableValue } from "../../values/types"; import { ValueApi } from "../../values/api"; import { timing } from "./functions"; /** * Creates an animation that is driven by a clock value. ...
7,227
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/timing/index.ts
export { Easing } from "./Easing"; export { useTiming } from "./useTiming"; export { useLoop } from "./useLoop"; export { runTiming } from "./runTiming";
7,228
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/timing/runTiming.ts
import type { SkiaMutableValue, SkiaAnimation } from "../../values/types"; import type { AnimationParams, TimingConfig, AnimationCallback, } from "../types"; import { getResolvedParams } from "./functions"; import { createTiming } from "./createTiming"; /** * Creates a new animation on an existing value that wi...
7,229
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/timing/useLoop.ts
import type { TimingConfig } from "../types"; import { useTiming } from "./useTiming"; /** * Configures a looped timing value. The value will go back and forth * between 0 and 1 and back. * @param config Timing configuration for easing and duration * @returns A value that can be used for further animations */ ex...
7,230
0
petrpan-code/Shopify/react-native-skia/package/src/animation
petrpan-code/Shopify/react-native-skia/package/src/animation/timing/useTiming.ts
import { useEffect, useMemo, useRef } from "react"; import type { SkiaValue, SkiaAnimation } from "../../values/types"; import type { AnimationParams, TimingConfig, AnimationCallback, } from "../types"; import { useValue } from "../../values/hooks/useValue"; import { getResolvedParams } from "./functions"; impo...
7,231
0
petrpan-code/Shopify/react-native-skia/package/src/animation/timing
petrpan-code/Shopify/react-native-skia/package/src/animation/timing/functions/bezier.ts
// eslint-disable-next-line max-len // Taken from https://github.com/facebook/react-native/blob/0b9ea60b4fee8cacc36e7160e31b91fc114dbc0d/Libraries/Animated/src/bezier.js const NEWTON_ITERATIONS = 4; const NEWTON_MIN_SLOPE = 0.001; const SUBDIVISION_PRECISION = 0.0000001; const SUBDIVISION_MAX_ITERATIONS = 10; const k...
7,232
0
petrpan-code/Shopify/react-native-skia/package/src/animation/timing
petrpan-code/Shopify/react-native-skia/package/src/animation/timing/functions/getResolvedParams.ts
import type { RequiredAnimationParams, AnimationParams, TimingConfig, } from "../../types"; const DefaultParameters = { to: 1, loop: false, yoyo: false, immediate: true, }; const DefaultTimingConfig = { duration: 1000, easing: (t: number) => t, }; /** * Resolves parameters from optional values to ...
7,233
0
petrpan-code/Shopify/react-native-skia/package/src/animation/timing
petrpan-code/Shopify/react-native-skia/package/src/animation/timing/functions/index.ts
export { bezier } from "./bezier"; export { timing } from "./timing"; export * from "./types"; export * from "./getResolvedParams";
7,234
0
petrpan-code/Shopify/react-native-skia/package/src/animation/timing
petrpan-code/Shopify/react-native-skia/package/src/animation/timing/functions/timing.ts
import type { AnimationState } from "../../../values/types"; /** * Calculates and returns a timing value based on the * input parameters. The timing value is a number between * 0 and 1. * @param t * @param duration * @param easing * @param loop * @param yoyo * @param onStop * @returns */ export const timing...
7,235
0
petrpan-code/Shopify/react-native-skia/package/src/animation/timing
petrpan-code/Shopify/react-native-skia/package/src/animation/timing/functions/types.ts
export type EasingFunction = (value: number) => number; export interface TimingConfig { from?: number; to?: number; duration?: number; easing?: EasingFunction; }
7,236
0
petrpan-code/Shopify/react-native-skia/package/src/animation/timing/functions
petrpan-code/Shopify/react-native-skia/package/src/animation/timing/functions/__tests__/timing.spec.ts
import { timing } from "../timing"; const state = { current: 0, finished: false }; describe("timing", () => { it("should return zero when the timestamp is zero", () => { expect(timing(0, 1000, (t) => t, false, false, state).current).toBe(0); }); it("should return 1 when the timestamp is over duration", () ...
7,237
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/__tests__/Compose.spec.tsx
import { importSkia, width, height, loadImage, getSkDOM, } from "../../renderer/__tests__/setup"; import { setupSkia } from "../../skia/__tests__/setup"; import { docPath, processResult } from "../../__tests__/setup"; import { JsiDrawingContext } from "../types"; describe("Compose", () => { it("should comp...
7,238
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/__tests__/Demos.spec.tsx
import { importSkia, width, height, getSkDOM, } from "../../renderer/__tests__/setup"; import { setupSkia } from "../../skia/__tests__/setup"; import { processResult } from "../../__tests__/setup"; import { JsiDrawingContext } from "../types"; describe("Drawings", () => { it("Apple Breathe Demo", () => { ...
7,239
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/__tests__/DrawingContext.spec.tsx
import { importSkia, width, height, getSkDOM, } from "../../renderer/__tests__/setup"; import { setupSkia } from "../../skia/__tests__/setup"; import type { Node, PaintProps } from "../types"; import { JsiDrawingContext } from "../types"; describe("DrawingContext", () => { it("should create contextes properl...
7,240
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/__tests__/Drawings.spec.tsx
import { importSkia, width, height, getSkDOM, } from "../../renderer/__tests__/setup"; import { setupSkia } from "../../skia/__tests__/setup"; import { processResult } from "../../__tests__/setup"; import { fitRects, rect2rect } from "../nodes/datatypes"; import { JsiDrawingContext } from "../types/DrawingConte...
7,241
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/__tests__/Group.spec.tsx
import { fitbox } from "../../renderer"; import { importSkia, width, height, loadImage, PIXEL_RATIO, getSkDOM, } from "../../renderer/__tests__/setup"; import { setupSkia } from "../../skia/__tests__/setup"; import { docPath, processResult } from "../../__tests__/setup"; import { JsiDrawingContext } from "....
7,242
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/__tests__/Paint.spec.tsx
import { importSkia, width, height, PIXEL_RATIO, getSkDOM, } from "../../renderer/__tests__/setup"; import { setupSkia } from "../../skia/__tests__/setup"; import { docPath, processResult } from "../../__tests__/setup"; import { JsiDrawingContext } from "../types/DrawingContext"; describe("Paint", () => { ...
7,243
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/__tests__/RenderNodes.spec.tsx
import { importSkia, width, height, getSkDOM, } from "../../renderer/__tests__/setup"; import { setupSkia } from "../../skia/__tests__/setup"; import { processResult } from "../../__tests__/setup"; import type { NodeType } from "../types"; import type { CircleProps } from "../types/Drawings"; import { JsiDrawin...
7,244
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/__tests__/Shaders.spec.tsx
import { importSkia, width, height, loadImage, getSkDOM, } from "../../renderer/__tests__/setup"; import { setupSkia } from "../../skia/__tests__/setup"; import { processResult } from "../../__tests__/setup"; import { fitRects, rect2rect } from "../nodes/datatypes"; import { JsiDrawingContext } from "../types...
7,245
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/DrawingNode.ts
import type { DrawingContext, DrawingNodeProps, Node, NodeType, RenderNode, } from "../types"; import type { NodeContext } from "./Node"; import { JsiDeclarationNode } from "./Node"; import { PaintNode } from "./PaintNode"; import { JsiRenderNode } from "./RenderNode"; export abstract class JsiDrawingNode<P...
7,246
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/GroupNode.ts
import type { DrawingContext, GroupProps } from "../types"; import { NodeType } from "../types"; import { JsiRenderNode } from "./RenderNode"; import type { NodeContext } from "./Node"; export class GroupNode extends JsiRenderNode<GroupProps> { constructor(ctx: NodeContext, props: GroupProps) { super(ctx, NodeT...
7,247
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/JsiSkDOM.ts
import type { PathProps, SkDOM, GroupProps, ImageProps, BlurImageFilterProps, MatrixColorFilterProps, CircleProps, BlurMaskFilterProps, LinearGradientProps, PaintProps, ShaderProps, ImageShaderProps, CustomDrawingNodeProps, LineProps, OvalProps, PatchProps, PointsProps, RectProps, ...
7,248
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/LayerNode.ts
import type { DrawingContext } from "../types"; import { NodeType } from "../types"; import type { ChildrenProps } from "../types/Common"; import { JsiRenderNode } from "./RenderNode"; import type { NodeContext } from "./Node"; import { JsiDeclarationNode } from "./Node"; export class LayerNode extends JsiRenderNode<...
7,249
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/Node.ts
import type { Skia } from "../../skia/types"; import type { Node, DeclarationNode, NodeType, DeclarationType, } from "../types"; import type { DependencyManager } from "../../renderer/DependencyManager"; import type { DeclarationContext } from "../types/DeclarationContext"; export interface NodeContext { Ski...
7,250
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/PaintNode.ts
import { StrokeCap, StrokeJoin, PaintStyle, BlendMode } from "../../skia/types"; import type { DeclarationNode, PaintProps } from "../types"; import { DeclarationType, NodeType } from "../types"; import type { DeclarationContext } from "../types/DeclarationContext"; import { enumKey } from "./datatypes"; import type {...
7,251
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/RenderNode.ts
import type { SkMatrix, SkRect, SkRRect, SkPath, SkPaint, } from "../../skia/types"; import { ClipOp, isRRect } from "../../skia/types"; import type { RenderNode, GroupProps, NodeType, Node, DrawingContext, } from "../types"; import { isPathDef, processPath, processTransformProps } from "./datatype...
7,252
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/index.ts
export * from "../types"; export * from "./JsiSkDOM"; export * from "./datatypes";
7,253
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/datatypes/Circle.ts
import type { Skia } from "../../../skia/types"; import type { CircleDef, ScalarCircleDef } from "../../types"; export const isCircleScalarDef = (def: CircleDef): def is ScalarCircleDef => // We have an issue to check property existence on JSI backed instances // eslint-disable-next-line @typescript-eslint/no-expl...
7,254
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/datatypes/Enum.ts
export const enumKey = <K extends string>(k: K) => (k.charAt(0).toUpperCase() + k.slice(1)) as Capitalize<K>;
7,255
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/datatypes/Fitting.ts
import { exhaustiveCheck } from "../../../renderer/typeddash"; import type { SkRect } from "../../../skia/types"; import type { Fit } from "../../types"; export interface Size { width: number; height: number; } export const size = (width = 0, height = 0) => ({ width, height }); export const rect2rect = (src: SkR...
7,256
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/datatypes/Gradient.ts
import type { Skia, SkRect, Transforms2d, Vector } from "../../../skia/types"; import { TileMode } from "../../../skia/types"; import type { GradientProps, ImageShaderProps } from "../../types"; import { enumKey } from "./Enum"; import { processTransformProps } from "./Transform"; export const transformOrigin = (orig...
7,257
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/datatypes/Path.ts
import type { Skia } from "../../../skia/types"; import { isPath } from "../../../skia/types"; import type { PathDef } from "../../types"; export const processPath = (Skia: Skia, rawPath: PathDef) => { const path = typeof rawPath === "string" ? Skia.Path.MakeFromSVGString(rawPath) : rawPath; if (!p...
7,258
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/datatypes/Radius.ts
import type { Skia, Vector } from "../../../skia/types"; import type { Radius } from "../../types"; export const processRadius = (Skia: Skia, radius: Radius): Vector => { if (typeof radius === "number") { return Skia.Point(radius, radius); } return radius; };
7,259
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/datatypes/Rect.ts
/* eslint-disable @typescript-eslint/no-explicit-any */ import type { Skia, SkRect, Vector } from "../../../skia/types"; import type { RectCtor, RectDef, RRectCtor, RRectDef } from "../../types"; import { processRadius } from "./Radius"; export const isEdge = (pos: Vector, b: SkRect) => { "worklet"; return ( ...
7,260
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/datatypes/Transform.ts
import type { TransformProps } from "../../types"; import type { SkMatrix } from "../../../skia/types"; import { processTransform } from "../../../skia/types"; export const processTransformProps = (m3: SkMatrix, props: TransformProps) => { const { transform, origin, matrix } = props; if (matrix) { if (origin) ...
7,261
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/datatypes/index.ts
export * from "./Enum"; export * from "./Path"; export * from "./Fitting"; export * from "./Rect"; export * from "./Radius"; export * from "./Circle"; export * from "./Gradient"; export * from "./Transform";
7,262
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/BackdropFilterNode.ts
import type { ChildrenProps, DrawingContext } from "../../types"; import { NodeType } from "../../types"; import { JsiDrawingNode } from "../DrawingNode"; import type { NodeContext } from "../Node"; import { JsiDeclarationNode } from "../Node"; import type { SkImageFilter } from "../../../skia/types/ImageFilter/ImageFi...
7,263
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/Box.ts
import type { SkRRect, Skia } from "../../../skia/types"; import { BlurStyle, ClipOp, isRRect } from "../../../skia/types"; import type { DrawingContext } from "../../types"; import { DeclarationType, NodeType } from "../../types"; import type { BoxShadowProps, BoxProps } from "../../types/Drawings"; import type { Node...
7,264
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/CircleNode.ts
import type { SkPoint } from "../../../skia/types"; import type { CircleProps, DrawingContext } from "../../types"; import { NodeType } from "../../types"; import { processCircle } from "../datatypes"; import { JsiDrawingNode } from "../DrawingNode"; import type { NodeContext } from "../Node"; export class CircleNode ...
7,265
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/CustomDrawingNode.ts
import type { CustomDrawingNodeProps, DrawingContext } from "../../types"; import { NodeType } from "../../types"; import { JsiDrawingNode } from "../DrawingNode"; import type { NodeContext } from "../Node"; export class CustomDrawingNode extends JsiDrawingNode< CustomDrawingNodeProps, null > { constructor(ctx: ...
7,266
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/DiffRectNode.ts
import type { DiffRectProps, DrawingContext } from "../../types"; import { NodeType } from "../../types"; import { JsiDrawingNode } from "../DrawingNode"; import type { NodeContext } from "../Node"; export class DiffRectNode extends JsiDrawingNode<DiffRectProps, null> { constructor(ctx: NodeContext, props: DiffRectP...
7,267
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/FillNode.ts
import type { DrawingContext, DrawingNodeProps } from "../../types"; import { NodeType } from "../../types"; import { JsiDrawingNode } from "../DrawingNode"; import type { NodeContext } from "../Node"; export class FillNode extends JsiDrawingNode<DrawingNodeProps, null> { constructor(ctx: NodeContext, props: Drawing...
7,268
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/ImageNode.ts
import type { SkRect } from "../../../skia/types"; import type { DrawingContext, ImageProps } from "../../types"; import { NodeType } from "../../types"; import { fitRects, processRect } from "../datatypes"; import { JsiDrawingNode } from "../DrawingNode"; import type { NodeContext } from "../Node"; export class Image...
7,269
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/ImageSVG.ts
import type { DrawingContext, ImageSVGProps } from "../../types"; import { NodeType } from "../../types"; import { JsiDrawingNode } from "../DrawingNode"; import type { NodeContext } from "../Node"; export class ImageSVGNode extends JsiDrawingNode< ImageSVGProps, Pick<ImageSVGProps, "x" | "y" | "width" | "height">...
7,270
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/LineNode.ts
import type { DrawingContext, LineProps } from "../../types"; import { NodeType } from "../../types"; import { JsiDrawingNode } from "../DrawingNode"; import type { NodeContext } from "../Node"; export class LineNode extends JsiDrawingNode<LineProps, null> { constructor(ctx: NodeContext, props: LineProps) { supe...
7,271
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/OvalNode.ts
import type { SkRect } from "../../../skia/types"; import type { DrawingContext, OvalProps } from "../../types"; import { NodeType } from "../../types"; import { processRect } from "../datatypes"; import { JsiDrawingNode } from "../DrawingNode"; import type { NodeContext } from "../Node"; export class OvalNode extends...
7,272
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/PatchNode.ts
import type { SkColor, SkPoint } from "../../../skia/types"; import { BlendMode } from "../../../skia/types"; import type { DrawingContext, PatchProps } from "../../types"; import { NodeType } from "../../types"; import { enumKey } from "../datatypes"; import { JsiDrawingNode } from "../DrawingNode"; import type { Node...
7,273
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/PathNode.ts
import { saturate } from "../../../renderer/processors/math"; import { FillType } from "../../../skia/types"; import type { SkPath } from "../../../skia/types"; import type { DrawingContext, PathProps } from "../../types"; import { NodeType } from "../../types"; import { enumKey, processPath } from "../datatypes"; impo...
7,274
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/PictureNode.ts
import type { DrawingContext, PictureProps } from "../../types"; import { NodeType } from "../../types"; import { JsiDrawingNode } from "../DrawingNode"; import type { NodeContext } from "../Node"; export class PictureNode extends JsiDrawingNode<PictureProps, null> { constructor(ctx: NodeContext, props: PictureProps...
7,275
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/PointsNode.ts
import { PointMode } from "../../../skia/types"; import type { DrawingContext, PointsProps } from "../../types"; import { NodeType } from "../../types"; import { enumKey } from "../datatypes"; import { JsiDrawingNode } from "../DrawingNode"; import type { NodeContext } from "../Node"; export class PointsNode extends J...
7,276
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/RRectNode.ts
import type { SkRRect } from "../../../skia/types"; import type { DrawingContext, RoundedRectProps } from "../../types"; import { NodeType } from "../../types"; import { processRRect } from "../datatypes"; import { JsiDrawingNode } from "../DrawingNode"; import type { NodeContext } from "../Node"; export class RRectNo...
7,277
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/RectNode.ts
import type { SkRect } from "../../../skia/types/Rect"; import type { DrawingContext, RectProps } from "../../types"; import { NodeType } from "../../types"; import { processRect } from "../datatypes"; import { JsiDrawingNode } from "../DrawingNode"; import type { NodeContext } from "../Node"; export class RectNode ex...
7,278
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/Text.ts
import type { SkRSXform, SkTextBlob, SkPoint, SkFont, } from "../../../skia/types"; import type { DrawingContext, TextBlobProps, TextPathProps, TextProps, } from "../../types"; import { NodeType } from "../../types"; import { processPath } from "../datatypes"; import type { GlyphsProps } from "../../typ...
7,279
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/VerticesNode.ts
import type { SkVertices } from "../../../skia/types"; import { VertexMode, BlendMode } from "../../../skia/types"; import type { DrawingContext, VerticesProps } from "../../types"; import { NodeType } from "../../types"; import { enumKey } from "../datatypes"; import { JsiDrawingNode } from "../DrawingNode"; import ty...
7,280
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/drawings/index.ts
export * from "./CircleNode"; export * from "./FillNode"; export * from "./ImageNode"; export * from "./PointsNode"; export * from "./PathNode"; export * from "./RectNode"; export * from "./RRectNode"; export * from "./OvalNode"; export * from "./LineNode"; export * from "./PatchNode"; export * from "./VerticesNode"; e...
7,281
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/paint/BlendNode.ts
import type { BlendProps } from "../../types/ImageFilters"; import { BlendMode } from "../../../skia/types"; import { DeclarationType, NodeType } from "../../types/NodeType"; import type { NodeContext } from "../Node"; import { JsiDeclarationNode } from "../Node"; import { enumKey } from "../datatypes"; import type { D...
7,282
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/paint/ColorFilters.ts
import type { SkColorFilter } from "../../../skia/types"; import { BlendMode } from "../../../skia/types"; import type { NodeContext } from "../Node"; import { JsiDeclarationNode } from "../Node"; import type { BlendColorFilterProps, MatrixColorFilterProps, } from "../../types"; import { DeclarationType, NodeType }...
7,283
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/paint/ImageFilters.ts
import type { SkImageFilter, SkColor, Skia } from "../../../skia/types"; import { BlendMode, ColorChannel, processUniforms, TileMode, } from "../../../skia/types"; import type { BlendImageFilterProps, BlurImageFilterProps, DeclarationContext, DisplacementMapImageFilterProps, DropShadowImageFilterProps...
7,284
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/paint/MaskFilters.ts
import { BlurStyle } from "../../../skia/types"; import type { NodeContext } from "../Node"; import { JsiDeclarationNode } from "../Node"; import type { BlurMaskFilterProps } from "../../types"; import { DeclarationType, NodeType } from "../../types"; import { enumKey } from "../datatypes"; import type { DeclarationCon...
7,285
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/paint/PathEffects.ts
import { Path1DEffectStyle } from "../../../skia/types"; import type { SkPathEffect } from "../../../skia/types"; import type { NodeContext } from "../Node"; import { JsiDeclarationNode } from "../Node"; import type { CornerPathEffectProps, DashPathEffectProps, DiscretePathEffectProps, Line2DPathEffectProps, ...
7,286
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/paint/Shaders.ts
import { processUniforms, FilterMode, MipmapMode, TileMode, } from "../../../skia/types"; import type { NodeContext } from "../Node"; import { JsiDeclarationNode } from "../Node"; import type { ColorProps, DeclarationContext, FractalNoiseProps, ImageShaderProps, LinearGradientProps, RadialGradientPr...
7,287
0
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes
petrpan-code/Shopify/react-native-skia/package/src/dom/nodes/paint/index.ts
export * from "./Shaders"; export * from "./MaskFilters"; export * from "./ColorFilters"; export * from "./ImageFilters"; export * from "./PathEffects"; export * from "./BlendNode";
7,288
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/types/ColorFilters.ts
import type { BlendMode, Color } from "../../skia/types"; import type { ChildrenProps, SkEnum } from "./Common"; export interface MatrixColorFilterProps extends ChildrenProps { matrix: number[]; } export interface BlendColorFilterProps extends ChildrenProps { mode: SkEnum<typeof BlendMode>; color: Color; } ex...
7,289
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/types/Common.ts
import type { ReactNode } from "react"; import type { BlendMode, Color, PaintStyle, SkMatrix, SkPaint, SkPath, SkRect, SkRRect, StrokeCap, StrokeJoin, Transforms2d, Vector, } from "../../skia/types"; export type SkEnum<T> = Uncapitalize<keyof T extends string ? keyof T : never>; export type P...
7,290
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/types/DeclarationContext.ts
import type { SkShader, SkPaint, SkImageFilter, SkMaskFilter, SkPathEffect, Skia, SkColorFilter, } from "../../skia/types"; type Composer<T> = (outer: T, inner: T) => T; export const composeDeclarations = <T>(filters: T[], composer: Composer<T>) => { if (filters.length <= 1) { return filters[0]; ...
7,291
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/types/DrawingContext.ts
import type { SkCanvas, SkColor, SkColorFilter, SkImageFilter, SkMaskFilter, SkPaint, SkPathEffect, SkShader, Skia, } from "../../skia/types"; import { BlendMode, PaintStyle, StrokeCap, StrokeJoin } from "../../skia/types"; import { enumKey } from "../nodes/datatypes/Enum"; import { JsiDeclarationNode...
7,292
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/types/Drawings.ts
import type { FillType, SkImage, StrokeOpts, Vector, Color, SkPoint, BlendMode, PointMode, VertexMode, SkFont, SkRRect, SkTextBlob, SkPicture, SkSVG, SkPaint, SkRect, } from "../../skia/types"; import type { CircleDef, Fit, GroupProps, PathDef, RectDef, RRectDef, SkEnum, }...
7,293
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/types/ImageFilters.ts
import type { BlendMode, Color, ColorChannel, SkRuntimeEffect, TileMode, Uniforms, } from "../../skia/types"; import type { Radius, SkEnum, ChildrenProps } from "./Common"; export interface BlurImageFilterProps extends ChildrenProps { blur: Radius; mode: SkEnum<typeof TileMode>; } export interface Of...
7,294
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/types/MaskFilters.ts
import type { BlurStyle } from "../../skia/types"; import type { SkEnum } from "./Common"; export interface BlurMaskFilterProps { style: SkEnum<typeof BlurStyle>; blur: number; respectCTM: boolean; }
7,295
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/types/Node.ts
import type { GroupProps } from "./Common"; import type { DeclarationType, NodeType } from "./NodeType"; import type { DeclarationContext } from "./DeclarationContext"; import type { DrawingContext } from "./DrawingContext"; export interface Node<P> { type: NodeType; setProps(props: P): void; setProp<K extends ...
7,296
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/types/NodeType.ts
export const enum NodeType { // Shaders Layer = "skLayer", Shader = "skShader", ImageShader = "skImageShader", ColorShader = "skColorShader", Turbulence = "skTurbulence", FractalNoise = "skFractalNoise", LinearGradient = "skLinearGradient", RadialGradient = "skRadialGradient", SweepGradient = "skSwe...
7,297
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/types/PathEffects.ts
import type { Path1DEffectStyle, SkMatrix } from "../../skia/types"; import type { ChildrenProps, PathDef, SkEnum } from "./Common"; export interface CornerPathEffectProps extends ChildrenProps { r: number; } export interface DiscretePathEffectProps extends ChildrenProps { length: number; deviation: number; ...
7,298
0
petrpan-code/Shopify/react-native-skia/package/src/dom
petrpan-code/Shopify/react-native-skia/package/src/dom/types/Shaders.ts
import type { Color, FilterMode, MipmapMode, SkImage, SkRect, SkRuntimeEffect, TileMode, Uniforms, Vector, } from "../../skia/types"; import type { SkEnum, TransformProps, ChildrenProps, RectCtor, Fit, } from "./Common"; export interface ShaderProps extends TransformProps, ChildrenProps { ...
7,299