@omerdlw/base-framework 1.0.0 → 1.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.
Files changed (71) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +121 -52
  3. package/dist/hooks/index.d.ts +1 -10
  4. package/dist/hooks/index.d.ts.map +1 -1
  5. package/dist/hooks/index.js +2 -538
  6. package/dist/hooks/index.js.map +1 -1
  7. package/dist/hooks/types.d.ts +0 -53
  8. package/dist/hooks/types.d.ts.map +1 -1
  9. package/dist/hooks/use-global-event.d.ts +0 -2
  10. package/dist/hooks/use-global-event.d.ts.map +1 -1
  11. package/dist/index.js +138 -742
  12. package/dist/index.js.map +1 -1
  13. package/dist/kernel/index.js +3 -3
  14. package/dist/kernel/index.js.map +1 -1
  15. package/dist/modules/ambient/index.js.map +1 -1
  16. package/dist/modules/background/index.js +5 -5
  17. package/dist/modules/background/index.js.map +1 -1
  18. package/dist/modules/context-menu/index.js +4 -4
  19. package/dist/modules/context-menu/index.js.map +1 -1
  20. package/dist/modules/controls/index.js +3 -3
  21. package/dist/modules/controls/index.js.map +1 -1
  22. package/dist/modules/dock/cards.d.ts +1 -1
  23. package/dist/modules/dock/hooks.d.ts +1 -1
  24. package/dist/modules/dock/index.js +3 -3
  25. package/dist/modules/dock/index.js.map +1 -1
  26. package/dist/modules/index.js +34 -115
  27. package/dist/modules/index.js.map +1 -1
  28. package/dist/modules/loading/index.js +3 -3
  29. package/dist/modules/loading/index.js.map +1 -1
  30. package/dist/modules/media/index.js.map +1 -1
  31. package/dist/modules/modal/index.js +11 -95
  32. package/dist/modules/modal/index.js.map +1 -1
  33. package/dist/modules/notification/index.js +7 -5
  34. package/dist/modules/notification/index.js.map +1 -1
  35. package/dist/provider.js.map +1 -1
  36. package/dist/utils/dom.d.ts +0 -2
  37. package/dist/utils/dom.d.ts.map +1 -1
  38. package/dist/utils/index.d.ts +5 -6
  39. package/dist/utils/index.d.ts.map +1 -1
  40. package/dist/utils/index.js +19 -84
  41. package/dist/utils/index.js.map +1 -1
  42. package/dist/utils/number.d.ts +0 -1
  43. package/dist/utils/number.d.ts.map +1 -1
  44. package/dist/utils/object.d.ts +0 -2
  45. package/dist/utils/object.d.ts.map +1 -1
  46. package/dist/utils/string.d.ts +0 -3
  47. package/dist/utils/string.d.ts.map +1 -1
  48. package/dist/utils/timing.d.ts +0 -1
  49. package/dist/utils/timing.d.ts.map +1 -1
  50. package/docs/README.md +124 -0
  51. package/docs/architecture-and-rules.md +129 -0
  52. package/docs/core-engine.md +196 -0
  53. package/docs/custom-modules.md +267 -0
  54. package/docs/getting-started.md +199 -0
  55. package/docs/modules/README.md +176 -0
  56. package/docs/modules/ambient.md +150 -0
  57. package/docs/modules/background.md +195 -0
  58. package/docs/modules/context-menu.md +248 -0
  59. package/docs/modules/controls.md +159 -0
  60. package/docs/modules/dock.md +734 -0
  61. package/docs/modules/error-boundary.md +160 -0
  62. package/docs/modules/kernel.md +266 -0
  63. package/docs/modules/loading.md +157 -0
  64. package/docs/modules/media.md +196 -0
  65. package/docs/modules/modal.md +229 -0
  66. package/docs/modules/notification.md +161 -0
  67. package/docs/modules/result.md +135 -0
  68. package/docs/testing.md +160 -0
  69. package/docs/theming.md +185 -0
  70. package/package.json +3 -1
  71. package/templates/AGENTS.md +165 -0
@@ -91,30 +91,6 @@ var init_cn = __esm({
91
91
  }
92
92
  });
93
93
 
