@mdxui/do 4.0.0 → 4.0.8

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 (125) hide show
  1. package/dist/app/index.d.ts +32 -186
  2. package/dist/app/index.js +19 -11
  3. package/dist/auth/index.d.ts +48 -0
  4. package/dist/auth/index.js +4 -0
  5. package/dist/{breadcrumbs-C9Qn3S7d.d.ts → breadcrumbs-DltlCiHt.d.ts} +3 -3
  6. package/dist/chunk-2FWXT4HH.js +576 -0
  7. package/dist/chunk-2FWXT4HH.js.map +1 -0
  8. package/dist/chunk-5PC6U46L.js +604 -0
  9. package/dist/chunk-5PC6U46L.js.map +1 -0
  10. package/dist/chunk-63VCRTDQ.js +2505 -0
  11. package/dist/chunk-63VCRTDQ.js.map +1 -0
  12. package/dist/chunk-7J3RSIG4.js +178 -0
  13. package/dist/chunk-7J3RSIG4.js.map +1 -0
  14. package/dist/chunk-7QCTRNEJ.js +173 -0
  15. package/dist/chunk-7QCTRNEJ.js.map +1 -0
  16. package/dist/chunk-7TFHUKS7.js +66 -0
  17. package/dist/chunk-7TFHUKS7.js.map +1 -0
  18. package/dist/{chunk-LJIWB7KE.js → chunk-BU5HMHGQ.js} +3 -3
  19. package/dist/chunk-BU5HMHGQ.js.map +1 -0
  20. package/dist/{chunk-GGO5GW72.js → chunk-BZURBNFD.js} +305 -51
  21. package/dist/chunk-BZURBNFD.js.map +1 -0
  22. package/dist/{chunk-NA652ART.js → chunk-FM2RTAHV.js} +5 -65
  23. package/dist/chunk-FM2RTAHV.js.map +1 -0
  24. package/dist/{chunk-WMNT4OIE.js → chunk-HC4PBXV4.js} +131 -58
  25. package/dist/chunk-HC4PBXV4.js.map +1 -0
  26. package/dist/{chunk-Y52IEYVM.js → chunk-JPZ6RZJE.js} +78 -45
  27. package/dist/chunk-JPZ6RZJE.js.map +1 -0
  28. package/dist/{chunk-OVLO7UOH.js → chunk-KLN5OTQH.js} +168 -361
  29. package/dist/chunk-KLN5OTQH.js.map +1 -0
  30. package/dist/chunk-LCYBQR35.js +79 -0
  31. package/dist/chunk-LCYBQR35.js.map +1 -0
  32. package/dist/chunk-PJYGRD7N.js +216 -0
  33. package/dist/chunk-PJYGRD7N.js.map +1 -0
  34. package/dist/chunk-QEXY4FZV.js +292 -0
  35. package/dist/chunk-QEXY4FZV.js.map +1 -0
  36. package/dist/chunk-SX4IIE2R.js +53 -0
  37. package/dist/chunk-SX4IIE2R.js.map +1 -0
  38. package/dist/chunk-UCWMSKCW.js +901 -0
  39. package/dist/chunk-UCWMSKCW.js.map +1 -0
  40. package/dist/{chunk-5SHZZC7L.js → chunk-WC6SFBAF.js} +59 -6
  41. package/dist/chunk-WC6SFBAF.js.map +1 -0
  42. package/dist/chunk-WIKU77ZY.js +18 -0
  43. package/dist/chunk-WIKU77ZY.js.map +1 -0
  44. package/dist/chunk-X3AWNFBF.js +47 -0
  45. package/dist/chunk-X3AWNFBF.js.map +1 -0
  46. package/dist/chunk-ZZTQGMLX.js +23 -0
  47. package/dist/chunk-ZZTQGMLX.js.map +1 -0
  48. package/dist/{lib → client}/index.d.ts +97 -345
  49. package/dist/client/index.js +3 -0
  50. package/dist/common-DW_JM2dW.d.ts +454 -0
  51. package/dist/components/index.d.ts +11 -2
  52. package/dist/components/index.js +8 -3
  53. package/dist/{config-CxvpD8Y6.d.ts → config-DB14_LhF.d.ts} +1 -1
  54. package/dist/{do-D27i5bU0.d.ts → do-D37hbmL9.d.ts} +6 -14
  55. package/dist/dotdo-client-2DkwXHM2.d.ts +344 -0
  56. package/dist/errors-BOY11CJs.d.ts +373 -0
  57. package/dist/features/data-browser/index.d.ts +51 -0
  58. package/dist/features/data-browser/index.js +12 -0
  59. package/dist/features/data-browser/index.js.map +1 -0
  60. package/dist/features/data-grid/index.d.ts +22 -0
  61. package/dist/features/data-grid/index.js +12 -0
  62. package/dist/features/data-grid/index.js.map +1 -0
  63. package/dist/features/document-editor/index.d.ts +26 -0
  64. package/dist/features/document-editor/index.js +12 -0
  65. package/dist/features/document-editor/index.js.map +1 -0
  66. package/dist/features/function-editor/index.d.ts +215 -0
  67. package/dist/features/function-editor/index.js +7 -0
  68. package/dist/features/function-editor/index.js.map +1 -0
  69. package/dist/hooks/index.d.ts +64 -7
  70. package/dist/hooks/index.js +8 -7
  71. package/dist/hooks/things/index.d.ts +5 -297
  72. package/dist/hooks/things/index.js +6 -6
  73. package/dist/index-C0m9UI6W.d.ts +444 -0
  74. package/dist/index.d.ts +42 -32
  75. package/dist/index.js +21 -13
  76. package/dist/providers/index.d.ts +16 -28
  77. package/dist/providers/index.js +3 -3
  78. package/dist/schemas/index.d.ts +4551 -109
  79. package/dist/schemas/index.js +2 -260
  80. package/dist/schemas/index.js.map +1 -1
  81. package/dist/shell/index.d.ts +92 -0
  82. package/dist/shell/index.js +6 -0
  83. package/dist/shell/index.js.map +1 -0
  84. package/dist/{thing-BF25aUtJ.d.ts → thing-Dc3AE2XI.d.ts} +22 -22
  85. package/dist/thing-adapters-aMjF0h9u.d.ts +1214 -0
  86. package/dist/types/index.d.ts +954 -7521
  87. package/dist/types/index.js +2 -2
  88. package/dist/ui-filters-BvrjMP_U.d.ts +108 -0
  89. package/dist/{errors-DratdVIz.d.ts → utils/index.d.ts} +38 -77
  90. package/dist/utils/index.js +4 -0
  91. package/dist/utils/index.js.map +1 -0
  92. package/dist-app/assets/index-DWX3479M.js +7 -0
  93. package/dist-app/assets/index-DWX3479M.js.map +1 -0
  94. package/dist-app/assets/main-BptePr_C.js +318 -0
  95. package/dist-app/assets/main-BptePr_C.js.map +1 -0
  96. package/dist-app/assets/main-CS9jgKzj.css +1 -0
  97. package/dist-app/index.html +38 -0
  98. package/package.json +32 -19
  99. package/dist/agents-2_r9e9i7.d.ts +0 -1043
  100. package/dist/capnweb-client-Bq78FtEA.d.ts +0 -229
  101. package/dist/chunk-3XKYQRXY.js +0 -192
  102. package/dist/chunk-3XKYQRXY.js.map +0 -1
  103. package/dist/chunk-4KXVN3EQ.js +0 -56
  104. package/dist/chunk-4KXVN3EQ.js.map +0 -1
  105. package/dist/chunk-5SHZZC7L.js.map +0 -1
  106. package/dist/chunk-7UFINK3Q.js +0 -1994
  107. package/dist/chunk-7UFINK3Q.js.map +0 -1
  108. package/dist/chunk-GGO5GW72.js.map +0 -1
  109. package/dist/chunk-JJLAES6W.js +0 -76
  110. package/dist/chunk-JJLAES6W.js.map +0 -1
  111. package/dist/chunk-KT52UU3U.js +0 -985
  112. package/dist/chunk-KT52UU3U.js.map +0 -1
  113. package/dist/chunk-LJIWB7KE.js.map +0 -1
  114. package/dist/chunk-NA652ART.js.map +0 -1
  115. package/dist/chunk-OVLO7UOH.js.map +0 -1
  116. package/dist/chunk-VRLUXCLD.js +0 -31
  117. package/dist/chunk-VRLUXCLD.js.map +0 -1
  118. package/dist/chunk-WMNT4OIE.js.map +0 -1
  119. package/dist/chunk-Y52IEYVM.js.map +0 -1
  120. package/dist/lib/index.js +0 -6
  121. package/dist/query-keys-CZNFikIi.d.ts +0 -153
  122. package/dist/views/index.d.ts +0 -131
  123. package/dist/views/index.js +0 -11
  124. /package/dist/{lib → auth}/index.js.map +0 -0
  125. /package/dist/{views → client}/index.js.map +0 -0
