point-click-components 0.0.1
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 -0
- package/dist/point-click-components.d.ts +50 -0
- package/dist/point-click-components.js +668 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ActorData } from 'point-click-lib';
|
|
2
|
+
import { Context } from 'react';
|
|
3
|
+
import { Provider } from 'react';
|
|
4
|
+
import { RoomData } from 'point-click-lib';
|
|
5
|
+
|
|
6
|
+
export declare const Bar: () => JSX.Element;
|
|
7
|
+
|
|
8
|
+
export declare function calculateScreenX(xPosition: number, viewAngleX: number, roomData: RoomData): number;
|
|
9
|
+
|
|
10
|
+
export declare function calculateScreenY(yPosition: number, viewAngleY: number, roomData: RoomData): number;
|
|
11
|
+
|
|
12
|
+
export declare const cameraPointContext: Context< {
|
|
13
|
+
cameraPoint?: XY;
|
|
14
|
+
}>;
|
|
15
|
+
|
|
16
|
+
export declare const CamerPointProvider: Provider< {
|
|
17
|
+
cameraPoint?: XY;
|
|
18
|
+
}>;
|
|
19
|
+
|
|
20
|
+
export declare const Foo: ({ message }: Props) => JSX.Element;
|
|
21
|
+
|
|
22
|
+
export declare function getLayerHeight(parallax: number, roomData: RoomData): number;
|
|
23
|
+
|
|
24
|
+
export declare function getLayerWidth(parallax: number, roomData: RoomData): number;
|
|
25
|
+
|
|
26
|
+
export declare function getXShift(viewAngleX: number, parallax: number, roomData: RoomData): number;
|
|
27
|
+
|
|
28
|
+
export declare function getYShift(viewAngleY: number, parallax: number, roomData: RoomData): number;
|
|
29
|
+
|
|
30
|
+
export declare function locateClickInWorld(clickXPosition: number, clickYposition: number, viewAngleX: number, viewAngleY: number, roomData: RoomData): {
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
declare interface Props {
|
|
36
|
+
message: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export declare const putActorsInDisplayOrder: (a: ActorData, b: ActorData) => number;
|
|
40
|
+
|
|
41
|
+
export declare const useCameraPoint: () => {
|
|
42
|
+
cameraPoint?: XY;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
declare type XY = {
|
|
46
|
+
x: number;
|
|
47
|
+
y: number;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export { }
|
|
@@ -0,0 +1,668 @@
|
|
|
1
|
+
import we, { createContext as createContext, useContext as useContext } from "react";
|
|
2
|
+
var N = { exports: {} }, W = {};
|
|
3
|
+
var Oe;
|
|
4
|
+
function gr() {
|
|
5
|
+
if (Oe) return W;
|
|
6
|
+
Oe = 1;
|
|
7
|
+
var s = we, c = /* @__PURE__ */ Symbol.for("react.element"), f = /* @__PURE__ */ Symbol.for("react.fragment"), l = Object.prototype.hasOwnProperty, h = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, _ = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
8
|
+
function P(m, p, C) {
|
|
9
|
+
var g, T = {}, O = null, j = null;
|
|
10
|
+
C !== void 0 && (O = "" + C), p.key !== void 0 && (O = "" + p.key), p.ref !== void 0 && (j = p.ref);
|
|
11
|
+
for (g in p) l.call(p, g) && !_.hasOwnProperty(g) && (T[g] = p[g]);
|
|
12
|
+
if (m && m.defaultProps) for (g in p = m.defaultProps, p) T[g] === void 0 && (T[g] = p[g]);
|
|
13
|
+
return { $$typeof: c, type: m, key: O, ref: j, props: T, _owner: h.current };
|
|
14
|
+
}
|
|
15
|
+
return W.Fragment = f, W.jsx = P, W.jsxs = P, W;
|
|
16
|
+
}
|
|
17
|
+
var Y = {};
|
|
18
|
+
var Ce;
|
|
19
|
+
function yr() {
|
|
20
|
+
return Ce || (Ce = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
21
|
+
var s = we, c = /* @__PURE__ */ Symbol.for("react.element"), f = /* @__PURE__ */ Symbol.for("react.portal"), l = /* @__PURE__ */ Symbol.for("react.fragment"), h = /* @__PURE__ */ Symbol.for("react.strict_mode"), _ = /* @__PURE__ */ Symbol.for("react.profiler"), P = /* @__PURE__ */ Symbol.for("react.provider"), m = /* @__PURE__ */ Symbol.for("react.context"), p = /* @__PURE__ */ Symbol.for("react.forward_ref"), C = /* @__PURE__ */ Symbol.for("react.suspense"), g = /* @__PURE__ */ Symbol.for("react.suspense_list"), T = /* @__PURE__ */ Symbol.for("react.memo"), O = /* @__PURE__ */ Symbol.for("react.lazy"), j = /* @__PURE__ */ Symbol.for("react.offscreen"), $ = Symbol.iterator, B = "@@iterator";
|
|
22
|
+
function J(e) {
|
|
23
|
+
if (e === null || typeof e != "object")
|
|
24
|
+
return null;
|
|
25
|
+
var r = $ && e[$] || e[B];
|
|
26
|
+
return typeof r == "function" ? r : null;
|
|
27
|
+
}
|
|
28
|
+
var k = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
29
|
+
function y(e) {
|
|
30
|
+
{
|
|
31
|
+
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
32
|
+
t[n - 1] = arguments[n];
|
|
33
|
+
Ae("error", e, t);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function Ae(e, r, t) {
|
|
37
|
+
{
|
|
38
|
+
var n = k.ReactDebugCurrentFrame, o = n.getStackAddendum();
|
|
39
|
+
o !== "" && (r += "%s", t = t.concat([o]));
|
|
40
|
+
var u = t.map(function(i) {
|
|
41
|
+
return String(i);
|
|
42
|
+
});
|
|
43
|
+
u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
var De = !1, Ie = !1, We = !1, Ye = !1, $e = !1, ee;
|
|
47
|
+
ee = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
48
|
+
function Le(e) {
|
|
49
|
+
return !!(typeof e == "string" || typeof e == "function" || e === l || e === _ || $e || e === h || e === C || e === g || Ye || e === j || De || Ie || We || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === T || e.$$typeof === P || e.$$typeof === m || e.$$typeof === p || // This needs to include all possible module reference object
|
|
50
|
+
// types supported by any Flight configuration anywhere since
|
|
51
|
+
// we don't know which Flight build this will end up being used
|
|
52
|
+
// with.
|
|
53
|
+
e.$$typeof === ee || e.getModuleId !== void 0));
|
|
54
|
+
}
|
|
55
|
+
function Me(e, r, t) {
|
|
56
|
+
var n = e.displayName;
|
|
57
|
+
if (n)
|
|
58
|
+
return n;
|
|
59
|
+
var o = r.displayName || r.name || "";
|
|
60
|
+
return o !== "" ? t + "(" + o + ")" : t;
|
|
61
|
+
}
|
|
62
|
+
function re(e) {
|
|
63
|
+
return e.displayName || "Context";
|
|
64
|
+
}
|
|
65
|
+
function S(e) {
|
|
66
|
+
if (e == null)
|
|
67
|
+
return null;
|
|
68
|
+
if (typeof e.tag == "number" && y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
69
|
+
return e.displayName || e.name || null;
|
|
70
|
+
if (typeof e == "string")
|
|
71
|
+
return e;
|
|
72
|
+
switch (e) {
|
|
73
|
+
case l:
|
|
74
|
+
return "Fragment";
|
|
75
|
+
case f:
|
|
76
|
+
return "Portal";
|
|
77
|
+
case _:
|
|
78
|
+
return "Profiler";
|
|
79
|
+
case h:
|
|
80
|
+
return "StrictMode";
|
|
81
|
+
case C:
|
|
82
|
+
return "Suspense";
|
|
83
|
+
case g:
|
|
84
|
+
return "SuspenseList";
|
|
85
|
+
}
|
|
86
|
+
if (typeof e == "object")
|
|
87
|
+
switch (e.$$typeof) {
|
|
88
|
+
case m:
|
|
89
|
+
var r = e;
|
|
90
|
+
return re(r) + ".Consumer";
|
|
91
|
+
case P:
|
|
92
|
+
var t = e;
|
|
93
|
+
return re(t._context) + ".Provider";
|
|
94
|
+
case p:
|
|
95
|
+
return Me(e, e.render, "ForwardRef");
|
|
96
|
+
case T:
|
|
97
|
+
var n = e.displayName || null;
|
|
98
|
+
return n !== null ? n : S(e.type) || "Memo";
|
|
99
|
+
case O: {
|
|
100
|
+
var o = e, u = o._payload, i = o._init;
|
|
101
|
+
try {
|
|
102
|
+
return S(i(u));
|
|
103
|
+
} catch {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
var w = Object.assign, D = 0, te, ne, ae, ie, oe, ue, se;
|
|
111
|
+
function ce() {
|
|
112
|
+
}
|
|
113
|
+
ce.__reactDisabledLog = !0;
|
|
114
|
+
function Ve() {
|
|
115
|
+
{
|
|
116
|
+
if (D === 0) {
|
|
117
|
+
te = console.log, ne = console.info, ae = console.warn, ie = console.error, oe = console.group, ue = console.groupCollapsed, se = console.groupEnd;
|
|
118
|
+
var e = {
|
|
119
|
+
configurable: !0,
|
|
120
|
+
enumerable: !0,
|
|
121
|
+
value: ce,
|
|
122
|
+
writable: !0
|
|
123
|
+
};
|
|
124
|
+
Object.defineProperties(console, {
|
|
125
|
+
info: e,
|
|
126
|
+
log: e,
|
|
127
|
+
warn: e,
|
|
128
|
+
error: e,
|
|
129
|
+
group: e,
|
|
130
|
+
groupCollapsed: e,
|
|
131
|
+
groupEnd: e
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
D++;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function Ue() {
|
|
138
|
+
{
|
|
139
|
+
if (D--, D === 0) {
|
|
140
|
+
var e = {
|
|
141
|
+
configurable: !0,
|
|
142
|
+
enumerable: !0,
|
|
143
|
+
writable: !0
|
|
144
|
+
};
|
|
145
|
+
Object.defineProperties(console, {
|
|
146
|
+
log: w({}, e, {
|
|
147
|
+
value: te
|
|
148
|
+
}),
|
|
149
|
+
info: w({}, e, {
|
|
150
|
+
value: ne
|
|
151
|
+
}),
|
|
152
|
+
warn: w({}, e, {
|
|
153
|
+
value: ae
|
|
154
|
+
}),
|
|
155
|
+
error: w({}, e, {
|
|
156
|
+
value: ie
|
|
157
|
+
}),
|
|
158
|
+
group: w({}, e, {
|
|
159
|
+
value: oe
|
|
160
|
+
}),
|
|
161
|
+
groupCollapsed: w({}, e, {
|
|
162
|
+
value: ue
|
|
163
|
+
}),
|
|
164
|
+
groupEnd: w({}, e, {
|
|
165
|
+
value: se
|
|
166
|
+
})
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
D < 0 && y("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
var q = k.ReactCurrentDispatcher, H;
|
|
173
|
+
function L(e, r, t) {
|
|
174
|
+
{
|
|
175
|
+
if (H === void 0)
|
|
176
|
+
try {
|
|
177
|
+
throw Error();
|
|
178
|
+
} catch (o) {
|
|
179
|
+
var n = o.stack.trim().match(/\n( *(at )?)/);
|
|
180
|
+
H = n && n[1] || "";
|
|
181
|
+
}
|
|
182
|
+
return `
|
|
183
|
+
` + H + e;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
var X = !1, M;
|
|
187
|
+
{
|
|
188
|
+
var Ne = typeof WeakMap == "function" ? WeakMap : Map;
|
|
189
|
+
M = new Ne();
|
|
190
|
+
}
|
|
191
|
+
function fe(e, r) {
|
|
192
|
+
if (!e || X)
|
|
193
|
+
return "";
|
|
194
|
+
{
|
|
195
|
+
var t = M.get(e);
|
|
196
|
+
if (t !== void 0)
|
|
197
|
+
return t;
|
|
198
|
+
}
|
|
199
|
+
var n;
|
|
200
|
+
X = !0;
|
|
201
|
+
var o = Error.prepareStackTrace;
|
|
202
|
+
Error.prepareStackTrace = void 0;
|
|
203
|
+
var u;
|
|
204
|
+
u = q.current, q.current = null, Ve();
|
|
205
|
+
try {
|
|
206
|
+
if (r) {
|
|
207
|
+
var i = function() {
|
|
208
|
+
throw Error();
|
|
209
|
+
};
|
|
210
|
+
if (Object.defineProperty(i.prototype, "props", {
|
|
211
|
+
set: function() {
|
|
212
|
+
throw Error();
|
|
213
|
+
}
|
|
214
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
215
|
+
try {
|
|
216
|
+
Reflect.construct(i, []);
|
|
217
|
+
} catch (b) {
|
|
218
|
+
n = b;
|
|
219
|
+
}
|
|
220
|
+
Reflect.construct(e, [], i);
|
|
221
|
+
} else {
|
|
222
|
+
try {
|
|
223
|
+
i.call();
|
|
224
|
+
} catch (b) {
|
|
225
|
+
n = b;
|
|
226
|
+
}
|
|
227
|
+
e.call(i.prototype);
|
|
228
|
+
}
|
|
229
|
+
} else {
|
|
230
|
+
try {
|
|
231
|
+
throw Error();
|
|
232
|
+
} catch (b) {
|
|
233
|
+
n = b;
|
|
234
|
+
}
|
|
235
|
+
e();
|
|
236
|
+
}
|
|
237
|
+
} catch (b) {
|
|
238
|
+
if (b && n && typeof b.stack == "string") {
|
|
239
|
+
for (var a = b.stack.split(`
|
|
240
|
+
`), R = n.stack.split(`
|
|
241
|
+
`), d = a.length - 1, v = R.length - 1; d >= 1 && v >= 0 && a[d] !== R[v]; )
|
|
242
|
+
v--;
|
|
243
|
+
for (; d >= 1 && v >= 0; d--, v--)
|
|
244
|
+
if (a[d] !== R[v]) {
|
|
245
|
+
if (d !== 1 || v !== 1)
|
|
246
|
+
do
|
|
247
|
+
if (d--, v--, v < 0 || a[d] !== R[v]) {
|
|
248
|
+
var E = `
|
|
249
|
+
` + a[d].replace(" at new ", " at ");
|
|
250
|
+
return e.displayName && E.includes("<anonymous>") && (E = E.replace("<anonymous>", e.displayName)), typeof e == "function" && M.set(e, E), E;
|
|
251
|
+
}
|
|
252
|
+
while (d >= 1 && v >= 0);
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
} finally {
|
|
257
|
+
X = !1, q.current = u, Ue(), Error.prepareStackTrace = o;
|
|
258
|
+
}
|
|
259
|
+
var A = e ? e.displayName || e.name : "", x = A ? L(A) : "";
|
|
260
|
+
return typeof e == "function" && M.set(e, x), x;
|
|
261
|
+
}
|
|
262
|
+
function Be(e, r, t) {
|
|
263
|
+
return fe(e, !1);
|
|
264
|
+
}
|
|
265
|
+
function Je(e) {
|
|
266
|
+
var r = e.prototype;
|
|
267
|
+
return !!(r && r.isReactComponent);
|
|
268
|
+
}
|
|
269
|
+
function V(e, r, t) {
|
|
270
|
+
if (e == null)
|
|
271
|
+
return "";
|
|
272
|
+
if (typeof e == "function")
|
|
273
|
+
return fe(e, Je(e));
|
|
274
|
+
if (typeof e == "string")
|
|
275
|
+
return L(e);
|
|
276
|
+
switch (e) {
|
|
277
|
+
case C:
|
|
278
|
+
return L("Suspense");
|
|
279
|
+
case g:
|
|
280
|
+
return L("SuspenseList");
|
|
281
|
+
}
|
|
282
|
+
if (typeof e == "object")
|
|
283
|
+
switch (e.$$typeof) {
|
|
284
|
+
case p:
|
|
285
|
+
return Be(e.render);
|
|
286
|
+
case T:
|
|
287
|
+
return V(e.type, r, t);
|
|
288
|
+
case O: {
|
|
289
|
+
var n = e, o = n._payload, u = n._init;
|
|
290
|
+
try {
|
|
291
|
+
return V(u(o), r, t);
|
|
292
|
+
} catch {
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return "";
|
|
297
|
+
}
|
|
298
|
+
var I = Object.prototype.hasOwnProperty, le = {}, de = k.ReactDebugCurrentFrame;
|
|
299
|
+
function U(e) {
|
|
300
|
+
if (e) {
|
|
301
|
+
var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
|
|
302
|
+
de.setExtraStackFrame(t);
|
|
303
|
+
} else
|
|
304
|
+
de.setExtraStackFrame(null);
|
|
305
|
+
}
|
|
306
|
+
function qe(e, r, t, n, o) {
|
|
307
|
+
{
|
|
308
|
+
var u = Function.call.bind(I);
|
|
309
|
+
for (var i in e)
|
|
310
|
+
if (u(e, i)) {
|
|
311
|
+
var a = void 0;
|
|
312
|
+
try {
|
|
313
|
+
if (typeof e[i] != "function") {
|
|
314
|
+
var R = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
315
|
+
throw R.name = "Invariant Violation", R;
|
|
316
|
+
}
|
|
317
|
+
a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
318
|
+
} catch (d) {
|
|
319
|
+
a = d;
|
|
320
|
+
}
|
|
321
|
+
a && !(a instanceof Error) && (U(o), y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), U(null)), a instanceof Error && !(a.message in le) && (le[a.message] = !0, U(o), y("Failed %s type: %s", t, a.message), U(null));
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
var He = Array.isArray;
|
|
326
|
+
function K(e) {
|
|
327
|
+
return He(e);
|
|
328
|
+
}
|
|
329
|
+
function Xe(e) {
|
|
330
|
+
{
|
|
331
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
332
|
+
return t;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
function Ke(e) {
|
|
336
|
+
try {
|
|
337
|
+
return ve(e), !1;
|
|
338
|
+
} catch {
|
|
339
|
+
return !0;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
function ve(e) {
|
|
343
|
+
return "" + e;
|
|
344
|
+
}
|
|
345
|
+
function pe(e) {
|
|
346
|
+
if (Ke(e))
|
|
347
|
+
return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Xe(e)), ve(e);
|
|
348
|
+
}
|
|
349
|
+
var he = k.ReactCurrentOwner, Ge = {
|
|
350
|
+
key: !0,
|
|
351
|
+
ref: !0,
|
|
352
|
+
__self: !0,
|
|
353
|
+
__source: !0
|
|
354
|
+
}, ge, ye;
|
|
355
|
+
function ze(e) {
|
|
356
|
+
if (I.call(e, "ref")) {
|
|
357
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
358
|
+
if (r && r.isReactWarning)
|
|
359
|
+
return !1;
|
|
360
|
+
}
|
|
361
|
+
return e.ref !== void 0;
|
|
362
|
+
}
|
|
363
|
+
function Ze(e) {
|
|
364
|
+
if (I.call(e, "key")) {
|
|
365
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
366
|
+
if (r && r.isReactWarning)
|
|
367
|
+
return !1;
|
|
368
|
+
}
|
|
369
|
+
return e.key !== void 0;
|
|
370
|
+
}
|
|
371
|
+
function Qe(e, r) {
|
|
372
|
+
typeof e.ref == "string" && he.current;
|
|
373
|
+
}
|
|
374
|
+
function er(e, r) {
|
|
375
|
+
{
|
|
376
|
+
var t = function() {
|
|
377
|
+
ge || (ge = !0, y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
378
|
+
};
|
|
379
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
380
|
+
get: t,
|
|
381
|
+
configurable: !0
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
function rr(e, r) {
|
|
386
|
+
{
|
|
387
|
+
var t = function() {
|
|
388
|
+
ye || (ye = !0, y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
389
|
+
};
|
|
390
|
+
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
391
|
+
get: t,
|
|
392
|
+
configurable: !0
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
var tr = function(e, r, t, n, o, u, i) {
|
|
397
|
+
var a = {
|
|
398
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
399
|
+
$$typeof: c,
|
|
400
|
+
// Built-in properties that belong on the element
|
|
401
|
+
type: e,
|
|
402
|
+
key: r,
|
|
403
|
+
ref: t,
|
|
404
|
+
props: i,
|
|
405
|
+
// Record the component responsible for creating this element.
|
|
406
|
+
_owner: u
|
|
407
|
+
};
|
|
408
|
+
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
409
|
+
configurable: !1,
|
|
410
|
+
enumerable: !1,
|
|
411
|
+
writable: !0,
|
|
412
|
+
value: !1
|
|
413
|
+
}), Object.defineProperty(a, "_self", {
|
|
414
|
+
configurable: !1,
|
|
415
|
+
enumerable: !1,
|
|
416
|
+
writable: !1,
|
|
417
|
+
value: n
|
|
418
|
+
}), Object.defineProperty(a, "_source", {
|
|
419
|
+
configurable: !1,
|
|
420
|
+
enumerable: !1,
|
|
421
|
+
writable: !1,
|
|
422
|
+
value: o
|
|
423
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
424
|
+
};
|
|
425
|
+
function nr(e, r, t, n, o) {
|
|
426
|
+
{
|
|
427
|
+
var u, i = {}, a = null, R = null;
|
|
428
|
+
t !== void 0 && (pe(t), a = "" + t), Ze(r) && (pe(r.key), a = "" + r.key), ze(r) && (R = r.ref, Qe(r, o));
|
|
429
|
+
for (u in r)
|
|
430
|
+
I.call(r, u) && !Ge.hasOwnProperty(u) && (i[u] = r[u]);
|
|
431
|
+
if (e && e.defaultProps) {
|
|
432
|
+
var d = e.defaultProps;
|
|
433
|
+
for (u in d)
|
|
434
|
+
i[u] === void 0 && (i[u] = d[u]);
|
|
435
|
+
}
|
|
436
|
+
if (a || R) {
|
|
437
|
+
var v = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
438
|
+
a && er(i, v), R && rr(i, v);
|
|
439
|
+
}
|
|
440
|
+
return tr(e, a, R, o, n, he.current, i);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
var G = k.ReactCurrentOwner, Re = k.ReactDebugCurrentFrame;
|
|
444
|
+
function F(e) {
|
|
445
|
+
if (e) {
|
|
446
|
+
var r = e._owner, t = V(e.type, e._source, r ? r.type : null);
|
|
447
|
+
Re.setExtraStackFrame(t);
|
|
448
|
+
} else
|
|
449
|
+
Re.setExtraStackFrame(null);
|
|
450
|
+
}
|
|
451
|
+
var z;
|
|
452
|
+
z = !1;
|
|
453
|
+
function Z(e) {
|
|
454
|
+
return typeof e == "object" && e !== null && e.$$typeof === c;
|
|
455
|
+
}
|
|
456
|
+
function be() {
|
|
457
|
+
{
|
|
458
|
+
if (G.current) {
|
|
459
|
+
var e = S(G.current.type);
|
|
460
|
+
if (e)
|
|
461
|
+
return `
|
|
462
|
+
|
|
463
|
+
Check the render method of \`` + e + "`.";
|
|
464
|
+
}
|
|
465
|
+
return "";
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
function ar(e) {
|
|
469
|
+
return "";
|
|
470
|
+
}
|
|
471
|
+
var Ee = {};
|
|
472
|
+
function ir(e) {
|
|
473
|
+
{
|
|
474
|
+
var r = be();
|
|
475
|
+
if (!r) {
|
|
476
|
+
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
477
|
+
t && (r = `
|
|
478
|
+
|
|
479
|
+
Check the top-level render call using <` + t + ">.");
|
|
480
|
+
}
|
|
481
|
+
return r;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
function _e(e, r) {
|
|
485
|
+
{
|
|
486
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
487
|
+
return;
|
|
488
|
+
e._store.validated = !0;
|
|
489
|
+
var t = ir(r);
|
|
490
|
+
if (Ee[t])
|
|
491
|
+
return;
|
|
492
|
+
Ee[t] = !0;
|
|
493
|
+
var n = "";
|
|
494
|
+
e && e._owner && e._owner !== G.current && (n = " It was passed a child from " + S(e._owner.type) + "."), F(e), y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), F(null);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
function me(e, r) {
|
|
498
|
+
{
|
|
499
|
+
if (typeof e != "object")
|
|
500
|
+
return;
|
|
501
|
+
if (K(e))
|
|
502
|
+
for (var t = 0; t < e.length; t++) {
|
|
503
|
+
var n = e[t];
|
|
504
|
+
Z(n) && _e(n, r);
|
|
505
|
+
}
|
|
506
|
+
else if (Z(e))
|
|
507
|
+
e._store && (e._store.validated = !0);
|
|
508
|
+
else if (e) {
|
|
509
|
+
var o = J(e);
|
|
510
|
+
if (typeof o == "function" && o !== e.entries)
|
|
511
|
+
for (var u = o.call(e), i; !(i = u.next()).done; )
|
|
512
|
+
Z(i.value) && _e(i.value, r);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
function or(e) {
|
|
517
|
+
{
|
|
518
|
+
var r = e.type;
|
|
519
|
+
if (r == null || typeof r == "string")
|
|
520
|
+
return;
|
|
521
|
+
var t;
|
|
522
|
+
if (typeof r == "function")
|
|
523
|
+
t = r.propTypes;
|
|
524
|
+
else if (typeof r == "object" && (r.$$typeof === p || // Note: Memo only checks outer props here.
|
|
525
|
+
// Inner props are checked in the reconciler.
|
|
526
|
+
r.$$typeof === T))
|
|
527
|
+
t = r.propTypes;
|
|
528
|
+
else
|
|
529
|
+
return;
|
|
530
|
+
if (t) {
|
|
531
|
+
var n = S(r);
|
|
532
|
+
qe(t, e.props, "prop", n, e);
|
|
533
|
+
} else if (r.PropTypes !== void 0 && !z) {
|
|
534
|
+
z = !0;
|
|
535
|
+
var o = S(r);
|
|
536
|
+
y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
|
|
537
|
+
}
|
|
538
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
function ur(e) {
|
|
542
|
+
{
|
|
543
|
+
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
544
|
+
var n = r[t];
|
|
545
|
+
if (n !== "children" && n !== "key") {
|
|
546
|
+
F(e), y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), F(null);
|
|
547
|
+
break;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
e.ref !== null && (F(e), y("Invalid attribute `ref` supplied to `React.Fragment`."), F(null));
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
var Te = {};
|
|
554
|
+
function Pe(e, r, t, n, o, u) {
|
|
555
|
+
{
|
|
556
|
+
var i = Le(e);
|
|
557
|
+
if (!i) {
|
|
558
|
+
var a = "";
|
|
559
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
560
|
+
var R = ar();
|
|
561
|
+
R ? a += R : a += be();
|
|
562
|
+
var d;
|
|
563
|
+
e === null ? d = "null" : K(e) ? d = "array" : e !== void 0 && e.$$typeof === c ? (d = "<" + (S(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, a);
|
|
564
|
+
}
|
|
565
|
+
var v = nr(e, r, t, o, u);
|
|
566
|
+
if (v == null)
|
|
567
|
+
return v;
|
|
568
|
+
if (i) {
|
|
569
|
+
var E = r.children;
|
|
570
|
+
if (E !== void 0)
|
|
571
|
+
if (n)
|
|
572
|
+
if (K(E)) {
|
|
573
|
+
for (var A = 0; A < E.length; A++)
|
|
574
|
+
me(E[A], e);
|
|
575
|
+
Object.freeze && Object.freeze(E);
|
|
576
|
+
} else
|
|
577
|
+
y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
578
|
+
else
|
|
579
|
+
me(E, e);
|
|
580
|
+
}
|
|
581
|
+
if (I.call(r, "key")) {
|
|
582
|
+
var x = S(e), b = Object.keys(r).filter(function(vr) {
|
|
583
|
+
return vr !== "key";
|
|
584
|
+
}), Q = b.length > 0 ? "{key: someKey, " + b.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
585
|
+
if (!Te[x + Q]) {
|
|
586
|
+
var dr = b.length > 0 ? "{" + b.join(": ..., ") + ": ...}" : "{}";
|
|
587
|
+
y(`A props object containing a "key" prop is being spread into JSX:
|
|
588
|
+
let props = %s;
|
|
589
|
+
<%s {...props} />
|
|
590
|
+
React keys must be passed directly to JSX without using spread:
|
|
591
|
+
let props = %s;
|
|
592
|
+
<%s key={someKey} {...props} />`, Q, x, dr, x), Te[x + Q] = !0;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
return e === l ? ur(v) : or(v), v;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
function sr(e, r, t) {
|
|
599
|
+
return Pe(e, r, t, !0);
|
|
600
|
+
}
|
|
601
|
+
function cr(e, r, t) {
|
|
602
|
+
return Pe(e, r, t, !1);
|
|
603
|
+
}
|
|
604
|
+
var fr = cr, lr = sr;
|
|
605
|
+
Y.Fragment = l, Y.jsx = fr, Y.jsxs = lr;
|
|
606
|
+
})()), Y;
|
|
607
|
+
}
|
|
608
|
+
var Se;
|
|
609
|
+
function Rr() {
|
|
610
|
+
return Se || (Se = 1, process.env.NODE_ENV === "production" ? N.exports = gr() : N.exports = yr()), N.exports;
|
|
611
|
+
}
|
|
612
|
+
var xe = Rr();
|
|
613
|
+
const Tr = ({ message: s }) => /* @__PURE__ */ xe.jsxs("div", { children: [
|
|
614
|
+
"This is the test FOO component: ",
|
|
615
|
+
s
|
|
616
|
+
] }), je = createContext({ cameraPoint: void 0 }), Pr = je.Provider, br = () => useContext(je), Or = () => {
|
|
617
|
+
const { cameraPoint: s } = br();
|
|
618
|
+
return /* @__PURE__ */ xe.jsxs("div", { children: [
|
|
619
|
+
"The Bar says [",
|
|
620
|
+
s?.x,
|
|
621
|
+
",",
|
|
622
|
+
s?.y,
|
|
623
|
+
"]"
|
|
624
|
+
] });
|
|
625
|
+
}, Cr = (s, c) => c.y + (c.baseline ? c.baseline : 0) - (s.y + (s.baseline ? s.baseline : 0));
|
|
626
|
+
function Er(s, c) {
|
|
627
|
+
const { frameWidth: f, width: l } = c;
|
|
628
|
+
return f + s * (l - f);
|
|
629
|
+
}
|
|
630
|
+
function ke(s, c, f) {
|
|
631
|
+
const h = (Er(c, f) - f.frameWidth) / 2;
|
|
632
|
+
return s * h;
|
|
633
|
+
}
|
|
634
|
+
function Sr(s, c, f) {
|
|
635
|
+
const { width: l, frameWidth: h } = f, _ = ke(c, 1, f);
|
|
636
|
+
return h / 2 + (s - l / 2) + _;
|
|
637
|
+
}
|
|
638
|
+
function _r(s, c) {
|
|
639
|
+
const { height: f, frameHeight: l = f } = c;
|
|
640
|
+
return l + s * (f - l);
|
|
641
|
+
}
|
|
642
|
+
function Fe(s, c, f) {
|
|
643
|
+
const { height: l, frameHeight: h = l } = f, P = (_r(c, f) - h) / 2;
|
|
644
|
+
return s * P;
|
|
645
|
+
}
|
|
646
|
+
function wr(s, c, f) {
|
|
647
|
+
const { height: l, frameHeight: h = l } = f, _ = Fe(c, 1, f);
|
|
648
|
+
return h / 2 + (s - l / 2) + _;
|
|
649
|
+
}
|
|
650
|
+
function xr(s, c, f, l, h) {
|
|
651
|
+
const { width: _, frameWidth: P, height: m, frameHeight: p = m } = h, C = ke(f, 1, h), g = s - P / 2, T = _ / 2 - C, O = g + T, j = Fe(l, 1, h), $ = c - p / 2, B = m / 2 - j, J = m - ($ + B);
|
|
652
|
+
return { x: Math.round(O), y: Math.round(J) };
|
|
653
|
+
}
|
|
654
|
+
export {
|
|
655
|
+
Or as Bar,
|
|
656
|
+
Pr as CamerPointProvider,
|
|
657
|
+
Tr as Foo,
|
|
658
|
+
Sr as calculateScreenX,
|
|
659
|
+
wr as calculateScreenY,
|
|
660
|
+
je as cameraPointContext,
|
|
661
|
+
_r as getLayerHeight,
|
|
662
|
+
Er as getLayerWidth,
|
|
663
|
+
ke as getXShift,
|
|
664
|
+
Fe as getYShift,
|
|
665
|
+
xr as locateClickInWorld,
|
|
666
|
+
Cr as putActorsInDisplayOrder,
|
|
667
|
+
br as useCameraPoint
|
|
668
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "point-click-components",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"main": "./dist/point-click-components.js",
|
|
9
|
+
"module": "./dist/point-click-components.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/point-click-components.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"dev": "vite",
|
|
17
|
+
"build": "tsc -b && vite build",
|
|
18
|
+
"lint": "eslint .",
|
|
19
|
+
"preview": "vite preview"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"react": "^18.3.1",
|
|
23
|
+
"react-dom": "^18.3.1"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@eslint/js": "^9.39.1",
|
|
27
|
+
"@types/node": "^24.10.1",
|
|
28
|
+
"@types/react": "^18.0.28",
|
|
29
|
+
"@types/react-dom": "^18.0.11",
|
|
30
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
31
|
+
"eslint": "^9.39.1",
|
|
32
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
33
|
+
"eslint-plugin-react-refresh": "^0.4.24",
|
|
34
|
+
"globals": "^16.5.0",
|
|
35
|
+
"typescript": "~5.9.3",
|
|
36
|
+
"typescript-eslint": "^8.46.4",
|
|
37
|
+
"vite-plugin-dts": "^4.5.4",
|
|
38
|
+
"vite": "^7.2.4"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"point-click-lib": "^0.0.11"
|
|
42
|
+
}
|
|
43
|
+
}
|