@effect-app/vue-components 4.0.0-beta.4 → 4.0.0-beta.41

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 (104) hide show
  1. package/README.md +24 -0
  2. package/dist/reset.css +51 -0
  3. package/dist/types/components/OmegaForm/OmegaAutoGen.vue.d.ts +1 -1
  4. package/dist/types/components/OmegaForm/OmegaFormStuff.d.ts +22 -15
  5. package/dist/types/components/OmegaForm/useOmegaForm.d.ts +3 -5
  6. package/dist/types/utils/index.d.ts +3 -4
  7. package/dist/vue-components.es.js +8 -7
  8. package/dist/vue-components.es10.js +138 -135
  9. package/dist/vue-components.es11.js +2 -2
  10. package/dist/vue-components.es12.js +430 -344
  11. package/dist/vue-components.es16.js +4 -11
  12. package/dist/vue-components.es17.js +11 -723
  13. package/dist/vue-components.es18.js +52 -138
  14. package/dist/vue-components.es19.js +54 -4
  15. package/dist/vue-components.es2.js +15 -14
  16. package/dist/vue-components.es20.js +6 -11
  17. package/dist/vue-components.es21.js +6 -3
  18. package/dist/vue-components.es22.js +3 -24
  19. package/dist/vue-components.es23.js +3 -4
  20. package/dist/vue-components.es24.js +2 -8
  21. package/dist/vue-components.es25.js +2 -55
  22. package/dist/vue-components.es26.js +2 -69
  23. package/dist/vue-components.es27.js +2 -6
  24. package/dist/vue-components.es28.js +17 -6
  25. package/dist/vue-components.es29.js +11 -3
  26. package/dist/vue-components.es3.js +11 -10
  27. package/dist/vue-components.es30.js +192 -3
  28. package/dist/vue-components.es32.js +29 -2
  29. package/dist/vue-components.es33.js +4 -2
  30. package/dist/vue-components.es34.js +1 -1
  31. package/dist/vue-components.es35.js +2 -17
  32. package/dist/vue-components.es36.js +107 -188
  33. package/dist/vue-components.es38.js +7 -4
  34. package/dist/vue-components.es39.js +30 -36
  35. package/dist/vue-components.es41.js +4 -83
  36. package/dist/vue-components.es42.js +22 -51
  37. package/dist/vue-components.es43.js +5 -561
  38. package/dist/vue-components.es44.js +20 -40
  39. package/dist/vue-components.es45.js +29 -26
  40. package/dist/vue-components.es46.js +22 -5
  41. package/dist/vue-components.es47.js +12 -40
  42. package/dist/vue-components.es48.js +5 -314
  43. package/dist/vue-components.es49.js +16 -28
  44. package/dist/vue-components.es5.js +1 -1
  45. package/dist/vue-components.es50.js +9 -4
  46. package/dist/vue-components.es51.js +31 -24
  47. package/dist/vue-components.es52.js +46 -73
  48. package/dist/vue-components.es53.js +25 -98
  49. package/dist/vue-components.es54.js +11 -2
  50. package/dist/vue-components.es55.js +61 -314
  51. package/dist/vue-components.es56.js +55 -63
  52. package/dist/vue-components.es57.js +17 -2
  53. package/dist/vue-components.es58.js +33 -2
  54. package/dist/vue-components.es59.js +29 -111
  55. package/dist/{vue-components.es97.js → vue-components.es60.js} +1 -1
  56. package/dist/vue-components.es61.js +2 -7
  57. package/dist/vue-components.es62.js +43 -31
  58. package/dist/vue-components.es7.js +37 -37
  59. package/package.json +17 -13
  60. package/src/components/OmegaForm/OmegaAutoGen.vue +25 -30
  61. package/src/components/OmegaForm/OmegaErrorsInternal.vue +2 -3
  62. package/src/components/OmegaForm/OmegaFormStuff.ts +499 -326
  63. package/src/components/OmegaForm/OmegaInternalInput.vue +9 -5
  64. package/src/components/OmegaForm/useOmegaForm.ts +39 -36
  65. package/src/reset.css +51 -0
  66. package/src/utils/index.ts +4 -8
  67. package/dist/vue-components.es31.js +0 -4
  68. package/dist/vue-components.es40.js +0 -6
  69. package/dist/vue-components.es64.js +0 -103
  70. package/dist/vue-components.es65.js +0 -4
  71. package/dist/vue-components.es66.js +0 -23
  72. package/dist/vue-components.es67.js +0 -84
  73. package/dist/vue-components.es68.js +0 -14
  74. package/dist/vue-components.es69.js +0 -115
  75. package/dist/vue-components.es70.js +0 -5
  76. package/dist/vue-components.es71.js +0 -34
  77. package/dist/vue-components.es72.js +0 -4
  78. package/dist/vue-components.es73.js +0 -4
  79. package/dist/vue-components.es74.js +0 -17
  80. package/dist/vue-components.es75.js +0 -72
  81. package/dist/vue-components.es76.js +0 -25
  82. package/dist/vue-components.es77.js +0 -7
  83. package/dist/vue-components.es78.js +0 -23
  84. package/dist/vue-components.es79.js +0 -32
  85. package/dist/vue-components.es80.js +0 -24
  86. package/dist/vue-components.es81.js +0 -14
  87. package/dist/vue-components.es82.js +0 -7
  88. package/dist/vue-components.es83.js +0 -21
  89. package/dist/vue-components.es84.js +0 -11
  90. package/dist/vue-components.es85.js +0 -33
  91. package/dist/vue-components.es86.js +0 -50
  92. package/dist/vue-components.es87.js +0 -28
  93. package/dist/vue-components.es88.js +0 -17
  94. package/dist/vue-components.es89.js +0 -18
  95. package/dist/vue-components.es90.js +0 -10
  96. package/dist/vue-components.es91.js +0 -13
  97. package/dist/vue-components.es92.js +0 -67
  98. package/dist/vue-components.es93.js +0 -58
  99. package/dist/vue-components.es94.js +0 -19
  100. package/dist/vue-components.es95.js +0 -35
  101. package/dist/vue-components.es96.js +0 -31
  102. package/dist/vue-components.es98.js +0 -4
  103. package/dist/vue-components.es99.js +0 -46
  104. /package/dist/{vue-components.es100.js → vue-components.es63.js} +0 -0
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <slot v-bind="{ ...inputProps.inputProps, field: inputProps.field, state: inputProps.state }">
3
- <div :class="$attrs.class as any">
3
+ <div :class="rootClass">
4
4
  <OmegaInputVuetify
