regl-web-components 0.0.1 → 0.2.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.
- package/bundler/esbuild.build.mjs +9 -0
- package/dist/all-define.cjs +10322 -0
- package/dist/all.cjs +10333 -0
- package/dist/all.js +61 -60
- package/dist/regl-element-define.cjs +9789 -0
- package/dist/regl-element.cjs +9853 -0
- package/dist/regl-multi-element-define.cjs +10011 -0
- package/dist/regl-multi-element.cjs +10021 -0
- package/dist/regl-multi-root-define.cjs +10086 -0
- package/dist/regl-multi-root.cjs +10095 -0
- package/package.json +10 -2
- package/src/all-define.ts +0 -7
- package/src/all.ts +0 -3
- package/src/deferred-regl.ts +0 -142
- package/src/multi-regl.ts +0 -283
- package/src/regl-element-define.ts +0 -2
- package/src/regl-element.ts +0 -31
- package/src/regl-multi-element-define.ts +0 -2
- package/src/regl-multi-element.ts +0 -69
- package/src/regl-multi-root-define.ts +0 -2
- package/src/regl-multi-root.ts +0 -80
- package/src/regl-wc-initialization-options.ts +0 -48
package/dist/all.js
CHANGED
|
@@ -9777,65 +9777,6 @@ var require_regl = __commonJS({
|
|
|
9777
9777
|
}
|
|
9778
9778
|
});
|
|
9779
9779
|
|
|
9780
|
-
// src/regl-element.ts
|
|
9781
|
-
var import_regl = __toESM(require_regl());
|
|
9782
|
-
|
|
9783
|
-
// src/regl-wc-initialization-options.ts
|
|
9784
|
-
var regl_wc_initialization_options_default = reglWcInitializationOptions;
|
|
9785
|
-
function reglWcInitializationOptions(element) {
|
|
9786
|
-
const optionsAttrJson = element.getAttribute("initializationOptions");
|
|
9787
|
-
const optionsFromAttrs = [
|
|
9788
|
-
{
|
|
9789
|
-
attribute: "canvas",
|
|
9790
|
-
getValue: (id) => document.getElementById(id)
|
|
9791
|
-
},
|
|
9792
|
-
{
|
|
9793
|
-
attribute: "container",
|
|
9794
|
-
getValue: (id) => document.getElementById(id)
|
|
9795
|
-
},
|
|
9796
|
-
{
|
|
9797
|
-
attribute: "pixelRatio",
|
|
9798
|
-
getValue: (attr) => +attr
|
|
9799
|
-
}
|
|
9800
|
-
].map((spec) => {
|
|
9801
|
-
const attr = element.getAttribute(spec.attribute);
|
|
9802
|
-
if (attr) return { [spec.attribute]: spec.getValue(attr) };
|
|
9803
|
-
return null;
|
|
9804
|
-
}).filter((v) => !!v).reduce((accum, kv) => {
|
|
9805
|
-
return {
|
|
9806
|
-
...accum,
|
|
9807
|
-
...kv
|
|
9808
|
-
};
|
|
9809
|
-
}, {});
|
|
9810
|
-
const options = {
|
|
9811
|
-
...optionsAttrJson ? JSON.parse(optionsAttrJson) : {},
|
|
9812
|
-
...optionsFromAttrs,
|
|
9813
|
-
...element.reglInitializationOptions
|
|
9814
|
-
};
|
|
9815
|
-
return {
|
|
9816
|
-
...options,
|
|
9817
|
-
...!options.container && !options.canvas ? { container: element } : {}
|
|
9818
|
-
};
|
|
9819
|
-
}
|
|
9820
|
-
|
|
9821
|
-
// src/regl-element.ts
|
|
9822
|
-
var ReglElement = class extends HTMLElement {
|
|
9823
|
-
regl;
|
|
9824
|
-
get reglInitializationOptions() {
|
|
9825
|
-
return {};
|
|
9826
|
-
}
|
|
9827
|
-
createRegl() {
|
|
9828
|
-
const options = regl_wc_initialization_options_default(this);
|
|
9829
|
-
this.regl = (0, import_regl.default)(options);
|
|
9830
|
-
}
|
|
9831
|
-
connectedCallback() {
|
|
9832
|
-
this.createRegl();
|
|
9833
|
-
}
|
|
9834
|
-
disconnectedCallback() {
|
|
9835
|
-
this?.regl?.destroy();
|
|
9836
|
-
}
|
|
9837
|
-
};
|
|
9838
|
-
|
|
9839
9780
|
// src/deferred-regl.ts
|
|
9840
9781
|
var deferred_regl_default = deferredRegl;
|
|
9841
9782
|
function deferredRegl() {
|
|
@@ -10014,6 +9955,65 @@ function falsy(x) {
|
|
|
10014
9955
|
return x === null || x === void 0;
|
|
10015
9956
|
}
|
|
10016
9957
|
|
|
9958
|
+
// src/regl-element.ts
|
|
9959
|
+
var import_regl = __toESM(require_regl());
|
|
9960
|
+
|
|
9961
|
+
// src/regl-wc-initialization-options.ts
|
|
9962
|
+
var regl_wc_initialization_options_default = reglWcInitializationOptions;
|
|
9963
|
+
function reglWcInitializationOptions(element) {
|
|
9964
|
+
const optionsAttrJson = element.getAttribute("initializationOptions");
|
|
9965
|
+
const optionsFromAttrs = [
|
|
9966
|
+
{
|
|
9967
|
+
attribute: "canvas",
|
|
9968
|
+
getValue: (id) => document.getElementById(id)
|
|
9969
|
+
},
|
|
9970
|
+
{
|
|
9971
|
+
attribute: "container",
|
|
9972
|
+
getValue: (id) => document.getElementById(id)
|
|
9973
|
+
},
|
|
9974
|
+
{
|
|
9975
|
+
attribute: "pixelRatio",
|
|
9976
|
+
getValue: (attr) => +attr
|
|
9977
|
+
}
|
|
9978
|
+
].map((spec) => {
|
|
9979
|
+
const attr = element.getAttribute(spec.attribute);
|
|
9980
|
+
if (attr) return { [spec.attribute]: spec.getValue(attr) };
|
|
9981
|
+
return null;
|
|
9982
|
+
}).filter((v) => !!v).reduce((accum, kv) => {
|
|
9983
|
+
return {
|
|
9984
|
+
...accum,
|
|
9985
|
+
...kv
|
|
9986
|
+
};
|
|
9987
|
+
}, {});
|
|
9988
|
+
const options = {
|
|
9989
|
+
...optionsAttrJson ? JSON.parse(optionsAttrJson) : {},
|
|
9990
|
+
...optionsFromAttrs,
|
|
9991
|
+
...element.reglInitializationOptions
|
|
9992
|
+
};
|
|
9993
|
+
return {
|
|
9994
|
+
...options,
|
|
9995
|
+
...!options.container && !options.canvas ? { container: element } : {}
|
|
9996
|
+
};
|
|
9997
|
+
}
|
|
9998
|
+
|
|
9999
|
+
// src/regl-element.ts
|
|
10000
|
+
var ReglElement = class extends HTMLElement {
|
|
10001
|
+
regl;
|
|
10002
|
+
get reglInitializationOptions() {
|
|
10003
|
+
return {};
|
|
10004
|
+
}
|
|
10005
|
+
createRegl() {
|
|
10006
|
+
const options = regl_wc_initialization_options_default(this);
|
|
10007
|
+
this.regl = (0, import_regl.default)(options);
|
|
10008
|
+
}
|
|
10009
|
+
connectedCallback() {
|
|
10010
|
+
this.createRegl();
|
|
10011
|
+
}
|
|
10012
|
+
disconnectedCallback() {
|
|
10013
|
+
this?.regl?.destroy();
|
|
10014
|
+
}
|
|
10015
|
+
};
|
|
10016
|
+
|
|
10017
10017
|
// src/regl-multi-root.ts
|
|
10018
10018
|
var import_regl2 = __toESM(require_regl());
|
|
10019
10019
|
|
|
@@ -10319,5 +10319,6 @@ var ReglMultiElement = class extends HTMLElement {
|
|
|
10319
10319
|
export {
|
|
10320
10320
|
ReglElement,
|
|
10321
10321
|
ReglMultiElement,
|
|
10322
|
-
ReglMultiRoot
|
|
10322
|
+
ReglMultiRoot,
|
|
10323
|
+
deferredRegl
|
|
10323
10324
|
};
|