@@ -1,76 +0,0 @@
1
- // src/lib/errors.ts
2
- var APIError = class _APIError extends Error {
3
- constructor(code, message, status, details) {
4
- super(message);
5
- this.code = code;
6
- this.status = status;
7
- this.details = details;
8
- this.name = "APIError";
9
- Object.setPrototypeOf(this, _APIError.prototype);
10
- }
11
- /**
12
- * Create an APIError from a fetch Response
13
- *
14
- * @param response - The Response object from fetch
15
- * @param body - Optional response body text (if already read)
16
- * @returns An APIError with HTTP status information
17
- *
18
- * @example
19
- * ```typescript
20
- * const response = await fetch('/api/things')
21
- * if (!response.ok) {
22
- * throw APIError.fromResponse(response, await response.text())
23
- * }
24
- * ```
25
- */
26
- static fromResponse(response, body) {
27
- return new _APIError(`HTTP_${response.status}`, body || response.statusText, response.status);
28
- }
29
- /**
30
- * Type guard to check if an error is an APIError
31
- */
32
- static isAPIError(error) {
33
- return error instanceof _APIError;
34
- }
35
- };
36
- var NetworkError = class _NetworkError extends Error {
37
- constructor(message, cause) {
38
- super(message);
39
- this.cause = cause;
40
- this.name = "NetworkError";
41
- Object.setPrototypeOf(this, _NetworkError.prototype);
42
- }
43
- };
44
- var ValidationError = class _ValidationError extends Error {
45
- constructor(message, fields) {
46
- super(message);
47
- this.fields = fields;
48
- this.name = "ValidationError";
49
- Object.setPrototypeOf(this, _ValidationError.prototype);
50
- }
51
- };
52
- var SyncError = class _SyncError extends Error {
53
- constructor(message, operation, recoverable) {
54
- super(message);
55
- this.operation = operation;
56
- this.recoverable = recoverable;
57
- this.name = "SyncError";
58
- Object.setPrototypeOf(this, _SyncError.prototype);
59
- }
60
- };
61
- function isAPIError(error) {
62
- return error instanceof APIError;
63
- }
64
- function isNetworkError(error) {
65
- return error instanceof NetworkError;
66
- }
67
- function isValidationError(error) {
68
- return error instanceof ValidationError;
69
- }
70
- function isSyncError(error) {
71
- return error instanceof SyncError;
72
- }
73
-
74
- export { APIError, NetworkError, SyncError, ValidationError, isAPIError, isNetworkError, isSyncError, isValidationError };
75
- //# sourceMappingURL=chunk-JJLAES6W.js.map
76
- //# sourceMappingURL=chunk-JJLAES6W.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lib/errors.ts"],"names":[],"mappings":";AAwCO,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiB,KAAA,CAAM;AAAA,EAClC,WAAA,CACkB,IAAA,EAChB,OAAA,EACgB,MAAA,EACA,OAAA,EAChB;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AALG,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AAEA,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AACA,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAGhB,IAAA,IAAA,CAAK,IAAA,GAAO,UAAA;AAEZ,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,SAAA,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A,SAAA,GAAA,SAAA;AACA,IAAA,IAAA,CAAA,WAAA,GAAA,WAAA;AAGhB,IAAA,IAAA,CAAK,IAAA,GAAO,WAAA;AACZ,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,UAAA,CAAU,SAAS,CAAA;AAAA,EACjD;AACF;AAKO,SAAS,WAAW,KAAA,EAAmC;AAC5D,EAAA,OAAO,KAAA,YAAiB,QAAA;AAC1B;AAKO,SAAS,eAAe,KAAA,EAAuC;AACpE,EAAA,OAAO,KAAA,YAAiB,YAAA;AAC1B;AAKO,SAAS,kBAAkB,KAAA,EAA0C;AAC1E,EAAA,OAAO,KAAA,YAAiB,eAAA;AAC1B;AAKO,SAAS,YAAY,KAAA,EAAoC;AAC9D,EAAA,OAAO,KAAA,YAAiB,SAAA;AAC1B","file":"chunk-JJLAES6W.js","sourcesContent":["/**\n * Standardized error classes for @mdxui/do\n *\n * These classes provide consistent error handling across the package:\n * - APIError: HTTP/RPC errors from the backend\n * - NetworkError: Connection/fetch failures\n * - ValidationError: Input validation errors\n * - SyncError: Real-time sync errors\n *\n * @example\n * ```typescript\n * import { APIError, NetworkError, isAPIError } from '@mdxui/do'\n *\n * try {\n * const response = await fetch(url)\n * if (!response.ok) {\n * throw APIError.fromResponse(response)\n * }\n * } catch (error) {\n * if (isAPIError(error)) {\n * console.log(`API error ${error.code}: ${error.message}`)\n * if (error.status === 401) {\n * // Handle auth error\n * }\n * } else if (isNetworkError(error)) {\n * console.log('Network unavailable, will retry...')\n * }\n * }\n * ```\n */\n\n/**\n * API error from HTTP/RPC calls\n *\n * Provides structured error information including:\n * - code: Machine-readable error code (e.g., 'HTTP_404', 'VALIDATION_ERROR')\n * - message: Human-readable error message\n * - status: HTTP status code (when applicable)\n * - details: Additional error details from the server\n */\nexport class APIError extends Error {\n constructor(\n public readonly code: string,\n message: string,\n public readonly status?: number,\n public readonly details?: Record<string, unknown>\n ) {\n super(message)\n this.name = 'APIError'\n // Maintain proper prototype chain for instanceof checks\n Object.setPrototypeOf(this, APIError.prototype)\n }\n\n /**\n * Create an APIError from a fetch Response\n *\n * @param response - The Response object from fetch\n * @param body - Optional response body text (if already read)\n * @returns An APIError with HTTP status information\n *\n * @example\n * ```typescript\n * const response = await fetch('/api/things')\n * if (!response.ok) {\n * throw APIError.fromResponse(response, await response.text())\n * }\n * ```\n */\n static fromResponse(response: Response, body?: string): APIError {\n return new APIError(`HTTP_${response.status}`, body || response.statusText, response.status)\n }\n\n /**\n * Type guard to check if an error is an APIError\n */\n static isAPIError(error: unknown): error is APIError {\n return error instanceof APIError\n }\n}\n\n/**\n * Network-level error (connection failures, timeouts, etc.)\n *\n * Use for errors that occur before an HTTP response is received:\n * - DNS resolution failures\n * - Connection refused\n * - Request timeouts\n * - CORS errors\n */\nexport class NetworkError extends Error {\n constructor(\n message: string,\n public readonly cause?: Error\n ) {\n super(message)\n this.name = 'NetworkError'\n Object.setPrototypeOf(this, NetworkError.prototype)\n }\n}\n\n/**\n * Validation error with field-level details\n *\n * Use when input data fails validation checks.\n * The fields property maps field names to arrays of error messages.\n *\n * @example\n * ```typescript\n * throw new ValidationError('Invalid input', {\n * email: ['Invalid email format'],\n * name: ['Name is required', 'Name must be at least 2 characters'],\n * })\n * ```\n */\nexport class ValidationError extends Error {\n constructor(\n message: string,\n public readonly fields: Record<string, string[]>\n ) {\n super(message)\n this.name = 'ValidationError'\n Object.setPrototypeOf(this, ValidationError.prototype)\n }\n}\n\n/**\n * Real-time sync error\n *\n * Use for errors in the sync protocol (WebSocket, EventSource, etc.).\n * The operation property indicates what sync operation failed.\n * The recoverable property indicates whether the client should retry.\n *\n * @example\n * ```typescript\n * // Recoverable connection error - client should retry\n * throw new SyncError('WebSocket disconnected', 'connect', true)\n *\n * // Non-recoverable push error - user intervention needed\n * throw new SyncError('Conflict: record modified by another user', 'push', false)\n * ```\n */\nexport class SyncError extends Error {\n constructor(\n message: string,\n public readonly operation: 'push' | 'pull' | 'connect',\n public readonly recoverable: boolean\n ) {\n super(message)\n this.name = 'SyncError'\n Object.setPrototypeOf(this, SyncError.prototype)\n }\n}\n\n/**\n * Type guard to check if an error is an APIError\n */\nexport function isAPIError(error: unknown): error is APIError {\n return error instanceof APIError\n}\n\n/**\n * Type guard to check if an error is a NetworkError\n */\nexport function isNetworkError(error: unknown): error is NetworkError {\n return error instanceof NetworkError\n}\n\n/**\n * Type guard to check if an error is a ValidationError\n */\nexport function isValidationError(error: unknown): error is ValidationError {\n return error instanceof ValidationError\n}\n\n/**\n * Type guard to check if an error is a SyncError\n */\nexport function isSyncError(error: unknown): error is SyncError {\n return error instanceof SyncError\n}\n"]}