@playdrop/playdrop-cli 0.7.13 → 0.7.16
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/config/client-meta.json +1 -1
- package/node_modules/@playdrop/ai-client/dist/index.js +461 -444
- package/node_modules/@playdrop/ai-client/package.json +1 -1
- package/node_modules/@playdrop/api-client/dist/client.js +903 -882
- package/node_modules/@playdrop/api-client/dist/core/errors.js +69 -45
- package/node_modules/@playdrop/api-client/dist/core/request.js +188 -159
- package/node_modules/@playdrop/api-client/dist/domains/admin.js +516 -491
- package/node_modules/@playdrop/api-client/dist/domains/ai.js +40 -14
- package/node_modules/@playdrop/api-client/dist/domains/apps.js +480 -462
- package/node_modules/@playdrop/api-client/dist/domains/asset-packs.js +439 -419
- package/node_modules/@playdrop/api-client/dist/domains/assets.js +696 -676
- package/node_modules/@playdrop/api-client/dist/domains/auth.js +346 -320
- package/node_modules/@playdrop/api-client/dist/domains/comments.js +124 -98
- package/node_modules/@playdrop/api-client/dist/domains/free-credits.js +91 -65
- package/node_modules/@playdrop/api-client/dist/domains/me.js +71 -45
- package/node_modules/@playdrop/api-client/dist/domains/payments.js +407 -386
- package/node_modules/@playdrop/api-client/dist/domains/player-meta.js +144 -118
- package/node_modules/@playdrop/api-client/dist/domains/search.js +117 -104
- package/node_modules/@playdrop/api-client/dist/domains/tags.js +188 -162
- package/node_modules/@playdrop/api-client/dist/index.js +993 -552
- package/node_modules/@playdrop/api-client/package.json +1 -1
- package/node_modules/@playdrop/boxel-three/dist/src/animations.js +84 -62
- package/node_modules/@playdrop/boxel-three/dist/src/builders.js +341 -308
- package/node_modules/@playdrop/boxel-three/dist/src/context.js +55 -29
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +856 -858
- package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.js +267 -261
- package/node_modules/@playdrop/boxel-three/dist/src/index.js +64 -15
- package/node_modules/@playdrop/boxel-three/dist/src/instantiate.js +89 -63
- package/node_modules/@playdrop/boxel-three/dist/src/nodes.js +81 -56
- package/node_modules/@playdrop/boxel-three/dist/src/overlays.js +112 -86
- package/node_modules/@playdrop/boxel-three/dist/src/primitives.js +45 -17
- package/node_modules/@playdrop/boxel-three/dist/src/scene.js +160 -136
- package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.js +582 -584
- package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.js +123 -97
- package/node_modules/@playdrop/boxel-three/dist/src/textures.js +207 -182
- package/node_modules/@playdrop/boxel-three/dist/src/types.js +15 -1
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.js +451 -425
- package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.js +109 -84
- package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.js +127 -106
- package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.js +73 -51
- package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.js +97 -79
- package/node_modules/@playdrop/boxel-three/dist/test/index.test.js +29 -7
- package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.js +80 -60
- package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.js +41 -19
- package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.js +72 -50
- package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.js +84 -62
- package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.js +69 -47
- package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.js +129 -109
- package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.js +40 -18
- package/node_modules/@playdrop/boxel-three/package.json +1 -1
- package/node_modules/@playdrop/config/client-meta.json +1 -1
- package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@playdrop/types/dist/api.js +289 -203
- package/node_modules/@playdrop/types/dist/app-capability-filters.js +112 -62
- package/node_modules/@playdrop/types/dist/app.js +91 -45
- package/node_modules/@playdrop/types/dist/asset-pack.js +37 -5
- package/node_modules/@playdrop/types/dist/asset-spec.js +170 -90
- package/node_modules/@playdrop/types/dist/asset.js +186 -108
- package/node_modules/@playdrop/types/dist/content-license.js +49 -15
- package/node_modules/@playdrop/types/dist/creator-public-image.js +60 -32
- package/node_modules/@playdrop/types/dist/ecs.js +102 -82
- package/node_modules/@playdrop/types/dist/engine-builtins.js +603 -573
- package/node_modules/@playdrop/types/dist/entity.js +63 -53
- package/node_modules/@playdrop/types/dist/graph.js +116 -80
- package/node_modules/@playdrop/types/dist/index.js +47 -20
- package/node_modules/@playdrop/types/dist/owned-assets.js +55 -33
- package/node_modules/@playdrop/types/dist/player-meta.js +151 -100
- package/node_modules/@playdrop/types/dist/realtime.js +27 -7
- package/node_modules/@playdrop/types/dist/version.js +182 -124
- package/node_modules/@playdrop/types/package.json +1 -1
- package/package.json +1 -1
|
@@ -1,144 +1,168 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var scene_exports = {};
|
|
19
|
+
__export(scene_exports, {
|
|
20
|
+
createBoxelNodeScene: () => createBoxelNodeScene,
|
|
21
|
+
createBoxelScene: () => createBoxelScene
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(scene_exports);
|
|
24
|
+
var import_context = require("./context.js");
|
|
25
|
+
var import_nodes = require("./nodes.js");
|
|
26
|
+
var import_animations = require("./animations.js");
|
|
27
|
+
var import_overlays = require("./overlays.js");
|
|
5
28
|
function normalizeNodeFilter(nodes) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
29
|
+
if (!nodes)
|
|
30
|
+
return null;
|
|
31
|
+
if (Array.isArray(nodes)) {
|
|
32
|
+
return new Set(nodes);
|
|
33
|
+
}
|
|
34
|
+
return /* @__PURE__ */ new Set([nodes]);
|
|
12
35
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
console.warn('[boxel-three] node not found', nodeId);
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
const { object, nodes } = buildNodeObject(builderContext, node);
|
|
42
|
-
nodes.forEach((nodeObject, id) => {
|
|
43
|
-
nodeObjects.set(id, {
|
|
44
|
-
id,
|
|
45
|
-
object: nodeObject,
|
|
46
|
-
primitiveId: nodeObject.userData?.primitiveId,
|
|
47
|
-
connectMode: (nodeObject.userData?.connectMode ?? 'none'),
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
return object;
|
|
51
|
-
};
|
|
52
|
-
if (nodeFilter) {
|
|
53
|
-
nodeFilter.forEach(nodeId => {
|
|
54
|
-
const object = gatherNode(nodeId);
|
|
55
|
-
if (object) {
|
|
56
|
-
root.add(object);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
36
|
+
function createBoxelScene(context, options = {}) {
|
|
37
|
+
const { THREE, entity } = context;
|
|
38
|
+
const nodeFilter = normalizeNodeFilter(options.nodes);
|
|
39
|
+
const builderContext = (0, import_context.createBuilderContext)({
|
|
40
|
+
THREE,
|
|
41
|
+
settings: { enableShadows: false }
|
|
42
|
+
});
|
|
43
|
+
(0, import_context.updateBuilderContext)(builderContext, { entity });
|
|
44
|
+
const root = new THREE.Group();
|
|
45
|
+
const nodeObjects = /* @__PURE__ */ new Map();
|
|
46
|
+
const overlayHandles = [];
|
|
47
|
+
const gatherNode = (nodeId) => {
|
|
48
|
+
const node = entity.geometry.root.id === nodeId ? entity.geometry.root : (function find(current) {
|
|
49
|
+
if (current.id === nodeId)
|
|
50
|
+
return current;
|
|
51
|
+
for (const child of current.children) {
|
|
52
|
+
const result = find(child);
|
|
53
|
+
if (result)
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
})(entity.geometry.root);
|
|
58
|
+
if (!node) {
|
|
59
|
+
console.warn("[boxel-three] node not found", nodeId);
|
|
60
|
+
return null;
|
|
59
61
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
const { object, nodes } = (0, import_nodes.buildNodeObject)(builderContext, node);
|
|
63
|
+
nodes.forEach((nodeObject, id) => {
|
|
64
|
+
nodeObjects.set(id, {
|
|
65
|
+
id,
|
|
66
|
+
object: nodeObject,
|
|
67
|
+
primitiveId: nodeObject.userData?.primitiveId,
|
|
68
|
+
connectMode: nodeObject.userData?.connectMode ?? "none"
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
return object;
|
|
72
|
+
};
|
|
73
|
+
if (nodeFilter) {
|
|
74
|
+
nodeFilter.forEach((nodeId) => {
|
|
75
|
+
const object = gatherNode(nodeId);
|
|
76
|
+
if (object) {
|
|
62
77
|
root.add(object);
|
|
63
|
-
|
|
64
|
-
nodeObjects.set(id, {
|
|
65
|
-
id,
|
|
66
|
-
object: nodeObject,
|
|
67
|
-
primitiveId: nodeObject.userData?.primitiveId,
|
|
68
|
-
connectMode: (nodeObject.userData?.connectMode ?? 'none'),
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
const applyOverlays = (overlayOptions) => {
|
|
73
|
-
if (!overlayOptions)
|
|
74
|
-
return;
|
|
75
|
-
const style = {
|
|
76
|
-
color: overlayOptions.color,
|
|
77
|
-
opacity: overlayOptions.opacity,
|
|
78
|
-
dashed: overlayOptions.dashed,
|
|
79
|
-
};
|
|
80
|
-
const rootId = entity.geometry.root.id;
|
|
81
|
-
nodeObjects.forEach(meta => {
|
|
82
|
-
const request = {
|
|
83
|
-
...style,
|
|
84
|
-
origin: overlayOptions.origin && meta.id === rootId,
|
|
85
|
-
bounds: overlayOptions.bounds && Boolean(meta.object.userData?.size),
|
|
86
|
-
sockets: overlayOptions.sockets && Boolean(meta.object.userData?.sockets),
|
|
87
|
-
};
|
|
88
|
-
if (!request.origin && !request.bounds && !request.sockets) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
const handles = attachBoxelOverlays({ THREE, target: meta.object }, request);
|
|
92
|
-
overlayHandles.push(handles);
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
applyOverlays(options.overlays);
|
|
96
|
-
const animationMeta = buildAnimations(THREE, entity, new Map(Array.from(nodeObjects.entries()).map(([id, meta]) => [id, meta.object])));
|
|
97
|
-
const clips = animationMeta.map(animation => animation.clip);
|
|
98
|
-
const resources = {
|
|
99
|
-
materials: [],
|
|
100
|
-
textures: [],
|
|
101
|
-
geometries: [],
|
|
102
|
-
};
|
|
103
|
-
root.traverse(object => {
|
|
104
|
-
if (object instanceof THREE.Mesh) {
|
|
105
|
-
const mesh = object;
|
|
106
|
-
const material = mesh.material;
|
|
107
|
-
const collectMaterial = (mat) => {
|
|
108
|
-
resources.materials.push(mat);
|
|
109
|
-
if ('map' in mat && mat.map)
|
|
110
|
-
resources.textures.push(mat.map);
|
|
111
|
-
if ('emissiveMap' in mat && mat.emissiveMap)
|
|
112
|
-
resources.textures.push(mat.emissiveMap);
|
|
113
|
-
};
|
|
114
|
-
if (Array.isArray(material)) {
|
|
115
|
-
material.forEach(mat => collectMaterial(mat));
|
|
116
|
-
}
|
|
117
|
-
else if (material) {
|
|
118
|
-
collectMaterial(material);
|
|
119
|
-
}
|
|
120
|
-
if (mesh.geometry) {
|
|
121
|
-
resources.geometries.push(mesh.geometry);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
78
|
+
}
|
|
124
79
|
});
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
80
|
+
} else {
|
|
81
|
+
const { object, nodes } = (0, import_nodes.buildNodeObject)(builderContext, entity.geometry.root);
|
|
82
|
+
root.add(object);
|
|
83
|
+
nodes.forEach((nodeObject, id) => {
|
|
84
|
+
nodeObjects.set(id, {
|
|
85
|
+
id,
|
|
86
|
+
object: nodeObject,
|
|
87
|
+
primitiveId: nodeObject.userData?.primitiveId,
|
|
88
|
+
connectMode: nodeObject.userData?.connectMode ?? "none"
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
const applyOverlays = (overlayOptions) => {
|
|
93
|
+
if (!overlayOptions)
|
|
94
|
+
return;
|
|
95
|
+
const style = {
|
|
96
|
+
color: overlayOptions.color,
|
|
97
|
+
opacity: overlayOptions.opacity,
|
|
98
|
+
dashed: overlayOptions.dashed
|
|
140
99
|
};
|
|
100
|
+
const rootId = entity.geometry.root.id;
|
|
101
|
+
nodeObjects.forEach((meta) => {
|
|
102
|
+
const request = {
|
|
103
|
+
...style,
|
|
104
|
+
origin: overlayOptions.origin && meta.id === rootId,
|
|
105
|
+
bounds: overlayOptions.bounds && Boolean(meta.object.userData?.size),
|
|
106
|
+
sockets: overlayOptions.sockets && Boolean(meta.object.userData?.sockets)
|
|
107
|
+
};
|
|
108
|
+
if (!request.origin && !request.bounds && !request.sockets) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const handles = (0, import_overlays.attachBoxelOverlays)({ THREE, target: meta.object }, request);
|
|
112
|
+
overlayHandles.push(handles);
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
applyOverlays(options.overlays);
|
|
116
|
+
const animationMeta = (0, import_animations.buildAnimations)(THREE, entity, new Map(Array.from(nodeObjects.entries()).map(([id, meta]) => [id, meta.object])));
|
|
117
|
+
const clips = animationMeta.map((animation) => animation.clip);
|
|
118
|
+
const resources = {
|
|
119
|
+
materials: [],
|
|
120
|
+
textures: [],
|
|
121
|
+
geometries: []
|
|
122
|
+
};
|
|
123
|
+
root.traverse((object) => {
|
|
124
|
+
if (object instanceof THREE.Mesh) {
|
|
125
|
+
const mesh = object;
|
|
126
|
+
const material = mesh.material;
|
|
127
|
+
const collectMaterial = (mat) => {
|
|
128
|
+
resources.materials.push(mat);
|
|
129
|
+
if ("map" in mat && mat.map)
|
|
130
|
+
resources.textures.push(mat.map);
|
|
131
|
+
if ("emissiveMap" in mat && mat.emissiveMap)
|
|
132
|
+
resources.textures.push(mat.emissiveMap);
|
|
133
|
+
};
|
|
134
|
+
if (Array.isArray(material)) {
|
|
135
|
+
material.forEach((mat) => collectMaterial(mat));
|
|
136
|
+
} else if (material) {
|
|
137
|
+
collectMaterial(material);
|
|
138
|
+
}
|
|
139
|
+
if (mesh.geometry) {
|
|
140
|
+
resources.geometries.push(mesh.geometry);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
const dispose = () => {
|
|
145
|
+
overlayHandles.splice(0).forEach((handles) => handles.dispose());
|
|
146
|
+
resources.geometries.forEach((geometry) => geometry.dispose?.());
|
|
147
|
+
resources.materials.forEach((material) => material.dispose?.());
|
|
148
|
+
resources.textures.forEach((texture) => texture.dispose?.());
|
|
149
|
+
nodeObjects.clear();
|
|
150
|
+
root.clear();
|
|
151
|
+
};
|
|
152
|
+
return {
|
|
153
|
+
root,
|
|
154
|
+
nodes: nodeObjects,
|
|
155
|
+
animations: animationMeta,
|
|
156
|
+
clips,
|
|
157
|
+
resources,
|
|
158
|
+
dispose
|
|
159
|
+
};
|
|
141
160
|
}
|
|
142
|
-
|
|
143
|
-
|
|
161
|
+
function createBoxelNodeScene(context, nodeId, options = {}) {
|
|
162
|
+
return createBoxelScene(context, { ...options, nodes: nodeId });
|
|
144
163
|
}
|
|
164
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
165
|
+
0 && (module.exports = {
|
|
166
|
+
createBoxelNodeScene,
|
|
167
|
+
createBoxelScene
|
|
168
|
+
});
|