trimble-terra 0.0.246 → 0.0.248
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/README.md +4 -4
- package/dist/Preview-D68MI3oh.js +127 -0
- package/dist/main-I9oQRF8a.js +20733 -0
- package/dist/main.css +1 -1
- package/dist/trimble-terra.js +33 -17081
- package/package.json +75 -73
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Trimble Terra MXP2
|
|
2
|
-
|
|
3
|
-
To visualize layouts, see Storybook
|
|
4
|
-
https://mxp2-storybook.netlify.app/
|
|
1
|
+
# Trimble Terra MXP2
|
|
2
|
+
|
|
3
|
+
To visualize layouts, see Storybook
|
|
4
|
+
https://mxp2-storybook.netlify.app/
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { g as y } from "./main-I9oQRF8a.js";
|
|
2
|
+
import v from "react";
|
|
3
|
+
function w(r, e) {
|
|
4
|
+
for (var t = 0; t < e.length; t++) {
|
|
5
|
+
const n = e[t];
|
|
6
|
+
if (typeof n != "string" && !Array.isArray(n)) {
|
|
7
|
+
for (const a in n)
|
|
8
|
+
if (a !== "default" && !(a in r)) {
|
|
9
|
+
const o = Object.getOwnPropertyDescriptor(n, a);
|
|
10
|
+
o && Object.defineProperty(r, a, o.get ? o : {
|
|
11
|
+
enumerable: !0,
|
|
12
|
+
get: () => n[a]
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return Object.freeze(Object.defineProperty(r, Symbol.toStringTag, { value: "Module" }));
|
|
18
|
+
}
|
|
19
|
+
var P = Object.create, s = Object.defineProperty, O = Object.getOwnPropertyDescriptor, x = Object.getOwnPropertyNames, I = Object.getPrototypeOf, j = Object.prototype.hasOwnProperty, S = (r, e, t) => e in r ? s(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t, E = (r, e) => {
|
|
20
|
+
for (var t in e)
|
|
21
|
+
s(r, t, { get: e[t], enumerable: !0 });
|
|
22
|
+
}, _ = (r, e, t, n) => {
|
|
23
|
+
if (e && typeof e == "object" || typeof e == "function")
|
|
24
|
+
for (let a of x(e))
|
|
25
|
+
!j.call(r, a) && a !== t && s(r, a, { get: () => e[a], enumerable: !(n = O(e, a)) || n.enumerable });
|
|
26
|
+
return r;
|
|
27
|
+
}, C = (r, e, t) => (t = r != null ? P(I(r)) : {}, _(
|
|
28
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
29
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
30
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
31
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
32
|
+
!r || !r.__esModule ? s(t, "default", { value: r, enumerable: !0 }) : t,
|
|
33
|
+
r
|
|
34
|
+
)), N = (r) => _(s({}, "__esModule", { value: !0 }), r), p = (r, e, t) => (S(r, typeof e != "symbol" ? e + "" : e, t), t), g = {};
|
|
35
|
+
E(g, {
|
|
36
|
+
default: () => k
|
|
37
|
+
});
|
|
38
|
+
var m = N(g), i = C(v);
|
|
39
|
+
const u = "64px", d = {};
|
|
40
|
+
class k extends i.Component {
|
|
41
|
+
constructor() {
|
|
42
|
+
super(...arguments), p(this, "mounted", !1), p(this, "state", {
|
|
43
|
+
image: null
|
|
44
|
+
}), p(this, "handleKeyPress", (e) => {
|
|
45
|
+
(e.key === "Enter" || e.key === " ") && this.props.onClick();
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
componentDidMount() {
|
|
49
|
+
this.mounted = !0, this.fetchImage(this.props);
|
|
50
|
+
}
|
|
51
|
+
componentDidUpdate(e) {
|
|
52
|
+
const { url: t, light: n } = this.props;
|
|
53
|
+
(e.url !== t || e.light !== n) && this.fetchImage(this.props);
|
|
54
|
+
}
|
|
55
|
+
componentWillUnmount() {
|
|
56
|
+
this.mounted = !1;
|
|
57
|
+
}
|
|
58
|
+
fetchImage({ url: e, light: t, oEmbedUrl: n }) {
|
|
59
|
+
if (!i.default.isValidElement(t)) {
|
|
60
|
+
if (typeof t == "string") {
|
|
61
|
+
this.setState({ image: t });
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (d[e]) {
|
|
65
|
+
this.setState({ image: d[e] });
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
return this.setState({ image: null }), window.fetch(n.replace("{url}", e)).then((a) => a.json()).then((a) => {
|
|
69
|
+
if (a.thumbnail_url && this.mounted) {
|
|
70
|
+
const o = a.thumbnail_url.replace("height=100", "height=480").replace("-d_295x166", "-d_640");
|
|
71
|
+
this.setState({ image: o }), d[e] = o;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
render() {
|
|
77
|
+
const { light: e, onClick: t, playIcon: n, previewTabIndex: a, previewAriaLabel: o } = this.props, { image: f } = this.state, l = i.default.isValidElement(e), h = {
|
|
78
|
+
display: "flex",
|
|
79
|
+
alignItems: "center",
|
|
80
|
+
justifyContent: "center"
|
|
81
|
+
}, c = {
|
|
82
|
+
preview: {
|
|
83
|
+
width: "100%",
|
|
84
|
+
height: "100%",
|
|
85
|
+
backgroundImage: f && !l ? `url(${f})` : void 0,
|
|
86
|
+
backgroundSize: "cover",
|
|
87
|
+
backgroundPosition: "center",
|
|
88
|
+
cursor: "pointer",
|
|
89
|
+
...h
|
|
90
|
+
},
|
|
91
|
+
shadow: {
|
|
92
|
+
background: "radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",
|
|
93
|
+
borderRadius: u,
|
|
94
|
+
width: u,
|
|
95
|
+
height: u,
|
|
96
|
+
position: l ? "absolute" : void 0,
|
|
97
|
+
...h
|
|
98
|
+
},
|
|
99
|
+
playIcon: {
|
|
100
|
+
borderStyle: "solid",
|
|
101
|
+
borderWidth: "16px 0 16px 26px",
|
|
102
|
+
borderColor: "transparent transparent transparent white",
|
|
103
|
+
marginLeft: "7px"
|
|
104
|
+
}
|
|
105
|
+
}, b = /* @__PURE__ */ i.default.createElement("div", { style: c.shadow, className: "react-player__shadow" }, /* @__PURE__ */ i.default.createElement("div", { style: c.playIcon, className: "react-player__play-icon" }));
|
|
106
|
+
return /* @__PURE__ */ i.default.createElement(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
style: c.preview,
|
|
110
|
+
className: "react-player__preview",
|
|
111
|
+
onClick: t,
|
|
112
|
+
tabIndex: a,
|
|
113
|
+
onKeyPress: this.handleKeyPress,
|
|
114
|
+
...o ? { "aria-label": o } : {}
|
|
115
|
+
},
|
|
116
|
+
l ? e : null,
|
|
117
|
+
n || b
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
const D = /* @__PURE__ */ y(m), A = /* @__PURE__ */ w({
|
|
122
|
+
__proto__: null,
|
|
123
|
+
default: D
|
|
124
|
+
}, [m]);
|
|
125
|
+
export {
|
|
126
|
+
A as P
|
|
127
|
+
};
|