@pie-lib/tools 2.0.3-next.0 → 2.0.3-next.57

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.
Files changed (126) hide show
  1. package/CHANGELOG.json +1 -0
  2. package/CHANGELOG.md +626 -0
  3. package/LICENSE.md +5 -0
  4. package/lib/anchor-utils.js +193 -0
  5. package/lib/anchor-utils.js.map +1 -0
  6. package/lib/anchor.js +33 -0
  7. package/lib/anchor.js.map +1 -0
  8. package/lib/index.js +33 -0
  9. package/lib/index.js.map +1 -0
  10. package/lib/protractor/graphic.js +147 -0
  11. package/lib/protractor/graphic.js.map +1 -0
  12. package/lib/protractor/index.js +90 -0
  13. package/lib/protractor/index.js.map +1 -0
  14. package/lib/rotatable.js +335 -0
  15. package/lib/rotatable.js.map +1 -0
  16. package/lib/ruler/graphic.js +89 -0
  17. package/lib/ruler/graphic.js.map +1 -0
  18. package/lib/ruler/index.js +114 -0
  19. package/lib/ruler/index.js.map +1 -0
  20. package/lib/ruler/unit-type.js +55 -0
  21. package/lib/ruler/unit-type.js.map +1 -0
  22. package/lib/ruler/unit.js +124 -0
  23. package/lib/ruler/unit.js.map +1 -0
  24. package/lib/style-utils.js +21 -0
  25. package/lib/style-utils.js.map +1 -0
  26. package/lib/transform-origin.js +71 -0
  27. package/lib/transform-origin.js.map +1 -0
  28. package/package.json +26 -32
  29. package/src/__tests__/anchor-utils.test.js +131 -0
  30. package/src/__tests__/rotatable.test.jsx +263 -0
  31. package/src/__tests__/transform-origin.test.jsx +24 -0
  32. package/src/anchor-utils.js +153 -0
  33. package/src/anchor.jsx +20 -0
  34. package/src/index.js +6 -0
  35. package/src/protractor/__tests__/graphic.test.jsx +64 -0
  36. package/src/protractor/__tests__/index.test.jsx +65 -0
  37. package/src/protractor/graphic.jsx +82 -0
  38. package/src/protractor/index.jsx +67 -0
  39. package/src/rotatable.jsx +290 -0
  40. package/src/ruler/__tests__/graphic.test.jsx +64 -0
  41. package/src/ruler/__tests__/index.test.jsx +85 -0
  42. package/src/ruler/__tests__/unit-type.test.jsx +66 -0
  43. package/src/ruler/__tests__/unit.test.jsx +68 -0
  44. package/src/ruler/graphic.jsx +48 -0
  45. package/src/ruler/index.jsx +78 -0
  46. package/src/ruler/unit-type.jsx +39 -0
  47. package/src/ruler/unit.jsx +83 -0
  48. package/src/style-utils.js +7 -0
  49. package/src/transform-origin.jsx +60 -0
  50. package/dist/_virtual/_rolldown/runtime.js +0 -11
  51. package/dist/anchor-utils.d.ts +0 -60
  52. package/dist/anchor-utils.js +0 -87
  53. package/dist/anchor.d.ts +0 -13
  54. package/dist/anchor.js +0 -17
  55. package/dist/index.d.ts +0 -13
  56. package/dist/index.js +0 -5
  57. package/dist/node_modules/.bun/assert@1.5.1/node_modules/assert/assert.js +0 -174
  58. package/dist/node_modules/.bun/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/actualApply.js +0 -13
  59. package/dist/node_modules/.bun/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionApply.js +0 -8
  60. package/dist/node_modules/.bun/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/functionCall.js +0 -8
  61. package/dist/node_modules/.bun/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/index.js +0 -16
  62. package/dist/node_modules/.bun/call-bind-apply-helpers@1.0.2/node_modules/call-bind-apply-helpers/reflectApply.js +0 -8
  63. package/dist/node_modules/.bun/call-bound@1.0.4/node_modules/call-bound/index.js +0 -14
  64. package/dist/node_modules/.bun/degrees-radians@1.0.3/node_modules/degrees-radians/index.js +0 -12
  65. package/dist/node_modules/.bun/dunder-proto@1.0.1/node_modules/dunder-proto/get.js +0 -19
  66. package/dist/node_modules/.bun/es-define-property@1.0.1/node_modules/es-define-property/index.js +0 -14
  67. package/dist/node_modules/.bun/es-errors@1.3.0/node_modules/es-errors/eval.js +0 -8
  68. package/dist/node_modules/.bun/es-errors@1.3.0/node_modules/es-errors/index.js +0 -8
  69. package/dist/node_modules/.bun/es-errors@1.3.0/node_modules/es-errors/range.js +0 -8
  70. package/dist/node_modules/.bun/es-errors@1.3.0/node_modules/es-errors/ref.js +0 -8
  71. package/dist/node_modules/.bun/es-errors@1.3.0/node_modules/es-errors/syntax.js +0 -8
  72. package/dist/node_modules/.bun/es-errors@1.3.0/node_modules/es-errors/type.js +0 -8
  73. package/dist/node_modules/.bun/es-errors@1.3.0/node_modules/es-errors/uri.js +0 -8
  74. package/dist/node_modules/.bun/es-object-atoms@1.1.2/node_modules/es-object-atoms/index.js +0 -8
  75. package/dist/node_modules/.bun/function-bind@1.1.2/node_modules/function-bind/implementation.js +0 -34
  76. package/dist/node_modules/.bun/function-bind@1.1.2/node_modules/function-bind/index.js +0 -10
  77. package/dist/node_modules/.bun/get-intrinsic@1.3.0/node_modules/get-intrinsic/index.js +0 -283
  78. package/dist/node_modules/.bun/get-proto@1.0.1/node_modules/get-proto/Object.getPrototypeOf.js +0 -9
  79. package/dist/node_modules/.bun/get-proto@1.0.1/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -8
  80. package/dist/node_modules/.bun/get-proto@1.0.1/node_modules/get-proto/index.js +0 -19
  81. package/dist/node_modules/.bun/gopd@1.2.0/node_modules/gopd/gOPD.js +0 -8
  82. package/dist/node_modules/.bun/gopd@1.2.0/node_modules/gopd/index.js +0 -15
  83. package/dist/node_modules/.bun/has-symbols@1.1.0/node_modules/has-symbols/index.js +0 -12
  84. package/dist/node_modules/.bun/has-symbols@1.1.0/node_modules/has-symbols/shams.js +0 -23
  85. package/dist/node_modules/.bun/hasown@2.0.4/node_modules/hasown/index.js +0 -10
  86. package/dist/node_modules/.bun/inherits@2.0.3/node_modules/inherits/inherits_browser.js +0 -19
  87. package/dist/node_modules/.bun/math-intrinsics@1.1.0/node_modules/math-intrinsics/abs.js +0 -8
  88. package/dist/node_modules/.bun/math-intrinsics@1.1.0/node_modules/math-intrinsics/floor.js +0 -8
  89. package/dist/node_modules/.bun/math-intrinsics@1.1.0/node_modules/math-intrinsics/isNaN.js +0 -10
  90. package/dist/node_modules/.bun/math-intrinsics@1.1.0/node_modules/math-intrinsics/max.js +0 -8
  91. package/dist/node_modules/.bun/math-intrinsics@1.1.0/node_modules/math-intrinsics/min.js +0 -8
  92. package/dist/node_modules/.bun/math-intrinsics@1.1.0/node_modules/math-intrinsics/pow.js +0 -8
  93. package/dist/node_modules/.bun/math-intrinsics@1.1.0/node_modules/math-intrinsics/round.js +0 -8
  94. package/dist/node_modules/.bun/math-intrinsics@1.1.0/node_modules/math-intrinsics/sign.js +0 -12
  95. package/dist/node_modules/.bun/object-keys@1.1.1/node_modules/object-keys/implementation.js +0 -77
  96. package/dist/node_modules/.bun/object-keys@1.1.1/node_modules/object-keys/index.js +0 -20
  97. package/dist/node_modules/.bun/object-keys@1.1.1/node_modules/object-keys/isArguments.js +0 -12
  98. package/dist/node_modules/.bun/object.assign@4.1.7/node_modules/object.assign/implementation.js +0 -29
  99. package/dist/node_modules/.bun/object.assign@4.1.7/node_modules/object.assign/polyfill.js +0 -27
  100. package/dist/node_modules/.bun/radians-degrees@1.0.0/node_modules/radians-degrees/index.js +0 -11
  101. package/dist/node_modules/.bun/react-portal@4.3.0_6dbf9a050bc9aadb/node_modules/react-portal/es/LegacyPortal.js +0 -77
  102. package/dist/node_modules/.bun/react-portal@4.3.0_6dbf9a050bc9aadb/node_modules/react-portal/es/Portal.js +0 -55
  103. package/dist/node_modules/.bun/react-portal@4.3.0_6dbf9a050bc9aadb/node_modules/react-portal/es/PortalCompat.js +0 -9
  104. package/dist/node_modules/.bun/react-portal@4.3.0_6dbf9a050bc9aadb/node_modules/react-portal/es/utils.js +0 -4
  105. package/dist/node_modules/.bun/trigonometry-calculator@2.0.0/node_modules/trigonometry-calculator/lib/index.js +0 -53
  106. package/dist/node_modules/.bun/trigonometry-equations@2.0.1/node_modules/trigonometry-equations/lib/index.js +0 -129
  107. package/dist/node_modules/.bun/util@0.10.4/node_modules/util/support/isBufferBrowser.js +0 -10
  108. package/dist/node_modules/.bun/util@0.10.4/node_modules/util/util.js +0 -262
  109. package/dist/protractor/graphic.d.ts +0 -13
  110. package/dist/protractor/graphic.js +0 -85
  111. package/dist/protractor/index.d.ts +0 -29
  112. package/dist/protractor/index.js +0 -56
  113. package/dist/rotatable.d.ts +0 -56
  114. package/dist/rotatable.js +0 -210
  115. package/dist/ruler/graphic.d.ts +0 -20
  116. package/dist/ruler/graphic.js +0 -53
  117. package/dist/ruler/index.d.ts +0 -32
  118. package/dist/ruler/index.js +0 -77
  119. package/dist/ruler/unit-type.d.ts +0 -30
  120. package/dist/ruler/unit-type.js +0 -38
  121. package/dist/ruler/unit.d.ts +0 -21
  122. package/dist/ruler/unit.js +0 -69
  123. package/dist/style-utils.d.ts +0 -12
  124. package/dist/style-utils.js +0 -5
  125. package/dist/transform-origin.d.ts +0 -18
  126. package/dist/transform-origin.js +0 -21
