@plasius/gpu-shared 0.1.14 → 0.1.15
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/CHANGELOG.md +4 -0
- package/README.md +15 -0
- package/dist/{chunk-4ZJ24VRS.js → chunk-6SOHFUOE.js} +4 -3
- package/dist/{chunk-4ZJ24VRS.js.map → chunk-6SOHFUOE.js.map} +1 -1
- package/dist/{chunk-3ARPGHCQ.js → chunk-CH3ZS5TQ.js} +8 -8
- package/dist/chunk-CH3ZS5TQ.js.map +1 -0
- package/dist/chunk-DGUM43GV.js +11 -0
- package/dist/{chunk-W5GA3VA6.js → chunk-QVNRTWHB.js} +8 -5
- package/dist/chunk-QVNRTWHB.js.map +1 -0
- package/dist/dist-B5R2GZQR.js +1433 -0
- package/dist/dist-B5R2GZQR.js.map +1 -0
- package/dist/gltf-loader-B6VOWGBV.js +9 -0
- package/dist/index.cjs +1483 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +30 -6
- package/dist/index.js.map +1 -1
- package/dist/{product-studio-runtime-HDAUDWYO.js → product-studio-runtime-BYVBUWIN.js} +4 -3
- package/dist/{showcase-inline-assets-WT4PSNKI.js → showcase-inline-assets-QRQKXGVX.js} +2 -1
- package/dist/showcase-inline-assets-QRQKXGVX.js.map +1 -0
- package/dist/{showcase-runtime-SNCUFSSC.js → showcase-runtime-M6TEUYOG.js} +4 -3
- package/dist/{showcase-runtime-SNCUFSSC.js.map → showcase-runtime-M6TEUYOG.js.map} +1 -1
- package/package.json +3 -4
- package/src/gltf-loader.js +7 -3
- package/src/index.d.ts +1 -0
- package/src/index.js +35 -1
- package/src/product-studio-runtime.js +1 -0
- package/dist/chunk-3ARPGHCQ.js.map +0 -1
- package/dist/chunk-W5GA3VA6.js.map +0 -1
- package/dist/gltf-loader-YDPLZS5Q.js +0 -8
- /package/dist/{gltf-loader-YDPLZS5Q.js.map → chunk-DGUM43GV.js.map} +0 -0
- /package/dist/{product-studio-runtime-HDAUDWYO.js.map → gltf-loader-B6VOWGBV.js.map} +0 -0
- /package/dist/{showcase-inline-assets-WT4PSNKI.js.map → product-studio-runtime-BYVBUWIN.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createProductStudioMeshes,
|
|
3
3
|
mountGpuProductStudio
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6SOHFUOE.js";
|
|
5
5
|
import {
|
|
6
6
|
GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE,
|
|
7
7
|
GPU_SHOWCASE_REALISTIC_MODELS_FEATURE,
|
|
@@ -10,11 +10,12 @@ import {
|
|
|
10
10
|
gpuSharedTranslationKeys,
|
|
11
11
|
gpuSharedTranslations,
|
|
12
12
|
translateGpuSharedText
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-CH3ZS5TQ.js";
|
|
14
14
|
import {
|
|
15
15
|
resolveShowcaseAssetUrl
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-QVNRTWHB.js";
|
|
17
17
|
import "./chunk-2GM64LB6.js";
|
|
18
|
+
import "./chunk-DGUM43GV.js";
|
|
18
19
|
|
|
19
20
|
// src/index.js
|
|
20
21
|
var showcaseFocusModes = Object.freeze([
|
|
@@ -28,13 +29,36 @@ var showcaseFocusModes = Object.freeze([
|
|
|
28
29
|
]);
|
|
29
30
|
var showcaseDemoModes = Object.freeze(["harbor", "product-studio"]);
|
|
30
31
|
async function loadGltfModel(url) {
|
|
31
|
-
const module = await import("./gltf-loader-
|
|
32
|
+
const module = await import("./gltf-loader-B6VOWGBV.js");
|
|
32
33
|
return module.loadGltfModel(url);
|
|
33
34
|
}
|
|
35
|
+
function isProductStudioFeatureEnabled(featureFlags) {
|
|
36
|
+
if (typeof featureFlags?.get === "function") {
|
|
37
|
+
return featureFlags.get(GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE) === true;
|
|
38
|
+
}
|
|
39
|
+
const direct = featureFlags?.[GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE];
|
|
40
|
+
if (typeof direct === "boolean") {
|
|
41
|
+
return direct;
|
|
42
|
+
}
|
|
43
|
+
const flagsValue = featureFlags?.flags?.[GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE];
|
|
44
|
+
if (typeof flagsValue === "boolean") {
|
|
45
|
+
return flagsValue;
|
|
46
|
+
}
|
|
47
|
+
const enabledValue = featureFlags?.enabled?.[GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE];
|
|
48
|
+
if (typeof enabledValue === "boolean") {
|
|
49
|
+
return enabledValue;
|
|
50
|
+
}
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
34
53
|
async function mountGpuShowcase(options = {}) {
|
|
35
54
|
const demoMode = options.demoMode ?? options.mode;
|
|
36
55
|
if (demoMode === "product-studio" || demoMode === "product" || demoMode === "studio" || demoMode === "eames") {
|
|
37
|
-
|
|
56
|
+
if (!isProductStudioFeatureEnabled(options.__featureFlags)) {
|
|
57
|
+
throw new Error(
|
|
58
|
+
`${GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE} must be enabled before Product Studio can mount.`
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
const productRuntimeLoader = typeof options.__productRuntimeLoader === "function" ? options.__productRuntimeLoader : () => import("./product-studio-runtime-BYVBUWIN.js");
|
|
38
62
|
const productModule = await productRuntimeLoader();
|
|
39
63
|
if (typeof productModule.mountGpuProductStudio !== "function") {
|
|
40
64
|
throw new Error("product runtime loader must provide mountGpuProductStudio.");
|
|
@@ -45,7 +69,7 @@ async function mountGpuShowcase(options = {}) {
|
|
|
45
69
|
delete productOptions.__featureFlags;
|
|
46
70
|
return productModule.mountGpuProductStudio(productOptions, options.__featureFlags);
|
|
47
71
|
}
|
|
48
|
-
const runtimeLoader = typeof options.__runtimeLoader === "function" ? options.__runtimeLoader : () => import("./showcase-runtime-
|
|
72
|
+
const runtimeLoader = typeof options.__runtimeLoader === "function" ? options.__runtimeLoader : () => import("./showcase-runtime-M6TEUYOG.js");
|
|
49
73
|
const module = await runtimeLoader();
|
|
50
74
|
if (typeof module.mountGpuShowcase !== "function") {
|
|
51
75
|
throw new Error("showcase runtime loader must provide mountGpuShowcase.");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"sourcesContent":["import {\n GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE,\n GPU_SHOWCASE_REALISTIC_MODELS_FEATURE,\n} from \"./feature-flags.js\";\n\nexport { resolveShowcaseAssetUrl } from \"./asset-url.js\";\nexport {\n createGpuSharedTranslator,\n gpuSharedTranslationKeys,\n gpuSharedTranslations,\n translateGpuSharedText,\n} from \"./i18n.js\";\nexport { gpuSharedEnGbTranslations } from \"./translations/en-GB.js\";\nexport {\n GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE,\n GPU_SHOWCASE_REALISTIC_MODELS_FEATURE,\n};\nexport {\n createProductStudioMeshes,\n mountGpuProductStudio,\n} from \"./product-studio-runtime.js\";\n\nexport const showcaseFocusModes = Object.freeze([\n \"integrated\",\n \"lighting\",\n \"cloth\",\n \"fluid\",\n \"physics\",\n \"performance\",\n \"debug\",\n]);\nexport const showcaseDemoModes = Object.freeze([\"harbor\", \"product-studio\"]);\n\nexport async function loadGltfModel(url) {\n const module = await import(\"./gltf-loader.js\");\n return module.loadGltfModel(url);\n}\n\nfunction isProductStudioFeatureEnabled(featureFlags) {\n if (typeof featureFlags?.get === \"function\") {\n return featureFlags.get(GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE) === true;\n }\n\n const direct = featureFlags?.[GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE];\n if (typeof direct === \"boolean\") {\n return direct;\n }\n\n const flagsValue = featureFlags?.flags?.[GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE];\n if (typeof flagsValue === \"boolean\") {\n return flagsValue;\n }\n\n const enabledValue = featureFlags?.enabled?.[GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE];\n if (typeof enabledValue === \"boolean\") {\n return enabledValue;\n }\n\n return false;\n}\n\nexport async function mountGpuShowcase(options = {}) {\n const demoMode = options.demoMode ?? options.mode;\n if (\n demoMode === \"product-studio\" ||\n demoMode === \"product\" ||\n demoMode === \"studio\" ||\n demoMode === \"eames\"\n ) {\n if (!isProductStudioFeatureEnabled(options.__featureFlags)) {\n throw new Error(\n `${GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE} must be enabled before Product Studio can mount.`\n );\n }\n\n const productRuntimeLoader =\n typeof options.__productRuntimeLoader === \"function\"\n ? options.__productRuntimeLoader\n : () => import(\"./product-studio-runtime.js\");\n const productModule = await productRuntimeLoader();\n if (typeof productModule.mountGpuProductStudio !== \"function\") {\n throw new Error(\"product runtime loader must provide mountGpuProductStudio.\");\n }\n\n const productOptions = { ...options, demoMode };\n delete productOptions.__runtimeLoader;\n delete productOptions.__productRuntimeLoader;\n delete productOptions.__featureFlags;\n return productModule.mountGpuProductStudio(productOptions, options.__featureFlags);\n }\n\n const runtimeLoader =\n typeof options.__runtimeLoader === \"function\"\n ? options.__runtimeLoader\n : () => import(\"./showcase-runtime.js\");\n const module = await runtimeLoader();\n if (typeof module.mountGpuShowcase !== \"function\") {\n throw new Error(\"showcase runtime loader must provide mountGpuShowcase.\");\n }\n\n const publicOptions = { ...options };\n delete publicOptions.__runtimeLoader;\n delete publicOptions.__productRuntimeLoader;\n delete publicOptions.__featureFlags;\n return module.mountGpuShowcase(publicOptions, options.__featureFlags);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsBO,IAAM,qBAAqB,OAAO,OAAO;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AACM,IAAM,oBAAoB,OAAO,OAAO,CAAC,UAAU,gBAA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,cAAc;AACnC,MAAI,OAAO,OAAO,qBAAqB,YAAY;AACjD,UAAM,IAAI,MAAM,wDAAwD;AAAA,EAC1E;AAEA,QAAM,gBAAgB,EAAE,GAAG,QAAQ;AACnC,SAAO,cAAc;AACrB,SAAO,cAAc;AACrB,SAAO,cAAc;AACrB,SAAO,OAAO,iBAAiB,eAAe,QAAQ,cAAc;AACtE;","names":[]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createProductStudioMeshes,
|
|
3
3
|
mountGpuProductStudio
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-6SOHFUOE.js";
|
|
5
|
+
import "./chunk-QVNRTWHB.js";
|
|
6
6
|
import "./chunk-2GM64LB6.js";
|
|
7
|
+
import "./chunk-DGUM43GV.js";
|
|
7
8
|
export {
|
|
8
9
|
createProductStudioMeshes,
|
|
9
10
|
mountGpuProductStudio
|
|
10
11
|
};
|
|
11
|
-
//# sourceMappingURL=product-studio-runtime-
|
|
12
|
+
//# sourceMappingURL=product-studio-runtime-BYVBUWIN.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
INLINE_SHOWCASE_ASSET_URLS
|
|
3
3
|
} from "./chunk-2GM64LB6.js";
|
|
4
|
+
import "./chunk-DGUM43GV.js";
|
|
4
5
|
export {
|
|
5
6
|
INLINE_SHOWCASE_ASSET_URLS
|
|
6
7
|
};
|
|
7
|
-
//# sourceMappingURL=showcase-inline-assets-
|
|
8
|
+
//# sourceMappingURL=showcase-inline-assets-QRQKXGVX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -2,12 +2,13 @@ import {
|
|
|
2
2
|
GPU_SHOWCASE_REALISTIC_MODELS_FEATURE,
|
|
3
3
|
createGpuSharedTranslator,
|
|
4
4
|
gpuSharedTranslationKeys
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CH3ZS5TQ.js";
|
|
6
6
|
import {
|
|
7
7
|
loadGltfModel,
|
|
8
8
|
resolveShowcaseAssetUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QVNRTWHB.js";
|
|
10
10
|
import "./chunk-2GM64LB6.js";
|
|
11
|
+
import "./chunk-DGUM43GV.js";
|
|
11
12
|
|
|
12
13
|
// src/showcase-runtime.js
|
|
13
14
|
var STYLE_ID = "plasius-shared-3d-showcase-style";
|
|
@@ -3782,4 +3783,4 @@ export {
|
|
|
3782
3783
|
mountGpuShowcase,
|
|
3783
3784
|
showcaseFocusModes
|
|
3784
3785
|
};
|
|
3785
|
-
//# sourceMappingURL=showcase-runtime-
|
|
3786
|
+
//# sourceMappingURL=showcase-runtime-M6TEUYOG.js.map
|