react-native-webrtc-kaleidoscope 2.7.7 → 2.7.8
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/README.md +1 -0
- package/catalog/composites/clouds/clouds.ts +6 -0
- package/catalog/composites/clouds/clouds.web.ts +35 -0
- package/dist/catalog/composites/clouds/clouds.d.ts +1 -0
- package/dist/catalog/composites/clouds/clouds.d.ts.map +1 -1
- package/dist/catalog/composites/clouds/clouds.js +6 -0
- package/dist/catalog/composites/clouds/clouds.js.map +1 -1
- package/dist/catalog/composites/clouds/clouds.web.d.ts +27 -0
- package/dist/catalog/composites/clouds/clouds.web.d.ts.map +1 -0
- package/dist/catalog/composites/clouds/clouds.web.js +39 -0
- package/dist/catalog/composites/clouds/clouds.web.js.map +1 -0
- package/llms.txt +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -284,6 +284,7 @@ The demo book's [`wolf-cave`](./demo/kaleidoscope.preset-book.ts) is a runnable
|
|
|
284
284
|
- **Bundled images** ship as tree-shakeable `image` layers, filed by category and imported per image (`import { officeDark } from 'react-native-webrtc-kaleidoscope/images/office/office-dark'`). On web a `source` can also be any image URL or data URI; native resolves bundled ids only. See [`catalog/images/README.md`](./catalog/images/README.md).
|
|
285
285
|
- **New shaders** drop a single `.frag` + typed `.ts` into `catalog/shaders/<name>/`; `bun run build:shaders` codegens the web and Android sources and transpiles the iOS Metal. The canonical upright frame and the mask stencil come for free; you write zero orientation code. See [`catalog/shaders/README.md`](./catalog/shaders/README.md).
|
|
286
286
|
- **Packaged composites** (the Worlds) live in `catalog/composites/<name>/` behind a `./composites/<name>` subpath export; import and spread one into your book.
|
|
287
|
+
- **Thumbnails** are a bundled-asset reference, not a URL string: pass a bare `require('./thumb.webp')` (what `bun run thumbs` emits), or an imported image module (`thumbnail: officeDark`). Both resolve on every platform; native loads the bundled asset, web the asset pipeline. Do **not** wrap the require in `Asset.fromModule(require('./thumb.webp')).uri` in a single-file book: the resolved string renders on web but is empty in a native release build.
|
|
287
288
|
|
|
288
289
|
After adding a preset to the demo book, regenerate its thumbnail and this README's gallery: `bun run thumbs && bun run gen:waffle` (see [Authoring tooling](#authoring-tooling)).
|
|
289
290
|
|
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
// procedural; no image layer.
|
|
3
3
|
//
|
|
4
4
|
// A packaged composite consumers can list by importing this module.
|
|
5
|
+
//
|
|
6
|
+
// Native variant. The thumbnail is the string id the prebuild plugin
|
|
7
|
+
// (app.plugin.js) bundles `clouds.thumb.webp` as into the native app target;
|
|
8
|
+
// `resolveImageUri` looks it up in Bundle.main. The web sibling (clouds.web.ts)
|
|
9
|
+
// keeps the `Asset.fromModule(...).uri` pattern; mirrors the other composites.
|
|
5
10
|
|
|
6
11
|
import type { KaleidoscopePreset } from '../../../src/kaleidoscope.preset-book.types';
|
|
7
12
|
|
|
8
13
|
export const clouds = {
|
|
9
14
|
name: 'Daytime',
|
|
10
15
|
taxonomy: ['Shaders', 'Sky'],
|
|
16
|
+
thumbnail: 'clouds-thumb',
|
|
11
17
|
layers: [
|
|
12
18
|
{
|
|
13
19
|
id: 'sky',
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Web variant. Resolves the thumbnail URI via expo-asset at module-load time;
|
|
2
|
+
// safe on web (react-native-web has no Image.resolveAssetSource and `.uri` is
|
|
3
|
+
// set synchronously by fromModule). Native is clouds.ts (a string-id thumbnail
|
|
4
|
+
// the prebuild plugin bundles). Mirrors the other composites' {<id>.ts,<id>.web.ts}.
|
|
5
|
+
|
|
6
|
+
import { Asset } from 'expo-asset';
|
|
7
|
+
import type { KaleidoscopePreset } from '../../../src/kaleidoscope.preset-book.types';
|
|
8
|
+
import cloudsThumb from './clouds.thumb.webp';
|
|
9
|
+
|
|
10
|
+
export const clouds = {
|
|
11
|
+
name: 'Daytime',
|
|
12
|
+
taxonomy: ['Shaders', 'Sky'],
|
|
13
|
+
thumbnail: Asset.fromModule(cloudsThumb).uri,
|
|
14
|
+
layers: [
|
|
15
|
+
{
|
|
16
|
+
id: 'sky',
|
|
17
|
+
shader: 'clouds',
|
|
18
|
+
uniforms: {
|
|
19
|
+
uSkyLowColor: [0.09, 0.63, 0.95],
|
|
20
|
+
uSkyHighColor: [0.04, 0.03, 0.86],
|
|
21
|
+
uCloudLightColor: [1.0, 0.91, 0.77],
|
|
22
|
+
uCloudDarkColor: [0.3, 0.3, 0.5],
|
|
23
|
+
uExposure: 1.27,
|
|
24
|
+
uStepSize: 0.16,
|
|
25
|
+
uCloudSpeed: 0.52,
|
|
26
|
+
uCloudScale: 1.08,
|
|
27
|
+
uDensity: 0.245,
|
|
28
|
+
uCoverage: 0.47,
|
|
29
|
+
uSoftness: 0.28,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
// You, under the sky.
|
|
33
|
+
{ id: 'you', shader: 'direct', target: 'subject' },
|
|
34
|
+
],
|
|
35
|
+
} as const satisfies KaleidoscopePreset;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clouds.d.ts","sourceRoot":"","sources":["../../../../catalog/composites/clouds/clouds.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clouds.d.ts","sourceRoot":"","sources":["../../../../catalog/composites/clouds/clouds.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,MAAM;mBACX,SAAS;;wBAEJ,cAAc;;qBAGjB,KAAK;yBACD,QAAQ;;qBAEd,YAAY;qBACZ,aAAa;qBACb,gBAAgB;qBAChB,eAAe;qBACf,SAAS,EAAE,IAAI;qBACf,SAAS,EAAE,IAAI;qBACf,WAAW,EAAE,IAAI;qBACjB,WAAW,EAAE,IAAI;qBACjB,QAAQ,EAAE,KAAK;qBACf,SAAS,EAAE,IAAI;qBACf,SAAS,EAAE,IAAI;;;qBAIb,KAAK;yBAAU,QAAQ;yBAAU,SAAS;;CAEb,CAAC"}
|
|
@@ -3,11 +3,17 @@
|
|
|
3
3
|
// procedural; no image layer.
|
|
4
4
|
//
|
|
5
5
|
// A packaged composite consumers can list by importing this module.
|
|
6
|
+
//
|
|
7
|
+
// Native variant. The thumbnail is the string id the prebuild plugin
|
|
8
|
+
// (app.plugin.js) bundles `clouds.thumb.webp` as into the native app target;
|
|
9
|
+
// `resolveImageUri` looks it up in Bundle.main. The web sibling (clouds.web.ts)
|
|
10
|
+
// keeps the `Asset.fromModule(...).uri` pattern; mirrors the other composites.
|
|
6
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
12
|
exports.clouds = void 0;
|
|
8
13
|
exports.clouds = {
|
|
9
14
|
name: 'Daytime',
|
|
10
15
|
taxonomy: ['Shaders', 'Sky'],
|
|
16
|
+
thumbnail: 'clouds-thumb',
|
|
11
17
|
layers: [
|
|
12
18
|
{
|
|
13
19
|
id: 'sky',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clouds.js","sourceRoot":"","sources":["../../../../catalog/composites/clouds/clouds.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,8BAA8B;AAC9B,EAAE;AACF,oEAAoE;;;
|
|
1
|
+
{"version":3,"file":"clouds.js","sourceRoot":"","sources":["../../../../catalog/composites/clouds/clouds.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,8BAA8B;AAC9B,EAAE;AACF,oEAAoE;AACpE,EAAE;AACF,qEAAqE;AACrE,6EAA6E;AAC7E,gFAAgF;AAChF,+EAA+E;;;AAIlE,QAAA,MAAM,GAAG;IACpB,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC;IAC5B,SAAS,EAAE,cAAc;IACzB,MAAM,EAAE;QACN;YACE,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,QAAQ;YAChB,QAAQ,EAAE;gBACR,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;gBAChC,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;gBACjC,gBAAgB,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC;gBACnC,eAAe,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;gBAChC,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;gBACf,WAAW,EAAE,IAAI;gBACjB,WAAW,EAAE,IAAI;gBACjB,QAAQ,EAAE,KAAK;gBACf,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;aAChB;SACF;QACD,sBAAsB;QACtB,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE;KACnD;CACoC,CAAC","sourcesContent":["// Sky: raymarched daytime clouds with you composited over them. Fully\n// procedural; no image layer.\n//\n// A packaged composite consumers can list by importing this module.\n//\n// Native variant. The thumbnail is the string id the prebuild plugin\n// (app.plugin.js) bundles `clouds.thumb.webp` as into the native app target;\n// `resolveImageUri` looks it up in Bundle.main. The web sibling (clouds.web.ts)\n// keeps the `Asset.fromModule(...).uri` pattern; mirrors the other composites.\n\nimport type { KaleidoscopePreset } from '../../../src/kaleidoscope.preset-book.types';\n\nexport const clouds = {\n name: 'Daytime',\n taxonomy: ['Shaders', 'Sky'],\n thumbnail: 'clouds-thumb',\n layers: [\n {\n id: 'sky',\n shader: 'clouds',\n uniforms: {\n uSkyLowColor: [0.09, 0.63, 0.95],\n uSkyHighColor: [0.04, 0.03, 0.86],\n uCloudLightColor: [1.0, 0.91, 0.77],\n uCloudDarkColor: [0.3, 0.3, 0.5],\n uExposure: 1.27,\n uStepSize: 0.16,\n uCloudSpeed: 0.52,\n uCloudScale: 1.08,\n uDensity: 0.245,\n uCoverage: 0.47,\n uSoftness: 0.28,\n },\n },\n // You, under the sky.\n { id: 'you', shader: 'direct', target: 'subject' },\n ],\n} as const satisfies KaleidoscopePreset;\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const clouds: {
|
|
2
|
+
readonly name: 'Daytime';
|
|
3
|
+
readonly taxonomy: readonly ["Shaders", "Sky"];
|
|
4
|
+
readonly thumbnail: string;
|
|
5
|
+
readonly layers: readonly [{
|
|
6
|
+
readonly id: 'sky';
|
|
7
|
+
readonly shader: 'clouds';
|
|
8
|
+
readonly uniforms: {
|
|
9
|
+
readonly uSkyLowColor: readonly [0.09, 0.63, 0.95];
|
|
10
|
+
readonly uSkyHighColor: readonly [0.04, 0.03, 0.86];
|
|
11
|
+
readonly uCloudLightColor: readonly [1, 0.91, 0.77];
|
|
12
|
+
readonly uCloudDarkColor: readonly [0.3, 0.3, 0.5];
|
|
13
|
+
readonly uExposure: 1.27;
|
|
14
|
+
readonly uStepSize: 0.16;
|
|
15
|
+
readonly uCloudSpeed: 0.52;
|
|
16
|
+
readonly uCloudScale: 1.08;
|
|
17
|
+
readonly uDensity: 0.245;
|
|
18
|
+
readonly uCoverage: 0.47;
|
|
19
|
+
readonly uSoftness: 0.28;
|
|
20
|
+
};
|
|
21
|
+
}, {
|
|
22
|
+
readonly id: 'you';
|
|
23
|
+
readonly shader: 'direct';
|
|
24
|
+
readonly target: 'subject';
|
|
25
|
+
}];
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=clouds.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clouds.web.d.ts","sourceRoot":"","sources":["../../../../catalog/composites/clouds/clouds.web.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,MAAM;mBACX,SAAS;;;;qBAKP,KAAK;yBACD,QAAQ;;qBAEd,YAAY;qBACZ,aAAa;qBACb,gBAAgB;qBAChB,eAAe;qBACf,SAAS,EAAE,IAAI;qBACf,SAAS,EAAE,IAAI;qBACf,WAAW,EAAE,IAAI;qBACjB,WAAW,EAAE,IAAI;qBACjB,QAAQ,EAAE,KAAK;qBACf,SAAS,EAAE,IAAI;qBACf,SAAS,EAAE,IAAI;;;qBAIb,KAAK;yBAAU,QAAQ;yBAAU,SAAS;;CAEb,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Web variant. Resolves the thumbnail URI via expo-asset at module-load time;
|
|
3
|
+
// safe on web (react-native-web has no Image.resolveAssetSource and `.uri` is
|
|
4
|
+
// set synchronously by fromModule). Native is clouds.ts (a string-id thumbnail
|
|
5
|
+
// the prebuild plugin bundles). Mirrors the other composites' {<id>.ts,<id>.web.ts}.
|
|
6
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.clouds = void 0;
|
|
11
|
+
const expo_asset_1 = require("expo-asset");
|
|
12
|
+
const clouds_thumb_webp_1 = __importDefault(require("./clouds.thumb.webp"));
|
|
13
|
+
exports.clouds = {
|
|
14
|
+
name: 'Daytime',
|
|
15
|
+
taxonomy: ['Shaders', 'Sky'],
|
|
16
|
+
thumbnail: expo_asset_1.Asset.fromModule(clouds_thumb_webp_1.default).uri,
|
|
17
|
+
layers: [
|
|
18
|
+
{
|
|
19
|
+
id: 'sky',
|
|
20
|
+
shader: 'clouds',
|
|
21
|
+
uniforms: {
|
|
22
|
+
uSkyLowColor: [0.09, 0.63, 0.95],
|
|
23
|
+
uSkyHighColor: [0.04, 0.03, 0.86],
|
|
24
|
+
uCloudLightColor: [1.0, 0.91, 0.77],
|
|
25
|
+
uCloudDarkColor: [0.3, 0.3, 0.5],
|
|
26
|
+
uExposure: 1.27,
|
|
27
|
+
uStepSize: 0.16,
|
|
28
|
+
uCloudSpeed: 0.52,
|
|
29
|
+
uCloudScale: 1.08,
|
|
30
|
+
uDensity: 0.245,
|
|
31
|
+
uCoverage: 0.47,
|
|
32
|
+
uSoftness: 0.28,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
// You, under the sky.
|
|
36
|
+
{ id: 'you', shader: 'direct', target: 'subject' },
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=clouds.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clouds.web.js","sourceRoot":"","sources":["../../../../catalog/composites/clouds/clouds.web.ts"],"names":[],"mappings":";AAAA,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,qFAAqF;;;;;;AAErF,2CAAmC;AAEnC,4EAA8C;AAEjC,QAAA,MAAM,GAAG;IACpB,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,CAAC,SAAS,EAAE,KAAK,CAAC;IAC5B,SAAS,EAAE,kBAAK,CAAC,UAAU,CAAC,2BAAW,CAAC,CAAC,GAAG;IAC5C,MAAM,EAAE;QACN;YACE,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,QAAQ;YAChB,QAAQ,EAAE;gBACR,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;gBAChC,aAAa,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;gBACjC,gBAAgB,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC;gBACnC,eAAe,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;gBAChC,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;gBACf,WAAW,EAAE,IAAI;gBACjB,WAAW,EAAE,IAAI;gBACjB,QAAQ,EAAE,KAAK;gBACf,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;aAChB;SACF;QACD,sBAAsB;QACtB,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE;KACnD;CACoC,CAAC","sourcesContent":["// Web variant. Resolves the thumbnail URI via expo-asset at module-load time;\n// safe on web (react-native-web has no Image.resolveAssetSource and `.uri` is\n// set synchronously by fromModule). Native is clouds.ts (a string-id thumbnail\n// the prebuild plugin bundles). Mirrors the other composites' {<id>.ts,<id>.web.ts}.\n\nimport { Asset } from 'expo-asset';\nimport type { KaleidoscopePreset } from '../../../src/kaleidoscope.preset-book.types';\nimport cloudsThumb from './clouds.thumb.webp';\n\nexport const clouds = {\n name: 'Daytime',\n taxonomy: ['Shaders', 'Sky'],\n thumbnail: Asset.fromModule(cloudsThumb).uri,\n layers: [\n {\n id: 'sky',\n shader: 'clouds',\n uniforms: {\n uSkyLowColor: [0.09, 0.63, 0.95],\n uSkyHighColor: [0.04, 0.03, 0.86],\n uCloudLightColor: [1.0, 0.91, 0.77],\n uCloudDarkColor: [0.3, 0.3, 0.5],\n uExposure: 1.27,\n uStepSize: 0.16,\n uCloudSpeed: 0.52,\n uCloudScale: 1.08,\n uDensity: 0.245,\n uCoverage: 0.47,\n uSoftness: 0.28,\n },\n },\n // You, under the sky.\n { id: 'you', shader: 'direct', target: 'subject' },\n ],\n} as const satisfies KaleidoscopePreset;\n"]}
|
package/llms.txt
CHANGED
|
@@ -484,7 +484,7 @@ Each book entry is a `KaleidoscopePreset`:
|
|
|
484
484
|
|
|
485
485
|
- `name`: human label shown in the picker.
|
|
486
486
|
- `taxonomy`: the picker's grouping path, root first: `[group]` or `[group, category]` (e.g. `['Backgrounds', 'Office']`). Group is the tab; category is the second-level menu. (This field is named `taxonomy`, NOT `category`.)
|
|
487
|
-
- `thumbnail?`: optional preview source for the picker tile.
|
|
487
|
+
- `thumbnail?`: optional preview source for the picker tile. Pass a bundled-asset reference: a bare `require('./thumb.webp')` (what `bun run thumbs` emits) or an imported image module (`thumbnail: officeDark`). Do NOT use `Asset.fromModule(require('./thumb.webp')).uri` in a single-file book; that string renders on web but is empty in a native release build.
|
|
488
488
|
- `controls?`: optional editor component for the live-controls panel (see below).
|
|
489
489
|
- `layers`: the painter's stack, rendered back to front. A layer is `{ id, shader, target?, blend? }` plus the shader's own fields:
|
|
490
490
|
- `shader: 'image'` takes a `source` (a bundled image id on native; a URL/data-URI also allowed on web).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-webrtc-kaleidoscope",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.8",
|
|
4
4
|
"description": "Live video effects (blur, background replacement, generative backgrounds, flip/rotate) for react-native-webrtc, packaged as a managed-Expo-friendly Expo Module. Working on web, Android, and iOS. Active development.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -331,6 +331,7 @@
|
|
|
331
331
|
"./composites/clouds": {
|
|
332
332
|
"types": "./dist/catalog/composites/clouds/clouds.d.ts",
|
|
333
333
|
"react-native": "./catalog/composites/clouds/clouds.ts",
|
|
334
|
+
"browser": "./dist/catalog/composites/clouds/clouds.web.js",
|
|
334
335
|
"import": "./dist/catalog/composites/clouds/clouds.js",
|
|
335
336
|
"default": "./dist/catalog/composites/clouds/clouds.js"
|
|
336
337
|
},
|
|
@@ -565,7 +566,8 @@
|
|
|
565
566
|
"lint:fix": "biome check --write",
|
|
566
567
|
"format": "biome format --write .",
|
|
567
568
|
"test": "bun test",
|
|
568
|
-
"check": "bun run lint:fix && bun run typecheck && bun run typecheck:test && bun run typecheck:demo && bun run check:react-compiler && bun run check:plugin && bun run build && (cd demo && bun run build) && bun run test && bun run check:knip && bun run check:package && bun run check:kotlin && bun run check:swift",
|
|
569
|
+
"check": "bun run lint:fix && bun run typecheck && bun run typecheck:test && bun run typecheck:demo && bun run check:react-compiler && bun run check:assets && bun run check:plugin && bun run build && (cd demo && bun run build) && bun run test && bun run check:knip && bun run check:package && bun run check:kotlin && bun run check:swift",
|
|
570
|
+
"check:assets": "bun run scripts/check-book-assets.ts",
|
|
569
571
|
"check:package": "publint --strict",
|
|
570
572
|
"check:knip": "knip",
|
|
571
573
|
"check:react-compiler": "eslint src/components 'catalog/composites/**/*.controls.tsx' 'catalog/shaders/**/*.form.tsx'",
|