@cleanweb/react 1.1.1-beta.17 → 1.1.1-beta.18

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.
@@ -1,55 +1,4 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
28
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
2
  Object.defineProperty(exports, "__esModule", { value: true });
54
3
  exports.useMethods = exports.ComponentMethods = void 0;
55
4
  // Values
@@ -97,28 +46,19 @@ var useMethods = function () {
97
46
  return methods;
98
47
  };
99
48
  exports.useMethods = useMethods;
100
- testing: {
101
- var a = function () { return __awaiter(void 0, void 0, void 0, function () {
102
- var a, MyMethods, useCleanState, self;
103
- return __generator(this, function (_a) {
104
- switch (_a.label) {
105
- case 0:
106
- a = { b: '' };
107
- MyMethods = /** @class */ (function (_super) {
108
- __extends(MyMethods, _super);
109
- function MyMethods() {
110
- return _super !== null && _super.apply(this, arguments) || this;
111
- }
112
- return MyMethods;
113
- }(ComponentMethods));
114
- ;
115
- return [4 /*yield*/, import('./state.js')];
116
- case 1:
117
- useCleanState = (_a.sent()).useCleanState;
118
- self = useMethods(MyMethods, {});
119
- self.state;
120
- return [2 /*return*/];
121
- }
122
- });
123
- }); };
124
- }
49
+ /*testing: {
50
+ let a = async () => {
51
+ const a: object = {b: ''};
52
+
53
+ type t = keyof typeof a;
54
+
55
+ class MyMethods extends ComponentMethods<WeakEmptyObject, null> {
56
+ // static getInitialState = () => ({});
57
+ };
58
+
59
+ const { useCleanState } = (await import('./state.js'));
60
+
61
+ const self = useMethods(MyMethods, {});
62
+ self.state;
63
+ }
64
+ }*/
@@ -155,20 +155,3 @@ var Use = function (params) {
155
155
  return null;
156
156
  };
157
157
  exports.Use = Use;
158
- testing: {
159
- var a = { b: '' };
160
- var MyComponentLogic = /** @class */ (function (_super) {
161
- __extends(MyComponentLogic, _super);
162
- function MyComponentLogic() {
163
- var _this = _super !== null && _super.apply(this, arguments) || this;
164
- // a = () => this.hooks.a = '';
165
- _this.useHooks = function () {
166
- };
167
- return _this;
168
- }
169
- MyComponentLogic.getInitialState = function () { return ({ a: '' }); };
170
- return MyComponentLogic;
171
- }(ClassComponent));
172
- ;
173
- var Template = MyComponentLogic.FC();
174
- }
@@ -156,20 +156,21 @@ var useInstance = function () {
156
156
  return instance;
157
157
  };
158
158
  exports.useInstance = useInstance;
159
- testing: {
160
- var A = /** @class */ (function (_super) {
161
- __extends(A, _super);
162
- function A() {
163
- var _this = _super !== null && _super.apply(this, arguments) || this;
164
- // k = this.props.o
165
- _this.a = _this.state['_initialValues_'];
166
- return _this;
167
- // hard empty has every key
168
- // weak empty has no key
169
- // weak empty is not assignable to hard empty
170
- }
171
- return A;
172
- }(ComponentInstance));
173
- var p = { k: '' };
174
- var a = (0, exports.useInstance)(A, { o: '' });
175
- }
159
+ /*testing: {
160
+ class A extends ComponentInstance {
161
+ static getInitialState: (p?: object) => ({putan: ''});
162
+ // k = this.props.o
163
+ a = this.state['_initialValues_']
164
+
165
+ // hard empty has every key
166
+ // weak empty has no key
167
+ // weak empty is not assignable to hard empty
168
+ }
169
+
170
+ const p = {k: ''}
171
+ const a = useInstance(A, {o: ''});
172
+
173
+ // a.props['o'];
174
+ type bbbb = A['state'];
175
+ type ttt = bbbb['put'];
176
+ }*/
@@ -1,20 +1,4 @@
1
1
  "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var _a;
18
2
  Object.defineProperty(exports, "__esModule", { value: true });
19
3
  exports.useLogic = exports.ComponentLogic = void 0;
20
4
  var react_1 = require("react");
@@ -68,37 +52,30 @@ var useLogic = function () {
68
52
  return self;
69
53
  };
70
54
  exports.useLogic = useLogic;
71
- testing: {
72
- var a = { b: '' };
73
- var MyComponentLogic = /** @class */ (function (_super) {
74
- __extends(MyComponentLogic, _super);
75
- function MyComponentLogic() {
76
- return _super !== null && _super.apply(this, arguments) || this;
77
- }
78
- MyComponentLogic.getInitialState = function () { return ({ a: '' }); };
79
- return MyComponentLogic;
80
- }(ComponentLogic));
81
- ;
82
- MyComponentLogic.getInitialState;
55
+ /*testing: {
56
+ const a: object = {b: ''};
57
+
58
+ type t = keyof typeof a;
59
+
60
+ class MyComponentLogic extends ComponentLogic<{a: string}> {
61
+ static getInitialState = () => ({a: '' as const});
62
+ // b = this.state.put[''] + this.props.b;
63
+ };
64
+
65
+ type tt = keyof {};
66
+
67
+ MyComponentLogic.getInitialState
83
68
  // const self = useLogic(MyComponentLogic);
84
- }
85
- testing: {
86
- var A = /** @class */ (function (_super) {
87
- __extends(C, _super);
88
- function C() {
89
- return _super !== null && _super.apply(this, arguments) || this;
90
- }
91
- return C;
92
- }(ComponentLogic));
69
+
70
+
71
+ const A = class C extends ComponentLogic {
72
+ // static getInitialState = () => ({a: 'l'});
73
+ // a = () => this.state.yyy = '';
74
+ }
75
+
93
76
  A.getInitialState();
77
+
94
78
  // const oa = {['a' as unknown as symbol]: 'boo'};
95
- var oa = (_a = {}, _a['a'] = 'boo', _a);
79
+ const oa = {['a']: 'boo'};
96
80
  // const self = useLogic(A, oa);
97
- }
98
- // export type ComponentClassStatics<Instance extends ComponentLogic<object, object, object>> = {
99
- // getInitialState: (props?: Instance['props']) => TState<Instance['state']>;
100
- // }
101
- // export type TComponentClass<
102
- // Instance extends ComponentLogic<object, object, object>,
103
- // Params extends CnstPrm = CnstPrm
104
- // > = ComponentClassStatics<Instance> & Constructor<Instance, Params>;
81
+ }*/
package/build/globals.js CHANGED
@@ -2,13 +2,3 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  /////////////
4
4
  var UniqueSecretSymbolKey = Symbol('asdfghjkliuytrewqaxcvb,nb');
5
- testing: {
6
- var mySymbol = Symbol('asdfgh');
7
- var tt = {
8
- // [mySymbol]: '' as never,
9
- // [UniqueSecretSymbolKey]: '',
10
- // '': '',
11
- };
12
- var TT = {};
13
- TT = tt;
14
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleanweb/react",
3
- "version": "1.1.1-beta.17",
3
+ "version": "1.1.1-beta.18",
4
4
  "description": "A suite of helpers for writing cleaner React function components.",
5
5
  "engines": {
6
6
  "node": ">=18"