@zephyr3d/editor 0.3.5 → 0.3.7

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 (48) hide show
  1. package/dist/assets/{index-DlnbO59X.js → index-ySiLtSxz.js} +2 -2
  2. package/dist/assistant/zephyr-types-index.json +14215 -7892
  3. package/dist/index.html +1 -1
  4. package/dist/modules/zephyr3d_backend-webgl.js.map +1 -1
  5. package/dist/modules/zephyr3d_backend-webgpu.js.map +1 -1
  6. package/dist/modules/zephyr3d_base.js +152 -152
  7. package/dist/modules/zephyr3d_base.js.map +1 -1
  8. package/dist/modules/zephyr3d_imgui.js.map +1 -1
  9. package/dist/modules/zephyr3d_loaders.js +6 -6
  10. package/dist/modules/zephyr3d_loaders.js.map +1 -1
  11. package/dist/modules/zephyr3d_scene.js +2538 -348
  12. package/dist/modules/zephyr3d_scene.js.map +1 -1
  13. package/dist/vendor/zephyr3d/backend-webgl/dist/index.js.map +1 -1
  14. package/dist/vendor/zephyr3d/backend-webgpu/dist/index.js.map +1 -1
  15. package/dist/vendor/zephyr3d/base/dist/vfs/common.js +152 -152
  16. package/dist/vendor/zephyr3d/base/dist/vfs/common.js.map +1 -1
  17. package/dist/vendor/zephyr3d/imgui/dist/index.d.ts +7 -0
  18. package/dist/vendor/zephyr3d/imgui/dist/index.js.map +1 -1
  19. package/dist/vendor/zephyr3d/loaders/dist/gltf/gltf_importer.js +6 -6
  20. package/dist/vendor/zephyr3d/loaders/dist/gltf/gltf_importer.js.map +1 -1
  21. package/dist/vendor/zephyr3d/scene/dist/animation/animation.js +87 -0
  22. package/dist/vendor/zephyr3d/scene/dist/animation/animation.js.map +1 -1
  23. package/dist/vendor/zephyr3d/scene/dist/animation/animationcontroller.js +503 -0
  24. package/dist/vendor/zephyr3d/scene/dist/animation/animationcontroller.js.map +1 -0
  25. package/dist/vendor/zephyr3d/scene/dist/animation/animationset.js +782 -156
  26. package/dist/vendor/zephyr3d/scene/dist/animation/animationset.js.map +1 -1
  27. package/dist/vendor/zephyr3d/scene/dist/animation/animationtimeline.js +974 -0
  28. package/dist/vendor/zephyr3d/scene/dist/animation/animationtimeline.js.map +1 -0
  29. package/dist/vendor/zephyr3d/scene/dist/animation/joint_dynamics/convex_collider.js +320 -0
  30. package/dist/vendor/zephyr3d/scene/dist/animation/joint_dynamics/convex_collider.js.map +1 -0
  31. package/dist/vendor/zephyr3d/scene/dist/app/scriptregistry.js +130 -125
  32. package/dist/vendor/zephyr3d/scene/dist/app/scriptregistry.js.map +1 -1
  33. package/dist/vendor/zephyr3d/scene/dist/asset/model.js +64 -63
  34. package/dist/vendor/zephyr3d/scene/dist/asset/model.js.map +1 -1
  35. package/dist/vendor/zephyr3d/scene/dist/index.d.ts +1270 -9
  36. package/dist/vendor/zephyr3d/scene/dist/index.js +3 -1
  37. package/dist/vendor/zephyr3d/scene/dist/index.js.map +1 -1
  38. package/dist/vendor/zephyr3d/scene/dist/material/mixins/lit.js +7 -3
  39. package/dist/vendor/zephyr3d/scene/dist/material/mixins/lit.js.map +1 -1
  40. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/manager.js +1 -0
  41. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/manager.js.map +1 -1
  42. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/animation.js +4 -3
  43. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/animation.js.map +1 -1
  44. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/camera.js +1 -1
  45. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/camera.js.map +1 -1
  46. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/node.js +3 -2
  47. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/node.js.map +1 -1
  48. package/package.json +8 -8
