@cueframe/kernel 0.0.1 → 0.1.0

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.
Files changed (122) hide show
  1. package/dist/_members/account-model/testing/conversationStoreContract.d.ts +1 -1
  2. package/dist/_members/authoring/providers/resourceApi.d.ts +1 -1
  3. package/dist/_members/authoring/transpileComponent.d.ts +1 -1
  4. package/dist/_members/cloud-import/CloudImportService.d.ts +35 -0
  5. package/dist/_members/cloud-import/ImportProvider.d.ts +73 -0
  6. package/dist/_members/cloud-import/MediaItemPreprocessor.d.ts +27 -0
  7. package/dist/_members/cloud-import/chunk-XKO6ZSWI.js +162 -0
  8. package/dist/_members/cloud-import/chunk-XKO6ZSWI.js.map +1 -0
  9. package/dist/_members/cloud-import/cloudConfig.d.ts +23 -0
  10. package/dist/_members/cloud-import/index.d.ts +9 -0
  11. package/dist/_members/cloud-import/index.js +241 -0
  12. package/dist/_members/cloud-import/index.js.map +1 -0
  13. package/dist/_members/cloud-import/multipartUpload.d.ts +12 -0
  14. package/dist/_members/cloud-import/multipartUpload.js +7 -0
  15. package/dist/_members/cloud-import/multipartUpload.js.map +1 -0
  16. package/dist/_members/composition/ops/compositionOps.d.ts +1 -1
  17. package/dist/_members/composition/ops/types.d.ts +1 -1
  18. package/dist/_members/composition/timeline/placement.d.ts +1 -1
  19. package/dist/_members/composition/validators/composition.d.ts +1 -1
  20. package/dist/_members/composition-ops/index.d.ts +1 -1
  21. package/dist/_members/composition-ops/opRecorder.d.ts +1 -1
  22. package/dist/_members/convex-api/api.d.ts +5 -0
  23. package/dist/_members/convex-api/dataModel.d.ts +6 -0
  24. package/dist/_members/core/render/exportSettings.d.ts +1 -1
  25. package/dist/_members/mcp/curation.d.ts +1 -1
  26. package/dist/_members/plane/conformance.d.ts +1 -1
  27. package/dist/_members/render-harness/localRender.d.ts +1 -1
  28. package/dist/animate.js +828 -79187
  29. package/dist/authoring/build-tools.js +8 -11
  30. package/dist/authoring/context.js +5 -5
  31. package/dist/authoring/models.js +1 -2
  32. package/dist/authoring/prompts.js +1 -1
  33. package/dist/authoring/tools.js +7 -7
  34. package/dist/authoring/transpileComponent.js +3 -2220
  35. package/dist/authoring.js +27 -29
  36. package/dist/brand-derivation.js +1 -1
  37. package/dist/chunk-6IU2UQI5.js +107 -0
  38. package/dist/{chunk-N67PDTKQ.js → chunk-ABL557OT.js} +1 -1
  39. package/dist/{chunk-DSNG6WLU.js → chunk-AYVJXDLB.js} +1 -4
  40. package/dist/{chunk-G3PBH53P.js → chunk-COYMZ76S.js} +1 -1
  41. package/dist/chunk-DSMLHYJ4.js +82 -0
  42. package/dist/{chunk-BRKJKB33.js → chunk-FYZVH3MC.js} +1 -1
  43. package/dist/{chunk-MVEE6HEC.js → chunk-GA23TRNR.js} +5 -7
  44. package/dist/{chunk-OIRUO5P7.js → chunk-GEA7E2FL.js} +1 -1
  45. package/dist/chunk-HCCBDJLW.js +68 -0
  46. package/dist/{chunk-QLAQHR3L.js → chunk-IBYQG46O.js} +1 -1
  47. package/dist/chunk-JQMPHKLU.js +126 -0
  48. package/dist/{chunk-ELLSET2N.js → chunk-LM4WDUQJ.js} +3 -6
  49. package/dist/{chunk-UEI3NLNK.js → chunk-MHOQTPOB.js} +1 -4
  50. package/dist/{chunk-ATAF24QG.js → chunk-MXFAADCQ.js} +1 -1
  51. package/dist/{chunk-TULRCY6U.js → chunk-NFEGPWGS.js} +1 -1
  52. package/dist/{chunk-MC5DLSEV.js → chunk-ODL7GQJG.js} +14 -14
  53. package/dist/{chunk-WZTTZHNR.js → chunk-OLFOPQCA.js} +12 -9
  54. package/dist/{chunk-P43IE4WB.js → chunk-P727GZVO.js} +2 -4
  55. package/dist/{chunk-S3P5BFFL.js → chunk-PMY24FUD.js} +2 -4
  56. package/dist/chunk-RF7U3SCL.js +606 -0
  57. package/dist/{chunk-JD77Y2WM.js → chunk-SW336CJP.js} +1 -4
  58. package/dist/{chunk-M3I5LMAB.js → chunk-UY4SWJVE.js} +1 -1
  59. package/dist/{chunk-52AHXNKM.js → chunk-VOO5FQSS.js} +5 -5
  60. package/dist/{chunk-NV4I6GJV.js → chunk-XWKZB5U5.js} +4 -4
  61. package/dist/{chunk-6QJ3V3VS.js → chunk-YX2GSJK7.js} +1 -1
  62. package/dist/{chunk-5I7VDCAC.js → chunk-ZB3C3HM7.js} +1 -1
  63. package/dist/chunk-ZT7MHRQU.js +104 -0
  64. package/dist/cloud-import/multipart.d.ts +1 -0
  65. package/dist/cloud-import/multipart.js +8 -0
  66. package/dist/cloud-import.d.ts +1 -0
  67. package/dist/cloud-import.js +234 -0
  68. package/dist/compose/renderer.js +18 -21
  69. package/dist/compose.js +18 -21
  70. package/dist/composition/graphics-plan.js +3 -3
  71. package/dist/composition/ops.js +4 -4
  72. package/dist/composition/primitive-catalog.js +1 -1
  73. package/dist/composition/projection.js +3 -3
  74. package/dist/composition/validators.js +2 -2
  75. package/dist/composition-ops.js +12 -12
  76. package/dist/composition.js +5 -5
  77. package/dist/{context-CEAKQ5T7.js → context-OKX3HHFS.js} +5 -5
  78. package/dist/convex-api/dataModel.d.ts +1 -0
  79. package/dist/convex-api/dataModel.js +0 -0
  80. package/dist/convex-api.d.ts +1 -0
  81. package/dist/convex-api.js +8 -0
  82. package/dist/core/render.js +2 -2
  83. package/dist/core.js +2 -2
  84. package/dist/mcp/adapter.js +1 -5
  85. package/dist/mcp/server.js +1 -2
  86. package/dist/mcp.js +2 -95
  87. package/dist/media-model/media-kind.js +9 -98
  88. package/dist/nle-export/xml.js +5 -22799
  89. package/dist/nle-export.js +18 -21
  90. package/dist/primitives/backgrounds.js +2 -3
  91. package/dist/primitives/captions.js +4 -243
  92. package/dist/primitives/effects.js +2 -3
  93. package/dist/primitives/hero-text.js +2 -3
  94. package/dist/primitives/layouts.js +2 -3
  95. package/dist/primitives/lib/index.js +8 -10
  96. package/dist/primitives/lib/preview.js +1 -2
  97. package/dist/primitives/lib/schema.js +1 -2
  98. package/dist/primitives/lib/text/fitText.js +1 -2
  99. package/dist/primitives/lib.js +8 -10
  100. package/dist/primitives/scenes.js +1 -2
  101. package/dist/primitives/text.js +2 -3
  102. package/dist/primitives/ui-blocks.js +4 -5
  103. package/dist/primitives.js +19 -21
  104. package/package.json +123 -13
  105. package/dist/TextureLoader-UQOFUSAP.js +0 -422
  106. package/dist/VideoTexture-AQWSPIJG.js +0 -62
  107. package/dist/chunk-7GISRVON.js +0 -14176
  108. package/dist/chunk-DIBOJJMU.js +0 -16838
  109. package/dist/chunk-EAUSEGB7.js +0 -420
  110. package/dist/chunk-FUWJOVVK.js +0 -3633
  111. package/dist/chunk-G75E7YA4.js +0 -11883
  112. package/dist/chunk-JCZQT7K3.js +0 -3266
  113. package/dist/chunk-KF5ETMKB.js +0 -544
  114. package/dist/chunk-NDKERSXY.js +0 -1296
  115. package/dist/chunk-V43Y7IE4.js +0 -3621
  116. package/dist/chunk-VIVQHIGZ.js +0 -4319
  117. package/dist/chunk-YA3OR2KK.js +0 -249
  118. package/dist/hls-HD4C5G6W.js +0 -33000
  119. package/dist/token-RGFIT24D.js +0 -69
  120. package/dist/token-util-GPLSGYVO.js +0 -5
  121. package/dist/vision_bundle-5Y376MAR.js +0 -4084
  122. package/dist/{chunk-6CMVBTTP.js → chunk-YIOY2XEO.js} +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cueframe/kernel",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "type": "module",
