@vielzeug/ore 3.0.1 → 26.10.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 (112) hide show
  1. package/README.md +1 -1
  2. package/dist/base-element.cjs +1 -1
  3. package/dist/base-element.cjs.map +1 -1
  4. package/dist/base-element.d.ts +2 -2
  5. package/dist/base-element.d.ts.map +1 -1
  6. package/dist/base-element.js +1 -1
  7. package/dist/base-element.js.map +1 -1
  8. package/dist/component-types.d.ts +2 -2
  9. package/dist/context.cjs.map +1 -1
  10. package/dist/context.d.ts +2 -2
  11. package/dist/context.d.ts.map +1 -1
  12. package/dist/context.js.map +1 -1
  13. package/dist/define.cjs +1 -1
  14. package/dist/define.cjs.map +1 -1
  15. package/dist/define.d.ts +7 -4
  16. package/dist/define.d.ts.map +1 -1
  17. package/dist/define.js +1 -1
  18. package/dist/define.js.map +1 -1
  19. package/dist/directives/classMap.cjs.map +1 -1
  20. package/dist/directives/classMap.d.ts +2 -1
  21. package/dist/directives/classMap.d.ts.map +1 -1
  22. package/dist/directives/classMap.js.map +1 -1
  23. package/dist/directives/each.cjs.map +1 -1
  24. package/dist/directives/each.d.ts +5 -4
  25. package/dist/directives/each.d.ts.map +1 -1
  26. package/dist/directives/each.js.map +1 -1
  27. package/dist/directives/live.cjs.map +1 -1
  28. package/dist/directives/live.d.ts +1 -1
  29. package/dist/directives/live.js.map +1 -1
  30. package/dist/directives/when.cjs.map +1 -1
  31. package/dist/directives/when.d.ts +1 -2
  32. package/dist/directives/when.d.ts.map +1 -1
  33. package/dist/directives/when.js.map +1 -1
  34. package/dist/errors.cjs +1 -1
  35. package/dist/errors.cjs.map +1 -1
  36. package/dist/errors.d.ts +10 -10
  37. package/dist/errors.js +1 -1
  38. package/dist/errors.js.map +1 -1
  39. package/dist/forms/field.cjs.map +1 -1
  40. package/dist/forms/field.d.ts +4 -4
  41. package/dist/forms/field.js.map +1 -1
  42. package/dist/host-bind.cjs.map +1 -1
  43. package/dist/host-bind.d.ts +4 -4
  44. package/dist/host-bind.d.ts.map +1 -1
  45. package/dist/host-bind.js.map +1 -1
  46. package/dist/index.d.ts +1 -0
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/ore.cjs +2 -2
  49. package/dist/ore.cjs.map +1 -1
  50. package/dist/ore.iife.js +2 -2
  51. package/dist/ore.iife.js.map +1 -1
  52. package/dist/ore.js +2 -2
  53. package/dist/ore.js.map +1 -1
  54. package/dist/props.cjs.map +1 -1
  55. package/dist/props.d.ts +3 -3
  56. package/dist/props.js.map +1 -1
  57. package/dist/runtime.cjs.map +1 -1
  58. package/dist/runtime.d.ts +5 -5
  59. package/dist/runtime.js.map +1 -1
  60. package/dist/slots.cjs.map +1 -1
  61. package/dist/slots.d.ts +3 -3
  62. package/dist/slots.js.map +1 -1
  63. package/dist/template/binding-types.d.ts +2 -2
  64. package/dist/template/bindings.cjs.map +1 -1
  65. package/dist/template/bindings.d.ts +2 -2
  66. package/dist/template/bindings.js.map +1 -1
  67. package/dist/template/compiler.cjs.map +1 -1
  68. package/dist/template/compiler.d.ts +1 -1
  69. package/dist/template/compiler.js.map +1 -1
  70. package/dist/template/instantiator.cjs.map +1 -1
  71. package/dist/template/instantiator.d.ts +1 -1
  72. package/dist/template/instantiator.js.map +1 -1
  73. package/dist/template/result.cjs.map +1 -1
  74. package/dist/template/result.d.ts +4 -4
  75. package/dist/template/result.js.map +1 -1
  76. package/dist/testing/dom.cjs.map +1 -1
  77. package/dist/testing/dom.d.ts +3 -3
  78. package/dist/testing/dom.js.map +1 -1
  79. package/dist/testing/flush.cjs +1 -1
  80. package/dist/testing/flush.cjs.map +1 -1
  81. package/dist/testing/flush.d.ts +4 -4
  82. package/dist/testing/flush.js +1 -1
  83. package/dist/testing/flush.js.map +1 -1
  84. package/dist/testing/form-internals-polyfill.cjs.map +1 -1
  85. package/dist/testing/form-internals-polyfill.d.ts +2 -2
  86. package/dist/testing/form-internals-polyfill.js.map +1 -1
  87. package/dist/testing/mount.cjs.map +1 -1
  88. package/dist/testing/mount.d.ts +3 -3
  89. package/dist/testing/mount.d.ts.map +1 -1
  90. package/dist/testing/mount.js.map +1 -1
  91. package/dist/testing/render-hook.cjs.map +1 -1
  92. package/dist/testing/render-hook.d.ts +1 -1
  93. package/dist/testing/render-hook.js.map +1 -1
  94. package/dist/testing/reset.cjs.map +1 -1
  95. package/dist/testing/reset.d.ts +2 -2
  96. package/dist/testing/reset.js.map +1 -1
  97. package/dist/testing.cjs.map +1 -1
  98. package/dist/testing.js.map +1 -1
  99. package/dist/utils/brand.cjs.map +1 -1
  100. package/dist/utils/brand.d.ts +2 -2
  101. package/dist/utils/brand.js.map +1 -1
  102. package/dist/utils/dom.cjs.map +1 -1
  103. package/dist/utils/dom.d.ts +11 -5
  104. package/dist/utils/dom.d.ts.map +1 -1
  105. package/dist/utils/dom.js.map +1 -1
  106. package/dist/utils/emit.cjs +1 -1
  107. package/dist/utils/emit.cjs.map +1 -1
  108. package/dist/utils/emit.d.ts +9 -6
  109. package/dist/utils/emit.d.ts.map +1 -1
  110. package/dist/utils/emit.js +1 -1
  111. package/dist/utils/emit.js.map +1 -1
  112. package/package.json +9 -9
