@shopify/react-native-skia 0.1.140 → 0.1.143
Sign up to get free protection for your applications and to get access to all the features.
- package/android/cpp/rnskia-android/RNSkDrawViewImpl.cpp +2 -2
- package/android/cpp/rnskia-android/RNSkDrawViewImpl.h +1 -1
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +15 -16
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +2 -2
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +69 -27
- package/cpp/api/JsiSkPathFactory.h +1 -1
- package/cpp/api/JsiSkPicture.h +7 -1
- package/cpp/rnskia/RNSkDrawView.cpp +66 -66
- package/cpp/rnskia/RNSkDrawView.h +22 -6
- package/cpp/rnskia/RNSkJsiViewApi.h +2 -2
- package/cpp/rnskia/values/RNSkComputedValue.h +10 -7
- package/cpp/rnskia/values/RNSkReadonlyValue.h +21 -2
- package/cpp/rnskia/values/RNSkValue.h +1 -0
- package/ios/RNSkia-iOS/RNSkDrawViewImpl.h +1 -1
- package/ios/RNSkia-iOS/RNSkDrawViewImpl.mm +2 -2
- package/ios/RNSkia-iOS/SkiaDrawView.mm +4 -0
- package/lib/commonjs/mock/index.js +3 -1
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/renderer/DependencyManager.js +1 -1
- package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
- package/lib/commonjs/renderer/components/Blend.js +20 -5
- package/lib/commonjs/renderer/components/Blend.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Shadow.js +1 -1
- package/lib/commonjs/renderer/components/imageFilters/Shadow.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.js +18 -5
- package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/commonjs/skia/core/Data.js +10 -22
- package/lib/commonjs/skia/core/Data.js.map +1 -1
- package/lib/commonjs/skia/core/Font.js +2 -3
- package/lib/commonjs/skia/core/Font.js.map +1 -1
- package/lib/commonjs/skia/core/Image.js.map +1 -1
- package/lib/commonjs/skia/core/SVG.js.map +1 -1
- package/lib/commonjs/skia/core/Typeface.js.map +1 -1
- package/lib/commonjs/skia/types/Data/Data.js +5 -0
- package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
- package/lib/commonjs/skia/web/Host.js +12 -21
- package/lib/commonjs/skia/web/Host.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js +50 -28
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +4 -4
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkFont.js +7 -3
- package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.js +4 -2
- package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFactory.js +4 -2
- package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +61 -19
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.js +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPaint.js +15 -6
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.js +16 -60
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +7 -3
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js +5 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +3 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPoint.js +9 -1
- package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRRect.js +9 -1
- package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRect.js +3 -3
- package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +4 -2
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js +10 -6
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSurface.js +3 -1
- package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +8 -4
- package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkTypefaceFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkia.js +12 -6
- package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
- package/lib/commonjs/values/hooks/useComputedValue.js +6 -2
- package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
- package/lib/commonjs/values/index.js +13 -0
- package/lib/commonjs/values/index.js.map +1 -1
- package/lib/commonjs/values/selector.js +24 -0
- package/lib/commonjs/values/selector.js.map +1 -0
- package/lib/commonjs/values/web/RNSkComputedValue.js +8 -0
- package/lib/commonjs/values/web/RNSkComputedValue.js.map +1 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.js +4 -0
- package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/commonjs/views/useTouchHandler.js +13 -20
- package/lib/commonjs/views/useTouchHandler.js.map +1 -1
- package/lib/module/mock/index.js +2 -1
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/renderer/DependencyManager.js +2 -2
- package/lib/module/renderer/DependencyManager.js.map +1 -1
- package/lib/module/renderer/components/Blend.js +21 -5
- package/lib/module/renderer/components/Blend.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Morphology.js +1 -1
- package/lib/module/renderer/components/imageFilters/Morphology.js.map +1 -1
- package/lib/module/renderer/components/imageFilters/Shadow.js +1 -1
- package/lib/module/renderer/components/imageFilters/Shadow.js.map +1 -1
- package/lib/module/renderer/processors/Animations/Animations.js +13 -4
- package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/module/skia/core/Data.js +10 -20
- package/lib/module/skia/core/Data.js.map +1 -1
- package/lib/module/skia/core/Font.js +2 -3
- package/lib/module/skia/core/Font.js.map +1 -1
- package/lib/module/skia/core/Image.js.map +1 -1
- package/lib/module/skia/core/SVG.js.map +1 -1
- package/lib/module/skia/core/Typeface.js.map +1 -1
- package/lib/module/skia/types/Data/Data.js +1 -1
- package/lib/module/skia/types/Data/Data.js.map +1 -1
- package/lib/module/skia/web/Host.js +9 -9
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js +40 -29
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilterFactory.js +5 -5
- package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkFont.js +6 -4
- package/lib/module/skia/web/JsiSkFont.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.js +4 -3
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFactory.js +4 -3
- package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilterFactory.js +61 -20
- package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkMatrix.js +2 -2
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.js +11 -7
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.js +15 -62
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffectFactory.js +6 -4
- package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathFactory.js +2 -2
- package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPicture.js +4 -2
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.js +3 -2
- package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/module/skia/web/JsiSkPoint.js +10 -2
- package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/module/skia/web/JsiSkRRect.js +10 -2
- package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/module/skia/web/JsiSkRect.js +4 -4
- package/lib/module/skia/web/JsiSkRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.js +4 -3
- package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkShaderFactory.js +9 -7
- package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurface.js +3 -2
- package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlobFactory.js +7 -5
- package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkTypefaceFactory.js +2 -2
- package/lib/module/skia/web/JsiSkTypefaceFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkia.js +10 -5
- package/lib/module/skia/web/JsiSkia.js.map +1 -1
- package/lib/module/values/hooks/useComputedValue.js +7 -3
- package/lib/module/values/hooks/useComputedValue.js.map +1 -1
- package/lib/module/values/index.js +1 -0
- package/lib/module/values/index.js.map +1 -1
- package/lib/module/values/selector.js +15 -0
- package/lib/module/values/selector.js.map +1 -0
- package/lib/module/values/web/RNSkComputedValue.js +8 -0
- package/lib/module/values/web/RNSkComputedValue.js.map +1 -1
- package/lib/module/values/web/RNSkReadonlyValue.js +4 -0
- package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/module/views/useTouchHandler.js +12 -19
- package/lib/module/views/useTouchHandler.js.map +1 -1
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +7 -2
- package/lib/typescript/src/skia/core/Data.d.ts +3 -5
- package/lib/typescript/src/skia/core/Font.d.ts +2 -2
- package/lib/typescript/src/skia/core/Image.d.ts +2 -2
- package/lib/typescript/src/skia/core/SVG.d.ts +2 -2
- package/lib/typescript/src/skia/core/Typeface.d.ts +2 -2
- package/lib/typescript/src/skia/types/Data/Data.d.ts +10 -3
- package/lib/typescript/src/skia/types/Picture/Picture.d.ts +2 -1
- package/lib/typescript/src/skia/web/Host.d.ts +5 -7
- package/lib/typescript/src/skia/web/JsiSkImageFilterFactory.d.ts +8 -8
- package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +3 -2
- package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +3 -2
- package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +1 -2
- package/lib/typescript/src/skia/web/JsiSkRect.d.ts +3 -3
- package/lib/typescript/src/skia/web/JsiSkTextBlobFactory.d.ts +2 -1
- package/lib/typescript/src/values/index.d.ts +1 -0
- package/lib/typescript/src/values/selector.d.ts +14 -0
- package/lib/typescript/src/values/types.d.ts +4 -0
- package/lib/typescript/src/values/web/RNSkComputedValue.d.ts +1 -0
- package/lib/typescript/src/values/web/RNSkReadonlyValue.d.ts +1 -0
- package/package.json +6 -6
- package/src/mock/index.ts +2 -1
- package/src/renderer/DependencyManager.tsx +5 -2
- package/src/renderer/components/Blend.tsx +25 -5
- package/src/renderer/components/imageFilters/Morphology.tsx +2 -2
- package/src/renderer/components/imageFilters/Shadow.tsx +2 -2
- package/src/renderer/processors/Animations/Animations.ts +27 -5
- package/src/skia/core/Data.ts +20 -51
- package/src/skia/core/Font.ts +4 -5
- package/src/skia/core/Image.ts +2 -2
- package/src/skia/core/SVG.ts +2 -2
- package/src/skia/core/Typeface.ts +2 -2
- package/src/skia/types/Data/Data.ts +11 -1
- package/src/skia/types/Picture/Picture.ts +2 -1
- package/src/skia/web/Host.ts +11 -21
- package/src/skia/web/JsiSkCanvas.ts +99 -56
- package/src/skia/web/JsiSkColorFilterFactory.ts +15 -5
- package/src/skia/web/JsiSkFont.ts +11 -4
- package/src/skia/web/JsiSkImage.ts +4 -3
- package/src/skia/web/JsiSkImageFactory.ts +6 -3
- package/src/skia/web/JsiSkImageFilterFactory.ts +124 -52
- package/src/skia/web/JsiSkMatrix.ts +4 -2
- package/src/skia/web/JsiSkPaint.ts +11 -7
- package/src/skia/web/JsiSkPath.ts +30 -56
- package/src/skia/web/JsiSkPathEffectFactory.ts +10 -5
- package/src/skia/web/JsiSkPathFactory.ts +3 -3
- package/src/skia/web/JsiSkPicture.ts +5 -3
- package/src/skia/web/JsiSkPictureRecorder.ts +3 -2
- package/src/skia/web/JsiSkPoint.ts +12 -2
- package/src/skia/web/JsiSkRRect.ts +16 -2
- package/src/skia/web/JsiSkRSXform.ts +1 -1
- package/src/skia/web/JsiSkRect.ts +4 -7
- package/src/skia/web/JsiSkRuntimeEffect.ts +9 -4
- package/src/skia/web/JsiSkShaderFactory.ts +24 -15
- package/src/skia/web/JsiSkSurface.ts +7 -2
- package/src/skia/web/JsiSkTextBlobFactory.ts +14 -8
- package/src/skia/web/JsiSkTypefaceFactory.tsx +4 -2
- package/src/skia/web/JsiSkia.ts +17 -5
- package/src/values/hooks/useComputedValue.ts +6 -3
- package/src/values/index.ts +1 -0
- package/src/values/selector.ts +24 -0
- package/src/values/types.ts +4 -0
- package/src/values/web/RNSkComputedValue.ts +6 -0
- package/src/values/web/RNSkReadonlyValue.ts +4 -0
- package/src/views/useTouchHandler.ts +15 -21
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":["Stub","constructor","Proxy","get","apply","set","Noop","Skia","vec","x","y","Mock","BaseSkia","
|
1
|
+
{"version":3,"sources":["index.ts"],"names":["Stub","constructor","Proxy","get","apply","set","Noop","Skia","vec","x","y","Mock","BaseSkia","useRawData","useData","useFont","useTypeface","useImage","useSVG","usePicture","rect","width","height","rrect","r","rx","ry","point","add","a","b","sub","neg","dist","Math","hypot","translate","translateX","translateY","bounds","topLeft","topRight","bottomLeft","bottomRight","center","processTransform2d","useSharedValueEffect","Values","ValuesHooks","Selector","timingFunctions","springFunctions","decayFunctions","interpolateFn","interpolatePathFn","interpolateVectorFn","interpolateColors","_value","_inputRange","_outputRange","Float32Array","of","mixColors","_v","_x","_y","ShaderLib","createDrawing","createDeclaration"],"mappings":"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","sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Color, Skia as SkiaApi, SkRect, Vector } from \"../skia/types\";\nimport * as Values from \"../values/web\";\nimport * as ValuesHooks from \"../values/hooks\";\nimport { Selector } from \"../values/selector\";\nimport * as BaseSkia from \"../skia/types\";\nimport type * as SkiaExports from \"../skia\";\nimport type * as ExternalExports from \"../external\";\nimport type * as ValueExports from \"../values\";\nimport type * as AnimationExports from \"../animation\";\nimport { useSharedValueEffect } from \"../external/reanimated/useSharedValueEffect\";\nimport * as timingFunctions from \"../animation/timing\";\nimport * as springFunctions from \"../animation/spring\";\nimport * as decayFunctions from \"../animation/decay\";\nimport * as interpolateFn from \"../animation/functions/interpolate\";\nimport * as interpolatePathFn from \"../animation/functions/interpolatePaths\";\nimport * as interpolateVectorFn from \"../animation/functions/interpolateVector\";\nimport { ShaderLib } from \"../renderer/components/shaders/ShaderLib\";\n\nclass Stub {\n constructor() {\n return new Proxy(() => {}, {\n get: () => new Stub(),\n apply: () => new Stub(),\n set: () => true,\n });\n }\n}\n\nconst Noop: () => any = () => {};\n\nexport const Skia: SkiaApi = new Stub() as any;\n\nexport const vec = (x?: number, y?: number) => ({ x: x ?? 0, y: y ?? x ?? 0 });\n\nexport const Mock: typeof SkiaExports &\n typeof ExternalExports &\n typeof ValueExports &\n typeof AnimationExports & {\n createDrawing: () => any;\n createDeclaration: () => any;\n ShaderLib: typeof ShaderLib;\n } = {\n // SkiaExports\n // 1. Skia API. BaseSkia contains the enums, and functions like isPaint etc\n Skia,\n ...BaseSkia,\n // 2. Hooks\n useRawData: Noop,\n useData: Noop,\n useFont: Noop,\n useTypeface: Noop,\n useImage: Noop,\n useSVG: Noop,\n usePicture: Noop,\n // 3. Point/Rect/Transform utilities\n vec,\n rect: (x: number, y: number, width: number, height: number) => ({\n x,\n y,\n width,\n height,\n }),\n rrect: (r: SkRect, rx: number, ry: number) => ({\n rect: r,\n rx,\n ry,\n }),\n point: vec,\n add: (a: Vector, b: Vector) => vec(a.x + b.x, a.y + b.y),\n sub: (a: Vector, b: Vector) => vec(a.x - b.x, a.y - b.y),\n neg: (a: Vector) => vec(-a.x, -a.y),\n dist: (a: Vector, b: Vector) => Math.hypot(a.x - b.x, a.y - b.y),\n translate: ({ x, y }: Vector) =>\n [{ translateX: x }, { translateY: y }] as const,\n\n bounds: Noop,\n topLeft: Noop,\n topRight: Noop,\n bottomLeft: Noop,\n bottomRight: Noop,\n center: Noop,\n processTransform2d: Noop,\n // ExternalExports\n useSharedValueEffect,\n // ValueExports\n ...Values,\n ...ValuesHooks,\n Selector,\n // Animations\n ...timingFunctions,\n ...springFunctions,\n ...decayFunctions,\n ...interpolateFn,\n ...interpolatePathFn,\n ...interpolateVectorFn,\n interpolateColors: (\n _value: number,\n _inputRange: number[],\n _outputRange: Color[]\n ) => Float32Array.of(0, 0, 0, 0),\n mixColors: (_v: number, _x: Color, _y: Color) => Float32Array.of(0, 0, 0, 0),\n ShaderLib,\n createDrawing: Noop,\n createDeclaration: Noop,\n};\n"]}
|
@@ -29,7 +29,7 @@ class DependencyManager {
|
|
29
29
|
}
|
30
30
|
|
31
31
|
subscribeNode(node, props) {
|
32
|
-
const values = Object.values(props).filter(_processors.isValue);
|
32
|
+
const values = Object.values(props).filter(v => (0, _processors.isValue)(v) || (0, _processors.isSelector)(v)).map(v => (0, _processors.isSelector)(v) ? v.value : v);
|
33
33
|
|
34
34
|
if (values.length > 0) {
|
35
35
|
this.subscriptions.set(node, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["DependencyManager.tsx"],"names":["DependencyManager","constructor","ref","Map","unSubscribeNode","node","subscription","subscriptions","get","unsubscribe","delete","subscribeNode","props","values","Object","filter","
|
1
|
+
{"version":3,"sources":["DependencyManager.tsx"],"names":["DependencyManager","constructor","ref","Map","unSubscribeNode","node","subscription","subscriptions","get","unsubscribe","delete","subscribeNode","props","values","Object","filter","v","map","value","length","set","subscribe","current","Error","forEach","registerValues","clear"],"mappings":";;;;;;;AAKA;;;;AAMO,MAAMA,iBAAN,CAAwB;AAO7BC,EAAAA,WAAW,CAACC,GAAD,EAA2B;AAAA;;AAAA,2CAFlC,IAAIC,GAAJ,EAEkC;;AACpC,SAAKD,GAAL,GAAWA,GAAX;AACD;;AAEDE,EAAAA,eAAe,CAACC,IAAD,EAAa;AAC1B,UAAMC,YAAY,GAAG,KAAKC,aAAL,CAAmBC,GAAnB,CAAuBH,IAAvB,CAArB;;AACA,QAAIC,YAAY,IAAIA,YAAY,CAACG,WAAjC,EAA8C;AAC5CH,MAAAA,YAAY,CAACG,WAAb;AACD;;AACD,SAAKF,aAAL,CAAmBG,MAAnB,CAA0BL,IAA1B;AACD;;AAEDM,EAAAA,aAAa,CAACN,IAAD,EAAaO,KAAb,EAA2B;AACtC,UAAMC,MAAM,GAAGC,MAAM,CAACD,MAAP,CAAcD,KAAd,EACZG,MADY,CACJC,CAAD,IAAO,yBAAQA,CAAR,KAAc,4BAAWA,CAAX,CADhB,EAEZC,GAFY,CAEPD,CAAD,IAAQ,4BAAWA,CAAX,IAAgBA,CAAC,CAACE,KAAlB,GAA2BF,CAF3B,CAAf;;AAIA,QAAIH,MAAM,CAACM,MAAP,GAAgB,CAApB,EAAuB;AACrB,WAAKZ,aAAL,CAAmBa,GAAnB,CAAuBf,IAAvB,EAA6B;AAAEQ,QAAAA,MAAF;AAAUJ,QAAAA,WAAW,EAAE;AAAvB,OAA7B;AACD;AACF;;AAEDY,EAAAA,SAAS,GAAG;AACV,QAAI,KAAKnB,GAAL,CAASoB,OAAT,KAAqB,IAAzB,EAA+B;AAC7B,YAAM,IAAIC,KAAJ,CAAU,uBAAV,CAAN;AACD;;AACD,SAAKhB,aAAL,CAAmBiB,OAAnB,CAA4BlB,YAAD,IAAkB;AAC3C,UAAIA,YAAY,CAACG,WAAb,KAA6B,IAAjC,EAAuC;AACrCH,QAAAA,YAAY,CAACG,WAAb,GAA2B,KAAKP,GAAL,CAASoB,OAAT,CAAkBG,cAAlB,CACzBnB,YAAY,CAACO,MADY,CAA3B;AAGD;AACF,KAND;AAOD;;AAEDJ,EAAAA,WAAW,GAAG;AACZ,SAAKF,aAAL,CAAmBiB,OAAnB,CAA2B,QAAqB;AAAA,UAApB;AAAEf,QAAAA;AAAF,OAAoB;;AAC9C,UAAIA,WAAJ,EAAiB;AACfA,QAAAA,WAAW;AACZ;AACF,KAJD;AAKA,SAAKF,aAAL,CAAmBmB,KAAnB;AACD;;AAjD4B","sourcesContent":["import type { RefObject } from \"react\";\n\nimport type { SkiaView } from \"../views\";\nimport type { SkiaValue } from \"../values\";\n\nimport { isSelector, isValue } from \"./processors\";\nimport type { Node } from \"./nodes\";\n\ntype Unsubscribe = () => void;\ntype Props = { [key: string]: unknown };\n\nexport class DependencyManager {\n ref: RefObject<SkiaView>;\n subscriptions: Map<\n Node,\n { values: SkiaValue<unknown>[]; unsubscribe: null | Unsubscribe }\n > = new Map();\n\n constructor(ref: RefObject<SkiaView>) {\n this.ref = ref;\n }\n\n unSubscribeNode(node: Node) {\n const subscription = this.subscriptions.get(node);\n if (subscription && subscription.unsubscribe) {\n subscription.unsubscribe();\n }\n this.subscriptions.delete(node);\n }\n\n subscribeNode(node: Node, props: Props) {\n const values = Object.values(props)\n .filter((v) => isValue(v) || isSelector(v))\n .map((v) => (isSelector(v) ? v.value : (v as SkiaValue<unknown>)));\n\n if (values.length > 0) {\n this.subscriptions.set(node, { values, unsubscribe: null });\n }\n }\n\n subscribe() {\n if (this.ref.current === null) {\n throw new Error(\"Canvas ref is not set\");\n }\n this.subscriptions.forEach((subscription) => {\n if (subscription.unsubscribe === null) {\n subscription.unsubscribe = this.ref.current!.registerValues(\n subscription.values\n );\n }\n });\n }\n\n unsubscribe() {\n this.subscriptions.forEach(({ unsubscribe }) => {\n if (unsubscribe) {\n unsubscribe();\n }\n });\n this.subscriptions.clear();\n }\n}\n"]}
|
@@ -17,6 +17,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
17
17
|
|
18
18
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
19
19
|
|
20
|
+
const childrenAreImageFilters = children => children.every(child => (0, _types.isImageFilter)(child));
|
21
|
+
|
22
|
+
const childrenAreShaders = children => children.every(child => (0, _types.isShader)(child));
|
23
|
+
|
20
24
|
const onDeclare = (0, _nodes.createDeclaration)((_ref, children, _ref2) => {
|
21
25
|
let {
|
22
26
|
mode
|
@@ -24,14 +28,25 @@ const onDeclare = (0, _nodes.createDeclaration)((_ref, children, _ref2) => {
|
|
24
28
|
let {
|
25
29
|
Skia
|
26
30
|
} = _ref2;
|
27
|
-
const [inner, outer] = children;
|
28
31
|
|
29
32
|
const blend = _types.BlendMode[(0, _Paint.enumKey)(mode)];
|
30
33
|
|
31
|
-
if ((
|
32
|
-
return
|
33
|
-
|
34
|
-
|
34
|
+
if (childrenAreImageFilters(children)) {
|
35
|
+
return children.reverse().reduce((inner, outer) => {
|
36
|
+
if (inner === null) {
|
37
|
+
return outer;
|
38
|
+
}
|
39
|
+
|
40
|
+
return Skia.ImageFilter.MakeBlend(blend, outer, inner);
|
41
|
+
}, null);
|
42
|
+
} else if (childrenAreShaders(children)) {
|
43
|
+
return children.reverse().reduce((inner, outer) => {
|
44
|
+
if (inner === null) {
|
45
|
+
return outer;
|
46
|
+
}
|
47
|
+
|
48
|
+
return Skia.Shader.MakeBlend(blend, outer, inner);
|
49
|
+
}, null);
|
35
50
|
}
|
36
51
|
|
37
52
|
throw new Error("<Blend /> can only blend Shaders or ImageFilters");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Blend.tsx"],"names":["
|
1
|
+
{"version":3,"sources":["Blend.tsx"],"names":["childrenAreImageFilters","children","every","child","childrenAreShaders","onDeclare","mode","Skia","blend","BlendMode","reverse","reduce","inner","outer","ImageFilter","MakeBlend","Shader","Error","Blend","props"],"mappings":";;;;;;;AACA;;AAGA;;AACA;;AAEA;;;;;;AAGA,MAAMA,uBAAuB,GAC3BC,QAD8B,IAG9BA,QAAQ,CAACC,KAAT,CAAgBC,KAAD,IAAW,0BAAcA,KAAd,CAA1B,CAHF;;AAKA,MAAMC,kBAAkB,GACtBH,QADyB,IAEEA,QAAQ,CAACC,KAAT,CAAgBC,KAAD,IAAW,qBAASA,KAAT,CAA1B,CAF7B;;AASA,MAAME,SAAS,GAAG,8BAChB,OAAWJ,QAAX,YAAkC;AAAA,MAAjC;AAAEK,IAAAA;AAAF,GAAiC;AAAA,MAAb;AAAEC,IAAAA;AAAF,GAAa;;AAChC,QAAMC,KAAK,GAAGC,iBAAU,oBAAQH,IAAR,CAAV,CAAd;;AACA,MAAIN,uBAAuB,CAACC,QAAD,CAA3B,EAAuC;AACrC,WAAOA,QAAQ,CAACS,OAAT,GAAmBC,MAAnB,CAAgD,CAACC,KAAD,EAAQC,KAAR,KAAkB;AACvE,UAAID,KAAK,KAAK,IAAd,EAAoB;AAClB,eAAOC,KAAP;AACD;;AACD,aAAON,IAAI,CAACO,WAAL,CAAiBC,SAAjB,CAA2BP,KAA3B,EAAkCK,KAAlC,EAAyCD,KAAzC,CAAP;AACD,KALM,EAKJ,IALI,CAAP;AAMD,GAPD,MAOO,IAAIR,kBAAkB,CAACH,QAAD,CAAtB,EAAkC;AACvC,WAAOA,QAAQ,CAACS,OAAT,GAAmBC,MAAnB,CAA2C,CAACC,KAAD,EAAQC,KAAR,KAAkB;AAClE,UAAID,KAAK,KAAK,IAAd,EAAoB;AAClB,eAAOC,KAAP;AACD;;AACD,aAAON,IAAI,CAACS,MAAL,CAAYD,SAAZ,CAAsBP,KAAtB,EAA6BK,KAA7B,EAAoCD,KAApC,CAAP;AACD,KALM,EAKJ,IALI,CAAP;AAMD;;AACD,QAAM,IAAIK,KAAJ,CAAU,kDAAV,CAAN;AACD,CAnBe,CAAlB;;AAsBO,MAAMC,KAAK,GAAIC,KAAD,IAAsC;AACzD,sBAAO;AAAe,IAAA,SAAS,EAAEd;AAA1B,KAAyCc,KAAzC,EAAP;AACD,CAFM","sourcesContent":["import type { ReactNode } from \"react\";\nimport React from \"react\";\n\nimport type { SkImageFilter, SkShader } from \"../../skia/types\";\nimport { isImageFilter, BlendMode, isShader } from \"../../skia/types\";\nimport { createDeclaration } from \"../nodes\";\nimport type { AnimatedProps, SkEnum } from \"../processors\";\nimport { enumKey } from \"../processors/Paint\";\nimport type { DeclarationResult } from \"../nodes/Declaration\";\n\nconst childrenAreImageFilters = (\n children: DeclarationResult[]\n): children is SkImageFilter[] =>\n children.every((child) => isImageFilter(child));\n\nconst childrenAreShaders = (\n children: DeclarationResult[]\n): children is SkShader[] => children.every((child) => isShader(child));\n\ninterface BlendProps {\n mode: SkEnum<typeof BlendMode>;\n children?: ReactNode | ReactNode[];\n}\n\nconst onDeclare = createDeclaration<BlendProps>(\n ({ mode }, children, { Skia }) => {\n const blend = BlendMode[enumKey(mode)];\n if (childrenAreImageFilters(children)) {\n return children.reverse().reduce<SkImageFilter | null>((inner, outer) => {\n if (inner === null) {\n return outer;\n }\n return Skia.ImageFilter.MakeBlend(blend, outer, inner);\n }, null);\n } else if (childrenAreShaders(children)) {\n return children.reverse().reduce<SkShader | null>((inner, outer) => {\n if (inner === null) {\n return outer;\n }\n return Skia.Shader.MakeBlend(blend, outer, inner);\n }, null);\n }\n throw new Error(\"<Blend /> can only blend Shaders or ImageFilters\");\n }\n);\n\nexport const Blend = (props: AnimatedProps<BlendProps>) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n"]}
|
@@ -27,7 +27,7 @@ const onDeclare = (0, _Declaration.createDeclaration)((_ref, children, _ref2) =>
|
|
27
27
|
} = _ref2;
|
28
28
|
const input = (0, _getInput.getInput)(Skia, children);
|
29
29
|
const r = (0, _Radius.processRadius)(Skia, radius);
|
30
|
-
const factory = operator === "dilate" ? Skia.ImageFilter.MakeDilate : Skia.ImageFilter.MakeErode;
|
30
|
+
const factory = operator === "dilate" ? Skia.ImageFilter.MakeDilate.bind(Skia.ImageFilter) : Skia.ImageFilter.MakeErode.bind(Skia.ImageFilter);
|
31
31
|
return factory(r.x, r.y, input);
|
32
32
|
});
|
33
33
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Morphology.tsx"],"names":["onDeclare","children","radius","operator","Skia","input","r","factory","ImageFilter","MakeDilate","MakeErode","x","y","Morphology","props","defaultProps"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;AAEA;;;;;;AAQA,MAAMA,SAAS,GAAG,oCAChB,OAAuBC,QAAvB,YAA8C;AAAA,MAA7C;AAAEC,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAA6C;AAAA,MAAb;AAAEC,IAAAA;AAAF,GAAa;AAC5C,QAAMC,KAAK,GAAG,wBAASD,IAAT,EAAeH,QAAf,CAAd;AACA,QAAMK,CAAC,GAAG,2BAAcF,IAAd,EAAoBF,MAApB,CAAV;AACA,QAAMK,OAAO,GACXJ,QAAQ,KAAK,QAAb,GACIC,IAAI,CAACI,WAAL,CAAiBC,
|
1
|
+
{"version":3,"sources":["Morphology.tsx"],"names":["onDeclare","children","radius","operator","Skia","input","r","factory","ImageFilter","MakeDilate","bind","MakeErode","x","y","Morphology","props","defaultProps"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;AAEA;;;;;;AAQA,MAAMA,SAAS,GAAG,oCAChB,OAAuBC,QAAvB,YAA8C;AAAA,MAA7C;AAAEC,IAAAA,MAAF;AAAUC,IAAAA;AAAV,GAA6C;AAAA,MAAb;AAAEC,IAAAA;AAAF,GAAa;AAC5C,QAAMC,KAAK,GAAG,wBAASD,IAAT,EAAeH,QAAf,CAAd;AACA,QAAMK,CAAC,GAAG,2BAAcF,IAAd,EAAoBF,MAApB,CAAV;AACA,QAAMK,OAAO,GACXJ,QAAQ,KAAK,QAAb,GACIC,IAAI,CAACI,WAAL,CAAiBC,UAAjB,CAA4BC,IAA5B,CAAiCN,IAAI,CAACI,WAAtC,CADJ,GAEIJ,IAAI,CAACI,WAAL,CAAiBG,SAAjB,CAA2BD,IAA3B,CAAgCN,IAAI,CAACI,WAArC,CAHN;AAIA,SAAOD,OAAO,CAACD,CAAC,CAACM,CAAH,EAAMN,CAAC,CAACO,CAAR,EAAWR,KAAX,CAAd;AACD,CATe,CAAlB;;AAYO,MAAMS,UAAU,GAAIC,KAAD,IAA2C;AACnE,sBAAO;AAAe,IAAA,SAAS,EAAEf;AAA1B,KAAyCe,KAAzC,EAAP;AACD,CAFM;;;AAIPD,UAAU,CAACE,YAAX,GAA0B;AACxBb,EAAAA,QAAQ,EAAE;AADc,CAA1B","sourcesContent":["import React from \"react\";\n\nimport { createDeclaration } from \"../../nodes/Declaration\";\nimport type { AnimatedProps, Radius } from \"../../processors\";\nimport { processRadius } from \"../../processors/Radius\";\n\nimport { getInput } from \"./getInput\";\n\nexport interface MorphologyProps {\n operator: \"erode\" | \"dilate\";\n radius: Radius;\n children?: React.ReactNode | React.ReactNode[];\n}\n\nconst onDeclare = createDeclaration<MorphologyProps>(\n ({ radius, operator }, children, { Skia }) => {\n const input = getInput(Skia, children);\n const r = processRadius(Skia, radius);\n const factory =\n operator === \"dilate\"\n ? Skia.ImageFilter.MakeDilate.bind(Skia.ImageFilter)\n : Skia.ImageFilter.MakeErode.bind(Skia.ImageFilter);\n return factory(r.x, r.y, input);\n }\n);\n\nexport const Morphology = (props: AnimatedProps<MorphologyProps>) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n\nMorphology.defaultProps = {\n operator: \"dilate\",\n};\n"]}
|
@@ -39,7 +39,7 @@ const onDeclare = (0, _Declaration.createDeclaration)((_ref, children, _ref2) =>
|
|
39
39
|
if (inner) {
|
40
40
|
factory = _InnerShadow.MakeInnerShadow.bind(null, Skia, shadowOnly);
|
41
41
|
} else {
|
42
|
-
factory = shadowOnly ? Skia.ImageFilter.MakeDropShadowOnly : Skia.ImageFilter.MakeDropShadow;
|
42
|
+
factory = shadowOnly ? Skia.ImageFilter.MakeDropShadowOnly.bind(Skia.ImageFilter) : Skia.ImageFilter.MakeDropShadow.bind(Skia.ImageFilter);
|
43
43
|
}
|
44
44
|
|
45
45
|
return factory(dx, dy, blur, blur, color, input);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Shadow.tsx"],"names":["onDeclare","children","dx","dy","blur","color","cl","shadowOnly","inner","opacity","Skia","input","factory","MakeInnerShadow","bind","ImageFilter","MakeDropShadowOnly","MakeDropShadow","Shadow","props"],"mappings":";;;;;;;AAAA;;AAEA;;AAGA;;AAEA;;AACA;;;;;;AAWA,MAAMA,SAAS,GAAG,oCAChB,OAEEC,QAFF,YAIK;AAAA,MAHH;AAAEC,IAAAA,EAAF;AAAMC,IAAAA,EAAN;AAAUC,IAAAA,IAAV;AAAgBC,IAAAA,KAAK,EAAEC,EAAvB;AAA2BC,IAAAA,UAA3B;AAAuCC,IAAAA;AAAvC,GAGG;AAAA,MADH;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,GACG;AACH,QAAMC,KAAK,GAAG,wBAASD,IAAT,EAAeT,QAAf,CAAd;AACA,QAAMI,KAAK,GAAG,yBAAaK,IAAb,EAAmBJ,EAAnB,EAAuBG,OAAvB,CAAd;AACA,MAAIG,OAAJ;;AACA,MAAIJ,KAAJ,EAAW;AACTI,IAAAA,OAAO,GAAGC,6BAAgBC,IAAhB,CAAqB,IAArB,EAA2BJ,IAA3B,EAAiCH,UAAjC,CAAV;AACD,GAFD,MAEO;AACLK,IAAAA,OAAO,GAAGL,UAAU,GAChBG,IAAI,CAACK,WAAL,CAAiBC,
|
1
|
+
{"version":3,"sources":["Shadow.tsx"],"names":["onDeclare","children","dx","dy","blur","color","cl","shadowOnly","inner","opacity","Skia","input","factory","MakeInnerShadow","bind","ImageFilter","MakeDropShadowOnly","MakeDropShadow","Shadow","props"],"mappings":";;;;;;;AAAA;;AAEA;;AAGA;;AAEA;;AACA;;;;;;AAWA,MAAMA,SAAS,GAAG,oCAChB,OAEEC,QAFF,YAIK;AAAA,MAHH;AAAEC,IAAAA,EAAF;AAAMC,IAAAA,EAAN;AAAUC,IAAAA,IAAV;AAAgBC,IAAAA,KAAK,EAAEC,EAAvB;AAA2BC,IAAAA,UAA3B;AAAuCC,IAAAA;AAAvC,GAGG;AAAA,MADH;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,GACG;AACH,QAAMC,KAAK,GAAG,wBAASD,IAAT,EAAeT,QAAf,CAAd;AACA,QAAMI,KAAK,GAAG,yBAAaK,IAAb,EAAmBJ,EAAnB,EAAuBG,OAAvB,CAAd;AACA,MAAIG,OAAJ;;AACA,MAAIJ,KAAJ,EAAW;AACTI,IAAAA,OAAO,GAAGC,6BAAgBC,IAAhB,CAAqB,IAArB,EAA2BJ,IAA3B,EAAiCH,UAAjC,CAAV;AACD,GAFD,MAEO;AACLK,IAAAA,OAAO,GAAGL,UAAU,GAChBG,IAAI,CAACK,WAAL,CAAiBC,kBAAjB,CAAoCF,IAApC,CAAyCJ,IAAI,CAACK,WAA9C,CADgB,GAEhBL,IAAI,CAACK,WAAL,CAAiBE,cAAjB,CAAgCH,IAAhC,CAAqCJ,IAAI,CAACK,WAA1C,CAFJ;AAGD;;AACD,SAAOH,OAAO,CAACV,EAAD,EAAKC,EAAL,EAASC,IAAT,EAAeA,IAAf,EAAqBC,KAArB,EAA4BM,KAA5B,CAAd;AACD,CAjBe,CAAlB;;AAoBO,MAAMO,MAAM,GAAIC,KAAD,IAAuC;AAC3D,sBAAO;AAAe,IAAA,SAAS,EAAEnB;AAA1B,KAAyCmB,KAAzC,EAAP;AACD,CAFM","sourcesContent":["import React from \"react\";\n\nimport { createDeclaration } from \"../../nodes/Declaration\";\nimport type { AnimatedProps } from \"../../processors/Animations/Animations\";\nimport type { Color } from \"../../../skia/types\";\nimport { processColor } from \"../../processors/Color\";\n\nimport { getInput } from \"./getInput\";\nimport { MakeInnerShadow } from \"./InnerShadow\";\n\nexport interface ShadowProps {\n dx: number;\n dy: number;\n blur: number;\n color: Color;\n inner?: boolean;\n shadowOnly?: boolean;\n}\n\nconst onDeclare = createDeclaration<ShadowProps>(\n (\n { dx, dy, blur, color: cl, shadowOnly, inner },\n children,\n { opacity, Skia }\n ) => {\n const input = getInput(Skia, children);\n const color = processColor(Skia, cl, opacity);\n let factory;\n if (inner) {\n factory = MakeInnerShadow.bind(null, Skia, shadowOnly);\n } else {\n factory = shadowOnly\n ? Skia.ImageFilter.MakeDropShadowOnly.bind(Skia.ImageFilter)\n : Skia.ImageFilter.MakeDropShadow.bind(Skia.ImageFilter);\n }\n return factory(dx, dy, blur, blur, color, input);\n }\n);\n\nexport const Shadow = (props: AnimatedProps<ShadowProps>) => {\n return <skDeclaration onDeclare={onDeclare} {...props} />;\n};\n"]}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.materialize = exports.isValue = exports.isAnimated = void 0;
|
6
|
+
exports.materialize = exports.isValue = exports.isSelector = exports.isAnimated = void 0;
|
7
7
|
|
8
8
|
var _typeddash = require("../../typeddash");
|
9
9
|
|
@@ -23,6 +23,16 @@ const isValue = value => {
|
|
23
23
|
|
24
24
|
exports.isValue = isValue;
|
25
25
|
|
26
|
+
const isSelector = value => {
|
27
|
+
if (value) {
|
28
|
+
return typeof value === "object" && "selector" in value && "value" in value && value.selector !== undefined && value.value !== undefined;
|
29
|
+
}
|
30
|
+
|
31
|
+
return false;
|
32
|
+
};
|
33
|
+
|
34
|
+
exports.isSelector = isSelector;
|
35
|
+
|
26
36
|
const isAnimated = props => {
|
27
37
|
for (const value of Object.values(props)) {
|
28
38
|
if (isValue(value)) {
|
@@ -39,14 +49,17 @@ const materialize = props => {
|
|
39
49
|
const result = { ...props
|
40
50
|
};
|
41
51
|
(0, _typeddash.mapKeys)(props).forEach(key => {
|
42
|
-
const
|
52
|
+
const prop = props[key];
|
43
53
|
|
44
|
-
if (isValue(
|
45
|
-
result[key] =
|
54
|
+
if (isValue(prop)) {
|
55
|
+
result[key] = prop.current;
|
56
|
+
} else if (isSelector(prop)) {
|
57
|
+
result[key] = prop.selector(prop.value.current);
|
46
58
|
}
|
47
59
|
});
|
48
60
|
return result;
|
49
|
-
};
|
61
|
+
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
62
|
+
|
50
63
|
|
51
64
|
exports.materialize = materialize;
|
52
65
|
//# sourceMappingURL=Animations.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Animations.ts"],"names":["isValue","value","undefined","__typename__","isAnimated","props","Object","values","materialize","result","forEach","key","current"],"mappings":";;;;;;;AACA;;AAEO,MAAMA,OAAO,GAAIC,KAAD,IAAiD;AACtE,MAAIA,KAAK,KAAKC,SAAV,IAAuBD,KAAK,KAAK,IAArC,EAA2C;AACzC,WAAO,KAAP;AACD;;AACD,MAAI;AACF,QACE,OAAOA,KAAP,KAAiB,QAAjB,IACA,kBAAkBA,KADlB,IAECA,KAAD,CAAyCE,YAAzC,KAA0D,WAH5D,EAIE;AACA,aAAO,IAAP;AACD;AACF,GARD,CAQE,MAAM,CAAE;;AACV,SAAO,KAAP;AACD,CAdM;;;;AAgBA,MAAMC,UAAU,GAAOC,KAAJ,IAAgC;AACxD,OAAK,
|
1
|
+
{"version":3,"sources":["Animations.ts"],"names":["isValue","value","undefined","__typename__","isSelector","selector","isAnimated","props","Object","values","materialize","result","forEach","key","prop","current"],"mappings":";;;;;;;AACA;;AAEO,MAAMA,OAAO,GAAIC,KAAD,IAAiD;AACtE,MAAIA,KAAK,KAAKC,SAAV,IAAuBD,KAAK,KAAK,IAArC,EAA2C;AACzC,WAAO,KAAP;AACD;;AACD,MAAI;AACF,QACE,OAAOA,KAAP,KAAiB,QAAjB,IACA,kBAAkBA,KADlB,IAECA,KAAD,CAAyCE,YAAzC,KAA0D,WAH5D,EAIE;AACA,aAAO,IAAP;AACD;AACF,GARD,CAQE,MAAM,CAAE;;AACV,SAAO,KAAP;AACD,CAdM;;;;AAgBA,MAAMC,UAAU,GACrBH,KADwB,IAKrB;AACH,MAAIA,KAAJ,EAAW;AACT,WACE,OAAOA,KAAP,KAAiB,QAAjB,IACA,cAAcA,KADd,IAEA,WAAWA,KAFX,IAGCA,KAAD,CAAmCI,QAAnC,KAAgDH,SAHhD,IAICD,KAAD,CAAmCA,KAAnC,KAA6CC,SAL/C;AAOD;;AACD,SAAO,KAAP;AACD,CAhBM;;;;AAkBA,MAAMI,UAAU,GAAOC,KAAJ,IAAgC;AACxD,OAAK,MAAMN,KAAX,IAAoBO,MAAM,CAACC,MAAP,CAAcF,KAAd,CAApB,EAA0C;AACxC,QAAIP,OAAO,CAACC,KAAD,CAAX,EAAoB;AAClB,aAAO,IAAP;AACD;AACF;;AACD,SAAO,KAAP;AACD,CAPM;;;;AASA,MAAMS,WAAW,GAAOH,KAAJ,IAAgC;AACzD,QAAMI,MAAM,GAAG,EAAE,GAAGJ;AAAL,GAAf;AACA,0BAAQA,KAAR,EAAeK,OAAf,CAAwBC,GAAD,IAAS;AAC9B,UAAMC,IAAI,GAAGP,KAAK,CAACM,GAAD,CAAlB;;AACA,QAAIb,OAAO,CAACc,IAAD,CAAX,EAAmB;AACjBH,MAAAA,MAAM,CAACE,GAAD,CAAN,GAAeC,IAAD,CAAmCC,OAAjD;AACD,KAFD,MAEO,IAAIX,UAAU,CAACU,IAAD,CAAd,EAAsB;AAC3BH,MAAAA,MAAM,CAACE,GAAD,CAAN,GAAcC,IAAI,CAACT,QAAL,CAAcS,IAAI,CAACb,KAAL,CAAWc,OAAzB,CAAd;AACD;AACF,GAPD;AAQA,SAAOJ,MAAP;AACD,CAXM,C,CAaP","sourcesContent":["import type { SkiaSelector, SkiaValue } from \"../../../values\";\nimport { mapKeys } from \"../../typeddash\";\n\nexport const isValue = (value: unknown): value is SkiaValue<unknown> => {\n if (value === undefined || value === null) {\n return false;\n }\n try {\n if (\n typeof value === \"object\" &&\n \"__typename__\" in value &&\n (value as unknown as SkiaValue<unknown>).__typename__ === \"RNSkValue\"\n ) {\n return true;\n }\n } catch {}\n return false;\n};\n\nexport const isSelector = <T, R>(\n value: unknown\n): value is {\n selector: (v: T) => R;\n value: SkiaValue<T>;\n} => {\n if (value) {\n return (\n typeof value === \"object\" &&\n \"selector\" in value &&\n \"value\" in value &&\n (value as Record<string, unknown>).selector !== undefined &&\n (value as Record<string, unknown>).value !== undefined\n );\n }\n return false;\n};\n\nexport const isAnimated = <T>(props: AnimatedProps<T>) => {\n for (const value of Object.values(props)) {\n if (isValue(value)) {\n return true;\n }\n }\n return false;\n};\n\nexport const materialize = <T>(props: AnimatedProps<T>) => {\n const result = { ...props };\n mapKeys(props).forEach((key) => {\n const prop = props[key];\n if (isValue(prop)) {\n result[key] = (prop as SkiaValue<T[typeof key]>).current;\n } else if (isSelector(prop)) {\n result[key] = prop.selector(prop.value.current) as T[typeof key];\n }\n });\n return result as T;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnimatedProp<T, P = any> = T | SkiaValue<T> | SkiaSelector<T, P>;\nexport type AnimatedProps<T> = {\n [K in keyof T]: AnimatedProp<T[K]>;\n};\n"]}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.useRawData = exports.
|
6
|
+
exports.useRawData = exports.useData = void 0;
|
7
7
|
|
8
8
|
var _react = require("react");
|
9
9
|
|
@@ -11,8 +11,10 @@ var _reactNative = require("react-native");
|
|
11
11
|
|
12
12
|
var _Skia = require("../Skia");
|
13
13
|
|
14
|
+
var _types = require("../types");
|
15
|
+
|
14
16
|
const resolveAsset = source => {
|
15
|
-
return
|
17
|
+
return (0, _types.isRNModule)(source) ? _reactNative.Image.resolveAssetSource(source).uri : source.default;
|
16
18
|
};
|
17
19
|
|
18
20
|
const factoryWrapper = (data2, factory, onError) => {
|
@@ -26,10 +28,8 @@ const factoryWrapper = (data2, factory, onError) => {
|
|
26
28
|
}
|
27
29
|
};
|
28
30
|
|
29
|
-
const loadDataCollection = (sources, factory, onError) => Promise.all(sources.map(source => loadData(source, factory, onError)));
|
30
|
-
|
31
31
|
const loadData = (source, factory, onError) => {
|
32
|
-
if (source === null) {
|
32
|
+
if (source === null || source === undefined) {
|
33
33
|
return new Promise(resolve => resolve(null));
|
34
34
|
} else if (source instanceof Uint8Array) {
|
35
35
|
return new Promise(resolve => resolve(factoryWrapper(_Skia.Skia.Data.fromBytes(source), factory, onError)));
|
@@ -39,33 +39,21 @@ const loadData = (source, factory, onError) => {
|
|
39
39
|
}
|
40
40
|
};
|
41
41
|
|
42
|
-
const useLoading =
|
43
|
-
let deps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
42
|
+
const useLoading = (source, loader) => {
|
44
43
|
const [data, setData] = (0, _react.useState)(null);
|
45
|
-
const prevSourceRef = (0, _react.useRef)();
|
46
44
|
(0, _react.useEffect)(() => {
|
47
|
-
|
48
|
-
|
49
|
-
loader().then(setData);
|
50
|
-
} else {
|
51
|
-
setData(null);
|
52
|
-
} // eslint-disable-next-line react-hooks/exhaustive-deps
|
53
|
-
|
54
|
-
}, deps);
|
45
|
+
loader().then(setData); // eslint-disable-next-line react-hooks/exhaustive-deps
|
46
|
+
}, [source]);
|
55
47
|
return data;
|
56
48
|
};
|
57
49
|
|
58
|
-
const
|
59
|
-
|
60
|
-
exports.useDataCollection = useDataCollection;
|
61
|
-
|
62
|
-
const useRawData = (source, factory, onError, deps) => useLoading(source, () => loadData(source, factory, onError), deps);
|
50
|
+
const useRawData = (source, factory, onError) => useLoading(source, () => loadData(source, factory, onError));
|
63
51
|
|
64
52
|
exports.useRawData = useRawData;
|
65
53
|
|
66
54
|
const identity = data => data;
|
67
55
|
|
68
|
-
const useData = (source, onError
|
56
|
+
const useData = (source, onError) => useRawData(source, identity, onError);
|
69
57
|
|
70
58
|
exports.useData = useData;
|
71
59
|
//# sourceMappingURL=Data.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Data.ts"],"names":["resolveAsset","source","
|
1
|
+
{"version":3,"sources":["Data.ts"],"names":["resolveAsset","source","Image","resolveAssetSource","uri","default","factoryWrapper","data2","factory","onError","factoryResult","Error","loadData","undefined","Promise","resolve","Uint8Array","Skia","Data","fromBytes","fromURI","then","d","useLoading","loader","data","setData","useRawData","identity","useData"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AAGA,MAAMA,YAAY,GAAIC,MAAD,IAAwB;AAC3C,SAAO,uBAAWA,MAAX,IACHC,mBAAMC,kBAAN,CAAyBF,MAAzB,EAAiCG,GAD9B,GAEHH,MAAM,CAACI,OAFX;AAGD,CAJD;;AAMA,MAAMC,cAAc,GAAG,CACrBC,KADqB,EAErBC,OAFqB,EAGrBC,OAHqB,KAIlB;AACH,QAAMC,aAAa,GAAGF,OAAO,CAACD,KAAD,CAA7B;;AACA,MAAIG,aAAa,KAAK,IAAtB,EAA4B;AAC1BD,IAAAA,OAAO,IAAIA,OAAO,CAAC,IAAIE,KAAJ,CAAU,qBAAV,CAAD,CAAlB;AACA,WAAO,IAAP;AACD,GAHD,MAGO;AACL,WAAOD,aAAP;AACD;AACF,CAZD;;AAcA,MAAME,QAAQ,GAAG,CACfX,MADe,EAEfO,OAFe,EAGfC,OAHe,KAIO;AACtB,MAAIR,MAAM,KAAK,IAAX,IAAmBA,MAAM,KAAKY,SAAlC,EAA6C;AAC3C,WAAO,IAAIC,OAAJ,CAAaC,OAAD,IAAaA,OAAO,CAAC,IAAD,CAAhC,CAAP;AACD,GAFD,MAEO,IAAId,MAAM,YAAYe,UAAtB,EAAkC;AACvC,WAAO,IAAIF,OAAJ,CAAaC,OAAD,IACjBA,OAAO,CAACT,cAAc,CAACW,WAAKC,IAAL,CAAUC,SAAV,CAAoBlB,MAApB,CAAD,EAA8BO,OAA9B,EAAuCC,OAAvC,CAAf,CADF,CAAP;AAGD,GAJM,MAIA;AACL,UAAML,GAAG,GAAG,OAAOH,MAAP,KAAkB,QAAlB,GAA6BA,MAA7B,GAAsCD,YAAY,CAACC,MAAD,CAA9D;AACA,WAAOgB,WAAKC,IAAL,CAAUE,OAAV,CAAkBhB,GAAlB,EAAuBiB,IAAvB,CAA6BC,CAAD,IACjChB,cAAc,CAACgB,CAAD,EAAId,OAAJ,EAAaC,OAAb,CADT,CAAP;AAGD;AACF,CAjBD;;AAkBA,MAAMc,UAAU,GAAG,CACjBtB,MADiB,EAEjBuB,MAFiB,KAGd;AACH,QAAM,CAACC,IAAD,EAAOC,OAAP,IAAkB,qBAAmB,IAAnB,CAAxB;AACA,wBAAU,MAAM;AACdF,IAAAA,MAAM,GAAGH,IAAT,CAAcK,OAAd,EADc,CAEd;AACD,GAHD,EAGG,CAACzB,MAAD,CAHH;AAIA,SAAOwB,IAAP;AACD,CAVD;;AAYO,MAAME,UAAU,GAAG,CACxB1B,MADwB,EAExBO,OAFwB,EAGxBC,OAHwB,KAIrBc,UAAU,CAACtB,MAAD,EAAS,MAAMW,QAAQ,CAACX,MAAD,EAASO,OAAT,EAAkBC,OAAlB,CAAvB,CAJR;;;;AAMP,MAAMmB,QAAQ,GAAIH,IAAD,IAAkBA,IAAnC;;AAEO,MAAMI,OAAO,GAAG,CACrB5B,MADqB,EAErBQ,OAFqB,KAGlBkB,UAAU,CAAC1B,MAAD,EAAS2B,QAAT,EAAmBnB,OAAnB,CAHR","sourcesContent":["import { useEffect, useState } from \"react\";\nimport { Image } from \"react-native\";\n\nimport { Skia } from \"../Skia\";\nimport { isRNModule } from \"../types\";\nimport type { SkData, DataModule, DataSourceParam } from \"../types\";\n\nconst resolveAsset = (source: DataModule) => {\n return isRNModule(source)\n ? Image.resolveAssetSource(source).uri\n : source.default;\n};\n\nconst factoryWrapper = <T>(\n data2: SkData,\n factory: (data: SkData) => T,\n onError?: (err: Error) => void\n) => {\n const factoryResult = factory(data2);\n if (factoryResult === null) {\n onError && onError(new Error(\"Could not load data\"));\n return null;\n } else {\n return factoryResult;\n }\n};\n\nconst loadData = <T>(\n source: DataSourceParam,\n factory: (data: SkData) => T,\n onError?: (err: Error) => void\n): Promise<T | null> => {\n if (source === null || source === undefined) {\n return new Promise((resolve) => resolve(null));\n } else if (source instanceof Uint8Array) {\n return new Promise((resolve) =>\n resolve(factoryWrapper(Skia.Data.fromBytes(source), factory, onError))\n );\n } else {\n const uri = typeof source === \"string\" ? source : resolveAsset(source);\n return Skia.Data.fromURI(uri).then((d) =>\n factoryWrapper(d, factory, onError)\n );\n }\n};\nconst useLoading = <T>(\n source: DataSourceParam,\n loader: () => Promise<T | null>\n) => {\n const [data, setData] = useState<T | null>(null);\n useEffect(() => {\n loader().then(setData);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [source]);\n return data;\n};\n\nexport const useRawData = <T>(\n source: DataSourceParam,\n factory: (data: SkData) => T,\n onError?: (err: Error) => void\n) => useLoading(source, () => loadData(source, factory, onError));\n\nconst identity = (data: SkData) => data;\n\nexport const useData = (\n source: DataSourceParam,\n onError?: (err: Error) => void\n) => useRawData(source, identity, onError);\n"]}
|
@@ -25,9 +25,8 @@ const useFont = (font, size, onError) => {
|
|
25
25
|
return _Skia.Skia.Font(typeface);
|
26
26
|
} else {
|
27
27
|
return null;
|
28
|
-
}
|
29
|
-
|
30
|
-
}, [typeface]);
|
28
|
+
}
|
29
|
+
}, [size, typeface]);
|
31
30
|
};
|
32
31
|
|
33
32
|
exports.useFont = useFont;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Font.ts"],"names":["useFont","font","size","onError","typeface","Skia","Font"],"mappings":";;;;;;;AACA;;AAEA;;AAGA;;AANA;;AAQA;AACA;AACA;AACO,MAAMA,OAAO,GAAG,CACrBC,IADqB,EAErBC,IAFqB,EAGrBC,OAHqB,
|
1
|
+
{"version":3,"sources":["Font.ts"],"names":["useFont","font","size","onError","typeface","Skia","Font"],"mappings":";;;;;;;AACA;;AAEA;;AAGA;;AANA;;AAQA;AACA;AACA;AACO,MAAMA,OAAO,GAAG,CACrBC,IADqB,EAErBC,IAFqB,EAGrBC,OAHqB,KAIlB;AACH,QAAMC,QAAQ,GAAG,2BAAYH,IAAZ,EAAkBE,OAAlB,CAAjB;AACA,SAAO,oBAAQ,MAAM;AACnB,QAAIC,QAAQ,IAAIF,IAAhB,EAAsB;AACpB,aAAOG,WAAKC,IAAL,CAAUF,QAAV,EAAoBF,IAApB,CAAP;AACD,KAFD,MAEO,IAAIE,QAAQ,IAAI,CAACF,IAAjB,EAAuB;AAC5B,aAAOG,WAAKC,IAAL,CAAUF,QAAV,CAAP;AACD,KAFM,MAEA;AACL,aAAO,IAAP;AACD;AACF,GARM,EAQJ,CAACF,IAAD,EAAOE,QAAP,CARI,CAAP;AASD,CAfM","sourcesContent":["/*global SkiaApi*/\nimport { useMemo } from \"react\";\n\nimport { Skia } from \"../Skia\";\nimport type { DataSourceParam } from \"../types\";\n\nimport { useTypeface } from \"./Typeface\";\n\n/**\n * Returns a Skia Font object\n * */\nexport const useFont = (\n font: DataSourceParam,\n size?: number,\n onError?: (err: Error) => void\n) => {\n const typeface = useTypeface(font, onError);\n return useMemo(() => {\n if (typeface && size) {\n return Skia.Font(typeface, size);\n } else if (typeface && !size) {\n return Skia.Font(typeface);\n } else {\n return null;\n }\n }, [size, typeface]);\n};\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Image.ts"],"names":["imgFactory","Skia","Image","MakeImageFromEncoded","bind","useImage","source","onError"],"mappings":";;;;;;;AAAA;;AAGA;;AAEA,MAAMA,UAAU,GAAGC,WAAKC,KAAL,CAAWC,oBAAX,CAAgCC,IAAhC,CAAqCH,WAAKC,KAA1C,CAAnB;AAEA;AACA;AACA;;;AACO,MAAMG,QAAQ,GAAG,CACtBC,MADsB,EAEtBC,OAFsB,KAGnB,sBAAWD,MAAX,EAAmBN,UAAnB,EAA+BO,OAA/B,CAHE","sourcesContent":["import { Skia } from \"../Skia\";\nimport type {
|
1
|
+
{"version":3,"sources":["Image.ts"],"names":["imgFactory","Skia","Image","MakeImageFromEncoded","bind","useImage","source","onError"],"mappings":";;;;;;;AAAA;;AAGA;;AAEA,MAAMA,UAAU,GAAGC,WAAKC,KAAL,CAAWC,oBAAX,CAAgCC,IAAhC,CAAqCH,WAAKC,KAA1C,CAAnB;AAEA;AACA;AACA;;;AACO,MAAMG,QAAQ,GAAG,CACtBC,MADsB,EAEtBC,OAFsB,KAGnB,sBAAWD,MAAX,EAAmBN,UAAnB,EAA+BO,OAA/B,CAHE","sourcesContent":["import { Skia } from \"../Skia\";\nimport type { DataSourceParam } from \"../types\";\n\nimport { useRawData } from \"./Data\";\n\nconst imgFactory = Skia.Image.MakeImageFromEncoded.bind(Skia.Image);\n\n/**\n * Returns a Skia Image object\n * */\nexport const useImage = (\n source: DataSourceParam,\n onError?: (err: Error) => void\n) => useRawData(source, imgFactory, onError);\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["SVG.ts"],"names":["svgFactory","Skia","SVG","MakeFromData","bind","useSVG","source","onError"],"mappings":";;;;;;;AAAA;;AAGA;;AAEA,MAAMA,UAAU,GAAGC,WAAKC,GAAL,CAASC,YAAT,CAAsBC,IAAtB,CAA2BH,WAAKC,GAAhC,CAAnB;;AAEO,MAAMG,MAAM,GAAG,CACpBC,MADoB,EAEpBC,OAFoB,KAGjB,sBAAWD,MAAX,EAAmBN,UAAnB,EAA+BO,OAA/B,CAHE","sourcesContent":["import { Skia } from \"../Skia\";\nimport type {
|
1
|
+
{"version":3,"sources":["SVG.ts"],"names":["svgFactory","Skia","SVG","MakeFromData","bind","useSVG","source","onError"],"mappings":";;;;;;;AAAA;;AAGA;;AAEA,MAAMA,UAAU,GAAGC,WAAKC,GAAL,CAASC,YAAT,CAAsBC,IAAtB,CAA2BH,WAAKC,GAAhC,CAAnB;;AAEO,MAAMG,MAAM,GAAG,CACpBC,MADoB,EAEpBC,OAFoB,KAGjB,sBAAWD,MAAX,EAAmBN,UAAnB,EAA+BO,OAA/B,CAHE","sourcesContent":["import { Skia } from \"../Skia\";\nimport type { DataSourceParam } from \"../types\";\n\nimport { useRawData } from \"./Data\";\n\nconst svgFactory = Skia.SVG.MakeFromData.bind(Skia.SVG);\n\nexport const useSVG = (\n source: DataSourceParam,\n onError?: (err: Error) => void\n) => useRawData(source, svgFactory, onError);\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Typeface.ts"],"names":["tfFactory","Skia","Typeface","MakeFreeTypeFaceFromData","bind","useTypeface","source","onError"],"mappings":";;;;;;;AAAA;;AAGA;;AAEA,MAAMA,SAAS,GAAGC,WAAKC,QAAL,CAAcC,wBAAd,CAAuCC,IAAvC,CAA4CH,WAAKC,QAAjD,CAAlB;AAEA;AACA;AACA;;;AACO,MAAMG,WAAW,GAAG,CACzBC,MADyB,EAEzBC,OAFyB,KAGtB,sBAAWD,MAAX,EAAmBN,SAAnB,EAA8BO,OAA9B,CAHE","sourcesContent":["import { Skia } from \"../Skia\";\nimport type {
|
1
|
+
{"version":3,"sources":["Typeface.ts"],"names":["tfFactory","Skia","Typeface","MakeFreeTypeFaceFromData","bind","useTypeface","source","onError"],"mappings":";;;;;;;AAAA;;AAGA;;AAEA,MAAMA,SAAS,GAAGC,WAAKC,QAAL,CAAcC,wBAAd,CAAuCC,IAAvC,CAA4CH,WAAKC,QAAjD,CAAlB;AAEA;AACA;AACA;;;AACO,MAAMG,WAAW,GAAG,CACzBC,MADyB,EAEzBC,OAFyB,KAGtB,sBAAWD,MAAX,EAAmBN,SAAnB,EAA8BO,OAA9B,CAHE","sourcesContent":["import { Skia } from \"../Skia\";\nimport type { DataSourceParam } from \"../types\";\n\nimport { useRawData } from \"./Data\";\n\nconst tfFactory = Skia.Typeface.MakeFreeTypeFaceFromData.bind(Skia.Typeface);\n\n/**\n * Returns a Skia Typeface object\n * */\nexport const useTypeface = (\n source: DataSourceParam,\n onError?: (err: Error) => void\n) => useRawData(source, tfFactory, onError);\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
1
|
+
{"version":3,"sources":["Data.ts"],"names":["isRNModule","mod"],"mappings":";;;;;;;AAaO,MAAMA,UAAU,GAAIC,GAAD,IACxB,OAAOA,GAAP,KAAe,QADV","sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\n\nexport type SkData = SkJSIInstance<\"Data\">;\n\ntype RNModule = number;\ntype ESModule = {\n __esModule: true;\n default: string;\n};\nexport type DataModule = RNModule | ESModule;\nexport type DataSource = DataModule | string | Uint8Array;\nexport type DataSourceParam = DataSource | null | undefined;\n\nexport const isRNModule = (mod: DataModule): mod is RNModule =>\n typeof mod === \"number\";\n"]}
|
@@ -3,14 +3,13 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.optEnum = exports.ckEnum = exports.NotImplementedOnRNWeb = exports.HostObject = exports.Host = exports.BaseHostObject = void 0;
|
7
7
|
|
8
8
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
9
9
|
|
10
|
-
/* eslint-disable no-nested-ternary */
|
11
10
|
class NotImplementedOnRNWeb extends Error {
|
12
|
-
constructor() {
|
13
|
-
super("Not implemented on React Native Web");
|
11
|
+
constructor(msg) {
|
12
|
+
super(msg !== null && msg !== void 0 ? msg : "Not implemented on React Native Web");
|
14
13
|
}
|
15
14
|
|
16
15
|
}
|
@@ -28,7 +27,7 @@ class Host {
|
|
28
27
|
|
29
28
|
exports.Host = Host;
|
30
29
|
|
31
|
-
class
|
30
|
+
class BaseHostObject extends Host {
|
32
31
|
constructor(CanvasKit, ref, typename) {
|
33
32
|
super(CanvasKit);
|
34
33
|
|
@@ -40,26 +39,18 @@ class HostObject extends Host {
|
|
40
39
|
this.__typename__ = typename;
|
41
40
|
}
|
42
41
|
|
43
|
-
}
|
44
|
-
|
45
|
-
|
46
|
-
exports.HostObject = HostObject;
|
47
|
-
|
48
|
-
const toOptionalValue = value => value === undefined ? undefined : value === null ? null : toValue(value);
|
49
|
-
|
50
|
-
exports.toOptionalValue = toOptionalValue;
|
51
|
-
|
52
|
-
const toUndefinedableValue = value => value === undefined ? undefined : toValue(value);
|
53
|
-
|
54
|
-
exports.toUndefinedableValue = toUndefinedableValue;
|
42
|
+
}
|
55
43
|
|
56
|
-
|
44
|
+
exports.BaseHostObject = BaseHostObject;
|
57
45
|
|
58
|
-
|
46
|
+
class HostObject extends BaseHostObject {
|
47
|
+
static fromValue(value) {
|
48
|
+
return value.ref;
|
49
|
+
}
|
59
50
|
|
60
|
-
|
51
|
+
}
|
61
52
|
|
62
|
-
exports.
|
53
|
+
exports.HostObject = HostObject;
|
63
54
|
|
64
55
|
const ckEnum = value => ({
|
65
56
|
value
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Host.ts"],"names":["NotImplementedOnRNWeb","Error","constructor","Host","CanvasKit","
|
1
|
+
{"version":3,"sources":["Host.ts"],"names":["NotImplementedOnRNWeb","Error","constructor","msg","Host","CanvasKit","BaseHostObject","ref","typename","__typename__","HostObject","fromValue","value","ckEnum","optEnum","undefined"],"mappings":";;;;;;;;;AAIO,MAAMA,qBAAN,SAAoCC,KAApC,CAA0C;AAC/CC,EAAAA,WAAW,CAACC,GAAD,EAAe;AACxB,UAAMA,GAAN,aAAMA,GAAN,cAAMA,GAAN,GAAa,qCAAb;AACD;;AAH8C;;;;AAM1C,MAAeC,IAAf,CAAoB;AAGzBF,EAAAA,WAAW,CAACG,SAAD,EAAuB;AAAA;;AAChC,SAAKA,SAAL,GAAiBA,SAAjB;AACD;;AALwB;;;;AAQpB,MAAeC,cAAf,SACGF,IADH,CAGP;AAIEF,EAAAA,WAAW,CAACG,SAAD,EAAuBE,GAAvB,EAA+BC,QAA/B,EAA4C;AACrD,UAAMH,SAAN;;AADqD;;AAAA;;AAErD,SAAKE,GAAL,GAAWA,GAAX;AACA,SAAKE,YAAL,GAAoBD,QAApB;AACD;;AARH;;;;AAWO,MAAeE,UAAf,SAAuDJ,cAAvD,CAGL;AACgB,SAATK,SAAS,CAAIC,KAAJ,EAAkC;AAChD,WAAQA,KAAD,CAAiCL,GAAxC;AACD;;AAHD;;;;AAMK,MAAMM,MAAM,GAAID,KAAD,KAAsC;AAAEA,EAAAA;AAAF,CAAtC,CAAf;;;;AACA,MAAME,OAAO,GAClBF,KADqB,IAGrBA,KAAK,KAAKG,SAAV,GAAsBA,SAAtB,GAAkC;AAAEH,EAAAA;AAAF,CAH7B","sourcesContent":["import type { CanvasKit, EmbindEnumEntity } from \"canvaskit-wasm\";\n\nimport type { SkJSIInstance } from \"../types\";\n\nexport class NotImplementedOnRNWeb extends Error {\n constructor(msg?: string) {\n super(msg ?? \"Not implemented on React Native Web\");\n }\n}\n\nexport abstract class Host {\n readonly CanvasKit: CanvasKit;\n\n constructor(CanvasKit: CanvasKit) {\n this.CanvasKit = CanvasKit;\n }\n}\n\nexport abstract class BaseHostObject<T, N extends string>\n extends Host\n implements SkJSIInstance<N>\n{\n readonly __typename__: N;\n readonly ref: T;\n\n constructor(CanvasKit: CanvasKit, ref: T, typename: N) {\n super(CanvasKit);\n this.ref = ref;\n this.__typename__ = typename;\n }\n}\n\nexport abstract class HostObject<T, N extends string> extends BaseHostObject<\n T,\n N\n> {\n static fromValue<T>(value: SkJSIInstance<string>) {\n return (value as HostObject<T, string>).ref;\n }\n}\n\nexport const ckEnum = (value: number): EmbindEnumEntity => ({ value });\nexport const optEnum = (\n value: number | undefined\n): EmbindEnumEntity | undefined =>\n value === undefined ? undefined : { value };\n"]}
|