5
5
  v-if="vuetified"
6
6
  v-bind="{ ...attrsWithoutClass, ...inputProps, class: props.inputClass }"
@@ -78,6 +78,8 @@ const attrsWithoutClass = computed(() => {
78
78
  return rest
79
79
  })
80
80
 
81
+ const rootClass = computed(() => attrs.class as any)
82
+
81
83
  const id = useId()
82
84
 
83
85
  const fieldApi = props.field
@@ -163,11 +165,13 @@ const inputProps: ComputedRef<InputProps<From, Name>> = computed(() => ({
163
165
  minLength: props.meta?.type === "string" && props.meta?.minLength,
164
166
  maxLength: props.meta?.type === "string" && props.meta?.maxLength,
165
167
  max: (props.meta?.type === "number")
166
- && (props.meta?.maximum
167
- ?? (typeof props.meta?.exclusiveMaximum === "number" && props.meta.exclusiveMaximum - 1)),
168
+ ? (props.meta?.maximum
169
+ ?? (typeof props.meta?.exclusiveMaximum === "number" ? props.meta.exclusiveMaximum - 1 : undefined))
170
+ : undefined,
168
171
  min: (props.meta?.type === "number")
169
- && (props.meta?.minimum
170
- ?? (typeof props.meta?.exclusiveMinimum === "number" && props.meta.exclusiveMinimum + 1)),
172
+ ? (props.meta?.minimum
173
+ ?? (typeof props.meta?.exclusiveMinimum === "number" ? props.meta.exclusiveMinimum + 1 : undefined))
174
+ : undefined,
171
175
  errorMessages: errors.value,
172
176
  error: !!errors.value.length,
173
177
  type: fieldType.value,
@@ -3,24 +3,21 @@
3
3
 
4
4
  import * as api from "@opentelemetry/api"
5
5
  import { type DeepKeys, DeepValue, type FormAsyncValidateOrFn, type FormValidateOrFn, type StandardSchemaV1, StandardSchemaV1Issue, useForm, ValidationError, ValidationErrorMap } from "@tanstack/vue-form"
6
+ import { Array, Data, Effect, Fiber, Option, Order, S, ServiceMap } from "effect-app"
6
7
  import { runtimeFiberAsPromise, UnionToTuples } from "effect-app/utils"
7
- import * as Data from "effect/Data"
8
- import * as Effect from "effect/Effect"
9
- import * as Fiber from "effect/Fiber"
10
- import * as Option from "effect/Option"
11
- import * as Order from "effect/Order"
12
- import * as S from "effect/Schema"
13
8
  import { Component, computed, ComputedRef, ConcreteComponent, h, type InjectionKey, onBeforeUnmount, onMounted, onUnmounted, Ref, ref, watch } from "vue"
14
9
  import { useIntl } from "../../utils"
15
10
  import { MergedInputProps } from "./InputProps"
16
11
  import OmegaArray from "./OmegaArray.vue"
17
12
  import OmegaAutoGen from "./OmegaAutoGen.vue"
18
13
  import OmegaErrorsInternal from "./OmegaErrorsInternal.vue"
19
- import { BaseProps, deepMerge, defaultsValueFromSchema, DefaultTypeProps, FieldPath, type FormProps, generateMetaFromSchema, type MetaRecord, type NestedKeyOf, OmegaArrayProps, OmegaAutoGenMeta, OmegaError, type OmegaFormApi, OmegaFormState } from "./OmegaFormStuff"
14
+ import { BaseProps, deepMerge, defaultsValueFromSchema, DefaultTypeProps, FieldPath, type FormProps, generateMetaFromSchema, type MetaRecord, type NestedKeyOf, OmegaArrayProps, OmegaAutoGenMeta, OmegaError, type OmegaFormApi, OmegaFormState, toFormSchema } from "./OmegaFormStuff"
20
15
  import OmegaInput from "./OmegaInput.vue"
21
16
  import OmegaTaggedUnion from "./OmegaTaggedUnion.vue"
22
17
  import OmegaForm from "./OmegaWrapper.vue"
23
18
 
19
+ import { makeRunPromise } from "@effect-app/vue/runtime"
20
+
24
21
  type keysRule<T> =
25
22
  | {
26
23
  keys?: NestedKeyOf<T>[]
@@ -107,26 +104,25 @@ const eHoc = (errorProps: {
107
104
 
108
105
  const errors = computed(() => {
109
106
  // Collect errors from fieldMeta (field-level errors for registered fields)
110
- const fieldErrors = Object
111
- .entries(fieldMeta.value)
112
- .reduce<OmegaError[]>((acc, [key, m]) => {
113
- const fieldErrors = (m as { errors?: Array<{ message?: string }> } | undefined)?.errors ?? []
114
- if (!fieldErrors.length) {
115
- return acc
116
- }
117
-
118
- const fieldInfo = fieldMap.value.get(key)
119
- if (!fieldInfo) {
120
- return acc
121
- }
107
+ const fieldErrors = Object.entries(fieldMeta.value).reduce<OmegaError[]>((acc, [key, m]) => {
108
+ const fieldErrors = (m as { errors?: Array<{ message?: string }> } | undefined)?.errors ?? []
109
+ if (!fieldErrors.length) {
110
+ return acc
111
+ }
122
112
 
123
- acc.push({
124
- label: fieldInfo.label,
125
- inputId: fieldInfo.id,
126
- errors: [fieldErrors[0]?.message].filter(Boolean) as string[]
127
- })
113
+ const fieldInfo = fieldMap.value.get(key)
114
+ if (!fieldInfo) {
128
115
  return acc
129
- }, [])
116
+ }
117
+
118
+ acc.push({
119
+ label: fieldInfo.label,
120
+ inputId: fieldInfo.id,
121
+ errors: [fieldErrors[0]?.message].filter(Boolean) as string[]
122
+ })
123
+
124
+ return acc
125
+ }, [])
130
126
 
131
127
  // Collect errors from errorMap.onSubmit ONLY for fields that are NOT registered
132
128
  // (registered fields already have their errors in fieldMeta)
@@ -401,7 +397,7 @@ export interface OmegaFormReturn<
401
397
  > extends OF<From, To> {
402
398
  // Pre-computed type aliases - computed ONCE for performance
403
399
  _paths: FieldPath<From>
404
- _keys: DeepKeys<From>
400
+ _keys: NestedKeyOf<From>
405
401
  _schema: S.Codec<To, From, never>
406
402
 
407
403
  // this crazy thing here is copied from the OmegaFormInput.vue.d.ts, with `From` removed as Generic, instead closed over from the From generic above..
@@ -674,6 +670,8 @@ export interface OmegaFormReturn<
674
670
  }
675
671
  }
676
672
 
673
+ const runPromise = makeRunPromise(ServiceMap.empty())
674
+
677
675
  export const useOmegaForm = <
678
676
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
679
677
  From extends Record<PropertyKey, any>,
@@ -686,8 +684,9 @@ export const useOmegaForm = <
686
684
  omegaConfig?: OmegaConfig<To>
687
685
  ): OmegaFormReturn<From, To, TypeProps> => {
688
686
  if (!schema) throw new Error("Schema is required")
689
- const standardSchema = S.toStandardSchemaV1(schema)
690
- const decode = S.decodeEffect(schema)
687
+ const formCompatibleSchema = toFormSchema(schema)
688
+ const standardSchema = S.toStandardSchemaV1(formCompatibleSchema)
689
+ const decode = S.decodeUnknownEffect(formCompatibleSchema)
691
690
 
692
691
  const { meta, unionMeta } = generateMetaFromSchema(schema)
693
692
 
@@ -796,17 +795,20 @@ export const useOmegaForm = <
796
795
  ? ({ formApi, meta, value }) =>
797
796
  wrapWithSpan(meta?.currentSpan, async () => {
798
797
  // validators only validate, they don't actually transform, so we have to do that manually here.
799
- const parsedValue = await Effect.runPromise(decode(value))
798
+ const parsedValue = await runPromise(decode(value))
800
799
  const r = tanstackFormOptions.onSubmit!({
801
800
  formApi: formApi as OmegaFormApi<From, To>,
802
801
  meta,
803
802
  value: parsedValue
804
803
  })
805
804
  if (Fiber.isFiber(r)) {
806
- return await runtimeFiberAsPromise(r as any)
805
+ return await runtimeFiberAsPromise(r)
807
806
  }
808
807
  if (Effect.isEffect(r)) {
809
- return await Effect.runPromise(r)
808
+ const effectResult = await runPromise(r)
809
+ return Fiber.isFiber(effectResult)
810
+ ? await runtimeFiberAsPromise(effectResult)
811
+ : effectResult
810
812
  }
811
813
  return r
812
814
  })
@@ -836,11 +838,12 @@ export const useOmegaForm = <
836
838
 
837
839
  const persistFilter = (persistency: OmegaConfig<From>["persistency"]) => {
838
840
  if (!persistency) return
839
- if (Array.isArray(persistency.keys)) {
840
- return createNestedObjectFromPaths(persistency.keys)
841
+ const { banKeys, keys } = persistency
842
+ if (Array.isArray(keys)) {
843
+ return createNestedObjectFromPaths(keys as string[])
841
844
  }
842
- if (Array.isArray(persistency.banKeys)) {
843
- const subs = Object.keys(meta).filter((metakey) => persistency.banKeys?.includes(metakey as any))
845
+ if (Array.isArray(banKeys)) {
846
+ const subs = Object.keys(meta).filter((metakey) => banKeys.includes(metakey as any))
844
847
  return createNestedObjectFromPaths(subs)
845
848
  }
846
849
  return form.store.state.values
@@ -939,7 +942,7 @@ export const useOmegaForm = <
939
942
  ? handleSubmitEffect_(options?.meta).pipe(Effect.flatMap(Effect.fnUntraced(function*() {
940
943
  const errors = form.getAllErrors()
941
944
  if (Object.keys(errors.fields).length || errors.form.errors.length) {
942
- return yield* new FormErrors({ form: errors.form, fields: errors.fields })
945
+ return yield* Effect.fail(new FormErrors({ form: errors.form, fields: errors.fields }))
943
946
  }
944
947
  })))
945
948
  : handleSubmitEffect_(options?.meta)
package/src/reset.css ADDED
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Supplemental CSS reset for Vuetify 4.
3
+ * Vuetify 4 removed the aggressive global reset that v3 included.
4
+ * Import this file to restore equivalent behavior:
5
+ * import '@effect-app/vue-components/reset.css'
6
+ */
7
+
8
+ body {
9
+ margin: 0;
10
+ }
11
+
12
+ ul,
13
+ ol {
14
+ margin: 0;
15
+ padding: 0;
16
+ list-style: none;
17
+ }
18
+
19
+ h1,
20
+ h2,
21
+ h3,
22
+ h4,
23
+ h5,
24
+ h6 {
25
+ margin: 0;
26
+ font-size: inherit;
27
+ font-weight: inherit;
28
+ }
29
+
30
+ p {
31
+ margin: 0;
32
+ }
33
+
34
+ input,
35
+ textarea,
36
+ select {
37
+ border: 0;
38
+ background: transparent;
39
+ }
40
+
41
+ a {
42
+ text-decoration: none;
43
+ color: inherit;
44
+ }
45
+
46
+ figure,
47
+ details,
48
+ summary {
49
+ margin: 0;
50
+ padding: 0;
51
+ }
@@ -1,5 +1,5 @@
1
1
  import { type makeIntl } from "@effect-app/vue"
2
- import { type S } from "effect-app"
2
+ import { S } from "effect-app"
3
3
  import { inject, type InjectionKey, provide } from "vue"
4
4
 
5
5
  export const useIntlKey = Symbol() as InjectionKey<
@@ -18,15 +18,11 @@ export const provideIntl = (
18
18
 
19
19
  /**
20
20
  * Recursively extracts the source AST from a transformation chain.
21
- * In v4, transformations are stored in the `encoding` property, not as wrapped AST nodes.
22
- * This function returns the encoded form if an encoding chain exists, otherwise returns the AST itself.
21
+ * If the provided AST is a transformation, it follows the chain to find the original source AST.
23
22
  *
24
23
  * @param ast - The AST node to extract the transformation source from
25
- * @returns The source AST (the decoded/type form, which is the AST itself in v4)
24
+ * @returns The source AST at the end of the transformation chain
26
25
  */
27
26
  export function getTransformationFrom(ast: S.AST.AST) {
28
- // In v4, the AST itself is the decoded (type) form
29
- // The encoding chain points to the encoded (wire) form via ast.encoding
30
- // For most metadata extraction purposes, we want the decoded form, so just return the ast
31
- return ast
27
+ return S.AST.toType(ast)
32
28
  }
@@ -1,4 +0,0 @@
1
- import f from "./vue-components.es6.js";
2
- export {
3
- f as default
4
- };
@@ -1,6 +0,0 @@
1
- import { causePretty as r, findError as o } from "./vue-components.es43.js";
2
- const n = o, e = r;
3
- export {
4
- n as findError,
5
- e as pretty
6
- };
@@ -1,103 +0,0 @@
1
- import { hash as p } from "./vue-components.es67.js";
2
- import { byReferenceInstances as m, getAllObjectKeys as g } from "./vue-components.es89.js";
3
- import { hasProperty as M } from "./vue-components.es45.js";
4
- const S = "~effect/interfaces/Equal";
5
- function b() {
6
- return arguments.length === 1 ? (e) => i(e, arguments[0]) : i(arguments[0], arguments[1]);
7
- }
8
- function i(e, r) {
9
- if (e === r) return !0;
10
- if (e == null || r == null) return !1;
11
- const n = typeof e;
12
- return n !== typeof r ? !1 : n === "number" && e !== e && r !== r ? !0 : n !== "object" && n !== "function" || m.has(e) || m.has(r) ? !1 : w(e, r, E);
13
- }
14
- function q(e, r, n) {
15
- const t = a.has(e), o = c.has(r);
16
- if (t && o)
17
- return !0;
18
- if (t || o)
19
- return !1;
20
- a.add(e), c.add(r);
21
- const u = n();
22
- return a.delete(e), c.delete(r), u;
23
- }
24
- const a = /* @__PURE__ */ new WeakSet(), c = /* @__PURE__ */ new WeakSet();
25
- function E(e, r) {
26
- if (p(e) !== p(r))
27
- return !1;
28
- if (e instanceof Date)
29
- return r instanceof Date ? e.toISOString() === r.toISOString() : !1;
30
- if (e instanceof RegExp)
31
- return r instanceof RegExp ? e.toString() === r.toString() : !1;
32
- const n = y(e), t = y(r);
33
- if (n !== t) return !1;
34
- const o = n && t;
35
- return typeof e == "function" && !o ? !1 : q(e, r, () => o ? e[S](r) : Array.isArray(e) ? !Array.isArray(r) || e.length !== r.length ? !1 : z(e, r) : e instanceof Map ? !(r instanceof Map) || e.size !== r.size ? !1 : I(e, r) : e instanceof Set ? !(r instanceof Set) || e.size !== r.size ? !1 : V(e, r) : A(e, r));
36
- }
37
- function w(e, r, n) {
38
- let t = s.get(e);
39
- if (!t)
40
- t = /* @__PURE__ */ new WeakMap(), s.set(e, t);
41
- else if (t.has(r))
42
- return t.get(r);
43
- const o = n(e, r);
44
- t.set(r, o);
45
- let u = s.get(r);
46
- return u || (u = /* @__PURE__ */ new WeakMap(), s.set(r, u)), u.set(e, o), o;
47
- }
48
- const s = /* @__PURE__ */ new WeakMap();
49
- function z(e, r) {
50
- for (let n = 0; n < e.length; n++)
51
- if (!i(e[n], r[n]))
52
- return !1;
53
- return !0;
54
- }
55
- function A(e, r) {
56
- const n = g(e), t = g(r);
57
- if (n.size !== t.size)
58
- return !1;
59
- for (const o of n)
60
- if (!t.has(o) || !i(e[o], r[o]))
61
- return !1;
62
- return !0;
63
- }
64
- function R(e, r) {
65
- return function(t, o) {
66
- for (const [u, f] of t) {
67
- let l = !1;
68
- for (const [d, k] of o)
69
- if (e(u, d) && r(f, k)) {
70
- l = !0;
71
- break;
72
- }
73
- if (!l)
74
- return !1;
75
- }
76
- return !0;
77
- };
78
- }
79
- const I = /* @__PURE__ */ R(i, i);
80
- function K(e) {
81
- return function(n, t) {
82
- for (const o of n) {
83
- let u = !1;
84
- for (const f of t)
85
- if (e(o, f)) {
86
- u = !0;
87
- break;
88
- }
89
- if (!u)
90
- return !1;
91
- }
92
- return !0;
93
- };
94
- }
95
- const V = /* @__PURE__ */ K(i), y = (e) => M(e, S), j = () => b;
96
- export {
97
- j as asEquivalence,
98
- b as equals,
99
- y as isEqual,
100
- R as makeCompareMap,
101
- K as makeCompareSet,
102
- S as symbol
103
- };
@@ -1,4 +0,0 @@
1
- const n = (t) => t.length > 0;
2
- export {
3
- n as isArrayNonEmpty
4
- };
@@ -1,23 +0,0 @@
1
- import { pipeArguments as t } from "./vue-components.es44.js";
2
- import { hasProperty as c } from "./vue-components.es45.js";
3
- const r = /* @__PURE__ */ Symbol.for("~effect/Inspectable/redactable"), n = (e) => c(e, r);
4
- function f(e) {
5
- return n(e) ? a(e) : e;
6
- }
7
- function a(e) {
8
- return e[r](globalThis[i]?.services ?? o);
9
- }
10
- const i = "~effect/Fiber/currentFiber", o = {
11
- "~effect/ServiceMap": {},
12
- mapUnsafe: /* @__PURE__ */ new Map(),
13
- pipe() {
14
- return t(this, arguments);
15
- }
16
- };
17
- export {
18
- i as currentFiberTypeId,
19
- a as getRedacted,
20
- n as isRedactable,
21
- f as redact,
22
- r as symbolRedactable
23
- };
@@ -1,84 +0,0 @@
1
- import { dual as g } from "./vue-components.es42.js";
2
- import { byReferenceInstances as b, getAllObjectKeys as S } from "./vue-components.es89.js";
3
- import { hasProperty as w } from "./vue-components.es45.js";
4
- const p = "~effect/interfaces/Hash", i = (t) => {
5
- switch (typeof t) {
6
- case "number":
7
- return y(t);
8
- case "bigint":
9
- return r(t.toString(10));
10
- case "boolean":
11
- return r(String(t));
12
- case "symbol":
13
- return r(String(t));
14
- case "string":
15
- return r(t);
16
- case "undefined":
17
- return r("undefined");
18
- case "function":
19
- case "object": {
20
- if (t === null)
21
- return r("null");
22
- if (t instanceof Date)
23
- return r(t.toISOString());
24
- if (t instanceof RegExp)
25
- return r(t.toString());
26
- {
27
- if (b.has(t))
28
- return h(t);
29
- if (f.has(t))
30
- return f.get(t);
31
- const e = C(t, () => M(t) ? t[p]() : typeof t == "function" ? h(t) : Array.isArray(t) ? A(t) : t instanceof Map ? E(t) : t instanceof Set ? k(t) : I(t));
32
- return f.set(t, e), e;
33
- }
34
- }
35
- default:
36
- throw new Error(`BUG: unhandled typeof ${typeof t} - please report an issue at https://github.com/Effect-TS/effect/issues`);
37
- }
38
- }, h = (t) => (c.has(t) || c.set(t, y(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER))), c.get(t)), m = /* @__PURE__ */ g(2, (t, e) => t * 53 ^ e), a = (t) => t & 3221225471 | t >>> 1 & 1073741824, M = (t) => w(t, p), y = (t) => {
39
- if (t !== t)
40
- return r("NaN");
41
- if (t === 1 / 0)
42
- return r("Infinity");
43
- if (t === -1 / 0)
44
- return r("-Infinity");
45
- let e = t | 0;
46
- for (e !== t && (e ^= t * 4294967295); t > 4294967295; )
47
- e ^= t /= 4294967295;
48
- return a(e);
49
- }, r = (t) => {
50
- let e = 5381, n = t.length;
51
- for (; n; )
52
- e = e * 33 ^ t.charCodeAt(--n);
53
- return a(e);
54
- }, x = (t, e) => {
55
- let n = 12289;
56
- for (const o of e)
57
- n ^= m(i(o), i(t[o]));
58
- return a(n);
59
- }, I = (t) => x(t, S(t)), s = (t, e) => (n) => {
60
- let o = t;
61
- for (const d of n)
62
- o ^= e(d);
63
- return a(o);
64
- }, A = /* @__PURE__ */ s(6151, i), E = /* @__PURE__ */ s(/* @__PURE__ */ r("Map"), ([t, e]) => m(i(t), i(e))), k = /* @__PURE__ */ s(/* @__PURE__ */ r("Set"), i), c = /* @__PURE__ */ new WeakMap(), f = /* @__PURE__ */ new WeakMap(), u = /* @__PURE__ */ new WeakSet();
65
- function C(t, e) {
66
- if (u.has(t))
67
- return r("[Circular]");
68
- u.add(t);
69
- const n = e();
70
- return u.delete(t), n;
71
- }
72
- export {
73
- A as array,
74
- m as combine,
75
- i as hash,
76
- M as isHash,
77
- y as number,
78
- a as optimize,
79
- h as random,
80
- r as string,
81
- I as structure,
82
- x as structureKeys,
83
- p as symbol
84
- };
@@ -1,14 +0,0 @@
1
- import { constUndefined as r } from "./vue-components.es42.js";
2
- import { Reference as e } from "./vue-components.es69.js";
3
- const n = /* @__PURE__ */ e("effect/References/CurrentStackFrame", {
4
- defaultValue: r
5
- }), o = /* @__PURE__ */ e("effect/References/CurrentLogLevel", {
6
- defaultValue: () => "Info"
7
- }), c = /* @__PURE__ */ e("effect/References/MinimumLogLevel", {
8
- defaultValue: () => "Info"
9
- });
10
- export {
11
- o as CurrentLogLevel,
12
- n as CurrentStackFrame,
13
- c as MinimumLogLevel
14
- };
@@ -1,115 +0,0 @@
1
- import { symbol as d, equals as S } from "./vue-components.es64.js";
2
- import { dual as m, constant as h } from "./vue-components.es42.js";
3
- import { symbol as g, number as U } from "./vue-components.es67.js";
4
- import { YieldableProto as v, PipeInspectableProto as p, withFiber as s, exitSucceed as u } from "./vue-components.es55.js";
5
- import { hasProperty as M } from "./vue-components.es45.js";
6
- const b = "~effect/ServiceMap/Service", E = function() {
7
- const e = Error.stackTraceLimit;
8
- Error.stackTraceLimit = 2;
9
- const t = new Error();
10
- Error.stackTraceLimit = e;
11
- function n() {
12
- }
13
- const r = n;
14
- return Object.setPrototypeOf(r, P), Object.defineProperty(r, "stack", {
15
- get() {
16
- return t.stack;
17
- }
18
- }), arguments.length > 0 ? (r.key = arguments[0], arguments[1]?.defaultValue && (r[o] = o, r.defaultValue = arguments[1].defaultValue), r) : function(y, f) {
19
- return r.key = y, f?.make && (r.make = f.make), r;
20
- };
21
- }, P = {
22
- [b]: {
23
- _Service: (e) => e,
24
- _Identifier: (e) => e
25
- },
26
- ...p,
27
- ...v,
28
- toJSON() {
29
- return {
30
- _id: "Service",
31
- key: this.key,
32
- stack: this.stack
33
- };
34
- },
35
- asEffect() {
36
- return (this.asEffect = h(s((t) => u(a(t.services, this)))))();
37
- },
38
- of(e) {
39
- return e;
40
- },
41
- serviceMap(e) {
42
- return T(this, e);
43
- },
44
- use(e) {
45
- return s((t) => e(a(t.services, this)));
46
- },
47
- useSync(e) {
48
- return s((t) => u(e(a(t.services, this))));
49
- }
50
- }, o = "~effect/ServiceMap/Reference", l = "~effect/ServiceMap", i = (e) => {
51
- const t = Object.create(w);
52
- return t.mapUnsafe = e, t;
53
- }, w = {
54
- ...p,
55
- [l]: {
56
- _Services: (e) => e
57
- },
58
- toJSON() {
59
- return {
60
- _id: "ServiceMap",
61
- services: Array.from(this.mapUnsafe).map(([e, t]) => ({
62
- key: e,
63
- value: t
64
- }))
65
- };
66
- },
67
- [d](e) {
68
- if (!V(e) || this.mapUnsafe.size !== e.mapUnsafe.size) return !1;
69
- for (const t of this.mapUnsafe.keys())
70
- if (!e.mapUnsafe.has(t) || !S(this.mapUnsafe.get(t), e.mapUnsafe.get(t)))
71
- return !1;
72
- return !0;
73
- },
74
- [g]() {
75
- return U(this.mapUnsafe.size);
76
- }
77
- }, V = (e) => M(e, l), N = () => O, O = /* @__PURE__ */ i(/* @__PURE__ */ new Map()), T = (e, t) => i(/* @__PURE__ */ new Map([[e.key, t]])), x = /* @__PURE__ */ m(3, (e, t, n) => {
78
- const r = new Map(e.mapUnsafe);
79
- return r.set(t.key, n), i(r);
80
- }), I = /* @__PURE__ */ m(2, (e, t) => {
81
- if (!e.mapUnsafe.has(t.key)) {
82
- if (o in t) return k(t);
83
- throw _(t);
84
- }
85
- return e.mapUnsafe.get(t.key);
86
- }), a = I, A = (e, t) => e.mapUnsafe.has(t.key) ? e.mapUnsafe.get(t.key) : k(t), c = "~effect/ServiceMap/defaultValue", k = (e) => c in e ? e[c] : e[c] = e.defaultValue(), _ = (e) => {
87
- const t = new Error(`Service not found${e.key ? `: ${String(e.key)}` : ""}`);
88
- if (e.stack) {
89
- const n = e.stack.split(`
90
- `);
91
- if (n.length > 2) {
92
- const r = n[2].match(/at (.*)/);
93
- r && (t.message = t.message + ` (defined at ${r[1]})`);
94
- }
95
- }
96
- if (t.stack) {
97
- const n = t.stack.split(`
98
- `);
99
- n.splice(1, 3), t.stack = n.join(`
100
- `);
101
- }
102
- return t;
103
- }, C = E;
104
- export {
105
- C as Reference,
106
- E as Service,
107
- x as add,
108
- N as empty,
109
- a as get,
110
- A as getReferenceUnsafe,
111
- I as getUnsafe,
112
- V as isServiceMap,
113
- T as make,
114
- i as makeUnsafe
115
- };
@@ -1,5 +0,0 @@
1
- const e = "effect/Tracer/ParentSpan", r = "effect/Tracer";
2
- export {
3
- e as ParentSpanKey,
4
- r as TracerKey
5
- };
@@ -1,34 +0,0 @@
1
- class l {
2
- called = !1;
3
- self;
4
- constructor(r) {
5
- this.self = r;
6
- }
7
- /**
8
- * @since 2.0.0
9
- */
10
- next(r) {
11
- return this.called ? {
12
- value: r,
13
- done: !0
14
- } : (this.called = !0, {
15
- value: this.self,
16
- done: !1
17
- });
18
- }
19
- /**
20
- * @since 2.0.0
21
- */
22
- [Symbol.iterator]() {
23
- return new l(this.self);
24
- }
25
- }
26
- const e = "~effect/Effect/internal", n = {
27
- [e]: (t) => t()
28
- }, s = {
29
- [e]: (t) => t()
30
- }, a = /* @__PURE__ */ n[e](() => new Error().stack)?.includes(e) === !0, c = a ? n[e] : s[e];
31
- export {
32
- l as SingleShotGen,
33
- c as internalCall
34
- };
@@ -1,4 +0,0 @@
1
- const e = "effect/observability/Metric/FiberRuntimeMetricsKey";
2
- export {
3
- e as FiberRuntimeMetricsKey
4
- };
@@ -1,4 +0,0 @@
1
- const e = "dev";
2
- export {
3
- e as version
4
- };