@@ -1,262 +0,0 @@
1
- import { __commonJSMin as e } from "../../../../../_virtual/_rolldown/runtime.js";
2
- import { require_isBufferBrowser as t } from "./support/isBufferBrowser.js";
3
- import { require_inherits_browser as n } from "../../../inherits@2.0.3/node_modules/inherits/inherits_browser.js";
4
- //#region ../../../node_modules/.bun/util@0.10.4/node_modules/util/util.js
5
- var r = /* @__PURE__ */ e(((e) => {
6
- var r = /%[sdj%]/g;
7
- e.format = function(e) {
8
- if (!x(e)) {
9
- for (var t = [], n = 0; n < arguments.length; n++) t.push(o(arguments[n]));
10
- return t.join(" ");
11
- }
12
- for (var n = 1, i = arguments, a = i.length, s = String(e).replace(r, function(e) {
13
- if (e === "%%") return "%";
14
- if (n >= a) return e;
15
- switch (e) {
16
- case "%s": return String(i[n++]);
17
- case "%d": return Number(i[n++]);
18
- case "%j": try {
19
- return JSON.stringify(i[n++]);
20
- } catch {
21
- return "[Circular]";
22
- }
23
- default: return e;
24
- }
25
- }), c = i[n]; n < a; c = i[++n]) v(c) || !T(c) ? s += " " + c : s += " " + o(c);
26
- return s;
27
- }, e.deprecate = function(t, n) {
28
- if (C(global.process)) return function() {
29
- return e.deprecate(t, n).apply(this, arguments);
30
- };
31
- if (process.noDeprecation === !0) return t;
32
- var r = !1;
33
- function i() {
34
- if (!r) {
35
- if (process.throwDeprecation) throw Error(n);
36
- process.traceDeprecation ? console.trace(n) : console.error(n), r = !0;
37
- }
38
- return t.apply(this, arguments);
39
- }
40
- return i;
41
- };
42
- var i = {}, a;
43
- e.debuglog = function(t) {
44
- if (C(a) && (a = process.env.NODE_DEBUG || ""), t = t.toUpperCase(), !i[t]) if (RegExp("\\b" + t + "\\b", "i").test(a)) {
45
- var n = process.pid;
46
- i[t] = function() {
47
- var r = e.format.apply(e, arguments);
48
- console.error("%s %d: %s", t, n, r);
49
- };
50
- } else i[t] = function() {};
51
- return i[t];
52
- };
53
- function o(t, n) {
54
- var r = {
55
- seen: [],
56
- stylize: c
57
- };
58
- return arguments.length >= 3 && (r.depth = arguments[2]), arguments.length >= 4 && (r.colors = arguments[3]), _(n) ? r.showHidden = n : n && e._extend(r, n), C(r.showHidden) && (r.showHidden = !1), C(r.depth) && (r.depth = 2), C(r.colors) && (r.colors = !1), C(r.customInspect) && (r.customInspect = !0), r.colors && (r.stylize = s), u(r, t, r.depth);
59
- }
60
- e.inspect = o, o.colors = {
61
- bold: [1, 22],
62
- italic: [3, 23],
63
- underline: [4, 24],
64
- inverse: [7, 27],
65
- white: [37, 39],
66
- grey: [90, 39],
67
- black: [30, 39],
68
- blue: [34, 39],
69
- cyan: [36, 39],
70
- green: [32, 39],
71
- magenta: [35, 39],
72
- red: [31, 39],
73
- yellow: [33, 39]
74
- }, o.styles = {
75
- special: "cyan",
76
- number: "yellow",
77
- boolean: "yellow",
78
- undefined: "grey",
79
- null: "bold",
80
- string: "green",
81
- date: "magenta",
82
- regexp: "red"
83
- };
84
- function s(e, t) {
85
- var n = o.styles[t];
86
- return n ? "\x1B[" + o.colors[n][0] + "m" + e + "\x1B[" + o.colors[n][1] + "m" : e;
87
- }
88
- function c(e, t) {
89
- return e;
90
- }
91
- function l(e) {
92
- var t = {};
93
- return e.forEach(function(e, n) {
94
- t[e] = !0;
95
- }), t;
96
- }
97
- function u(t, n, r) {
98
- if (t.customInspect && n && O(n.inspect) && n.inspect !== e.inspect && !(n.constructor && n.constructor.prototype === n)) {
99
- var i = n.inspect(r, t);
100
- return x(i) || (i = u(t, i, r)), i;
101
- }
102
- var a = d(t, n);
103
- if (a) return a;
104
- var o = Object.keys(n), s = l(o);
105
- if (t.showHidden && (o = Object.getOwnPropertyNames(n)), D(n) && (o.indexOf("message") >= 0 || o.indexOf("description") >= 0)) return f(n);
106
- if (o.length === 0) {
107
- if (O(n)) {
108
- var c = n.name ? ": " + n.name : "";
109
- return t.stylize("[Function" + c + "]", "special");
110
- }
111
- if (w(n)) return t.stylize(RegExp.prototype.toString.call(n), "regexp");
112
- if (E(n)) return t.stylize(Date.prototype.toString.call(n), "date");
113
- if (D(n)) return f(n);
114
- }
115
- var _ = "", v = !1, y = ["{", "}"];
116
- if (g(n) && (v = !0, y = ["[", "]"]), O(n) && (_ = " [Function" + (n.name ? ": " + n.name : "") + "]"), w(n) && (_ = " " + RegExp.prototype.toString.call(n)), E(n) && (_ = " " + Date.prototype.toUTCString.call(n)), D(n) && (_ = " " + f(n)), o.length === 0 && (!v || n.length == 0)) return y[0] + _ + y[1];
117
- if (r < 0) return w(n) ? t.stylize(RegExp.prototype.toString.call(n), "regexp") : t.stylize("[Object]", "special");
118
- t.seen.push(n);
119
- var b = v ? p(t, n, r, s, o) : o.map(function(e) {
120
- return m(t, n, r, s, e, v);
121
- });
122
- return t.seen.pop(), h(b, _, y);
123
- }
124
- function d(e, t) {
125
- if (C(t)) return e.stylize("undefined", "undefined");
126
- if (x(t)) {
127
- var n = "'" + JSON.stringify(t).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, "\"") + "'";
128
- return e.stylize(n, "string");
129
- }
130
- if (b(t)) return e.stylize("" + t, "number");
131
- if (_(t)) return e.stylize("" + t, "boolean");
132
- if (v(t)) return e.stylize("null", "null");
133
- }
134
- function f(e) {
135
- return "[" + Error.prototype.toString.call(e) + "]";
136
- }
137
- function p(e, t, n, r, i) {
138
- for (var a = [], o = 0, s = t.length; o < s; ++o) P(t, String(o)) ? a.push(m(e, t, n, r, String(o), !0)) : a.push("");
139
- return i.forEach(function(i) {
140
- i.match(/^\d+$/) || a.push(m(e, t, n, r, i, !0));
141
- }), a;
142
- }
143
- function m(e, t, n, r, i, a) {
144
- var o, s, c = Object.getOwnPropertyDescriptor(t, i) || { value: t[i] };
145
- if (c.get ? s = c.set ? e.stylize("[Getter/Setter]", "special") : e.stylize("[Getter]", "special") : c.set && (s = e.stylize("[Setter]", "special")), P(r, i) || (o = "[" + i + "]"), s || (e.seen.indexOf(c.value) < 0 ? (s = v(n) ? u(e, c.value, null) : u(e, c.value, n - 1), s.indexOf("\n") > -1 && (s = a ? s.split("\n").map(function(e) {
146
- return " " + e;
147
- }).join("\n").substr(2) : "\n" + s.split("\n").map(function(e) {
148
- return " " + e;
149
- }).join("\n"))) : s = e.stylize("[Circular]", "special")), C(o)) {
150
- if (a && i.match(/^\d+$/)) return s;
151
- o = JSON.stringify("" + i), o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (o = o.substr(1, o.length - 2), o = e.stylize(o, "name")) : (o = o.replace(/'/g, "\\'").replace(/\\"/g, "\"").replace(/(^"|"$)/g, "'"), o = e.stylize(o, "string"));
152
- }
153
- return o + ": " + s;
154
- }
155
- function h(e, t, n) {
156
- var r = 0;
157
- return e.reduce(function(e, t) {
158
- return r++, t.indexOf("\n") >= 0 && r++, e + t.replace(/\u001b\[\d\d?m/g, "").length + 1;
159
- }, 0) > 60 ? n[0] + (t === "" ? "" : t + "\n ") + " " + e.join(",\n ") + " " + n[1] : n[0] + t + " " + e.join(", ") + " " + n[1];
160
- }
161
- function g(e) {
162
- return Array.isArray(e);
163
- }
164
- e.isArray = g;
165
- function _(e) {
166
- return typeof e == "boolean";
167
- }
168
- e.isBoolean = _;
169
- function v(e) {
170
- return e === null;
171
- }
172
- e.isNull = v;
173
- function y(e) {
174
- return e == null;
175
- }
176
- e.isNullOrUndefined = y;
177
- function b(e) {
178
- return typeof e == "number";
179
- }
180
- e.isNumber = b;
181
- function x(e) {
182
- return typeof e == "string";
183
- }
184
- e.isString = x;
185
- function S(e) {
186
- return typeof e == "symbol";
187
- }
188
- e.isSymbol = S;
189
- function C(e) {
190
- return e === void 0;
191
- }
192
- e.isUndefined = C;
193
- function w(e) {
194
- return T(e) && A(e) === "[object RegExp]";
195
- }
196
- e.isRegExp = w;
197
- function T(e) {
198
- return typeof e == "object" && !!e;
199
- }
200
- e.isObject = T;
201
- function E(e) {
202
- return T(e) && A(e) === "[object Date]";
203
- }
204
- e.isDate = E;
205
- function D(e) {
206
- return T(e) && (A(e) === "[object Error]" || e instanceof Error);
207
- }
208
- e.isError = D;
209
- function O(e) {
210
- return typeof e == "function";
211
- }
212
- e.isFunction = O;
213
- function k(e) {
214
- return e === null || typeof e == "boolean" || typeof e == "number" || typeof e == "string" || typeof e == "symbol" || e === void 0;
215
- }
216
- e.isPrimitive = k, e.isBuffer = t();
217
- function A(e) {
218
- return Object.prototype.toString.call(e);
219
- }
220
- function j(e) {
221
- return e < 10 ? "0" + e.toString(10) : e.toString(10);
222
- }
223
- var M = [
224
- "Jan",
225
- "Feb",
226
- "Mar",
227
- "Apr",
228
- "May",
229
- "Jun",
230
- "Jul",
231
- "Aug",
232
- "Sep",
233
- "Oct",
234
- "Nov",
235
- "Dec"
236
- ];
237
- function N() {
238
- var e = /* @__PURE__ */ new Date(), t = [
239
- j(e.getHours()),
240
- j(e.getMinutes()),
241
- j(e.getSeconds())
242
- ].join(":");
243
- return [
244
- e.getDate(),
245
- M[e.getMonth()],
246
- t
247
- ].join(" ");
248
- }
249
- e.log = function() {
250
- console.log("%s - %s", N(), e.format.apply(e, arguments));
251
- }, e.inherits = n(), e._extend = function(e, t) {
252
- if (!t || !T(t)) return e;
253
- for (var n = Object.keys(t), r = n.length; r--;) e[n[r]] = t[n[r]];
254
- return e;
255
- };
256
- function P(e, t) {
257
- return Object.prototype.hasOwnProperty.call(e, t);
258
- }
259
- }));
260
- //#endregion
261
- export default r();
262
- export { r as require_util };
@@ -1,13 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/tools/src/protractor/graphic.jsx
3
- * @auto-generated
4
- *
5
- * This file is automatically synced from pie-elements and converted to TypeScript.
6
- * Manual edits will be overwritten on next sync.
7
- * To make changes, edit the upstream JavaScript file and run sync again.
8
- */
9
- import React from 'react';
10
- export declare class Graphic extends React.PureComponent {
11
- render(): React.JSX.Element;
12
- }
13
- export default Graphic;
@@ -1,85 +0,0 @@
1
- import { noSelect as e, strokeColor as t } from "../style-utils.js";
2
- import n from "react";
3
- import { styled as r } from "@mui/material/styles";
4
- import { range as i } from "@pie-element/shared-lodash";
5
- import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
- //#region src/protractor/graphic.tsx
7
- var s = r("line")(({ theme: e }) => ({
8
- strokeWidth: "0.2",
9
- stroke: t(e)
10
- })), c = ({ angle: e, major: t, minor: n }) => /* @__PURE__ */ a(s, {
11
- transform: `rotate(${e}, 50.5,50)`,
12
- style: {},
13
- x1: "1",
14
- x2: t ? 10 : n ? 6 : 3,
15
- y1: "50",
16
- y2: "50"
17
- }), l = r("line")(({ theme: e }) => ({
18
- strokeWidth: "0.2",
19
- stroke: t(e)
20
- })), u = ({ angle: e }) => /* @__PURE__ */ a(l, {
21
- transform: `rotate(${e}, 50.5,50)`,
22
- style: {},
23
- x1: "15",
24
- x2: "46",
25
- y1: "50",
26
- y2: "50"
27
- }), d = r("text")(({ theme: n }) => ({
28
- fontSize: "2.5px",
29
- textAnchor: "middle",
30
- fill: t(n),
31
- ...e()
32
- })), f = ({ angle: e }) => /* @__PURE__ */ a(d, {
33
- transform: `rotate(${e - 90}, 50.5, 50)`,
34
- x: "50",
35
- y: "12.5",
36
- children: e
37
- }), p = r("path")(({ theme: e }) => ({
38
- strokeWidth: "0.2",
39
- stroke: t(e)
40
- })), m = r("line")(({ theme: e }) => ({
41
- strokeWidth: "0.2",
42
- stroke: t(e)
43
- })), h = r("circle")(({ theme: e }) => ({
44
- strokeWidth: "0.2",
45
- stroke: t(e),
46
- fill: "none"
47
- })), g = class extends n.PureComponent {
48
- render() {
49
- return /* @__PURE__ */ o("svg", {
50
- viewBox: "0 0 102 61",
51
- children: [
52
- /* @__PURE__ */ a(p, {
53
- d: "M 1,50 A 1,1 0 0 1 100,50 L 100,60 L 1,60 Z",
54
- fill: "none"
55
- }),
56
- i(0, 181).map((e) => /* @__PURE__ */ a(c, {
57
- minor: e % 5 == 0,
58
- major: e % 10 == 0,
59
- angle: e
60
- }, e)),
61
- i(0, 181, 10).map((e) => /* @__PURE__ */ o(n.Fragment, { children: [/* @__PURE__ */ a(u, { angle: e }), /* @__PURE__ */ a(f, { angle: e })] }, e)),
62
- /* @__PURE__ */ a(h, {
63
- r: "4",
64
- cx: "50.5",
65
- cy: "50"
66
- }),
67
- /* @__PURE__ */ a(m, {
68
- x1: "48.5",
69
- x2: "52.5",
70
- y1: "50",
71
- y2: "50"
72
- }),
73
- /* @__PURE__ */ a(m, {
74
- transform: "rotate(90 50.5 50)",
75
- x1: "48.5",
76
- x2: "52.5",
77
- y1: "50",
78
- y2: "50"
79
- })
80
- ]
81
- });
82
- }
83
- };
84
- //#endregion
85
- export { g as default };
@@ -1,29 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/tools/src/protractor/index.jsx
3
- * @auto-generated
4
- *
5
- * This file is automatically synced from pie-elements and converted to TypeScript.
6
- * Manual edits will be overwritten on next sync.
7
- * To make changes, edit the upstream JavaScript file and run sync again.
8
- */
9
- import React from 'react';
10
- import PropTypes from 'prop-types';
11
- export declare class Protractor extends React.Component {
12
- static propTypes: {
13
- width: PropTypes.Validator<number>;
14
- className: PropTypes.Requireable<string>;
15
- startPosition: PropTypes.Requireable<PropTypes.InferProps<{
16
- left: PropTypes.Requireable<number>;
17
- top: PropTypes.Requireable<number>;
18
- }>>;
19
- };
20
- static defaultProps: {
21
- width: number;
22
- startPosition: {
23
- left: number;
24
- top: number;
25
- };
26
- };
27
- render(): React.JSX.Element;
28
- }
29
- export default Protractor;
@@ -1,56 +0,0 @@
1
- import e from "./graphic.js";
2
- import t from "../anchor.js";
3
- import n from "../rotatable.js";
4
- import r from "react";
5
- import { styled as i } from "@mui/material/styles";
6
- import a from "prop-types";
7
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
- //#region src/protractor/index.tsx
9
- var c = i("div")(() => ({ position: "relative" })), l = i(t)(() => ({
10
- position: "absolute",
11
- left: 0,
12
- bottom: 0
13
- })), u = i(t)(() => ({
14
- position: "absolute",
15
- right: 0,
16
- bottom: 0
17
- })), d = class extends r.Component {
18
- static propTypes = {
19
- width: a.number.isRequired,
20
- className: a.string,
21
- startPosition: a.shape({
22
- left: a.number,
23
- top: a.number
24
- })
25
- };
26
- static defaultProps = {
27
- width: 450,
28
- startPosition: {
29
- left: 0,
30
- top: 0
31
- }
32
- };
33
- render() {
34
- let { width: t, startPosition: r } = this.props;
35
- return /* @__PURE__ */ o(n, {
36
- startPosition: r,
37
- handle: [{
38
- class: "leftAnchor",
39
- origin: `${t * .495}px ${t * .49}px`
40
- }, {
41
- class: "rightAnchor",
42
- origin: `${t * .495}px ${t * .49}px`
43
- }],
44
- children: /* @__PURE__ */ s(c, {
45
- style: { width: `${t}px` },
46
- children: [
47
- /* @__PURE__ */ o(e, {}),
48
- /* @__PURE__ */ o(l, { className: "leftAnchor" }),
49
- /* @__PURE__ */ o(u, { className: "rightAnchor" })
50
- ]
51
- })
52
- });
53
- }
54
- };
55
- //#endregion
56
- export { d as default };
@@ -1,56 +0,0 @@
1
- /**
2
- * @synced-from pie-lib/packages/tools/src/rotatable.jsx
3
- * @auto-generated
4
- *
5
- * This file is automatically synced from pie-elements and converted to TypeScript.
6
- * Manual edits will be overwritten on next sync.
7
- * To make changes, edit the upstream JavaScript file and run sync again.
8
- */
9
- import React from 'react';
10
- import PropTypes from 'prop-types';
11
- export declare class Rotatable extends React.Component {
12
- static propTypes: {
13
- children: PropTypes.Validator<NonNullable<NonNullable<PropTypes.ReactNodeLike>>>;
14
- showAnchor: PropTypes.Requireable<boolean>;
15
- handle: PropTypes.Requireable<(PropTypes.InferProps<{
16
- class: PropTypes.Validator<string>;
17
- origin: PropTypes.Requireable<string>;
18
- }> | null | undefined)[]>;
19
- startPosition: PropTypes.Requireable<PropTypes.InferProps<{
20
- left: PropTypes.Requireable<number>;
21
- top: PropTypes.Requireable<number>;
22
- }>>;
23
- };
24
- static defaultProps: {
25
- showAnchor: boolean;
26
- startPosition: {
27
- left: number;
28
- top: number;
29
- };
30
- };
31
- constructor(props: any);
32
- componentWillUnmount(): void;
33
- componentDidMount(): void;
34
- initHandles: any;
35
- addMouseUpHandler: any;
36
- originToXY: any;
37
- /**
38
- * Get the anchor point for the given element, origin and rotation.
39
- * @returns {{left:number, top: number}} - the co-ordinates of the anchor point relative to the whole page.
40
- */
41
- getAnchor: any;
42
- rotateStart: (origin: any) => (e: any) => void;
43
- rotateStop: any;
44
- getAngle(anchor: any, e: any): {
45
- angle: number;
46
- x: number;
47
- y: number;
48
- };
49
- rotate: any;
50
- mouseDown: any;
51
- dragStart: any;
52
- drag: any;
53
- mouseUp: any;
54
- render(): React.JSX.Element;
55
- }
56
- export default Rotatable;