@@ -1,2 +1,2 @@
1
- import{getHost as e}from"../runtime.js";var t={bubbles:!0,cancelable:!0,composed:!1},n=()=>{let n=e();return((e,...r)=>{let i=r.length>0?{...t,detail:r[0]}:t;return n.dispatchEvent(new CustomEvent(String(e),i))})};export{n as useEmit};
1
+ import{getHost as e}from"../runtime.js";var t={bubbles:!0,cancelable:!0,composed:!0},n=()=>{let n=e();return((e,...r)=>{let i=r.length>0?{...t,detail:r[0]}:t;return n.dispatchEvent(new CustomEvent(String(e),i))})};export{n as useEmit};
2
2
  //# sourceMappingURL=emit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"emit.js","names":[],"sources":["../../src/utils/emit.ts"],"sourcesContent":["/**\n * Type-safe custom event emission for components.\n */\n\nimport { getHost } from '../runtime';\n\ntype NoDetail = undefined | undefined | never;\ntype KeysWithoutDetail<T extends Record<string, unknown>> = {\n [P in keyof T]: [T[P]] extends [NoDetail] ? P : never;\n}[keyof T];\n\n/**\n * Typed emit function: only declared event names type-check, and `detail` is\n * required exactly when its payload type is non-void. Dynamic event names must\n * be cast at the call site — an intentional speed bump, not a silent escape.\n */\nexport type EmitFn<T extends Record<string, unknown>> = {\n <K extends KeysWithoutDetail<T>>(event: K): boolean;\n <K extends Exclude<keyof T, KeysWithoutDetail<T>>>(event: K, detail: T[K]): boolean;\n};\n\nconst DEFAULT_FIRE_OPTIONS = { bubbles: true, cancelable: true, composed: false };\n\n/**\n * Returns a typed `emit()` function bound to the current component's host element.\n * Call once during `setup()` — the `Emits` type parameter maps event names to\n * their `detail` payload type.\n *\n * Every event is dispatched `cancelable: true`, and `emit()` returns `dispatchEvent`'s\n * own boolean result — `false` when a listener called `preventDefault()`. Components\n * that need to know whether a listener cancelled an event (e.g. to skip a default\n * action) read this return value directly instead of hand-rolling `dispatchEvent`.\n *\n * Events do **not** cross the shadow boundary by default (`composed: false`) — a\n * listener outside the component's shadow root will not observe them. Dispatch a\n * `CustomEvent` with `composed: true` by hand if an event must escape the shadow root.\n *\n * @example\n * ```ts\n * type Events = { close: undefined; change: { value: string } };\n *\n * setup(props) {\n * const emit = useEmit<Events>();\n * emit('close');\n *\n * const notCancelled = emit('change', { value: 'ok' });\n * if (notCancelled) props.value.value = 'ok';\n * }\n * ```\n */\nexport const useEmit = <T extends Record<string, unknown> = Record<string, never>>(): EmitFn<T> => {\n const host = getHost();\n\n return ((event: keyof T, ...rest: unknown[]) => {\n const customEventInit = rest.length > 0 ? { ...DEFAULT_FIRE_OPTIONS, detail: rest[0] } : DEFAULT_FIRE_OPTIONS;\n\n return host.dispatchEvent(new CustomEvent<unknown>(String(event), customEventInit));\n }) as EmitFn<T>;\n};\n"],"mappings":"wCAqBA,IAAM,EAAuB,CAAE,QAAS,GAAM,WAAY,GAAM,SAAU,EAAM,EA6BnE,MAAsF,CACjG,IAAM,EAAO,EAAQ,EAErB,QAAS,EAAgB,GAAG,IAAoB,CAC9C,IAAM,EAAkB,EAAK,OAAS,EAAI,CAAE,GAAG,EAAsB,OAAQ,EAAK,EAAG,EAAI,EAEzF,OAAO,EAAK,cAAc,IAAI,YAAqB,OAAO,CAAK,EAAG,CAAe,CAAC,CACpF,EACF"}