5
5
  "description": "PILOT (two-repo split §3). Publish-only aggregate: bundles the isomorphic kernel packages into ONE npm artifact so the private repo consumes 4 dependencies instead of 20. Members stay separate workspace packages — this only changes what SHIPS. Currently carries errors + foundation; the remaining nine land once the mechanism is proven.",
6
6
  "files": [
@@ -15,30 +15,55 @@
15
15
  "devDependencies": {
16
16
  "tsup": "^8.3.5",
17
17
  "typescript": "^5.9.3",
18
- "@cueframe/errors": "0.1.0",
18
+ "@cueframe/cloud-import": "0.1.0",
19
+ "@cueframe/authoring": "0.1.0",
20
+ "@cueframe/animate": "0.1.0",
19
21
  "@cueframe/brand-derivation": "0.1.0",
20
- "@cueframe/core": "0.1.0",
21
22
  "@cueframe/account-model": "0.1.0",
22
- "@cueframe/media-model": "0.1.0",
23
- "@cueframe/composition": "0.1.0",
24
- "@cueframe/foundation": "0.1.0",
23
+ "@cueframe/errors": "0.1.0",
25
24
  "@cueframe/composition-ops": "0.1.0",
25
+ "@cueframe/composition": "0.1.0",
26
+ "@cueframe/convex-api": "0.1.0",
27
+ "@cueframe/mcp": "0.1.0",
26
28
  "@cueframe/perception": "0.1.0",
27
- "@cueframe/nle-export": "0.1.0",
28
- "@cueframe/plane": "0.1.0",
29
- "@cueframe/animate": "0.1.0",
30
- "@cueframe/primitives": "0.1.0",
31
29
  "@cueframe/compose": "0.1.0",
30
+ "@cueframe/media-model": "0.1.0",
31
+ "@cueframe/primitives": "0.1.0",
32
+ "@cueframe/plane": "0.1.0",
32
33
  "@cueframe/render-harness": "0.1.0",
33
- "@cueframe/authoring": "0.1.0",
34
- "@cueframe/mcp": "0.1.0"
34
+ "@cueframe/nle-export": "0.1.0",
35
+ "@cueframe/foundation": "0.1.0",
36
+ "@cueframe/core": "0.1.0"
35
37
  },
36
38
  "peerDependencies": {
37
39
  "convex": ">=1.42",
38
40
  "convex-helpers": "^0.1.114",
39
41
  "react": "^19.0.0",
40
42
  "react-dom": "^19.0.0",
41
- "remotion": "4.0.429"
43
+ "remotion": "4.0.429",
44
+ "apca-w3": "^0.1.9",
45
+ "culori": "^4.0.2",
46
+ "xmlbuilder2": "^3.1.1",
47
+ "@remotion/transitions": "4.0.429",
48
+ "@remotion/player": "4.0.429",
49
+ "@remotion/captions": "4.0.429",
50
+ "@remotion/layout-utils": "4.0.429",
51
+ "zod-to-json-schema": "^3.23.0",
52
+ "@react-three/drei": "^10.7.7",
53
+ "@react-three/fiber": "^9.5.0",
54
+ "@remotion/paths": "4.0.429",
55
+ "@remotion/three": "4.0.429",
56
+ "d3-force": "^3.0.0",
57
+ "d3-hierarchy": "^3.1.2",
58
+ "three": "^0.183.2",
59
+ "@modelcontextprotocol/sdk": "^1.11.0",
60
+ "ai": "^7.0.66",
61
+ "@ai-sdk/anthropic": "^4.0.39",
62
+ "@ai-sdk/openai": "^4.0.42",
63
+ "esbuild": "^0.25.2",
64
+ "@uppy/aws-s3": "^5.1.0",
65
+ "@uppy/core": "^5.2.0",
66
+ "@uppy/react": "^5.2.0"
42
67
  },
43
68
  "exports": {
44
69
  "./errors": {
@@ -458,6 +483,22 @@
458
483
  "./authoring/composer": {
459
484
  "types": "./dist/authoring/composer.d.ts",
460
485
  "default": "./dist/authoring/composer.js"
486
+ },
487
+ "./cloud-import": {
488
+ "types": "./dist/cloud-import.d.ts",
489
+ "default": "./dist/cloud-import.js"
490
+ },
491
+ "./cloud-import/multipart": {
492
+ "types": "./dist/cloud-import/multipart.d.ts",
493
+ "default": "./dist/cloud-import/multipart.js"
494
+ },
495
+ "./convex-api": {
496
+ "types": "./dist/convex-api.d.ts",
497
+ "default": "./dist/convex-api.js"
498
+ },
499
+ "./convex-api/dataModel": {
500
+ "types": "./dist/convex-api/dataModel.d.ts",
501
+ "default": "./dist/convex-api/dataModel.js"
461
502
  }
462
503
  },
463
504
  "peerDependenciesMeta": {
@@ -475,6 +516,75 @@
475
516
  },
476
517
  "convex-helpers": {
477
518
  "optional": true
519
+ },
520
+ "apca-w3": {
521
+ "optional": true
522
+ },
523
+ "culori": {
524
+ "optional": true
525
+ },
526
+ "xmlbuilder2": {
527
+ "optional": true
528
+ },
529
+ "@remotion/transitions": {
530
+ "optional": true
531
+ },
532
+ "@remotion/player": {
533
+ "optional": true
534
+ },
535
+ "@remotion/captions": {
536
+ "optional": true
537
+ },
538
+ "@remotion/layout-utils": {
539
+ "optional": true
540
+ },
541
+ "zod-to-json-schema": {
542
+ "optional": true
543
+ },
544
+ "@react-three/drei": {
545
+ "optional": true
546
+ },
547
+ "@react-three/fiber": {
548
+ "optional": true
549
+ },
550
+ "@remotion/paths": {
551
+ "optional": true
552
+ },
553
+ "@remotion/three": {
554
+ "optional": true
555
+ },
556
+ "d3-force": {
557
+ "optional": true
558
+ },
559
+ "d3-hierarchy": {
560
+ "optional": true
561
+ },
562
+ "three": {
563
+ "optional": true
564
+ },
565
+ "@modelcontextprotocol/sdk": {
566
+ "optional": true
567
+ },
568
+ "ai": {
569
+ "optional": true
570
+ },
571
+ "@ai-sdk/anthropic": {
572
+ "optional": true
573
+ },
574
+ "@ai-sdk/openai": {
575
+ "optional": true
576
+ },
577
+ "esbuild": {
578
+ "optional": true
579
+ },
580
+ "@uppy/aws-s3": {
581
+ "optional": true
582
+ },
583
+ "@uppy/core": {
584
+ "optional": true
585
+ },
586
+ "@uppy/react": {
587
+ "optional": true
478
588
  }
479
589
  },
480
590
  "license": "AGPL-3.0-only",
@@ -1,422 +0,0 @@
1
- import {
2
- Texture,
3
- createElementNS
4
- } from "./chunk-JCZQT7K3.js";
5
- import "./chunk-2ESYSVXG.js";
6
-
7
- // ../../node_modules/.pnpm/three@0.183.2/node_modules/three/src/loaders/Cache.js
8
- var Cache = {
9
- /**
10
- * Whether caching is enabled or not.
11
- *
12
- * @static
13
- * @type {boolean}
14
- * @default false
15
- */
16
- enabled: false,
17
- /**
18
- * A dictionary that holds cached files.
19
- *
20
- * @static
21
- * @type {Object<string,Object>}
22
- */
23
- files: {},
24
- /**
25
- * Adds a cache entry with a key to reference the file. If this key already
26
- * holds a file, it is overwritten.
27
- *
28
- * @static
29
- * @param {string} key - The key to reference the cached file.
30
- * @param {Object} file - The file to be cached.
31
- */
32
- add: function(key, file) {
33
- if (this.enabled === false) return;
34
- if (isBlobURL(key)) return;
35
- this.files[key] = file;
36
- },
37
- /**
38
- * Gets the cached value for the given key.
39
- *
40
- * @static
41
- * @param {string} key - The key to reference the cached file.
42
- * @return {Object|undefined} The cached file. If the key does not exist `undefined` is returned.
43
- */
44
- get: function(key) {
45
- if (this.enabled === false) return;
46
- if (isBlobURL(key)) return;
47
- return this.files[key];
48
- },
49
- /**
50
- * Removes the cached file associated with the given key.
51
- *
52
- * @static
53
- * @param {string} key - The key to reference the cached file.
54
- */
55
- remove: function(key) {
56
- delete this.files[key];
57
- },
58
- /**
59
- * Remove all values from the cache.
60
- *
61
- * @static
62
- */
63
- clear: function() {
64
- this.files = {};
65
- }
66
- };
67
- function isBlobURL(key) {
68
- try {
69
- const urlString = key.slice(key.indexOf(":") + 1);
70
- const url = new URL(urlString);
71
- return url.protocol === "blob:";
72
- } catch (e) {
73
- return false;
74
- }
75
- }
76
-
77
- // ../../node_modules/.pnpm/three@0.183.2/node_modules/three/src/loaders/LoadingManager.js
78
- var LoadingManager = class {
79
- /**
80
- * Constructs a new loading manager.
81
- *
82
- * @param {Function} [onLoad] - Executes when all items have been loaded.
83
- * @param {Function} [onProgress] - Executes when single items have been loaded.
84
- * @param {Function} [onError] - Executes when an error occurs.
85
- */
86
- constructor(onLoad, onProgress, onError) {
87
- const scope = this;
88
- let isLoading = false;
89
- let itemsLoaded = 0;
90
- let itemsTotal = 0;
91
- let urlModifier = void 0;
92
- const handlers = [];
93
- this.onStart = void 0;
94
- this.onLoad = onLoad;
95
- this.onProgress = onProgress;
96
- this.onError = onError;
97
- this._abortController = null;
98
- this.itemStart = function(url) {
99
- itemsTotal++;
100
- if (isLoading === false) {
101
- if (scope.onStart !== void 0) {
102
- scope.onStart(url, itemsLoaded, itemsTotal);
103
- }
104
- }
105
- isLoading = true;
106
- };
107
- this.itemEnd = function(url) {
108
- itemsLoaded++;
109
- if (scope.onProgress !== void 0) {
110
- scope.onProgress(url, itemsLoaded, itemsTotal);
111
- }
112
- if (itemsLoaded === itemsTotal) {
113
- isLoading = false;
114
- if (scope.onLoad !== void 0) {
115
- scope.onLoad();
116
- }
117
- }
118
- };
119
- this.itemError = function(url) {
120
- if (scope.onError !== void 0) {
121
- scope.onError(url);
122
- }
123
- };
124
- this.resolveURL = function(url) {
125
- if (urlModifier) {
126
- return urlModifier(url);
127
- }
128
- return url;
129
- };
130
- this.setURLModifier = function(transform) {
131
- urlModifier = transform;
132
- return this;
133
- };
134
- this.addHandler = function(regex, loader) {
135
- handlers.push(regex, loader);
136
- return this;
137
- };
138
- this.removeHandler = function(regex) {
139
- const index = handlers.indexOf(regex);
140
- if (index !== -1) {
141
- handlers.splice(index, 2);
142
- }
143
- return this;
144
- };
145
- this.getHandler = function(file) {
146
- for (let i = 0, l = handlers.length; i < l; i += 2) {
147
- const regex = handlers[i];
148
- const loader = handlers[i + 1];
149
- if (regex.global) regex.lastIndex = 0;
150
- if (regex.test(file)) {
151
- return loader;
152
- }
153
- }
154
- return null;
155
- };
156
- this.abort = function() {
157
- this.abortController.abort();
158
- this._abortController = null;
159
- return this;
160
- };
161
- }
162
- // TODO: Revert this back to a single member variable once this issue has been fixed
163
- // https://github.com/cloudflare/workerd/issues/3657
164
- /**
165
- * Used for aborting ongoing requests in loaders using this manager.
166
- *
167
- * @type {AbortController}
168
- */
169
- get abortController() {
170
- if (!this._abortController) {
171
- this._abortController = new AbortController();
172
- }
173
- return this._abortController;
174
- }
175
- };
176
- var DefaultLoadingManager = /* @__PURE__ */ new LoadingManager();
177
-
178
- // ../../node_modules/.pnpm/three@0.183.2/node_modules/three/src/loaders/Loader.js
179
- var Loader = class {
180
- /**
181
- * Constructs a new loader.
182
- *
183
- * @param {LoadingManager} [manager] - The loading manager.
184
- */
185
- constructor(manager) {
186
- this.manager = manager !== void 0 ? manager : DefaultLoadingManager;
187
- this.crossOrigin = "anonymous";
188
- this.withCredentials = false;
189
- this.path = "";
190
- this.resourcePath = "";
191
- this.requestHeader = {};
192
- if (typeof __THREE_DEVTOOLS__ !== "undefined") {
193
- __THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe", { detail: this }));
194
- }
195
- }
196
- /**
197
- * This method needs to be implemented by all concrete loaders. It holds the
198
- * logic for loading assets from the backend.
199
- *
200
- * @abstract
201
- * @param {string} url - The path/URL of the file to be loaded.
202
- * @param {Function} onLoad - Executed when the loading process has been finished.
203
- * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
204
- * @param {onErrorCallback} [onError] - Executed when errors occur.
205
- */
206
- load() {
207
- }
208
- /**
209
- * A async version of {@link Loader#load}.
210
- *
211
- * @param {string} url - The path/URL of the file to be loaded.
212
- * @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
213
- * @return {Promise} A Promise that resolves when the asset has been loaded.
214
- */
215
- loadAsync(url, onProgress) {
216
- const scope = this;
217
- return new Promise(function(resolve, reject) {
218
- scope.load(url, resolve, onProgress, reject);
219
- });
220
- }
221
- /**
222
- * This method needs to be implemented by all concrete loaders. It holds the
223
- * logic for parsing the asset into three.js entities.
224
- *
225
- * @abstract
226
- * @param {any} data - The data to parse.
227
- */
228
- parse() {
229
- }
230
- /**
231
- * Sets the `crossOrigin` String to implement CORS for loading the URL
232
- * from a different domain that allows CORS.
233
- *
234
- * @param {string} crossOrigin - The `crossOrigin` value.
235
- * @return {Loader} A reference to this instance.
236
- */
237
- setCrossOrigin(crossOrigin) {
238
- this.crossOrigin = crossOrigin;
239
- return this;
240
- }
241
- /**
242
- * Whether the XMLHttpRequest uses credentials such as cookies, authorization
243
- * headers or TLS client certificates, see [XMLHttpRequest.withCredentials](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials).
244
- *
245
- * Note: This setting has no effect if you are loading files locally or from the same domain.
246
- *
247
- * @param {boolean} value - The `withCredentials` value.
248
- * @return {Loader} A reference to this instance.
249
- */
250
- setWithCredentials(value) {
251
- this.withCredentials = value;
252
- return this;
253
- }
254
- /**
255
- * Sets the base path for the asset.
256
- *
257
- * @param {string} path - The base path.
258
- * @return {Loader} A reference to this instance.
259
- */
260
- setPath(path) {
261
- this.path = path;
262
- return this;
263
- }
264
- /**
265
- * Sets the base path for dependent resources like textures.
266
- *
267
- * @param {string} resourcePath - The resource path.
268
- * @return {Loader} A reference to this instance.
269
- */
270
- setResourcePath(resourcePath) {
271
- this.resourcePath = resourcePath;
272
- return this;
273
- }
274
- /**
275
- * Sets the given request header.
276
- *
277
- * @param {Object} requestHeader - A [request header](https://developer.mozilla.org/en-US/docs/Glossary/Request_header)
278
- * for configuring the HTTP request.
279
- * @return {Loader} A reference to this instance.
280
- */
281
- setRequestHeader(requestHeader) {
282
- this.requestHeader = requestHeader;
283
- return this;
284
- }
285
- /**
286
- * This method can be implemented in loaders for aborting ongoing requests.
287
- *
288
- * @abstract
289
- * @return {Loader} A reference to this instance.
290
- */
291
- abort() {
292
- return this;
293
- }
294
- };
295
- Loader.DEFAULT_MATERIAL_NAME = "__DEFAULT";
296
-
297
- // ../../node_modules/.pnpm/three@0.183.2/node_modules/three/src/loaders/ImageLoader.js
298
- var _loading = /* @__PURE__ */ new WeakMap();
299
- var ImageLoader = class extends Loader {
300
- /**
301
- * Constructs a new image loader.
302
- *
303
- * @param {LoadingManager} [manager] - The loading manager.
304
- */
305
- constructor(manager) {
306
- super(manager);
307
- }
308
- /**
309
- * Starts loading from the given URL and passes the loaded image
310
- * to the `onLoad()` callback. The method also returns a new `Image` object which can
311
- * directly be used for texture creation. If you do it this way, the texture
312
- * may pop up in your scene once the respective loading process is finished.
313
- *
314
- * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.
315
- * @param {function(Image)} onLoad - Executed when the loading process has been finished.
316
- * @param {onProgressCallback} onProgress - Unsupported in this loader.
317
- * @param {onErrorCallback} onError - Executed when errors occur.
318
- * @return {Image} The image.
319
- */
320
- load(url, onLoad, onProgress, onError) {
321
- if (this.path !== void 0) url = this.path + url;
322
- url = this.manager.resolveURL(url);
323
- const scope = this;
324
- const cached = Cache.get(`image:${url}`);
325
- if (cached !== void 0) {
326
- if (cached.complete === true) {
327
- scope.manager.itemStart(url);
328
- setTimeout(function() {
329
- if (onLoad) onLoad(cached);
330
- scope.manager.itemEnd(url);
331
- }, 0);
332
- } else {
333
- let arr = _loading.get(cached);
334
- if (arr === void 0) {
335
- arr = [];
336
- _loading.set(cached, arr);
337
- }
338
- arr.push({ onLoad, onError });
339
- }
340
- return cached;
341
- }
342
- const image = createElementNS("img");
343
- function onImageLoad() {
344
- removeEventListeners();
345
- if (onLoad) onLoad(this);
346
- const callbacks = _loading.get(this) || [];
347
- for (let i = 0; i < callbacks.length; i++) {
348
- const callback = callbacks[i];
349
- if (callback.onLoad) callback.onLoad(this);
350
- }
351
- _loading.delete(this);
352
- scope.manager.itemEnd(url);
353
- }
354
- function onImageError(event) {
355
- removeEventListeners();
356
- if (onError) onError(event);
357
- Cache.remove(`image:${url}`);
358
- const callbacks = _loading.get(this) || [];
359
- for (let i = 0; i < callbacks.length; i++) {
360
- const callback = callbacks[i];
361
- if (callback.onError) callback.onError(event);
362
- }
363
- _loading.delete(this);
364
- scope.manager.itemError(url);
365
- scope.manager.itemEnd(url);
366
- }
367
- function removeEventListeners() {
368
- image.removeEventListener("load", onImageLoad, false);
369
- image.removeEventListener("error", onImageError, false);
370
- }
371
- image.addEventListener("load", onImageLoad, false);
372
- image.addEventListener("error", onImageError, false);
373
- if (url.slice(0, 5) !== "data:") {
374
- if (this.crossOrigin !== void 0) image.crossOrigin = this.crossOrigin;
375
- }
376
- Cache.add(`image:${url}`, image);
377
- scope.manager.itemStart(url);
378
- image.src = url;
379
- return image;
380
- }
381
- };
382
-
383
- // ../../node_modules/.pnpm/three@0.183.2/node_modules/three/src/loaders/TextureLoader.js
384
- var TextureLoader = class extends Loader {
385
- /**
386
- * Constructs a new texture loader.
387
- *
388
- * @param {LoadingManager} [manager] - The loading manager.
389
- */
390
- constructor(manager) {
391
- super(manager);
392
- }
393
- /**
394
- * Starts loading from the given URL and pass the fully loaded texture
395
- * to the `onLoad()` callback. The method also returns a new texture object which can
396
- * directly be used for material creation. If you do it this way, the texture
397
- * may pop up in your scene once the respective loading process is finished.
398
- *
399
- * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.
400
- * @param {function(Texture)} onLoad - Executed when the loading process has been finished.
401
- * @param {onProgressCallback} onProgress - Unsupported in this loader.
402
- * @param {onErrorCallback} onError - Executed when errors occur.
403
- * @return {Texture} The texture.
404
- */
405
- load(url, onLoad, onProgress, onError) {
406
- const texture = new Texture();
407
- const loader = new ImageLoader(this.manager);
408
- loader.setCrossOrigin(this.crossOrigin);
409
- loader.setPath(this.path);
410
- loader.load(url, function(image) {
411
- texture.image = image;
412
- texture.needsUpdate = true;
413
- if (onLoad !== void 0) {
414
- onLoad(texture);
415
- }
416
- }, onProgress, onError);
417
- return texture;
418
- }
419
- };
420
- export {
421
- TextureLoader
422
- };
@@ -1,62 +0,0 @@
1
- import {
2
- LinearFilter,
3
- Texture
4
- } from "./chunk-JCZQT7K3.js";
5
- import "./chunk-2ESYSVXG.js";
6
-
7
- // ../../node_modules/.pnpm/three@0.183.2/node_modules/three/src/textures/VideoTexture.js
8
- var VideoTexture = class extends Texture {
9
- /**
10
- * Constructs a new video texture.
11
- *
12
- * @param {HTMLVideoElement} video - The video element to use as a data source for the texture.
13
- * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.
14
- * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.
15
- * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.
16
- * @param {number} [magFilter=LinearFilter] - The mag filter value.
17
- * @param {number} [minFilter=LinearFilter] - The min filter value.
18
- * @param {number} [format=RGBAFormat] - The texture format.
19
- * @param {number} [type=UnsignedByteType] - The texture type.
20
- * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
21
- */
22
- constructor(video, mapping, wrapS, wrapT, magFilter = LinearFilter, minFilter = LinearFilter, format, type, anisotropy) {
23
- super(video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy);
24
- this.isVideoTexture = true;
25
- this.generateMipmaps = false;
26
- this._requestVideoFrameCallbackId = 0;
27
- const scope = this;
28
- function updateVideo() {
29
- scope.needsUpdate = true;
30
- scope._requestVideoFrameCallbackId = video.requestVideoFrameCallback(updateVideo);
31
- }
32
- if ("requestVideoFrameCallback" in video) {
33
- this._requestVideoFrameCallbackId = video.requestVideoFrameCallback(updateVideo);
34
- }
35
- }
36
- clone() {
37
- return new this.constructor(this.image).copy(this);
38
- }
39
- /**
40
- * This method is called automatically by the renderer and sets {@link Texture#needsUpdate}
41
- * to `true` every time a new frame is available.
42
- *
43
- * Only relevant if `requestVideoFrameCallback` is not supported in the browser.
44
- */
45
- update() {
46
- const video = this.image;
47
- const hasVideoFrameCallback = "requestVideoFrameCallback" in video;
48
- if (hasVideoFrameCallback === false && video.readyState >= video.HAVE_CURRENT_DATA) {
49
- this.needsUpdate = true;
50
- }
51
- }
52
- dispose() {
53
- if (this._requestVideoFrameCallbackId !== 0) {
54
- this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId);
55
- this._requestVideoFrameCallbackId = 0;
56
- }
57
- super.dispose();
58
- }
59
- };
60
- export {
61
- VideoTexture
62
- };