@@ -9920,35 +9920,35 @@ const mimeTypes = {
9920
9920
  '.zprefab': 'application/vnd.zephyr3d.prefab+json',
9921
9921
  '.zabc': 'application/vnd.zephyr3d.alembic-cache+json'
9922
9922
  };
9923
- /**
9924
- * Path utilities.
9925
- *
9926
- * Provides POSIX-like path manipulation helpers (pure string operations),
9927
- * including normalization, joining, dirname/basename/extname extraction,
9928
- * absolute-path detection, and relative path computation.
9929
- *
9930
- * Notes:
9931
- * - Uses "/" as the separator (web/URL or POSIX-like paths).
9932
- * - All methods are pure and do not touch a real filesystem.
9933
- * - `normalize` collapses ".", "..", and redundant slashes.
9934
- *
9935
- * @public
9923
+ /**
9924
+ * Path utilities.
9925
+ *
9926
+ * Provides POSIX-like path manipulation helpers (pure string operations),
9927
+ * including normalization, joining, dirname/basename/extname extraction,
9928
+ * absolute-path detection, and relative path computation.
9929
+ *
9930
+ * Notes:
9931
+ * - Uses "/" as the separator (web/URL or POSIX-like paths).
9932
+ * - All methods are pure and do not touch a real filesystem.
9933
+ * - `normalize` collapses ".", "..", and redundant slashes.
9934
+ *
9935
+ * @public
9936
9936
  */ class PathUtils {
9937
- /**
9938
- * Normalizes a path by collapsing redundant slashes, removing "." segments,
9939
- * and resolving ".." segments.
9940
- *
9941
- * Rules:
9942
- * - Multiple consecutive "/" are collapsed into a single "/".
9943
- * - "." segments are removed.
9944
- * - ".." removes the previous segment (no-op at root).
9945
- * - The result always starts with "/" (absolute form).
9946
- *
9947
- * Example:
9948
- * - normalize('/a//b/./c/../d') -\> '/a/b/d'
9949
- *
9950
- * @param path - Input path (relative or absolute).
9951
- * @returns The normalized absolute path (always starting with "/").
9937
+ /**
9938
+ * Normalizes a path by collapsing redundant slashes, removing "." segments,
9939
+ * and resolving ".." segments.
9940
+ *
9941
+ * Rules:
9942
+ * - Multiple consecutive "/" are collapsed into a single "/".
9943
+ * - "." segments are removed.
9944
+ * - ".." removes the previous segment (no-op at root).
9945
+ * - The result always starts with "/" (absolute form).
9946
+ *
9947
+ * Example:
9948
+ * - normalize('/a//b/./c/../d') -\> '/a/b/d'
9949
+ *
9950
+ * @param path - Input path (relative or absolute).
9951
+ * @returns The normalized absolute path (always starting with "/").
9952
9952
  */ static normalize(path) {
9953
9953
  const parts = path.split('/').filter((p)=>p && p !== '.');
9954
9954
  const result = [];
@@ -9961,55 +9961,55 @@ const mimeTypes = {
9961
9961
  }
9962
9962
  return '/' + result.join('/');
9963
9963
  }
9964
- /**
9965
- * Joins multiple path segments and normalizes the result.
9966
- *
9967
- * Behavior:
9968
- * - Concatenates segments with "/" and then runs `normalize`.
9969
- * - The returned path is always absolute.
9970
- *
9971
- * Example:
9972
- * - join('/a', 'b', '../c') -\> '/a/c'
9973
- *
9974
- * @param paths - Path segments in order.
9975
- * @returns Normalized absolute path.
9964
+ /**
9965
+ * Joins multiple path segments and normalizes the result.
9966
+ *
9967
+ * Behavior:
9968
+ * - Concatenates segments with "/" and then runs `normalize`.
9969
+ * - The returned path is always absolute.
9970
+ *
9971
+ * Example:
9972
+ * - join('/a', 'b', '../c') -\> '/a/c'
9973
+ *
9974
+ * @param paths - Path segments in order.
9975
+ * @returns Normalized absolute path.
9976
9976
  */ static join(...paths) {
9977
9977
  return this.normalize(paths.join('/'));
9978
9978
  }
9979
- /**
9980
- * Returns the directory name (parent directory) of a path.
9981
- *
9982
- * Behavior:
9983
- * - Applies `normalize` first.
9984
- * - If the path is root "/" or has no parent, returns "/".
9985
- *
9986
- * Examples:
9987
- * - dirname('/a/b/c') -\> '/a/b'
9988
- * - dirname('/a') -\> '/'
9989
- * - dirname('/') -\> '/'
9990
- *
9991
- * @param path - Input path.
9992
- * @returns Directory path of the input.
9979
+ /**
9980
+ * Returns the directory name (parent directory) of a path.
9981
+ *
9982
+ * Behavior:
9983
+ * - Applies `normalize` first.
9984
+ * - If the path is root "/" or has no parent, returns "/".
9985
+ *
9986
+ * Examples:
9987
+ * - dirname('/a/b/c') -\> '/a/b'
9988
+ * - dirname('/a') -\> '/'
9989
+ * - dirname('/') -\> '/'
9990
+ *
9991
+ * @param path - Input path.
9992
+ * @returns Directory path of the input.
9993
9993
  */ static dirname(path) {
9994
9994
  const normalized = this.normalize(path);
9995
9995
  const lastSlash = normalized.lastIndexOf('/');
9996
9996
  return lastSlash <= 0 ? '/' : normalized.slice(0, lastSlash);
9997
9997
  }
9998
- /**
9999
- * Returns the last portion of a path (file name).
10000
- *
10001
- * Behavior:
10002
- * - Applies `normalize` first.
10003
- * - If `ext` is provided and the name ends with it, the extension is stripped.
10004
- *
10005
- * Examples:
10006
- * - basename('/a/b/c.txt') -\> 'c.txt'
10007
- * - basename('/a/b/c.txt', '.txt') -\> 'c'
10008
- * - basename('/') -\> ''
10009
- *
10010
- * @param path - Input path.
10011
- * @param ext - Optional extension to strip (exact suffix match).
10012
- * @returns The base name of the path.
9998
+ /**
9999
+ * Returns the last portion of a path (file name).
10000
+ *
10001
+ * Behavior:
10002
+ * - Applies `normalize` first.
10003
+ * - If `ext` is provided and the name ends with it, the extension is stripped.
10004
+ *
10005
+ * Examples:
10006
+ * - basename('/a/b/c.txt') -\> 'c.txt'
10007
+ * - basename('/a/b/c.txt', '.txt') -\> 'c'
10008
+ * - basename('/') -\> ''
10009
+ *
10010
+ * @param path - Input path.
10011
+ * @param ext - Optional extension to strip (exact suffix match).
10012
+ * @returns The base name of the path.
10013
10013
  */ static basename(path, ext) {
10014
10014
  const normalized = this.normalize(path);
10015
10015
  const lastSlash = normalized.lastIndexOf('/');
@@ -10019,44 +10019,44 @@ const mimeTypes = {
10019
10019
  }
10020
10020
  return name;
10021
10021
  }
10022
- /**
10023
- * Returns the extension of the path, including the leading dot.
10024
- *
10025
- * Behavior:
10026
- * - Based on the result of `basename`.
10027
- * - If there is no dot, returns an empty string.
10028
- *
10029
- * Examples:
10030
- * - extname('/a/b/c.txt') -\> '.txt'
10031
- * - extname('/a/b/c') -\> ''
10032
- *
10033
- * @param path - Input path.
10034
- * @returns The extension (e.g., ".txt") or an empty string if none.
10022
+ /**
10023
+ * Returns the extension of the path, including the leading dot.
10024
+ *
10025
+ * Behavior:
10026
+ * - Based on the result of `basename`.
10027
+ * - If there is no dot, returns an empty string.
10028
+ *
10029
+ * Examples:
10030
+ * - extname('/a/b/c.txt') -\> '.txt'
10031
+ * - extname('/a/b/c') -\> ''
10032
+ *
10033
+ * @param path - Input path.
10034
+ * @returns The extension (e.g., ".txt") or an empty string if none.
10035
10035
  */ static extname(path) {
10036
10036
  const basename = this.basename(path);
10037
10037
  const lastDot = basename.lastIndexOf('.');
10038
10038
  return lastDot === -1 ? '' : basename.slice(lastDot);
10039
10039
  }
10040
- /**
10041
- * Sanitizes a file or directory name by replacing or removing invalid characters.
10042
- *
10043
- * Behavior:
10044
- * - Removes or replaces characters that are invalid in common filesystems.
10045
- * - Trims leading/trailing spaces and dots.
10046
- * - Collapses multiple spaces into single spaces.
10047
- * - Replaces reserved names with safe alternatives.
10048
- * - Optionally limits the length of the result.
10049
- *
10050
- * Examples:
10051
- * - sanitizeFilename('my file.txt') -\> 'my file.txt'
10052
- * - sanitizeFilename('file:name*.txt') -\> 'file_name_.txt'
10053
- * - sanitizeFilename(' .hidden ') -\> 'hidden'
10054
- * - sanitizeFilename('CON') -\> '_CON'
10055
- * - sanitizeFilename('a'.repeat(300)) -\> (truncated to maxLength)
10056
- *
10057
- * @param filename - Input filename to sanitize.
10058
- * @param options - Optional configuration.
10059
- * @returns Sanitized filename safe for use across platforms.
10040
+ /**
10041
+ * Sanitizes a file or directory name by replacing or removing invalid characters.
10042
+ *
10043
+ * Behavior:
10044
+ * - Removes or replaces characters that are invalid in common filesystems.
10045
+ * - Trims leading/trailing spaces and dots.
10046
+ * - Collapses multiple spaces into single spaces.
10047
+ * - Replaces reserved names with safe alternatives.
10048
+ * - Optionally limits the length of the result.
10049
+ *
10050
+ * Examples:
10051
+ * - sanitizeFilename('my file.txt') -\> 'my file.txt'
10052
+ * - sanitizeFilename('file:name*.txt') -\> 'file_name_.txt'
10053
+ * - sanitizeFilename(' .hidden ') -\> 'hidden'
10054
+ * - sanitizeFilename('CON') -\> '_CON'
10055
+ * - sanitizeFilename('a'.repeat(300)) -\> (truncated to maxLength)
10056
+ *
10057
+ * @param filename - Input filename to sanitize.
10058
+ * @param options - Optional configuration.
10059
+ * @returns Sanitized filename safe for use across platforms.
10060
10060
  */ static sanitizeFilename(filename, options) {
10061
10061
  const { replacement = '_', maxLength = 255, asciiOnly = false } = options ?? {};
10062
10062
  const reserved = /^(CON|PRN|AUX|NUL|COM[1-9]|LPT[1-9])$/i;
@@ -10097,32 +10097,32 @@ const mimeTypes = {
10097
10097
  }
10098
10098
  return sanitized;
10099
10099
  }
10100
- /**
10101
- * Determines whether the path is absolute.
10102
- *
10103
- * Definition here: absolute paths start with "/".
10104
- *
10105
- * @param path - Input path.
10106
- * @returns True if the path starts with "/", otherwise false.
10100
+ /**
10101
+ * Determines whether the path is absolute.
10102
+ *
10103
+ * Definition here: absolute paths start with "/".
10104
+ *
10105
+ * @param path - Input path.
10106
+ * @returns True if the path starts with "/", otherwise false.
10107
10107
  */ static isAbsolute(path) {
10108
10108
  return path.startsWith('/');
10109
10109
  }
10110
- /**
10111
- * Computes a relative path from one path to another.
10112
- *
10113
- * Behavior:
10114
- * - Both `from` and `to` are normalized first.
10115
- * - The returned path does not start with "/" (relative form).
10116
- * - If both resolve to the same path, returns ".".
10117
- *
10118
- * Examples:
10119
- * - relative('/a/b/c', '/a/d/e') -\> '../../d/e'
10120
- * - relative('/a/b', '/a/b/c') -\> 'c'
10121
- * - relative('/a/b', '/a/b') -\> '.'
10122
- *
10123
- * @param from - Base path to start from.
10124
- * @param to - Target path to reach.
10125
- * @returns Relative path from `from` to `to`.
10110
+ /**
10111
+ * Computes a relative path from one path to another.
10112
+ *
10113
+ * Behavior:
10114
+ * - Both `from` and `to` are normalized first.
10115
+ * - The returned path does not start with "/" (relative form).
10116
+ * - If both resolve to the same path, returns ".".
10117
+ *
10118
+ * Examples:
10119
+ * - relative('/a/b/c', '/a/d/e') -\> '../../d/e'
10120
+ * - relative('/a/b', '/a/b/c') -\> 'c'
10121
+ * - relative('/a/b', '/a/b') -\> '.'
10122
+ *
10123
+ * @param from - Base path to start from.
10124
+ * @param to - Target path to reach.
10125
+ * @returns Relative path from `from` to `to`.
10126
10126
  */ static relative(from, to) {
10127
10127
  const fromParts = this.normalize(from).split('/').filter(Boolean);
10128
10128
  const toParts = this.normalize(to).split('/').filter(Boolean);
@@ -10135,37 +10135,37 @@ const mimeTypes = {
10135
10135
  return up + down || '.';
10136
10136
  }
10137
10137
  }
10138
- /**
10139
- * Guesses the MIME type based on a file path or file name.
10140
- *
10141
- * Behavior:
10142
- * - Uses `PathUtils.extname` to extract the extension (case-insensitive).
10143
- * - Falls back to `application/octet-stream` if unknown.
10144
- *
10145
- * Notes:
10146
- * - The mapping is intentionally minimal and web-oriented.
10147
- * - Extend the `mimeTypes` table if you need additional types.
10148
- *
10149
- * Examples:
10150
- * - guessMimeType('image.png') -\> 'image/png'
10151
- * - guessMimeType('/a/b/model.glb') -\> 'model/gltf-binary'
10152
- * - guessMimeType('unknown.ext') -\> 'application/octet-stream'
10153
- *
10154
- * @param path - File path or name used to infer the MIME type.
10155
- * @returns The guessed MIME type string.
10156
- *
10157
- * @public
10138
+ /**
10139
+ * Guesses the MIME type based on a file path or file name.
10140
+ *
10141
+ * Behavior:
10142
+ * - Uses `PathUtils.extname` to extract the extension (case-insensitive).
10143
+ * - Falls back to `application/octet-stream` if unknown.
10144
+ *
10145
+ * Notes:
10146
+ * - The mapping is intentionally minimal and web-oriented.
10147
+ * - Extend the `mimeTypes` table if you need additional types.
10148
+ *
10149
+ * Examples:
10150
+ * - guessMimeType('image.png') -\> 'image/png'
10151
+ * - guessMimeType('/a/b/model.glb') -\> 'model/gltf-binary'
10152
+ * - guessMimeType('unknown.ext') -\> 'application/octet-stream'
10153
+ *
10154
+ * @param path - File path or name used to infer the MIME type.
10155
+ * @returns The guessed MIME type string.
10156
+ *
10157
+ * @public
10158
10158
  */ function guessMimeType(path) {
10159
10159
  const ext = PathUtils.extname(path).toLowerCase();
10160
10160
  return mimeTypes[ext] || 'application/octet-stream';
10161
10161
  }
10162
- /**
10163
- * Gets the MIME type based on a file extension.
10164
- *
10165
- * @param ext - File extension (e.g., "png", ".jpg").
10166
- * @returns The corresponding MIME type or 'application/octet-stream' if unknown.
10167
- *
10168
- * @public
10162
+ /**
10163
+ * Gets the MIME type based on a file extension.
10164
+ *
10165
+ * @param ext - File extension (e.g., "png", ".jpg").
10166
+ * @returns The corresponding MIME type or 'application/octet-stream' if unknown.
10167
+ *
10168
+ * @public
10169
10169
  */ function mimeTypeOf(ext) {
10170
10170
  ext = ext.toLowerCase();
10171
10171
  if (!ext.startsWith('.')) {