@zag-js/clipboard
Advanced tools
Comparing version
import * as _zag_js_anatomy from '@zag-js/anatomy'; | ||
import { RequiredBy, PropTypes, CommonProperties, NormalizeProps } from '@zag-js/types'; | ||
import * as _zag_js_core from '@zag-js/core'; | ||
import { StateMachine } from '@zag-js/core'; | ||
import { Machine, StateMachine } from '@zag-js/core'; | ||
@@ -46,2 +46,3 @@ declare const anatomy: _zag_js_anatomy.AnatomyInstance<"root" | "control" | "trigger" | "indicator" | "input" | "label">; | ||
type Send = StateMachine.Send<StateMachine.AnyEventObject>; | ||
type Service = Machine<MachineContext, MachineState, StateMachine.AnyEventObject>; | ||
interface IndicatorProps { | ||
@@ -84,2 +85,2 @@ copied: boolean; | ||
export { type MachineApi as Api, type UserDefinedContext as Context, type CopyStatusDetails, type ElementIds, type IndicatorProps, anatomy, connect, contextProps, indicatorProps, machine, props, splitIndicatorProps }; | ||
export { type MachineApi as Api, type UserDefinedContext as Context, type CopyStatusDetails, type ElementIds, type IndicatorProps, type Service, anatomy, connect, contextProps, indicatorProps, machine, props, splitIndicatorProps }; |
@@ -44,5 +44,5 @@ "use strict"; | ||
var dom = (0, import_dom_query.createScope)({ | ||
getRootId: (ctx) => ctx.ids?.root ?? `clip-${ctx.id}`, | ||
getInputId: (ctx) => ctx.ids?.input ?? `clip-input-${ctx.id}`, | ||
getLabelId: (ctx) => ctx.ids?.label ?? `clip-label-${ctx.id}`, | ||
getRootId: (ctx) => ctx.ids?.root ?? `clip:${ctx.id}`, | ||
getInputId: (ctx) => ctx.ids?.input ?? `clip:${ctx.id}:input`, | ||
getLabelId: (ctx) => ctx.ids?.label ?? `clip:${ctx.id}:label`, | ||
getInputEl: (ctx) => dom.getById(ctx, dom.getInputId(ctx)), | ||
@@ -49,0 +49,0 @@ writeToClipboard: (ctx) => copyText(dom.getDoc(ctx), ctx.value) |
{ | ||
"name": "@zag-js/clipboard", | ||
"version": "0.57.0", | ||
"version": "0.58.0", | ||
"description": "Core logic for the clipboard widget implemented as a state machine", | ||
@@ -31,7 +31,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@zag-js/anatomy": "0.57.0", | ||
"@zag-js/core": "0.57.0", | ||
"@zag-js/dom-query": "0.57.0", | ||
"@zag-js/utils": "0.57.0", | ||
"@zag-js/types": "0.57.0" | ||
"@zag-js/anatomy": "0.58.0", | ||
"@zag-js/core": "0.58.0", | ||
"@zag-js/dom-query": "0.58.0", | ||
"@zag-js/utils": "0.58.0", | ||
"@zag-js/types": "0.58.0" | ||
}, | ||
@@ -38,0 +38,0 @@ "devDependencies": { |
@@ -5,5 +5,5 @@ import { createScope, getWindow } from "@zag-js/dom-query" | ||
export const dom = createScope({ | ||
getRootId: (ctx: Ctx) => ctx.ids?.root ?? `clip-${ctx.id}`, | ||
getInputId: (ctx: Ctx) => ctx.ids?.input ?? `clip-input-${ctx.id}`, | ||
getLabelId: (ctx: Ctx) => ctx.ids?.label ?? `clip-label-${ctx.id}`, | ||
getRootId: (ctx: Ctx) => ctx.ids?.root ?? `clip:${ctx.id}`, | ||
getInputId: (ctx: Ctx) => ctx.ids?.input ?? `clip:${ctx.id}:input`, | ||
getLabelId: (ctx: Ctx) => ctx.ids?.label ?? `clip:${ctx.id}:label`, | ||
getInputEl: (ctx: Ctx) => dom.getById<HTMLInputElement>(ctx, dom.getInputId(ctx)), | ||
@@ -10,0 +10,0 @@ writeToClipboard: (ctx: Ctx) => copyText(dom.getDoc(ctx), ctx.value), |
@@ -1,2 +0,2 @@ | ||
import type { StateMachine as S } from "@zag-js/core" | ||
import type { Machine, StateMachine as S } from "@zag-js/core" | ||
import type { CommonProperties, PropTypes, RequiredBy } from "@zag-js/types" | ||
@@ -50,2 +50,4 @@ | ||
export type Service = Machine<MachineContext, MachineState, S.AnyEventObject> | ||
/* ----------------------------------------------------------------------------- | ||
@@ -52,0 +54,0 @@ * Component API |
@@ -11,2 +11,3 @@ export { anatomy } from "./clipboard.anatomy" | ||
IndicatorProps, | ||
Service, | ||
} from "./clipboard.types" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
52493
0.62%834
0.36%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated
Updated
Updated