@praxisjs/decorators 0.1.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.
Files changed (144) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE +21 -0
  3. package/dist/component/component.d.ts +3 -0
  4. package/dist/component/component.d.ts.map +1 -0
  5. package/dist/component/component.js +13 -0
  6. package/dist/component/component.js.map +1 -0
  7. package/dist/component/index.d.ts +5 -0
  8. package/dist/component/index.d.ts.map +1 -0
  9. package/dist/component/index.js +5 -0
  10. package/dist/component/index.js.map +1 -0
  11. package/dist/component/lazy.d.ts +3 -0
  12. package/dist/component/lazy.d.ts.map +1 -0
  13. package/dist/component/lazy.js +44 -0
  14. package/dist/component/lazy.js.map +1 -0
  15. package/dist/component/lifecycle.d.ts +3 -0
  16. package/dist/component/lifecycle.d.ts.map +1 -0
  17. package/dist/component/lifecycle.js +35 -0
  18. package/dist/component/lifecycle.js.map +1 -0
  19. package/dist/component/memoize.d.ts +5 -0
  20. package/dist/component/memoize.d.ts.map +1 -0
  21. package/dist/component/memoize.js +23 -0
  22. package/dist/component/memoize.js.map +1 -0
  23. package/dist/component/virtual.d.ts +3 -0
  24. package/dist/component/virtual.d.ts.map +1 -0
  25. package/dist/component/virtual.js +66 -0
  26. package/dist/component/virtual.js.map +1 -0
  27. package/dist/events/command.d.ts +6 -0
  28. package/dist/events/command.d.ts.map +1 -0
  29. package/dist/events/command.js +13 -0
  30. package/dist/events/command.js.map +1 -0
  31. package/dist/events/emit.d.ts +2 -0
  32. package/dist/events/emit.d.ts.map +1 -0
  33. package/dist/events/emit.js +36 -0
  34. package/dist/events/emit.js.map +1 -0
  35. package/dist/events/helper.d.ts +3 -0
  36. package/dist/events/helper.d.ts.map +1 -0
  37. package/dist/events/helper.js +7 -0
  38. package/dist/events/helper.js.map +1 -0
  39. package/dist/events/index.d.ts +4 -0
  40. package/dist/events/index.d.ts.map +1 -0
  41. package/dist/events/index.js +4 -0
  42. package/dist/events/index.js.map +1 -0
  43. package/dist/events/on-command.d.ts +2 -0
  44. package/dist/events/on-command.d.ts.map +1 -0
  45. package/dist/events/on-command.js +33 -0
  46. package/dist/events/on-command.js.map +1 -0
  47. package/dist/functions/bind.d.ts +2 -0
  48. package/dist/functions/bind.d.ts.map +1 -0
  49. package/dist/functions/bind.js +19 -0
  50. package/dist/functions/bind.js.map +1 -0
  51. package/dist/functions/debounce.d.ts +2 -0
  52. package/dist/functions/debounce.d.ts.map +1 -0
  53. package/dist/functions/debounce.js +29 -0
  54. package/dist/functions/debounce.js.map +1 -0
  55. package/dist/functions/index.d.ts +10 -0
  56. package/dist/functions/index.d.ts.map +1 -0
  57. package/dist/functions/index.js +10 -0
  58. package/dist/functions/index.js.map +1 -0
  59. package/dist/functions/log.d.ts +9 -0
  60. package/dist/functions/log.d.ts.map +1 -0
  61. package/dist/functions/log.js +43 -0
  62. package/dist/functions/log.js.map +1 -0
  63. package/dist/functions/memo.d.ts +2 -0
  64. package/dist/functions/memo.d.ts.map +1 -0
  65. package/dist/functions/memo.js +45 -0
  66. package/dist/functions/memo.js.map +1 -0
  67. package/dist/functions/once.d.ts +2 -0
  68. package/dist/functions/once.d.ts.map +1 -0
  69. package/dist/functions/once.js +17 -0
  70. package/dist/functions/once.js.map +1 -0
  71. package/dist/functions/retry.d.ts +7 -0
  72. package/dist/functions/retry.d.ts.map +1 -0
  73. package/dist/functions/retry.js +28 -0
  74. package/dist/functions/retry.js.map +1 -0
  75. package/dist/functions/throttle.d.ts +2 -0
  76. package/dist/functions/throttle.d.ts.map +1 -0
  77. package/dist/functions/throttle.js +27 -0
  78. package/dist/functions/throttle.js.map +1 -0
  79. package/dist/functions/watch.d.ts +19 -0
  80. package/dist/functions/watch.d.ts.map +1 -0
  81. package/dist/functions/watch.js +45 -0
  82. package/dist/functions/watch.js.map +1 -0
  83. package/dist/functions/when.d.ts +2 -0
  84. package/dist/functions/when.d.ts.map +1 -0
  85. package/dist/functions/when.js +31 -0
  86. package/dist/functions/when.js.map +1 -0
  87. package/dist/index.d.ts +5 -0
  88. package/dist/index.d.ts.map +1 -0
  89. package/dist/index.js +5 -0
  90. package/dist/index.js.map +1 -0
  91. package/dist/properties/history.d.ts +2 -0
  92. package/dist/properties/history.d.ts.map +1 -0
  93. package/dist/properties/history.js +39 -0
  94. package/dist/properties/history.js.map +1 -0
  95. package/dist/properties/index.d.ts +6 -0
  96. package/dist/properties/index.d.ts.map +1 -0
  97. package/dist/properties/index.js +6 -0
  98. package/dist/properties/index.js.map +1 -0
  99. package/dist/properties/persisted.d.ts +3 -0
  100. package/dist/properties/persisted.d.ts.map +1 -0
  101. package/dist/properties/persisted.js +46 -0
  102. package/dist/properties/persisted.js.map +1 -0
  103. package/dist/properties/prop.d.ts +2 -0
  104. package/dist/properties/prop.d.ts.map +1 -0
  105. package/dist/properties/prop.js +18 -0
  106. package/dist/properties/prop.js.map +1 -0
  107. package/dist/properties/slot.d.ts +9 -0
  108. package/dist/properties/slot.d.ts.map +1 -0
  109. package/dist/properties/slot.js +46 -0
  110. package/dist/properties/slot.js.map +1 -0
  111. package/dist/properties/state.d.ts +2 -0
  112. package/dist/properties/state.d.ts.map +1 -0
  113. package/dist/properties/state.js +24 -0
  114. package/dist/properties/state.js.map +1 -0
  115. package/package.json +26 -0
  116. package/src/component/component.ts +18 -0
  117. package/src/component/index.ts +4 -0
  118. package/src/component/lazy.ts +56 -0
  119. package/src/component/lifecycle.ts +47 -0
  120. package/src/component/memoize.ts +31 -0
  121. package/src/component/virtual.tsx +104 -0
  122. package/src/events/command.ts +17 -0
  123. package/src/events/emit.ts +47 -0
  124. package/src/events/helper.ts +7 -0
  125. package/src/events/index.ts +3 -0
  126. package/src/events/on-command.ts +55 -0
  127. package/src/functions/bind.ts +22 -0
  128. package/src/functions/debounce.ts +34 -0
  129. package/src/functions/index.ts +9 -0
  130. package/src/functions/log.ts +68 -0
  131. package/src/functions/memo.ts +63 -0
  132. package/src/functions/once.ts +22 -0
  133. package/src/functions/retry.ts +43 -0
  134. package/src/functions/throttle.ts +32 -0
  135. package/src/functions/watch.ts +99 -0
  136. package/src/functions/when.ts +44 -0
  137. package/src/index.ts +16 -0
  138. package/src/properties/history.ts +62 -0
  139. package/src/properties/index.ts +5 -0
  140. package/src/properties/persisted.ts +75 -0
  141. package/src/properties/prop.ts +18 -0
  142. package/src/properties/slot.ts +75 -0
  143. package/src/properties/state.ts +24 -0
  144. package/tsconfig.json +8 -0
