@zag-js/timer
Advanced tools
Comparing version 0.70.0 to 0.71.0
@@ -1,35 +0,11 @@ | ||
"use strict"; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | ||
var __getOwnPropNames = Object.getOwnPropertyNames; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __export = (target, all) => { | ||
for (var name in all) | ||
__defProp(target, name, { get: all[name], enumerable: true }); | ||
}; | ||
var __copyProps = (to, from, except, desc) => { | ||
if (from && typeof from === "object" || typeof from === "function") { | ||
for (let key of __getOwnPropNames(from)) | ||
if (!__hasOwnProp.call(to, key) && key !== except) | ||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); | ||
} | ||
return to; | ||
}; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
'use strict'; | ||
// src/index.ts | ||
var src_exports = {}; | ||
__export(src_exports, { | ||
anatomy: () => anatomy, | ||
connect: () => connect, | ||
machine: () => machine, | ||
parse: () => parse, | ||
props: () => props, | ||
splitProps: () => splitProps | ||
}); | ||
module.exports = __toCommonJS(src_exports); | ||
var anatomy$1 = require('@zag-js/anatomy'); | ||
var domQuery = require('@zag-js/dom-query'); | ||
var core = require('@zag-js/core'); | ||
var utils = require('@zag-js/utils'); | ||
var types = require('@zag-js/types'); | ||
// src/timer.anatomy.ts | ||
var import_anatomy = require("@zag-js/anatomy"); | ||
var anatomy = (0, import_anatomy.createAnatomy)("timer").parts( | ||
var anatomy = anatomy$1.createAnatomy("timer").parts( | ||
"root", | ||
@@ -45,6 +21,3 @@ "area", | ||
var parts = anatomy.build(); | ||
// src/timer.dom.ts | ||
var import_dom_query = require("@zag-js/dom-query"); | ||
var dom = (0, import_dom_query.createScope)({ | ||
var dom = domQuery.createScope({ | ||
getRootId: (ctx) => ctx.ids?.root ?? `timer:${ctx.id}:root`, | ||
@@ -163,9 +136,5 @@ getAreaId: (ctx) => ctx.ids?.area ?? `timer:${ctx.id}:area`, | ||
} | ||
// src/timer.machine.ts | ||
var import_core = require("@zag-js/core"); | ||
var import_utils = require("@zag-js/utils"); | ||
function machine(userContext) { | ||
const ctx = (0, import_utils.compact)(userContext); | ||
return (0, import_core.createMachine)( | ||
const ctx = utils.compact(userContext); | ||
return core.createMachine( | ||
{ | ||
@@ -244,4 +213,2 @@ id: "timer", | ||
resetTime(ctx2) { | ||
let targetMs = ctx2.targetMs; | ||
if (targetMs == null && ctx2.countdown) targetMs = 0; | ||
ctx2.currentMs = ctx2.startMs ?? 0; | ||
@@ -301,8 +268,5 @@ }, | ||
} | ||
// src/timer.parse.ts | ||
var import_utils2 = require("@zag-js/utils"); | ||
var segments = /* @__PURE__ */ new Set(["days", "hours", "minutes", "seconds"]); | ||
function isTimeSegment(date) { | ||
return (0, import_utils2.isObject)(date) && Object.keys(date).some((key) => segments.has(key)); | ||
return utils.isObject(date) && Object.keys(date).some((key) => segments.has(key)); | ||
} | ||
@@ -320,7 +284,3 @@ function parse(date) { | ||
} | ||
// src/timer.props.ts | ||
var import_types = require("@zag-js/types"); | ||
var import_utils3 = require("@zag-js/utils"); | ||
var props = (0, import_types.createProps)()([ | ||
var props = types.createProps()([ | ||
"autoStart", | ||
@@ -337,12 +297,9 @@ "countdown", | ||
]); | ||
var splitProps = (0, import_utils3.createSplitProps)(props); | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
anatomy, | ||
connect, | ||
machine, | ||
parse, | ||
props, | ||
splitProps | ||
}); | ||
//# sourceMappingURL=index.js.map | ||
var splitProps = utils.createSplitProps(props); | ||
exports.anatomy = anatomy; | ||
exports.connect = connect; | ||
exports.machine = machine; | ||
exports.parse = parse; | ||
exports.props = props; | ||
exports.splitProps = splitProps; |
{ | ||
"name": "@zag-js/timer", | ||
"version": "0.70.0", | ||
"version": "0.71.0", | ||
"description": "Core logic for the timer widget implemented as a state machine", | ||
@@ -20,4 +20,3 @@ "keywords": [ | ||
"files": [ | ||
"dist", | ||
"src" | ||
"dist" | ||
], | ||
@@ -31,7 +30,7 @@ "publishConfig": { | ||
"dependencies": { | ||
"@zag-js/anatomy": "0.70.0", | ||
"@zag-js/dom-query": "0.70.0", | ||
"@zag-js/core": "0.70.0", | ||
"@zag-js/types": "0.70.0", | ||
"@zag-js/utils": "0.70.0" | ||
"@zag-js/anatomy": "0.71.0", | ||
"@zag-js/dom-query": "0.71.0", | ||
"@zag-js/core": "0.71.0", | ||
"@zag-js/types": "0.71.0", | ||
"@zag-js/utils": "0.71.0" | ||
}, | ||
@@ -55,3 +54,3 @@ "devDependencies": { | ||
"build": "tsup", | ||
"test": "jest --config ../../jest.config.js --rootDir tests", | ||
"test": "vitest", | ||
"lint": "eslint src", | ||
@@ -58,0 +57,0 @@ "test-ci": "pnpm test --ci --runInBand -u", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27627
7
732
+ Added@zag-js/anatomy@0.71.0(transitive)
+ Added@zag-js/core@0.71.0(transitive)
+ Added@zag-js/dom-query@0.71.0(transitive)
+ Added@zag-js/store@0.71.0(transitive)
+ Added@zag-js/types@0.71.0(transitive)
+ Added@zag-js/utils@0.71.0(transitive)
- Removed@zag-js/anatomy@0.70.0(transitive)
- Removed@zag-js/core@0.70.0(transitive)
- Removed@zag-js/dom-query@0.70.0(transitive)
- Removed@zag-js/store@0.70.0(transitive)
- Removed@zag-js/types@0.70.0(transitive)
- Removed@zag-js/utils@0.70.0(transitive)
Updated@zag-js/anatomy@0.71.0
Updated@zag-js/core@0.71.0
Updated@zag-js/dom-query@0.71.0
Updated@zag-js/types@0.71.0
Updated@zag-js/utils@0.71.0