1
+ {"version":3,"file":"emit.js","names":[],"sources":["../../src/utils/emit.ts"],"sourcesContent":["/**\n * Type-safe custom event emission for components.\n */\n\nimport { getHost } from '../runtime';\n\ntype NoDetail = undefined | undefined | never;\ntype KeysWithoutDetail<T extends Record<string, unknown>> = {\n [P in keyof T]: [T[P]] extends [NoDetail] ? P : never;\n}[keyof T];\n\n/**\n * Typed emit function: only declared event names type-check, and `detail` is\n * required exactly when its payload type is non-void. Dynamic event names must\n * be cast at the call site: an intentional speed bump, not a silent escape.\n */\nexport type EmitFn<T extends Record<string, unknown>> = {\n <K extends KeysWithoutDetail<T>>(event: K): boolean;\n <K extends Exclude<keyof T, KeysWithoutDetail<T>>>(event: K, detail: T[K]): boolean;\n};\n\nconst DEFAULT_FIRE_OPTIONS = { bubbles: true, cancelable: true, composed: true };\n\n/**\n * Returns a typed `emit()` function bound to the current component's host element.\n * Call once during `setup()`: the `Emits` type parameter maps event names to\n * their `detail` payload type.\n *\n * Every event is dispatched `cancelable: true`, and `emit()` returns `dispatchEvent`'s\n * own boolean result: `false` when a listener called `preventDefault()`. Components\n * that need to know whether a listener cancelled an event (e.g. to skip a default\n * action) read this return value directly instead of hand-rolling `dispatchEvent`.\n *\n * Events are dispatched `bubbles: true, composed: true`: the same convention as\n * `ore:error` and native form-control re-dispatches. A listener on the host, an\n * ancestor, or `document` observes the event even when the component is nested\n * inside another component's shadow root, so composed events integrate with\n * document-level and framework (e.g. React synthetic) listeners without an\n * escape hatch.\n *\n * @example\n * ```ts\n * type Events = { close: undefined; change: { value: string } };\n *\n * setup(props) {\n * const emit = useEmit<Events>();\n * emit('close');\n *\n * const notCancelled = emit('change', { value: 'ok' });\n * if (notCancelled) props.value.value = 'ok';\n * }\n * ```\n */\nexport const useEmit = <T extends Record<string, unknown> = Record<string, never>>(): EmitFn<T> => {\n const host = getHost();\n\n return ((event: keyof T, ...rest: unknown[]) => {\n const customEventInit = rest.length > 0 ? { ...DEFAULT_FIRE_OPTIONS, detail: rest[0] } : DEFAULT_FIRE_OPTIONS;\n\n return host.dispatchEvent(new CustomEvent<unknown>(String(event), customEventInit));\n }) as EmitFn<T>;\n};\n"],"mappings":"wCAqBA,IAAM,EAAuB,CAAE,QAAS,GAAM,WAAY,GAAM,SAAU,EAAK,EAgClE,MAAsF,CACjG,IAAM,EAAO,EAAQ,EAErB,QAAS,EAAgB,GAAG,IAAoB,CAC9C,IAAM,EAAkB,EAAK,OAAS,EAAI,CAAE,GAAG,EAAsB,OAAQ,EAAK,EAAG,EAAI,EAEzF,OAAO,EAAK,cAAc,IAAI,YAAqB,OAAO,CAAK,EAAG,CAAe,CAAC,CACpF,EACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vielzeug/ore",
3
- "version": "3.0.1",
3
+ "version": "26.10.1",
4
4
  "description": "Functional web-component authoring on top of ripple",
5
5
  "repository": {
6
6
  "type": "git",
@@ -53,8 +53,8 @@
53
53
  "test:types": "tsc -p tsconfig.json --noEmit"
54
54
  },
55
55
  "peerDependencies": {
56
- "@vielzeug/assay": "^3.0.0",
57
- "@vielzeug/ripple": "^3.0.0"
56
+ "@vielzeug/assay": "^26.10.1",
57
+ "@vielzeug/ripple": "^26.10.1"
58
58
  },
59
59
  "peerDependenciesMeta": {
60
60
  "@vielzeug/assay": {
@@ -62,13 +62,13 @@
62
62
  }
63
63
  },
64
64
  "devDependencies": {
65
- "@types/node": "^26.4.1",
66
- "@vielzeug/assay": "3.0.0",
67
- "@vielzeug/ripple": "3.0.0",
65
+ "@types/node": "^26.6.2",
66
+ "@vielzeug/assay": "26.10.1",
67
+ "@vielzeug/ripple": "26.10.1",
68
68
  "axe-core": "^4.13.0",
69
- "jsdom": "^30.0.1",
69
+ "jsdom": "^30.1.1",
70
70
  "typescript": "^6.0.3",
71
- "vite": "^8.2.2",
72
- "vitest": "^5.0.0"
71
+ "vite": "^8.3.0",
72
+ "vitest": "^5.0.1"
73
73
  }
74
74
  }