@@ -0,0 +1,43 @@
1
+ export function Log(options = {}) {
2
+ const { level = "log", args: logArgs = true, result = true, time = false, devOnly = true, } = options;
3
+ return function (_target, methodKey, descriptor) {
4
+ const originalMethod = descriptor.value;
5
+ descriptor.value = function (...args) {
6
+ if (devOnly &&
7
+ typeof process !== "undefined" &&
8
+ process.env.NODE_ENV === "production") {
9
+ return originalMethod.apply(this, args);
10
+ }
11
+ const className = this.constructor.name ?? "Unknown";
12
+ const label = `[${className}.${methodKey}]`;
13
+ const logger = console[level].bind(console);
14
+ if (logArgs)
15
+ logger(`${label} args:`, args);
16
+ const start = time ? performance.now() : 0;
17
+ const output = originalMethod.apply(this, args);
18
+ if (output instanceof Promise) {
19
+ return output
20
+ .then((resolved) => {
21
+ const elapsed = time
22
+ ? ` (${(performance.now() - start).toFixed(2)}ms)`
23
+ : "";
24
+ if (result)
25
+ logger(`${label} resolved:`, resolved, elapsed);
26
+ return resolved;
27
+ })
28
+ .catch((e) => {
29
+ logger(`${label} rejected:`, e);
30
+ throw e;
31
+ });
32
+ }
33
+ const elapsed = time
34
+ ? ` (${(performance.now() - start).toFixed(2)}ms)`
35
+ : "";
36
+ if (result)
37
+ logger(`${label} returned:`, output, elapsed);
38
+ return output;
39
+ };
40
+ return descriptor;
41
+ };
42
+ }
43
+ //# sourceMappingURL=log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/functions/log.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,GAAG,CAAC,UAAsB,EAAE;IA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C,KAAK;wBAClD,CAAC,CAAC,EAAE,CAAC;oBACP,IAAI,MAAM;wBAAE,MAAM,CAAC,GAAG,KAAK,YAAY,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;oBAC5D,OAAO,QAAQ,CAAC;gBAClB,CAAC,CAAC;qBACD,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE;oBACpB,MAAM,CAAC,GAAG,KAAK,YAAY,EAAE,CAAC,CAAC,CAAC;oBAChC,MAAM,CAAC,CAAC;gBACV,CAAC,CAAC,CAAC;YACP,CAAC;YAED,MAAM,OAAO,GAAG,IAAI;gBAClB,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK;gBAClD,CAAC,CAAC,EAAE,CAAC;YACP,IAAI,MAAM;gBAAE,MAAM,CAAC,GAAG,KAAK,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YAE1D,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function Memo(): (_target: object, methodName: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
2
+ //# sourceMappingURL=memo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memo.d.ts","sourceRoot":"","sources":["../../src/functions/memo.ts"],"names":[],"mappings":"AA8CA,wBAAgB,IAAI,KAEhB,SAAS,MAAM,EACf,YAAY,MAAM,EAClB,YAAY,kBAAkB,KAC7B,kBAAkB,CAWtB"}
@@ -0,0 +1,45 @@
1
+ import { computed } from "@praxisjs/core";
2
+ const instanceCache = new WeakMap();
3
+ function getCache(instance, methodName, argKey, factory) {
4
+ let methodMap = instanceCache.get(instance);
5
+ if (!methodMap) {
6
+ methodMap = new Map();
7
+ instanceCache.set(instance, methodMap);
8
+ }
9
+ let argMap = methodMap.get(methodName);
10
+ if (!argMap) {
11
+ argMap = new Map();
12
+ methodMap.set(methodName, argMap);
13
+ }
14
+ let cached = argMap.get(argKey);
15
+ if (!cached) {
16
+ cached = computed(factory);
17
+ argMap.set(argKey, cached);
18
+ }
19
+ return cached;
20
+ }
21
+ function serializeArgs(args) {
22
+ if (args.length === 0)
23
+ return "__no_args__";
24
+ return args
25
+ .map((a) => {
26
+ if (a === null || typeof a === "object")
27
+ return JSON.stringify(a);
28
+ if (typeof a === "symbol")
29
+ return a.toString();
30
+ return String(a);
31
+ })
32
+ .join("|");
33
+ }
34
+ export function Memo() {
35
+ return function (_target, methodName, descriptor) {
36
+ const originalMethod = descriptor.value;
37
+ descriptor.value = function (...args) {
38
+ const argKey = serializeArgs(args);
39
+ const memoized = getCache(this, methodName, argKey, () => originalMethod.apply(this, args));
40
+ return memoized();
41
+ };
42
+ return descriptor;
43
+ };
44
+ }
45
+ //# sourceMappingURL=memo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memo.js","sourceRoot":"","sources":["../../src/functions/memo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,MAAM,aAAa,GAAG,IAAI,OAAO,EAG9B,CAAC;AAEJ,SAAS,QAAQ,CACf,QAAgB,EAChB,UAAkB,EAClB,MAAc,EACd,OAAsB;IAEtB,IAAI,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,SAAS,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,aAAa,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IACvC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,IAAI,GAAG,EAAE,CAAC;QACnB,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE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
@@ -0,0 +1,2 @@
1
+ export declare function Once(): (_target: object, _methodKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
2
+ //# sourceMappingURL=once.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"once.d.ts","sourceRoot":"","sources":["../../src/functions/once.ts"],"names":[],"mappings":"AAAA,wBAAgB,IAAI,KAKhB,SAAS,MAAM,EACf,YAAY,MAAM,EAClB,YAAY,kBAAkB,KAC7B,kBAAkB,CAatB"}
@@ -0,0 +1,17 @@
1
+ export function Once() {
2
+ const called = new WeakMap();
3
+ const results = new WeakMap();
4
+ return function (_target, _methodKey, descriptor) {
5
+ const originalMethod = descriptor.value;
6
+ descriptor.value = function (...args) {
7
+ if (called.get(this))
8
+ return results.get(this);
9
+ const result = originalMethod.apply(this, args);
10
+ called.set(this, true);
11
+ results.set(this, result);
12
+ return result;
13
+ };
14
+ return descriptor;
15
+ };
16
+ }
17
+ //# sourceMappingURL=once.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"once.js","sourceRoot":"","sources":["../../src/functions/once.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,IAAI;IAClB,MAAM,MAAM,GAAG,IAAI,OAAO,EAAmB,CAAC;IAC9C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAmB,CAAC;IAE/C,OAAO,UACL,OAAe,EACf,UAAkB,EAClB,UAA8B;QAE9B,MAAM,cAAc,GAAG,UAAU,CAAC,KAAwC,CAAC;QAE3E,UAAU,CAAC,KAAK,GAAG,UAAwB,GAAG,IAAe;YAC3D,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;gBAAE,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC/C,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAChD,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACvB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAC1B,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ export interface RetryOptions {
2
+ delay?: number;
3
+ backoff?: number;
4
+ onRetry?: (error: Error, attempt: number) => void;
5
+ }
6
+ export declare function Retry(maxAttempts: number, options?: RetryOptions): (_target: object, _methodKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
7
+ //# sourceMappingURL=retry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/functions/retry.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD;AAED,wBAAgB,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,IAIjE,SAAS,MAAM,EACf,YAAY,MAAM,EAClB,YAAY,kBAAkB,KAC7B,kBAAkB,CA6BtB"}
@@ -0,0 +1,28 @@
1
+ export function Retry(maxAttempts, options = {}) {
2
+ const { delay = 0, backoff = 1, onRetry } = options;
3
+ return function (_target, _methodKey, descriptor) {
4
+ const originalMethod = descriptor.value;
5
+ descriptor.value = async function (...args) {
6
+ let lastError = new Error("Unknown error");
7
+ let currentDelay = delay;
8
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
9
+ try {
10
+ return await originalMethod.apply(this, args);
11
+ }
12
+ catch (e) {
13
+ lastError = e instanceof Error ? e : new Error(String(e));
14
+ if (attempt === maxAttempts)
15
+ break;
16
+ onRetry?.(lastError, attempt);
17
+ if (currentDelay > 0) {
18
+ await new Promise((res) => setTimeout(res, currentDelay));
19
+ currentDelay = Math.round(currentDelay * backoff);
20
+ }
21
+ }
22
+ }
23
+ throw lastError;
24
+ };
25
+ return descriptor;
26
+ };
27
+ }
28
+ //# sourceMappingURL=retry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/functions/retry.ts"],"names":[],"mappings":"AAMA,MAAM,UAAU,KAAK,CAAC,WAAmB,EAAE,UAAwB,EAAE;IACnE,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAEpD,OAAO,UACL,OAAe,EACf,UAAkB,EAClB,UAA8B;QAE9B,MAAM,cAAc,GAAG,UAAU,CAAC,KAEb,CAAC;QAEtB,UAAU,CAAC,KAAK,GAAG,KAAK,WAAyB,GAAG,IAAe;YACjE,IAAI,SAAS,GAAU,IAAI,KAAK,CAAC,eAAe,CAAC,CAAC;YAClD,IAAI,YAAY,GAAG,KAAK,CAAC;YAEzB,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,WAAW,EAAE,OAAO,EAAE,EAAE,CAAC;gBACxD,IAAI,CAAC;oBACH,OAAO,MAAM,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBAChD,CAAC;gBAAC,OAAO,CAAU,EAAE,CAAC;oBACpB,SAAS,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;oBAC1D,IAAI,OAAO,KAAK,WAAW;wBAAE,MAAM;oBACnC,OAAO,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;oBAE9B,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;wBACrB,MAAM,IAAI,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC;wBAC1D,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,OAAO,CAAC,CAAC;oBACpD,CAAC;gBACH,CAAC;YACH,CAAC;YAED,MAAM,SAAS,CAAC;QAClB,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function Throttle(ms: number): (_target: object, methodKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
2
+ //# sourceMappingURL=throttle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"throttle.d.ts","sourceRoot":"","sources":["../../src/functions/throttle.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,IAI/B,SAAS,MAAM,EACf,WAAW,MAAM,EACjB,YAAY,kBAAkB,KAC7B,kBAAkB,CAwBtB"}
@@ -0,0 +1,27 @@
1
+ export function Throttle(ms) {
2
+ const lastRun = new WeakMap();
3
+ return function (_target, methodKey, descriptor) {
4
+ const originalMethod = descriptor.value;
5
+ return {
6
+ enumerable: false,
7
+ configurable: true,
8
+ get() {
9
+ const bound = (...args) => {
10
+ const now = Date.now();
11
+ const last = lastRun.get(this) ?? 0;
12
+ if (now - last < ms)
13
+ return;
14
+ lastRun.set(this, now);
15
+ return originalMethod.apply(this, args);
16
+ };
17
+ Object.defineProperty(this, methodKey, {
18
+ value: bound,
19
+ configurable: true,
20
+ writable: true,
21
+ });
22
+ return bound;
23
+ },
24
+ };
25
+ };
26
+ }
27
+ //# sourceMappingURL=throttle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"throttle.js","sourceRoot":"","sources":["../../src/functions/throttle.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CAAC,EAAU;IACjC,MAAM,OAAO,GAAG,IAAI,OAAO,EAAkB,CAAC;IAE9C,OAAO,UACL,OAAe,EACf,SAAiB,EACjB,UAA8B;QAE9B,MAAM,cAAc,GAAG,UAAU,CAAC,KAAwC,CAAC;QAC3E,OAAO;YACL,UAAU,EAAE,KAAK;YACjB,YAAY,EAAE,IAAI;YAClB,GAAG;gBACD,MAAM,KAAK,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE;oBACnC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;oBACvB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAEpC,IAAI,GAAG,GAAG,IAAI,GAAG,EAAE;wBAAE,OAAO;oBAE5B,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;oBACvB,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;gBAC1C,CAAC,CAAC;gBACF,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE;oBACrC,KAAK,EAAE,KAAK;oBACZ,YAAY,EAAE,IAAI;oBAClB,QAAQ,EAAE,IAAI;iBACf,CAAC,CAAC;gBACH,OAAO,KAAK,CAAC;YACf,CAAC;SACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { type BaseComponent } from "@praxisjs/core";
2
+ import { type Computed } from "@praxisjs/shared";
3
+ type BaseComponentKeys = keyof BaseComponent;
4
+ type WatchableKeys<T> = {
5
+ [K in Exclude<keyof T, BaseComponentKeys>]: T[K] extends (...args: infer A) => unknown ? A extends [] ? T[K] extends Computed<unknown> ? K : never : never : K;
6
+ }[Exclude<keyof T, BaseComponentKeys>] & string;
7
+ type NoDuplicates<Keys extends readonly string[], Seen extends string = never> = Keys extends readonly [
8
+ infer Head extends string,
9
+ ...infer Rest extends string[]
10
+ ] ? Head extends Seen ? [`Error: prop '${Head}' is duplicated`, ...Rest] : [Head, ...NoDuplicates<Rest, Seen | Head>] : Keys;
11
+ type ValidateKeys<T extends BaseComponent, Keys extends ReadonlyArray<WatchableKeys<T>>> = NoDuplicates<[...Keys]> extends Keys ? Keys : NoDuplicates<[...Keys]>;
12
+ type Unwrap<T> = T extends Computed<infer U> ? U : T extends () => infer U ? U : T;
13
+ export type WatchVal<T extends BaseComponent, K extends keyof T> = Unwrap<T[K]>;
14
+ export type WatchVals<T extends BaseComponent, K extends keyof T> = {
15
+ [P in K]: Unwrap<T[P]>;
16
+ };
17
+ export declare function Watch<T extends BaseComponent, const Keys extends ReadonlyArray<WatchableKeys<T>>>(...propNames: ValidateKeys<T, Keys>): (target: T, _key: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
18
+ export {};
19
+ //# sourceMappingURL=watch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/functions/watch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,KAAK,QAAQ,EAAc,MAAM,kBAAkB,CAAC;AAE7D,KAAK,iBAAiB,GAAG,MAAM,aAAa,CAAC;AAE7C,KAAK,aAAa,CAAC,CAAC,IAAI;KACrB,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CACvD,GAAG,IAAI,EAAE,MAAM,CAAC,KACb,OAAO,GACR,CAAC,SAAS,EAAE,GACV,CAAC,CAAC,CAAC,CAAC,SAAS,QAAQ,CAAC,OAAO,CAAC,GAC5B,CAAC,GACD,KAAK,GACP,KAAK,GACP,CAAC;CACN,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC,CAAC,GACpC,MAAM,CAAC;AAET,KAAK,YAAY,CACf,IAAI,SAAS,SAAS,MAAM,EAAE,EAC9B,IAAI,SAAS,MAAM,GAAG,KAAK,IACzB,IAAI,SAAS,SAAS;IACxB,MAAM,IAAI,SAAS,MAAM;IACzB,GAAG,MAAM,IAAI,SAAS,MAAM,EAAE;CAC/B,GACG,IAAI,SAAS,IAAI,GACf,CAAC,gBAAgB,IAAI,iBAAiB,EAAE,GAAG,IAAI,CAAC,GAChD,CAAC,IAAI,EAAE,GAAG,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC,GAC5C,IAAI,CAAC;AAET,KAAK,YAAY,CACf,CAAC,SAAS,aAAa,EACvB,IAAI,SAAS,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAC1C,YAAY,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,GAAG,YAAY,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;AAE1E,KAAK,MAAM,CAAC,CAAC,IACX,CAAC,SAAS,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEpE,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,aAAa,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,aAAa,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI;KACjE,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACvB,CAAC;AAmBF,wBAAgB,KAAK,CACnB,CAAC,SAAS,aAAa,EACvB,KAAK,CAAC,IAAI,SAAS,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAClD,GAAG,SAAS,EAAE,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC,IAEjC,QAAQ,CAAC,EACT,MAAM,MAAM,EACZ,YAAY,kBAAkB,KAC7B,kBAAkB,CA8BtB"}
@@ -0,0 +1,45 @@
1
+ import { effect } from "@praxisjs/core";
2
+ import { isComputed } from "@praxisjs/shared";
3
+ function readValue(instance, key) {
4
+ const raw = instance[key];
5
+ return isComputed(raw) ? raw() : raw;
6
+ }
7
+ function injectOnMount(target, fn) {
8
+ const t = target;
9
+ const originalMethod = t.onMount;
10
+ t.onMount = function () {
11
+ originalMethod?.call(this);
12
+ fn.call(this);
13
+ };
14
+ }
15
+ export function Watch(...propNames) {
16
+ return function (target, _key, descriptor) {
17
+ const props = propNames;
18
+ const method = descriptor.value;
19
+ injectOnMount(target, function () {
20
+ if (props.length === 1) {
21
+ let oldVal = readValue(this, props[0]);
22
+ effect(() => {
23
+ const newVal = readValue(this, props[0]);
24
+ if (!Object.is(newVal, oldVal)) {
25
+ method.call(this, newVal, oldVal);
26
+ oldVal = newVal;
27
+ }
28
+ });
29
+ }
30
+ else {
31
+ const read = () => Object.fromEntries(props.map((p) => [p, readValue(this, p)]));
32
+ let oldVals = read();
33
+ effect(() => {
34
+ const newVals = read();
35
+ if (props.some((p) => !Object.is(newVals[p], oldVals[p]))) {
36
+ method.call(this, newVals, oldVals);
37
+ oldVals = newVals;
38
+ }
39
+ });
40
+ }
41
+ });
42
+ return descriptor;
43
+ };
44
+ }
45
+ //# sourceMappingURL=watch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watch.js","sourceRoot":"","sources":["../../src/functions/watch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAiB,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA0C7D,SAAS,SAAS,CAAC,QAAiC,EAAE,GAAW;IAC/D,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC1B,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,GAAyB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;AAC9D,CAAC;AAED,SAAS,aAAa,CACpB,MAAc,EACd,EAA2C;IAE3C,MAAM,CAAC,GAAG,MAAkC,CAAC;IAC7C,MAAM,cAAc,GAAG,CAAC,CAAC,OAAO,CAAC;IACjC,CAAC,CAAC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C,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;wBAC1D,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;wBACpC,OAAO,GAAG,OAAO,CAAC;oBACpB,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function When(propName: string): (target: object, _methodKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
2
+ //# sourceMappingURL=when.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"when.d.ts","sourceRoot":"","sources":["../../src/functions/when.ts"],"names":[],"mappings":"AAGA,wBAAgB,IAAI,CAAC,QAAQ,EAAE,MAAM,IAEjC,QAAQ,MAAM,EACd,YAAY,MAAM,EAClB,YAAY,kBAAkB,KAC7B,kBAAkB,CAmCtB"}
@@ -0,0 +1,31 @@
1
+ import { when } from "@praxisjs/core";
2
+ import { isComputed } from "@praxisjs/shared";
3
+ export function When(propName) {
4
+ return function (target, _methodKey, descriptor) {
5
+ // eslint-disable-next-line @typescript-eslint/unbound-method
6
+ const originalOnMount = target.onMount;
7
+ // eslint-disable-next-line @typescript-eslint/unbound-method
8
+ const originalOnUnmount = target.onUnmount;
9
+ const method = descriptor.value;
10
+ const cancels = new WeakMap();
11
+ target.onMount = function () {
12
+ originalOnMount?.call(this);
13
+ const instance = this;
14
+ const source = () => {
15
+ const raw = instance[propName];
16
+ return isComputed(raw) ? raw() : raw;
17
+ };
18
+ const cancel = when(source, (value) => {
19
+ method.call(this, value);
20
+ });
21
+ cancels.set(this, cancel);
22
+ };
23
+ target.onUnmount = function () {
24
+ originalOnUnmount?.call(this);
25
+ cancels.get(this)?.();
26
+ cancels.delete(this);
27
+ };
28
+ return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,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;YACtB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { Component, Memoize, Lazy, Virtual } from "./component";
2
+ export { Memo, Bind, Log, Once, Retry, Debounce, Throttle, When, Watch, type WatchVal, type WatchVals, } from "./functions";
3
+ export { Prop, State, Persisted, Slot, initSlots, History } from "./properties";
4
+ export { type Command, createCommand, Emit, OnCommand } from "./events";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,KAAK,QAAQ,EACb,KAAK,SAAS,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,KAAK,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export { Component, Memoize, Lazy, Virtual } from "./component";
2
+ export { Memo, Bind, Log, Once, Retry, Debounce, Throttle, When, Watch, } from "./functions";
3
+ export { Prop, State, Persisted, Slot, initSlots, History } from "./properties";
4
+ export { createCommand, Emit, OnCommand } from "./events";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,KAAK,GAGN,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAgB,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function History(limit?: number): (target: object, propertyKey: string) => void;
2
+ //# sourceMappingURL=history.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/properties/history.ts"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,CAAC,KAAK,SAAK,IACf,QAAQ,MAAM,EAAE,aAAa,MAAM,KAAG,IAAI,CA0D5D"}
@@ -0,0 +1,39 @@
1
+ import { history } from "@praxisjs/core";
2
+ export function History(limit = 50) {
3
+ return function (target, propertyKey) {
4
+ const historyKey = `${propertyKey}History`;
5
+ const histories = new WeakMap();
6
+ const originalDescriptor = Object.getOwnPropertyDescriptor(target, propertyKey);
7
+ Object.defineProperty(target, historyKey, {
8
+ get() {
9
+ if (!histories.has(this)) {
10
+ const source = () => {
11
+ const desc = Object.getOwnPropertyDescriptor(this, propertyKey) ??
12
+ Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this), propertyKey);
13
+ return desc?.get?.call(this);
14
+ };
15
+ const h = history(source, limit);
16
+ const originalUndo = () => { h.undo(); };
17
+ const originalRedo = () => { h.redo(); };
18
+ h.undo = () => {
19
+ const prev = h.values()[h.values().length - 2];
20
+ if (prev === undefined)
21
+ return;
22
+ originalUndo();
23
+ (Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this), propertyKey) ?? originalDescriptor)?.set?.call(this, prev);
24
+ };
25
+ h.redo = () => {
26
+ originalRedo();
27
+ const next = h.current();
28
+ (Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this), propertyKey) ?? originalDescriptor)?.set?.call(this, next);
29
+ };
30
+ histories.set(this, h);
31
+ }
32
+ return histories.get(this);
33
+ },
34
+ enumerable: false,
35
+ configurable: true,
36
+ });
37
+ };
38
+ }
39
+ //# sourceMappingURL=history.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"history.js","sourceRoot":"","sources":["../../src/properties/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,UAAU,OAAO,CAAC,KAAK,GAAG,EAAE;IAChC,OAAO,UAAU,MAAc,EAAE,WAAmB;QAClD,MAAM,UAAU,GAAG,GAAG,WAAW,SAAS,CAAC;QAC3C,MAAM,SAAS,GAAG,IAAI,OAAO,EAAmC,CAAC;QAEjE,MAAM,kBAAkB,GAAG,MAAM,CAAC,wBAAwB,CACxD,MAAM,EACN,WAAW,CACZ,CAAC;QAEF,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,EAAE;YACxC,GAAG;gBACD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;oBACzB,MAAM,MAAM,GAAG,GAAG,EAAE;wBAClB,MAAM,IAAI,GACR,MAAM,CAAC,wBAAwB,CAAC,IAAI,EAAE,WAAW,CAAC;4BAClD,MAAM,CAAC,wBAAwB,CAC7B,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,EAC3B,WAAW,CACZ,CAAC;wBACJ,OAAO,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAY,CAAC;oBAC1C,CAAC,CAAC;oBAEF,MAAM,CAAC,GAAG,OAAO,CAAC,MAAuB,EAAE,KAAK,CAAC,CAAC;oBAElD,MAAM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";
4
+ export { Slot, initSlots } from "./slot";
5
+ export { History } from "./history";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/properties/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { Prop } from "./prop";
2
+ export { State } from "./state";
3
+ export { Persisted } from "./persisted";
4
+ export { Slot, initSlots } from "./slot";
5
+ export { History } from "./history";
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/properties/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { type PersistedSignalOptions } from "@praxisjs/core";
2
+ export declare function Persisted<T>(key?: string, options?: PersistedSignalOptions<T>): (target: object, propertyKey: string) => void;
3
+ //# sourceMappingURL=persisted.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persisted.d.ts","sourceRoot":"","sources":["../../src/properties/persisted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAsC9E,wBAAgB,SAAS,CAAC,CAAC,EACzB,GAAG,CAAC,EAAE,MAAM,EACZ,OAAO,GAAE,sBAAsB,CAAC,CAAC,CAAM,IAEtB,QAAQ,MAAM,EAAE,aAAa,MAAM,KAAG,IAAI,CAgC5D"}
@@ -0,0 +1,46 @@
1
+ import { persistedSignal } from "@praxisjs/core";
2
+ const signalMap = new WeakMap();
3
+ const initMap = new WeakMap();
4
+ function isInitialized(instance, propKey) {
5
+ return initMap.get(instance)?.has(propKey) ?? false;
6
+ }
7
+ function markInitialized(instance, propKey) {
8
+ if (!initMap.has(instance)) {
9
+ initMap.set(instance, new Set());
10
+ }
11
+ initMap.get(instance).add(propKey);
12
+ }
13
+ function getOrCreateSignal(instance, storageKey, initialValue, options) {
14
+ if (!signalMap.has(instance)) {
15
+ signalMap.set(instance, new Map());
16
+ }
17
+ const map = signalMap.get(instance);
18
+ if (!map.has(storageKey)) {
19
+ map.set(storageKey, persistedSignal(storageKey, initialValue, options));
20
+ }
21
+ return map.get(storageKey);
22
+ }
23
+ export function Persisted(key, options = {}) {
24
+ return function (target, propertyKey) {
25
+ const storageKey = key ?? propertyKey;
26
+ Object.defineProperty(target, propertyKey, {
27
+ get() {
28
+ if (!isInitialized(this, propertyKey)) {
29
+ return undefined;
30
+ }
31
+ return getOrCreateSignal(this, storageKey, undefined, options)();
32
+ },
33
+ set(value) {
34
+ if (!isInitialized(this, propertyKey)) {
35
+ markInitialized(this, propertyKey);
36
+ getOrCreateSignal(this, storageKey, value, options);
37
+ return;
38
+ }
39
+ getOrCreateSignal(this, storageKey, undefined, options).set(value);
40
+ },
41
+ enumerable: true,
42
+ configurable: true,
43
+ });
44
+ };
45
+ }
46
+ //# sourceMappingURL=persisted.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persisted.js","sourceRoot":"","sources":["../../src/properties/persisted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAA+B,MAAM,gBAAgB,CAAC;AAG9E,MAAM,SAAS,GAAG,IAAI,OAA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W,EAAE;YACzC,GAAG;gBACD,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,CAAC;oBACtC,OAAO,SAAc,CAAC;gBACxB,CAAC;gBAED,OAAO,iBAAiB,CACtB,IAAI,EACJ,UAAU,EACV,SAAc,EACd,OAAO,CACR,EAAE,CAAC;YACN,CAAC;YAED,GAAG,CAAe,KAAQ;gBACxB,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,CAAC;oBACtC,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;oBACnC,iBAAiB,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;oBACpD,OAAO;gBACT,CAAC;gBACD,iBAAiB,CAAI,IAAI,EAAE,UAAU,EAAE,SAAc,EAAE,OAAO,CAAC,CAAC,GAAG,CACjE,KAAK,CACN,CAAC;YACJ,CAAC;YAED,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,IAAI;SACnB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function Prop(): (target: object, propertyKey: string) => void;
2
+ //# sourceMappingURL=prop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop.d.ts","sourceRoot":"","sources":["../../src/properties/prop.ts"],"names":[],"mappings":"AAEA,wBAAgB,IAAI,KACD,QAAQ,MAAM,EAAE,aAAa,MAAM,UAcrD"}
@@ -0,0 +1,18 @@
1
+ export function Prop() {
2
+ return function (target, propertyKey) {
3
+ Object.defineProperty(target, propertyKey, {
4
+ get() {
5
+ const fromParent = this._rawProps[propertyKey];
6
+ if (fromParent !== undefined)
7
+ return fromParent;
8
+ return this._defaults[propertyKey];
9
+ },
10
+ set(value) {
11
+ this._defaults[propertyKey] = value;
12
+ },
13
+ enumerable: true,
14
+ configurable: true,
15
+ });
16
+ };
17
+ }
18
+ //# sourceMappingURL=prop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prop.js","sourceRoot":"","sources":["../../src/properties/prop.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,IAAI;IAClB,OAAO,UAAU,MAAc,EAAE,WAAmB;QAClD,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE;YACzC,GAAG;gBACD,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;gBAC/C,IAAI,UAAU,KAAK,SAAS;oBAAE,OAAO,UAAU,CAAC;gBAChD,OAAO,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YACrC,CAAC;YACD,GAAG,CAAsB,KAAc;gBACrC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,KAAK,CAAC;YACtC,CAAC;YACD,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,IAAI;SACnB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { type Children, type ChildrenInternal, type VNode } from "@praxisjs/shared";
2
+ export interface SlottedVNode extends VNode {
3
+ slot?: string;
4
+ }
5
+ export declare function resolveSlots(children: ChildrenInternal | ChildrenInternal[] | undefined): Map<string, ChildrenInternal[]>;
6
+ export declare function initSlots(instance: object, children: Children | undefined): void;
7
+ export declare function getSlot(instance: object, name: string): ChildrenInternal[];
8
+ export declare function Slot(name?: string): (target: object, propertyKey: string) => void;
9
+ //# sourceMappingURL=slot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slot.d.ts","sourceRoot":"","sources":["../../src/properties/slot.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EAErB,KAAK,KAAK,EACX,MAAM,kBAAkB,CAAC;AAI1B,MAAM,WAAW,YAAa,SAAQ,KAAK;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,GAAG,SAAS,GAC1D,GAAG,CAAC,MAAM,EAAE,gBAAgB,EAAE,CAAC,CAuBjC;AAED,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAC7B,IAAI,CAEN;AAED,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,gBAAgB,EAAE,CAE1E;AAED,wBAAgB,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,IACf,QAAQ,MAAM,EAAE,aAAa,MAAM,KAAG,IAAI,CAqB5D"}
@@ -0,0 +1,46 @@
1
+ import { flattenChildren, } from "@praxisjs/shared";
2
+ const slotsMap = new WeakMap();
3
+ export function resolveSlots(children) {
4
+ const slots = new Map();
5
+ const defaultSlot = [];
6
+ slots.set("default", defaultSlot);
7
+ if (!children)
8
+ return slots;
9
+ const arr = flattenChildren(children);
10
+ for (const child of arr) {
11
+ const slotName = child.props.slot ?? child.slot;
12
+ if (slotName) {
13
+ if (!slots.has(slotName))
14
+ slots.set(slotName, []);
15
+ slots.get(slotName).push(child);
16
+ }
17
+ else {
18
+ defaultSlot.push(child);
19
+ }
20
+ }
21
+ return slots;
22
+ }
23
+ export function initSlots(instance, children) {
24
+ slotsMap.set(instance, resolveSlots(children));
25
+ }
26
+ export function getSlot(instance, name) {
27
+ return slotsMap.get(instance)?.get(name) ?? [];
28
+ }
29
+ export function Slot(name) {
30
+ return function (target, propertyKey) {
31
+ const slotName = name ?? (propertyKey === "default" ? "default" : propertyKey);
32
+ Object.defineProperty(target, propertyKey, {
33
+ get() {
34
+ return getSlot(this, slotName);
35
+ },
36
+ set(_value) {
37
+ if (process.env.NODE_ENV !== "production") {
38
+ console.warn(`[Slot] "${propertyKey}" is a slot and cannot be assigned directly. Slots are filled by the parent component.`);
39
+ }
40
+ },
41
+ enumerable: true,
42
+ configurable: true,
43
+ });
44
+ };
45
+ }
46
+ //# sourceMappingURL=slot.js.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AE,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,IAAa;IAChC,OAAO,UAAU,MAAc,EAAE,WAAmB;QAClD,MAAM,QAAQ,GACZ,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC;QAEhE,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE;YACzC,GAAG;gBACD,OAAO,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YACjC,CAAC;YAED,GAAG,CAAC,MAAe;gBACjB,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;oBAC1C,OAAO,CAAC,IAAI,CACV,WAAW,WAAW,wFAAwF,CAC/G,CAAC;gBACJ,CAAC;YACH,CAAC;YAED,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,IAAI;SACnB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function State(): (target: object, propertyKey: string) => void;
2
+ //# sourceMappingURL=state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/properties/state.ts"],"names":[],"mappings":"AAGA,wBAAgB,KAAK,KACF,QAAQ,MAAM,EAAE,aAAa,MAAM,UAmBrD"}