94
- // src/utils/string.ts
95
- function trimToNull(value) {
96
- if (value === null || value === void 0) return null;
97
- const trimmed = String(value).trim();
98
- return trimmed.length > 0 ? trimmed : null;
99
- }
100
- function stripTrailingSlash(url) {
101
- if (typeof url !== "string") return "";
102
- return url.replace(/\/+$/, "");
103
- }
104
- function normalizePath(path) {
105
- const trimmed = trimToNull(path);
106
- if (!trimmed) return "";
107
- if (trimmed === "/") return "/";
108
- return stripTrailingSlash(trimmed);
109
- }
110
- function isImageIconSource(icon) {
111
- return typeof icon === "string" && (icon.startsWith("http://") || icon.startsWith("https://") || icon.startsWith("/") || icon.startsWith("data:image/"));
112
- }
113
- var init_string = __esm({
114
- "src/utils/string.ts"() {
115
- }
116
- });
117
-
118
94
  // src/utils/dom.ts
119
95
  function acquireGlobalScrollLock() {
120
96
  if (typeof document === "undefined") return () => {
@@ -148,13 +124,36 @@ function acquireGlobalScrollLock() {
148
124
  var isBrowser, globalScrollLockCount, globalScrollLockStyles;
149
125
  var init_dom = __esm({
150
126
  "src/utils/dom.ts"() {
151
- init_string();
152
127
  isBrowser = typeof window !== "undefined";
153
128
  globalScrollLockCount = 0;
154
129
  globalScrollLockStyles = null;
155
130
  }
156
131
  });
157
132
 
133
+ // src/utils/string.ts
134
+ function trimToNull(value) {
135
+ if (value === null || value === void 0) return null;
136
+ const trimmed = String(value).trim();
137
+ return trimmed.length > 0 ? trimmed : null;
138
+ }
139
+ function stripTrailingSlash(url) {
140
+ if (typeof url !== "string") return "";
141
+ return url.replace(/\/+$/, "");
142
+ }
143
+ function normalizePath(path) {
144
+ const trimmed = trimToNull(path);
145
+ if (!trimmed) return "";
146
+ if (trimmed === "/") return "/";
147
+ return stripTrailingSlash(trimmed);
148
+ }
149
+ function isImageIconSource(icon) {
150
+ return typeof icon === "string" && (icon.startsWith("http://") || icon.startsWith("https://") || icon.startsWith("/") || icon.startsWith("data:image/"));
151
+ }
152
+ var init_string = __esm({
153
+ "src/utils/string.ts"() {
154
+ }
155
+ });
156
+
158
157
  // src/utils/number.ts
159
158
  function clamp(value, min, max) {
160
159
  const num = Number(value);
@@ -212,12 +211,6 @@ var init_timing = __esm({
212
211
  }
213
212
  });
214
213
 
215
- // src/utils/json.ts
216
- var init_json = __esm({
217
- "src/utils/json.ts"() {
218
- }
219
- });
220
-
221
214
  // src/utils/report.ts
222
215
  function report(scope, error, level = "error") {
223
216
  if (sink) {
@@ -509,7 +502,6 @@ var init_utils = __esm({
509
502
  init_number();
510
503
  init_object();
511
504
  init_timing();
512
- init_json();
513
505
  init_report();
514
506
  init_user_message();
515
507
  init_store();
@@ -713,35 +705,6 @@ var init_use_isomorphic_layout_effect = __esm({
713
705
  useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;
714
706
  }
715
707
  });
716
- var init_use_debounce = __esm({
717
- "src/hooks/use-debounce.ts"() {
718
- "use client";
719
- }
720
- });
721
- var init_use_mounted = __esm({
722
- "src/hooks/use-mounted.ts"() {
723
- "use client";
724
- }
725
- });
726
- var init_use_media_query = __esm({
727
- "src/hooks/use-media-query.ts"() {
728
- "use client";
729
- init_utils();
730
- }
731
- });
732
- var init_use_controllable_state = __esm({
733
- "src/hooks/use-controllable-state.ts"() {
734
- "use client";
735
- init_use_isomorphic_layout_effect();
736
- }
737
- });
738
- var init_use_hotkey = __esm({
739
- "src/hooks/use-hotkey.ts"() {
740
- "use client";
741
- init_utils();
742
- init_use_isomorphic_layout_effect();
743
- }
744
- });
745
708
 
746
709
  // src/events.ts
747
710
  var EVENT_TYPES, EventEmitter, GLOBAL_EVENTS_KEY, _global, globalEvents;
@@ -863,47 +826,6 @@ var init_use_global_event = __esm({
863
826
  init_use_isomorphic_layout_effect();
864
827
  }
865
828
  });
866
-
867
- // src/result.ts
868
- function isResult(value) {
869
- return typeof value === "object" && value !== null && "success" in value && typeof value.success === "boolean" && ("data" in value && value.success === true || "error" in value && value.success === false);
870
- }
871
- var init_result = __esm({
872
- "src/result.ts"() {
873
- init_user_message();
874
- init_report();
875
- }
876
- });
877
- var init_use_async_action = __esm({
878
- "src/hooks/use-async-action.ts"() {
879
- "use client";
880
- init_events();
881
- init_result();
882
- init_utils();
883
- }
884
- });
885
- var init_use_server_action = __esm({
886
- "src/hooks/use-server-action.ts"() {
887
- "use client";
888
- init_events();
889
- init_result();
890
- init_utils();
891
- }
892
- });
893
- var init_use_storage_state = __esm({
894
- "src/hooks/use-storage-state.ts"() {
895
- "use client";
896
- init_utils();
897
- init_use_isomorphic_layout_effect();
898
- }
899
- });
900
- var init_use_intersection_observer = __esm({
901
- "src/hooks/use-intersection-observer.ts"() {
902
- "use client";
903
- init_utils();
904
- init_use_isomorphic_layout_effect();
905
- }
906
- });
907
829
  function getDomSnapshot() {
908
830
  if (typeof document === "undefined") {
909
831
  return activeFullscreenStateIds.size > 0;
@@ -981,16 +903,7 @@ var init_hooks = __esm({
981
903
  init_use_store();
982
904
  init_use_click_outside();
983
905
  init_use_isomorphic_layout_effect();
984
- init_use_debounce();
985
- init_use_mounted();
986
- init_use_media_query();
987
- init_use_controllable_state();
988
- init_use_hotkey();
989
906
  init_use_global_event();
990
- init_use_async_action();
991
- init_use_server_action();
992
- init_use_storage_state();
993
- init_use_intersection_observer();
994
907
  init_use_fullscreen_state();
995
908
  }
996
909
  });
@@ -4156,8 +4069,8 @@ function triggerVideoPlaybackDirect(videoElement, nextPlaying, configuredMuted)
4156
4069
  if (!configuredMuted && videoElement.volume === 0) {
4157
4070
  videoElement.volume = 0.8;
4158
4071
  }
4159
- videoElement.play().catch((err2) => {
4160
- if (err2?.name === "NotAllowedError") {
4072
+ videoElement.play().catch((err) => {
4073
+ if (err?.name === "NotAllowedError") {
4161
4074
  videoElement.muted = true;
4162
4075
  videoElement.play().catch(() => {
4163
4076
  });
@@ -5954,7 +5867,7 @@ function safeInvoke(handler, ...args) {
5954
5867
  const result = handler(...args);
5955
5868
  if (result && typeof result.then === "function") {
5956
5869
  result.catch(
5957
- (err2) => report("Context menu async callback", err2)
5870
+ (err) => report("Context menu async callback", err)
5958
5871
  );
5959
5872
  }
5960
5873
  return result;
@@ -17738,8 +17651,14 @@ function useNotificationState() {
17738
17651
  return useStore(store);
17739
17652
  }
17740
17653
 
17654
+ // src/result.ts
17655
+ init_user_message();
17656
+ init_report();
17657
+ function isResult(value) {
17658
+ return typeof value === "object" && value !== null && "success" in value && typeof value.success === "boolean" && ("data" in value && value.success === true || "error" in value && value.success === false);
17659
+ }
17660
+
17741
17661
  // src/modules/notification/hooks.ts
17742
- init_result();
17743
17662
  init_utils();
17744
17663
  init_events();
17745
17664
  init_hooks();