@shopify/react-native-skia 2.2.7 → 2.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +0 -11
- package/cpp/api/JsiSkParagraph.h +40 -8
- package/cpp/api/recorder/DrawingCtx.h +15 -0
- package/cpp/api/recorder/JsiRecorder.h +2 -1
- package/cpp/api/recorder/RNRecorder.h +2 -2
- package/cpp/api/recorder/Shaders.h +6 -5
- package/lib/commonjs/renderer/__tests__/e2e/ParagraphMethods.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/setup/Paragraph.d.ts +1 -1
- package/lib/commonjs/skia/types/Paragraph/Paragraph.d.ts +31 -1
- package/lib/commonjs/skia/types/Paragraph/Paragraph.js.map +1 -1
- package/lib/commonjs/skia/types/Recorder.d.ts +1 -1
- package/lib/commonjs/skia/types/Recorder.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkParagraph.d.ts +2 -2
- package/lib/commonjs/skia/web/JsiSkParagraph.js +4 -18
- package/lib/commonjs/skia/web/JsiSkParagraph.js.map +1 -1
- package/lib/commonjs/sksg/Container.d.ts +2 -10
- package/lib/commonjs/sksg/Container.js +1 -78
- package/lib/commonjs/sksg/Container.js.map +1 -1
- package/lib/commonjs/sksg/Container.web.d.ts +14 -0
- package/lib/commonjs/sksg/Container.web.js +91 -0
- package/lib/commonjs/sksg/Container.web.js.map +1 -0
- package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.d.ts +1 -1
- package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js +2 -2
- package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Recorder.d.ts +1 -1
- package/lib/commonjs/sksg/Recorder/Recorder.js +3 -2
- package/lib/commonjs/sksg/Recorder/Recorder.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Visitor.js +2 -2
- package/lib/commonjs/sksg/Recorder/Visitor.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/commands/Shaders.js +3 -3
- package/lib/commonjs/sksg/Recorder/commands/Shaders.js.map +1 -1
- package/lib/module/renderer/__tests__/e2e/ParagraphMethods.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/setup/Paragraph.d.ts +1 -1
- package/lib/module/skia/types/Paragraph/Paragraph.d.ts +31 -1
- package/lib/module/skia/types/Paragraph/Paragraph.js.map +1 -1
- package/lib/module/skia/types/Recorder.d.ts +1 -1
- package/lib/module/skia/types/Recorder.js.map +1 -1
- package/lib/module/skia/web/JsiSkParagraph.d.ts +2 -2
- package/lib/module/skia/web/JsiSkParagraph.js +4 -18
- package/lib/module/skia/web/JsiSkParagraph.js.map +1 -1
- package/lib/module/sksg/Container.d.ts +2 -10
- package/lib/module/sksg/Container.js +2 -78
- package/lib/module/sksg/Container.js.map +1 -1
- package/lib/module/sksg/Container.web.d.ts +14 -0
- package/lib/module/sksg/Container.web.js +83 -0
- package/lib/module/sksg/Container.web.js.map +1 -0
- package/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +1 -1
- package/lib/module/sksg/Recorder/ReanimatedRecorder.js +2 -2
- package/lib/module/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
- package/lib/module/sksg/Recorder/Recorder.d.ts +1 -1
- package/lib/module/sksg/Recorder/Recorder.js +3 -2
- package/lib/module/sksg/Recorder/Recorder.js.map +1 -1
- package/lib/module/sksg/Recorder/Visitor.js +2 -2
- package/lib/module/sksg/Recorder/Visitor.js.map +1 -1
- package/lib/module/sksg/Recorder/commands/Shaders.js +3 -3
- package/lib/module/sksg/Recorder/commands/Shaders.js.map +1 -1
- package/lib/typescript/lib/commonjs/sksg/Container.d.ts +1 -13
- package/lib/typescript/lib/commonjs/sksg/Container.web.d.ts +15 -0
- package/lib/typescript/lib/commonjs/sksg/Reconciler.d.ts +1 -17
- package/lib/typescript/lib/commonjs/sksg/Recorder/ReanimatedRecorder.d.ts +1 -1
- package/lib/typescript/lib/commonjs/sksg/Recorder/Recorder.d.ts +1 -1
- package/lib/typescript/lib/module/sksg/Container.d.ts +1 -14
- package/lib/typescript/lib/module/sksg/Container.web.d.ts +15 -0
- package/lib/typescript/lib/module/sksg/Reconciler.d.ts +1 -17
- package/lib/typescript/lib/module/sksg/Recorder/ReanimatedRecorder.d.ts +1 -1
- package/lib/typescript/lib/module/sksg/Recorder/Recorder.d.ts +1 -1
- package/lib/typescript/src/renderer/__tests__/e2e/ParagraphMethods.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/setup/Paragraph.d.ts +1 -1
- package/lib/typescript/src/skia/types/Paragraph/Paragraph.d.ts +31 -1
- package/lib/typescript/src/skia/types/Recorder.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkParagraph.d.ts +2 -2
- package/lib/typescript/src/sksg/Container.d.ts +2 -10
- package/lib/typescript/src/sksg/Container.web.d.ts +14 -0
- package/lib/typescript/src/sksg/Recorder/ReanimatedRecorder.d.ts +1 -1
- package/lib/typescript/src/sksg/Recorder/Recorder.d.ts +1 -1
- package/package.json +1 -1
- package/src/renderer/__tests__/e2e/ParagraphMethods.spec.tsx +383 -0
- package/src/renderer/__tests__/e2e/Shader.spec.tsx +93 -0
- package/src/skia/types/Paragraph/Paragraph.ts +32 -1
- package/src/skia/types/Recorder.ts +5 -1
- package/src/skia/web/JsiSkParagraph.ts +19 -28
- package/src/sksg/Container.ts +2 -81
- package/src/sksg/Container.web.ts +95 -0
- package/src/sksg/Recorder/ReanimatedRecorder.ts +6 -2
- package/src/sksg/Recorder/Recorder.ts +6 -2
- package/src/sksg/Recorder/Visitor.ts +2 -2
- package/src/sksg/Recorder/commands/Shaders.ts +8 -3
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["enumKey","fitRects","getRect","processColor","processGradientProps","processTransformProps","rect2rect","NodeType","BlendMode","FilterMode","isCubicSampling","MipmapMode","processUniforms","TileMode","composeDeclarations","CommandType","declareShader","ctx","props","source","uniforms","transform","m3","Skia","Matrix","shader","makeShaderWithChildren","shaders","splice","length","push","declareColorShader","color","Shader","MakeColor","declareFractalNoiseShader","freqX","freqY","octaves","seed","tileWidth","tileHeight","MakeFractalNoise","declareTwoPointConicalGradientShader","startR","endR","start","end","colors","positions","mode","localMatrix","flags","MakeTwoPointConicalGradient","declareRadialGradientShader","c","r","MakeRadialGradient","declareSweepGradientShader","MakeSweepGradient","x","y","declareLinearGradientShader","MakeLinearGradient","declareTurbulenceShader","MakeTurbulence","declareImageShader","fit","image","tx","ty","sampling","imageShaderProps","rct","rects","width","height","sx","sy","src","dst","translate","translateX","translateY","scale","scaleX","scaleY","lm","concat","makeShaderCubic","B","C","_sampling$filter","_sampling$mipmap","filter","Linear","mipmap","None","declareBlend","blend","composer","MakeBlend","bind","isPushShader","command","type","PushShader","isShader","shaderType","pushShader","ImageShader","ColorShader","Turbulence","FractalNoise","LinearGradient","RadialGradient","SweepGradient","TwoPointConicalGradient","Blend","Error"],"sources":["Shaders.ts"],"sourcesContent":["import {\n enumKey,\n fitRects,\n getRect,\n processColor,\n processGradientProps,\n processTransformProps,\n rect2rect,\n} from \"../../../dom/nodes\";\nimport { NodeType } from \"../../../dom/types\";\nimport type {\n BlendProps,\n ColorProps,\n FractalNoiseProps,\n ImageShaderProps,\n LinearGradientProps,\n RadialGradientProps,\n ShaderProps,\n SweepGradientProps,\n TurbulenceProps,\n TwoPointConicalGradientProps,\n} from \"../../../dom/types\";\nimport type { SkShader } from \"../../../skia/types\";\nimport {\n BlendMode,\n FilterMode,\n isCubicSampling,\n MipmapMode,\n processUniforms,\n TileMode,\n} from \"../../../skia/types\";\nimport { composeDeclarations } from \"../../utils\";\nimport type { Command } from \"../Core\";\nimport { CommandType } from \"../Core\";\nimport type { DrawingContext } from \"../DrawingContext\";\n\nconst declareShader = (ctx: DrawingContext, props: ShaderProps) => {\n \"worklet\";\n const { source, uniforms, ...transform } = props;\n const m3 = ctx.Skia.Matrix();\n processTransformProps(m3, transform);\n const shader = source.makeShaderWithChildren(\n processUniforms(source, uniforms),\n ctx.shaders.splice(0, ctx.shaders.length),\n m3\n );\n ctx.shaders.push(shader);\n};\n\nconst declareColorShader = (ctx: DrawingContext, props: ColorProps) => {\n \"worklet\";\n const { color } = props;\n const shader = ctx.Skia.Shader.MakeColor(processColor(ctx.Skia, color));\n ctx.shaders.push(shader);\n};\n\nconst declareFractalNoiseShader = (\n ctx: DrawingContext,\n props: FractalNoiseProps\n) => {\n \"worklet\";\n const { freqX, freqY, octaves, seed, tileWidth, tileHeight } = props;\n const shader = ctx.Skia.Shader.MakeFractalNoise(\n freqX,\n freqY,\n octaves,\n seed,\n tileWidth,\n tileHeight\n );\n ctx.shaders.push(shader);\n};\n\nconst declareTwoPointConicalGradientShader = (\n ctx: DrawingContext,\n props: TwoPointConicalGradientProps\n) => {\n \"worklet\";\n const { startR, endR, start, end } = props;\n const { colors, positions, mode, localMatrix, flags } = processGradientProps(\n ctx.Skia,\n props\n );\n const shader = ctx.Skia.Shader.MakeTwoPointConicalGradient(\n start,\n startR,\n end,\n endR,\n colors,\n positions,\n mode,\n localMatrix,\n flags\n );\n ctx.shaders.push(shader);\n};\n\nconst declareRadialGradientShader = (\n ctx: DrawingContext,\n props: RadialGradientProps\n) => {\n \"worklet\";\n const { c, r } = props;\n const { colors, positions, mode, localMatrix, flags } = processGradientProps(\n ctx.Skia,\n props\n );\n const shader = ctx.Skia.Shader.MakeRadialGradient(\n c,\n r,\n colors,\n positions,\n mode,\n localMatrix,\n flags\n );\n ctx.shaders.push(shader);\n};\n\nconst declareSweepGradientShader = (\n ctx: DrawingContext,\n props: SweepGradientProps\n) => {\n \"worklet\";\n const { c, start, end } = props;\n const { colors, positions, mode, localMatrix, flags } = processGradientProps(\n ctx.Skia,\n props\n );\n const shader = ctx.Skia.Shader.MakeSweepGradient(\n c.x,\n c.y,\n colors,\n positions,\n mode,\n localMatrix,\n flags,\n start,\n end\n );\n ctx.shaders.push(shader);\n};\n\nconst declareLinearGradientShader = (\n ctx: DrawingContext,\n props: LinearGradientProps\n) => {\n \"worklet\";\n const { start, end } = props;\n const { colors, positions, mode, localMatrix, flags } = processGradientProps(\n ctx.Skia,\n props\n );\n const shader = ctx.Skia.Shader.MakeLinearGradient(\n start,\n end,\n colors,\n positions ?? null,\n mode,\n localMatrix,\n flags\n );\n ctx.shaders.push(shader);\n};\n\nconst declareTurbulenceShader = (\n ctx: DrawingContext,\n props: TurbulenceProps\n) => {\n \"worklet\";\n const { freqX, freqY, octaves, seed, tileWidth, tileHeight } = props;\n const shader = ctx.Skia.Shader.MakeTurbulence(\n freqX,\n freqY,\n octaves,\n seed,\n tileWidth,\n tileHeight\n );\n ctx.shaders.push(shader);\n};\n\nconst declareImageShader = (ctx: DrawingContext, props: ImageShaderProps) => {\n \"worklet\";\n const { fit, image, tx, ty, sampling, ...imageShaderProps } = props;\n if (!image) {\n return;\n }\n\n const rct = getRect(ctx.Skia, imageShaderProps);\n const m3 = ctx.Skia.Matrix();\n if (rct) {\n const rects = fitRects(\n fit,\n { x: 0, y: 0, width: image.width(), height: image.height() },\n rct\n );\n const [x, y, sx, sy] = rect2rect(rects.src, rects.dst);\n m3.translate(x.translateX, y.translateY);\n m3.scale(sx.scaleX, sy.scaleY);\n }\n const lm = ctx.Skia.Matrix();\n lm.concat(m3);\n processTransformProps(lm, imageShaderProps);\n let shader: SkShader;\n if (sampling && isCubicSampling(sampling)) {\n shader = image.makeShaderCubic(\n TileMode[enumKey(tx)],\n TileMode[enumKey(ty)],\n sampling.B,\n sampling.C,\n lm\n );\n } else {\n shader = image.makeShaderCubic(\n TileMode[enumKey(tx)],\n TileMode[enumKey(ty)],\n sampling?.filter ?? FilterMode.Linear,\n sampling?.mipmap ?? MipmapMode.None,\n lm\n );\n }\n ctx.shaders.push(shader);\n};\n\nconst declareBlend = (ctx: DrawingContext, props: BlendProps) => {\n \"worklet\";\n const blend = BlendMode[enumKey(props.mode as BlendProps[\"mode\"])];\n const shaders = ctx.shaders.splice(0, ctx.shaders.length);\n if (shaders.length > 0) {\n const composer = ctx.Skia.Shader.MakeBlend.bind(ctx.Skia.Shader, blend);\n ctx.shaders.push(composeDeclarations(shaders, composer));\n }\n};\n\nexport const isPushShader = (\n command: Command\n): command is Command<CommandType.PushShader> => {\n \"worklet\";\n return command.type === CommandType.PushShader;\n};\n\ntype Props = {\n [NodeType.Shader]: ShaderProps;\n [NodeType.ImageShader]: ImageShaderProps;\n [NodeType.ColorShader]: ColorProps;\n [NodeType.Turbulence]: TurbulenceProps;\n [NodeType.FractalNoise]: FractalNoiseProps;\n [NodeType.LinearGradient]: LinearGradientProps;\n [NodeType.RadialGradient]: RadialGradientProps;\n [NodeType.SweepGradient]: SweepGradientProps;\n [NodeType.TwoPointConicalGradient]: TwoPointConicalGradientProps;\n [NodeType.Blend]: BlendProps;\n};\n\ninterface PushShader<T extends keyof Props>\n extends Command<CommandType.PushShader> {\n shaderType: T;\n props: Props[T];\n}\n\nconst isShader = <T extends keyof Props>(\n command: Command<CommandType.PushShader>,\n type: T\n): command is PushShader<T> => {\n \"worklet\";\n return command.shaderType === type;\n};\n\nexport const pushShader = (\n ctx: DrawingContext,\n command: Command<CommandType.PushShader>\n) => {\n \"worklet\";\n if (isShader(command, NodeType.Shader)) {\n declareShader(ctx, command.props);\n } else if (isShader(command, NodeType.ImageShader)) {\n declareImageShader(ctx, command.props);\n } else if (isShader(command, NodeType.ColorShader)) {\n declareColorShader(ctx, command.props);\n } else if (isShader(command, NodeType.Turbulence)) {\n declareTurbulenceShader(ctx, command.props);\n } else if (isShader(command, NodeType.FractalNoise)) {\n declareFractalNoiseShader(ctx, command.props);\n } else if (isShader(command, NodeType.LinearGradient)) {\n declareLinearGradientShader(ctx, command.props);\n } else if (isShader(command, NodeType.RadialGradient)) {\n declareRadialGradientShader(ctx, command.props);\n } else if (isShader(command, NodeType.SweepGradient)) {\n declareSweepGradientShader(ctx, command.props);\n } else if (isShader(command, NodeType.TwoPointConicalGradient)) {\n declareTwoPointConicalGradientShader(ctx, command.props);\n } else if (isShader(command, NodeType.Blend)) {\n declareBlend(ctx, command.props);\n } else {\n throw new Error(`Unknown shader type: ${command.shaderType}`);\n }\n};\n"],"mappings":"AAAA,SACEA,OAAO,EACPC,QAAQ,EACRC,OAAO,EACPC,YAAY,EACZC,oBAAoB,EACpBC,qBAAqB,EACrBC,SAAS,QACJ,oBAAoB;AAC3B,SAASC,QAAQ,QAAQ,oBAAoB;AAc7C,SACEC,SAAS,EACTC,UAAU,EACVC,eAAe,EACfC,UAAU,EACVC,eAAe,EACfC,QAAQ,QACH,qBAAqB;AAC5B,SAASC,mBAAmB,QAAQ,aAAa;AAEjD,SAASC,WAAW,QAAQ,SAAS;AAGrC,MAAMC,aAAa,GAAGA,CAACC,GAAmB,EAAEC,KAAkB,KAAK;EACjE,SAAS;;EACT,MAAM;IAAEC,MAAM;IAAEC,QAAQ;IAAE,GAAGC;EAAU,CAAC,GAAGH,KAAK;EAChD,MAAMI,EAAE,GAAGL,GAAG,CAACM,IAAI,CAACC,MAAM,CAAC,CAAC;EAC5BnB,qBAAqB,CAACiB,EAAE,EAAED,SAAS,CAAC;EACpC,MAAMI,MAAM,GAAGN,MAAM,CAACO,sBAAsB,CAC1Cd,eAAe,CAACO,MAAM,EAAEC,QAAQ,CAAC,EACjCH,GAAG,CAACU,OAAO,CAACC,MAAM,CAAC,CAAC,EAAEX,GAAG,CAACU,OAAO,CAACE,MAAM,CAAC,EACzCP,EACF,CAAC;EACDL,GAAG,CAACU,OAAO,CAACG,IAAI,CAACL,MAAM,CAAC;AAC1B,CAAC;AAED,MAAMM,kBAAkB,GAAGA,CAACd,GAAmB,EAAEC,KAAiB,KAAK;EACrE,SAAS;;EACT,MAAM;IAAEc;EAAM,CAAC,GAAGd,KAAK;EACvB,MAAMO,MAAM,GAAGR,GAAG,CAACM,IAAI,CAACU,MAAM,CAACC,SAAS,CAAC/B,YAAY,CAACc,GAAG,CAACM,IAAI,EAAES,KAAK,CAAC,CAAC;EACvEf,GAAG,CAACU,O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G,QAAQ,CAAC+G,KAAK,CAAC,EAAE;IAC5CpB,YAAY,CAACjF,GAAG,EAAEuF,OAAO,CAACtF,KAAK,CAAC;EAClC,CAAC,MAAM;IACL,MAAM,IAAIqG,KAAK,CAAC,wBAAwBf,OAAO,CAACI,UAAU,EAAE,CAAC;EAC/D;AACF,CAAC","ignoreList":[]}
|
1
|
+
{"version":3,"names":["enumKey","fitRects","getRect","processColor","processGradientProps","processTransformProps","rect2rect","NodeType","BlendMode","FilterMode","isCubicSampling","MipmapMode","processUniforms","TileMode","composeDeclarations","CommandType","declareShader","ctx","props","children","source","uniforms","transform","m3","Skia","Matrix","shader","makeShaderWithChildren","shaders","splice","push","declareColorShader","color","Shader","MakeColor","declareFractalNoiseShader","freqX","freqY","octaves","seed","tileWidth","tileHeight","MakeFractalNoise","declareTwoPointConicalGradientShader","startR","endR","start","end","colors","positions","mode","localMatrix","flags","MakeTwoPointConicalGradient","declareRadialGradientShader","c","r","MakeRadialGradient","declareSweepGradientShader","MakeSweepGradient","x","y","declareLinearGradientShader","MakeLinearGradient","declareTurbulenceShader","MakeTurbulence","declareImageShader","fit","image","tx","ty","sampling","imageShaderProps","rct","rects","width","height","sx","sy","src","dst","translate","translateX","translateY","scale","scaleX","scaleY","lm","concat","makeShaderCubic","B","C","_sampling$filter","_sampling$mipmap","filter","Linear","mipmap","None","declareBlend","blend","length","composer","MakeBlend","bind","isPushShader","command","type","PushShader","isShader","shaderType","pushShader","ImageShader","ColorShader","Turbulence","FractalNoise","LinearGradient","RadialGradient","SweepGradient","TwoPointConicalGradient","Blend","Error"],"sources":["Shaders.ts"],"sourcesContent":["import {\n enumKey,\n fitRects,\n getRect,\n processColor,\n processGradientProps,\n processTransformProps,\n rect2rect,\n} from \"../../../dom/nodes\";\nimport { NodeType } from \"../../../dom/types\";\nimport type {\n BlendProps,\n ColorProps,\n FractalNoiseProps,\n ImageShaderProps,\n LinearGradientProps,\n RadialGradientProps,\n ShaderProps,\n SweepGradientProps,\n TurbulenceProps,\n TwoPointConicalGradientProps,\n} from \"../../../dom/types\";\nimport type { SkShader } from \"../../../skia/types\";\nimport {\n BlendMode,\n FilterMode,\n isCubicSampling,\n MipmapMode,\n processUniforms,\n TileMode,\n} from \"../../../skia/types\";\nimport { composeDeclarations } from \"../../utils\";\nimport type { Command } from \"../Core\";\nimport { CommandType } from \"../Core\";\nimport type { DrawingContext } from \"../DrawingContext\";\n\nconst declareShader = (\n ctx: DrawingContext,\n props: ShaderProps,\n children: number\n) => {\n \"worklet\";\n const { source, uniforms, ...transform } = props;\n const m3 = ctx.Skia.Matrix();\n processTransformProps(m3, transform);\n const shader = source.makeShaderWithChildren(\n processUniforms(source, uniforms),\n ctx.shaders.splice(0, children),\n m3\n );\n ctx.shaders.push(shader);\n};\n\nconst declareColorShader = (ctx: DrawingContext, props: ColorProps) => {\n \"worklet\";\n const { color } = props;\n const shader = ctx.Skia.Shader.MakeColor(processColor(ctx.Skia, color));\n ctx.shaders.push(shader);\n};\n\nconst declareFractalNoiseShader = (\n ctx: DrawingContext,\n props: FractalNoiseProps\n) => {\n \"worklet\";\n const { freqX, freqY, octaves, seed, tileWidth, tileHeight } = props;\n const shader = ctx.Skia.Shader.MakeFractalNoise(\n freqX,\n freqY,\n octaves,\n seed,\n tileWidth,\n tileHeight\n );\n ctx.shaders.push(shader);\n};\n\nconst declareTwoPointConicalGradientShader = (\n ctx: DrawingContext,\n props: TwoPointConicalGradientProps\n) => {\n \"worklet\";\n const { startR, endR, start, end } = props;\n const { colors, positions, mode, localMatrix, flags } = processGradientProps(\n ctx.Skia,\n props\n );\n const shader = ctx.Skia.Shader.MakeTwoPointConicalGradient(\n start,\n startR,\n end,\n endR,\n colors,\n positions,\n mode,\n localMatrix,\n flags\n );\n ctx.shaders.push(shader);\n};\n\nconst declareRadialGradientShader = (\n ctx: DrawingContext,\n props: RadialGradientProps\n) => {\n \"worklet\";\n const { c, r } = props;\n const { colors, positions, mode, localMatrix, flags } = processGradientProps(\n ctx.Skia,\n props\n );\n const shader = ctx.Skia.Shader.MakeRadialGradient(\n c,\n r,\n colors,\n positions,\n mode,\n localMatrix,\n flags\n );\n ctx.shaders.push(shader);\n};\n\nconst declareSweepGradientShader = (\n ctx: DrawingContext,\n props: SweepGradientProps\n) => {\n \"worklet\";\n const { c, start, end } = props;\n const { colors, positions, mode, localMatrix, flags } = processGradientProps(\n ctx.Skia,\n props\n );\n const shader = ctx.Skia.Shader.MakeSweepGradient(\n c.x,\n c.y,\n colors,\n positions,\n mode,\n localMatrix,\n flags,\n start,\n end\n );\n ctx.shaders.push(shader);\n};\n\nconst declareLinearGradientShader = (\n ctx: DrawingContext,\n props: LinearGradientProps\n) => {\n \"worklet\";\n const { start, end } = props;\n const { colors, positions, mode, localMatrix, flags } = processGradientProps(\n ctx.Skia,\n props\n );\n const shader = ctx.Skia.Shader.MakeLinearGradient(\n start,\n end,\n colors,\n positions ?? null,\n mode,\n localMatrix,\n flags\n );\n ctx.shaders.push(shader);\n};\n\nconst declareTurbulenceShader = (\n ctx: DrawingContext,\n props: TurbulenceProps\n) => {\n \"worklet\";\n const { freqX, freqY, octaves, seed, tileWidth, tileHeight } = props;\n const shader = ctx.Skia.Shader.MakeTurbulence(\n freqX,\n freqY,\n octaves,\n seed,\n tileWidth,\n tileHeight\n );\n ctx.shaders.push(shader);\n};\n\nconst declareImageShader = (ctx: DrawingContext, props: ImageShaderProps) => {\n \"worklet\";\n const { fit, image, tx, ty, sampling, ...imageShaderProps } = props;\n if (!image) {\n return;\n }\n\n const rct = getRect(ctx.Skia, imageShaderProps);\n const m3 = ctx.Skia.Matrix();\n if (rct) {\n const rects = fitRects(\n fit,\n { x: 0, y: 0, width: image.width(), height: image.height() },\n rct\n );\n const [x, y, sx, sy] = rect2rect(rects.src, rects.dst);\n m3.translate(x.translateX, y.translateY);\n m3.scale(sx.scaleX, sy.scaleY);\n }\n const lm = ctx.Skia.Matrix();\n lm.concat(m3);\n processTransformProps(lm, imageShaderProps);\n let shader: SkShader;\n if (sampling && isCubicSampling(sampling)) {\n shader = image.makeShaderCubic(\n TileMode[enumKey(tx)],\n TileMode[enumKey(ty)],\n sampling.B,\n sampling.C,\n lm\n );\n } else {\n shader = image.makeShaderCubic(\n TileMode[enumKey(tx)],\n TileMode[enumKey(ty)],\n sampling?.filter ?? FilterMode.Linear,\n sampling?.mipmap ?? MipmapMode.None,\n lm\n );\n }\n ctx.shaders.push(shader);\n};\n\nconst declareBlend = (ctx: DrawingContext, props: BlendProps) => {\n \"worklet\";\n const blend = BlendMode[enumKey(props.mode as BlendProps[\"mode\"])];\n const shaders = ctx.shaders.splice(0, ctx.shaders.length);\n if (shaders.length > 0) {\n const composer = ctx.Skia.Shader.MakeBlend.bind(ctx.Skia.Shader, blend);\n ctx.shaders.push(composeDeclarations(shaders, composer));\n }\n};\n\nexport const isPushShader = (\n command: Command\n): command is Command<CommandType.PushShader> => {\n \"worklet\";\n return command.type === CommandType.PushShader;\n};\n\ntype Props = {\n [NodeType.Shader]: ShaderProps;\n [NodeType.ImageShader]: ImageShaderProps;\n [NodeType.ColorShader]: ColorProps;\n [NodeType.Turbulence]: TurbulenceProps;\n [NodeType.FractalNoise]: FractalNoiseProps;\n [NodeType.LinearGradient]: LinearGradientProps;\n [NodeType.RadialGradient]: RadialGradientProps;\n [NodeType.SweepGradient]: SweepGradientProps;\n [NodeType.TwoPointConicalGradient]: TwoPointConicalGradientProps;\n [NodeType.Blend]: BlendProps;\n};\n\ninterface PushShader<T extends keyof Props>\n extends Command<CommandType.PushShader> {\n shaderType: T;\n props: Props[T];\n children: number;\n}\n\nconst isShader = <T extends keyof Props>(\n command: Command<CommandType.PushShader>,\n type: T\n): command is PushShader<T> => {\n \"worklet\";\n return command.shaderType === type;\n};\n\nexport const pushShader = (\n ctx: DrawingContext,\n command: Command<CommandType.PushShader>\n) => {\n \"worklet\";\n if (isShader(command, NodeType.Shader)) {\n declareShader(ctx, command.props, command.children);\n } else if (isShader(command, NodeType.ImageShader)) {\n declareImageShader(ctx, command.props);\n } else if (isShader(command, NodeType.ColorShader)) {\n declareColorShader(ctx, command.props);\n } else if (isShader(command, NodeType.Turbulence)) {\n declareTurbulenceShader(ctx, command.props);\n } else if (isShader(command, NodeType.FractalNoise)) {\n declareFractalNoiseShader(ctx, command.props);\n } else if (isShader(command, NodeType.LinearGradient)) {\n declareLinearGradientShader(ctx, command.props);\n } else if (isShader(command, NodeType.RadialGradient)) {\n declareRadialGradientShader(ctx, command.props);\n } else if (isShader(command, NodeType.SweepGradient)) {\n declareSweepGradientShader(ctx, command.props);\n } else if (isShader(command, NodeType.TwoPointConicalGradient)) {\n declareTwoPointConicalGradientShader(ctx, command.props);\n } else if (isShader(command, NodeType.Blend)) {\n declareBlend(ctx, command.props);\n } else {\n throw new Error(`Unknown shader type: ${command.shaderType}`);\n }\n};\n"],"mappings":"AAAA,SACEA,OAAO,EACPC,QAAQ,EACRC,OAAO,EACPC,YAAY,EACZC,oBAAoB,EACpBC,qBAAqB,EACrBC,SAAS,QACJ,oBAAoB;AAC3B,SAASC,QAAQ,QAAQ,oBAAoB;AAc7C,SACEC,SAAS,EACTC,UAAU,EACVC,eAAe,EACfC,UAAU,EACVC,eAAe,EACfC,QAAQ,QACH,qBAAqB;AAC5B,SAASC,mBAAmB,QAAQ,aAAa;AAEjD,SAASC,WAAW,QAAQ,SAAS;AAGrC,MAAMC,aAAa,GAAGA,CACpBC,GAAmB,EACnBC,KAAkB,EAClBC,QAAgB,KACb;EACH,SAAS;;EACT,MAAM;IAAEC,MAAM;IAAEC,QAAQ;IAAE,GAAGC;EAAU,CAAC,GAAGJ,KAAK;EAChD,MAAMK,EAAE,GAAGN,GAAG,CAACO,IAAI,CAACC,MAAM,CAAC,CAAC;EAC5BpB,qBAAqB,CAACkB,EAAE,EAAED,SAAS,CAAC;EACpC,MAAMI,MAAM,GAAGN,MAAM,CAACO,sBAAsB,CAC1Cf,eAAe,CAACQ,MAAM,EAAEC,QAAQ,CAAC,EACjCJ,GAAG,CAACW,OAAO,CAACC,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Ac,CAAC,EAAE;IACrD9D,2BAA2B,CAACrC,GAAG,EAAEwF,OAAO,CAACvF,KAAK,CAAC;EACjD,CAAC,MAAM,IAAI0F,QAAQ,CAACH,OAAO,EAAElG,QAAQ,CAAC8G,aAAa,CAAC,EAAE;IACpD3D,0BAA0B,CAACzC,GAAG,EAAEwF,OAAO,CAACvF,KAAK,CAAC;EAChD,CAAC,MAAM,IAAI0F,QAAQ,CAACH,OAAO,EAAElG,QAAQ,CAAC+G,uBAAuB,CAAC,EAAE;IAC9D3E,oCAAoC,CAAC1B,GAAG,EAAEwF,OAAO,CAACvF,KAAK,CAAC;EAC1D,CAAC,MAAM,IAAI0F,QAAQ,CAACH,OAAO,EAAElG,QAAQ,CAACgH,KAAK,CAAC,EAAE;IAC5CrB,YAAY,CAACjF,GAAG,EAAEwF,OAAO,CAACvF,KAAK,CAAC;EAClC,CAAC,MAAM;IACL,MAAM,IAAIsG,KAAK,CAAC,wBAAwBf,OAAO,CAACI,UAAU,EAAE,CAAC;EAC/D;AACF,CAAC","ignoreList":[]}
|
@@ -1,15 +1,3 @@
|
|
1
1
|
export const __esModule: boolean;
|
2
|
-
export function createContainer(Skia: any, nativeId: any, onSize: any): _StaticContainer.StaticContainer
|
2
|
+
export function createContainer(Skia: any, nativeId: any, onSize: any): _StaticContainer.StaticContainer;
|
3
3
|
import _StaticContainer = require("./StaticContainer");
|
4
|
-
declare class ReanimatedContainer extends _StaticContainer.Container {
|
5
|
-
constructor(Skia: any, nativeId: any, onSize: any);
|
6
|
-
nativeId: any;
|
7
|
-
onSize: any;
|
8
|
-
redraw(): void;
|
9
|
-
recording: {
|
10
|
-
commands: any;
|
11
|
-
paintPool: never[];
|
12
|
-
} | undefined;
|
13
|
-
mapperId: any;
|
14
|
-
}
|
15
|
-
export {};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export const __esModule: boolean;
|
2
|
+
export function createContainer(Skia: any, nativeId: any, onSize: any): _StaticContainer.StaticContainer | ReanimatedContainer;
|
3
|
+
import _StaticContainer = require("./StaticContainer");
|
4
|
+
declare class ReanimatedContainer extends _StaticContainer.Container {
|
5
|
+
constructor(Skia: any, nativeId: any, onSize: any);
|
6
|
+
nativeId: any;
|
7
|
+
onSize: any;
|
8
|
+
redraw(): void;
|
9
|
+
recording: {
|
10
|
+
commands: any;
|
11
|
+
paintPool: never[];
|
12
|
+
} | undefined;
|
13
|
+
mapperId: any;
|
14
|
+
}
|
15
|
+
export {};
|
@@ -2,23 +2,7 @@ export const __esModule: boolean;
|
|
2
2
|
export class SkiaSGRoot {
|
3
3
|
constructor(Skia: any, nativeId: number | undefined, onSize: any);
|
4
4
|
Skia: any;
|
5
|
-
container: import("./StaticContainer").StaticContainer
|
6
|
-
nativeId: any;
|
7
|
-
onSize: any;
|
8
|
-
redraw(): void;
|
9
|
-
recording: {
|
10
|
-
commands: any;
|
11
|
-
paintPool: never[];
|
12
|
-
} | undefined;
|
13
|
-
mapperId: any;
|
14
|
-
Skia: any;
|
15
|
-
root: any;
|
16
|
-
_root: any;
|
17
|
-
mount(): void;
|
18
|
-
unmounted: boolean | undefined;
|
19
|
-
unmount(): void;
|
20
|
-
drawOnCanvas(canvas: any): void;
|
21
|
-
};
|
5
|
+
container: import("./StaticContainer").StaticContainer;
|
22
6
|
root: any;
|
23
7
|
get sg(): {
|
24
8
|
type: any;
|
@@ -14,7 +14,7 @@ export class ReanimatedRecorder {
|
|
14
14
|
pushPathEffect(pathEffectType: any, props: any): void;
|
15
15
|
pushImageFilter(imageFilterType: any, props: any): void;
|
16
16
|
pushColorFilter(colorFilterType: any, props: any): void;
|
17
|
-
pushShader(shaderType: any, props: any): void;
|
17
|
+
pushShader(shaderType: any, props: any, children: any): void;
|
18
18
|
pushBlurMaskFilter(props: any): void;
|
19
19
|
composePathEffect(): void;
|
20
20
|
composeColorFilter(): void;
|
@@ -19,7 +19,7 @@ export class Recorder {
|
|
19
19
|
pushPathEffect(pathEffectType: any, props: any): void;
|
20
20
|
pushImageFilter(imageFilterType: any, props: any): void;
|
21
21
|
pushColorFilter(colorFilterType: any, props: any): void;
|
22
|
-
pushShader(shaderType: any, props: any): void;
|
22
|
+
pushShader(shaderType: any, props: any, children: any): void;
|
23
23
|
pushBlurMaskFilter(props: any): void;
|
24
24
|
composePathEffect(): void;
|
25
25
|
composeColorFilter(): void;
|
@@ -1,15 +1,2 @@
|
|
1
|
-
export function createContainer(Skia: any, nativeId: any, onSize: any): StaticContainer
|
1
|
+
export function createContainer(Skia: any, nativeId: any, onSize: any): StaticContainer;
|
2
2
|
import { StaticContainer } from "./StaticContainer";
|
3
|
-
declare class ReanimatedContainer extends Container {
|
4
|
-
constructor(Skia: any, nativeId: any, onSize: any);
|
5
|
-
nativeId: any;
|
6
|
-
onSize: any;
|
7
|
-
redraw(): void;
|
8
|
-
recording: {
|
9
|
-
commands: any;
|
10
|
-
paintPool: never[];
|
11
|
-
} | undefined;
|
12
|
-
mapperId: any;
|
13
|
-
}
|
14
|
-
import { Container } from "./StaticContainer";
|
15
|
-
export {};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export function createContainer(Skia: any, nativeId: any, onSize: any): StaticContainer | ReanimatedContainer;
|
2
|
+
import { StaticContainer } from "./StaticContainer";
|
3
|
+
declare class ReanimatedContainer extends Container {
|
4
|
+
constructor(Skia: any, nativeId: any, onSize: any);
|
5
|
+
nativeId: any;
|
6
|
+
onSize: any;
|
7
|
+
redraw(): void;
|
8
|
+
recording: {
|
9
|
+
commands: any;
|
10
|
+
paintPool: never[];
|
11
|
+
} | undefined;
|
12
|
+
mapperId: any;
|
13
|
+
}
|
14
|
+
import { Container } from "./StaticContainer";
|
15
|
+
export {};
|
@@ -1,23 +1,7 @@
|
|
1
1
|
export class SkiaSGRoot {
|
2
2
|
constructor(Skia: any, nativeId: number | undefined, onSize: any);
|
3
3
|
Skia: any;
|
4
|
-
container: import("./StaticContainer").StaticContainer
|
5
|
-
nativeId: any;
|
6
|
-
onSize: any;
|
7
|
-
redraw(): void;
|
8
|
-
recording: {
|
9
|
-
commands: any;
|
10
|
-
paintPool: never[];
|
11
|
-
} | undefined;
|
12
|
-
mapperId: any;
|
13
|
-
Skia: any;
|
14
|
-
root: any;
|
15
|
-
_root: any;
|
16
|
-
mount(): void;
|
17
|
-
unmounted: boolean | undefined;
|
18
|
-
unmount(): void;
|
19
|
-
drawOnCanvas(canvas: any): void;
|
20
|
-
};
|
4
|
+
container: import("./StaticContainer").StaticContainer;
|
21
5
|
root: any;
|
22
6
|
get sg(): {
|
23
7
|
type: any;
|
@@ -13,7 +13,7 @@ export class ReanimatedRecorder {
|
|
13
13
|
pushPathEffect(pathEffectType: any, props: any): void;
|
14
14
|
pushImageFilter(imageFilterType: any, props: any): void;
|
15
15
|
pushColorFilter(colorFilterType: any, props: any): void;
|
16
|
-
pushShader(shaderType: any, props: any): void;
|
16
|
+
pushShader(shaderType: any, props: any, children: any): void;
|
17
17
|
pushBlurMaskFilter(props: any): void;
|
18
18
|
composePathEffect(): void;
|
19
19
|
composeColorFilter(): void;
|
@@ -18,7 +18,7 @@ export class Recorder {
|
|
18
18
|
pushPathEffect(pathEffectType: any, props: any): void;
|
19
19
|
pushImageFilter(imageFilterType: any, props: any): void;
|
20
20
|
pushColorFilter(colorFilterType: any, props: any): void;
|
21
|
-
pushShader(shaderType: any, props: any): void;
|
21
|
+
pushShader(shaderType: any, props: any, children: any): void;
|
22
22
|
pushBlurMaskFilter(props: any): void;
|
23
23
|
composePathEffect(): void;
|
24
24
|
composeColorFilter(): void;
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -12,7 +12,7 @@ export declare class ParagraphAsset<Ctx extends EvalContext> extends SkiaObject<
|
|
12
12
|
getLongestLine(): number;
|
13
13
|
getGlyphPositionAtCoordinate(x: number, y: number): number;
|
14
14
|
getRectsForRange(start: number, end: number): import("../../../../skia/types").SkRect[];
|
15
|
-
getLineMetrics(): import("../../../../skia/types").
|
15
|
+
getLineMetrics(): import("../../../../skia/types").LineMetrics[];
|
16
16
|
getRectsForPlaceholders(): import("../../../../skia/types").SkRectWithDirection[];
|
17
17
|
__typename__: "Paragraph";
|
18
18
|
dispose(): void;
|
@@ -2,6 +2,36 @@ import type { SkCanvas } from "../Canvas";
|
|
2
2
|
import type { SkJSIInstance } from "../JsiInstance";
|
3
3
|
import type { SkRect } from "../Rect";
|
4
4
|
import type { TextDirection } from "./ParagraphStyle";
|
5
|
+
export interface LineMetrics {
|
6
|
+
/** The index in the text buffer the line begins. */
|
7
|
+
startIndex: number;
|
8
|
+
/** The index in the text buffer the line ends. */
|
9
|
+
endIndex: number;
|
10
|
+
endExcludingWhitespaces: number;
|
11
|
+
endIncludingNewline: number;
|
12
|
+
/** True if the line ends in a hard break (e.g. newline) */
|
13
|
+
isHardBreak: boolean;
|
14
|
+
/**
|
15
|
+
* The final computed ascent for the line. This can be impacted by
|
16
|
+
* the strut, height, scaling, as well as outlying runs that are very tall.
|
17
|
+
*/
|
18
|
+
ascent: number;
|
19
|
+
/**
|
20
|
+
* The final computed descent for the line. This can be impacted by
|
21
|
+
* the strut, height, scaling, as well as outlying runs that are very tall.
|
22
|
+
*/
|
23
|
+
descent: number;
|
24
|
+
/** round(ascent + descent) */
|
25
|
+
height: number;
|
26
|
+
/** width of the line */
|
27
|
+
width: number;
|
28
|
+
/** The left edge of the line. The right edge can be obtained with `left + width` */
|
29
|
+
left: number;
|
30
|
+
/** The y position of the baseline for this line from the top of the paragraph. */
|
31
|
+
baseline: number;
|
32
|
+
/** Zero indexed line number. */
|
33
|
+
lineNumber: number;
|
34
|
+
}
|
5
35
|
export interface SkRectWithDirection {
|
6
36
|
rect: SkRect;
|
7
37
|
direction: TextDirection;
|
@@ -70,7 +100,7 @@ export interface SkParagraph extends SkJSIInstance<"Paragraph"> {
|
|
70
100
|
* Returns the bounding boxes for all lines in the paragraph. This method
|
71
101
|
* requires the layout method to have been called first.
|
72
102
|
*/
|
73
|
-
getLineMetrics():
|
103
|
+
getLineMetrics(): LineMetrics[];
|
74
104
|
/**
|
75
105
|
* Returns a list of rects with direction info for the placeholders added
|
76
106
|
* to the paragraph.
|
@@ -12,7 +12,7 @@ export interface BaseRecorder {
|
|
12
12
|
pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>): void;
|
13
13
|
pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>): void;
|
14
14
|
pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>): void;
|
15
|
-
pushShader(shaderType: NodeType, props: AnimatedProps<unknown
|
15
|
+
pushShader(shaderType: NodeType, props: AnimatedProps<unknown>, children: number): void;
|
16
16
|
pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>): void;
|
17
17
|
composePathEffect(): void;
|
18
18
|
composeColorFilter(): void;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { CanvasKit, Paragraph } from "canvaskit-wasm";
|
2
|
-
import type { SkRect, SkRectWithDirection, SkParagraph } from "../types";
|
2
|
+
import type { SkRect, SkRectWithDirection, SkParagraph, LineMetrics } from "../types";
|
3
3
|
import { HostObject } from "./Host";
|
4
4
|
import type { JsiSkCanvas } from "./JsiSkCanvas";
|
5
5
|
export declare class JsiSkParagraph extends HostObject<Paragraph, "Paragraph"> implements SkParagraph {
|
@@ -14,6 +14,6 @@ export declare class JsiSkParagraph extends HostObject<Paragraph, "Paragraph"> i
|
|
14
14
|
getGlyphPositionAtCoordinate(x: number, y: number): number;
|
15
15
|
getRectsForPlaceholders(): SkRectWithDirection[];
|
16
16
|
getRectsForRange(start: number, end: number): SkRect[];
|
17
|
-
getLineMetrics():
|
17
|
+
getLineMetrics(): LineMetrics[];
|
18
18
|
dispose(): void;
|
19
19
|
}
|
@@ -1,12 +1,4 @@
|
|
1
1
|
import type { SharedValue } from "react-native-reanimated";
|
2
2
|
import type { Skia, SkSize } from "../skia/types";
|
3
|
-
import {
|
4
|
-
declare
|
5
|
-
private nativeId;
|
6
|
-
private onSize?;
|
7
|
-
private mapperId;
|
8
|
-
constructor(Skia: Skia, nativeId: number, onSize?: SharedValue<SkSize> | undefined);
|
9
|
-
redraw(): void;
|
10
|
-
}
|
11
|
-
export declare const createContainer: (Skia: Skia, nativeId: number, onSize?: SharedValue<SkSize>) => StaticContainer | ReanimatedContainer;
|
12
|
-
export {};
|
3
|
+
import { StaticContainer } from "./StaticContainer";
|
4
|
+
export declare const createContainer: (Skia: Skia, nativeId: number, onSize?: SharedValue<SkSize>) => StaticContainer;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import type { SharedValue } from "react-native-reanimated";
|
2
|
+
import type { Skia, SkSize } from "../skia/types";
|
3
|
+
import { Container, StaticContainer } from "./StaticContainer";
|
4
|
+
import "../skia/NativeSetup";
|
5
|
+
import "../views/api";
|
6
|
+
declare class ReanimatedContainer extends Container {
|
7
|
+
private nativeId;
|
8
|
+
private onSize?;
|
9
|
+
private mapperId;
|
10
|
+
constructor(Skia: Skia, nativeId: number, onSize?: SharedValue<SkSize> | undefined);
|
11
|
+
redraw(): void;
|
12
|
+
}
|
13
|
+
export declare const createContainer: (Skia: Skia, nativeId: number, onSize?: SharedValue<SkSize>) => StaticContainer | ReanimatedContainer;
|
14
|
+
export {};
|
@@ -18,7 +18,7 @@ export declare class ReanimatedRecorder implements BaseRecorder {
|
|
18
18
|
pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>): void;
|
19
19
|
pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>): void;
|
20
20
|
pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>): void;
|
21
|
-
pushShader(shaderType: NodeType, props: AnimatedProps<unknown
|
21
|
+
pushShader(shaderType: NodeType, props: AnimatedProps<unknown>, children: number): void;
|
22
22
|
pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>): void;
|
23
23
|
composePathEffect(): void;
|
24
24
|
composeColorFilter(): void;
|
@@ -28,7 +28,7 @@ export declare class Recorder implements BaseRecorder {
|
|
28
28
|
pushPathEffect(pathEffectType: NodeType, props: AnimatedProps<unknown>): void;
|
29
29
|
pushImageFilter(imageFilterType: NodeType, props: AnimatedProps<unknown>): void;
|
30
30
|
pushColorFilter(colorFilterType: NodeType, props: AnimatedProps<unknown>): void;
|
31
|
-
pushShader(shaderType: NodeType, props: AnimatedProps<unknown
|
31
|
+
pushShader(shaderType: NodeType, props: AnimatedProps<unknown>, children: number): void;
|
32
32
|
pushBlurMaskFilter(props: AnimatedProps<BlurMaskFilterProps>): void;
|
33
33
|
composePathEffect(): void;
|
34
34
|
composeColorFilter(): void;
|
package/package.json
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
"setup-skia-web": "scripts/setup-canvaskit.js"
|
9
9
|
},
|
10
10
|
"title": "React Native Skia",
|
11
|
-
"version": "2.2.
|
11
|
+
"version": "2.2.9",
|
12
12
|
"description": "High-performance React Native Graphics using Skia",
|
13
13
|
"main": "lib/module/index.js",
|
14
14
|
"react-native": "src/index.ts",
|