@flickfyi/flkr 0.0.141 → 0.0.146
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.
- package/node_modules/@flickfyi/attestation/.turbo/turbo-build.log +7 -7
- package/node_modules/@flickfyi/biscuit/.turbo/turbo-build.log +7 -7
- package/node_modules/@flickfyi/core/.oxlintrc.json +2 -1
- package/node_modules/@flickfyi/core/.turbo/turbo-build.log +502 -95
- package/node_modules/@flickfyi/core/README.md +58 -4
- package/node_modules/@flickfyi/core/dist/index.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/index.js +35 -24
- package/node_modules/@flickfyi/core/dist/kowalski/calculations.d.ts +17 -0
- package/node_modules/@flickfyi/core/dist/kowalski/calculator.d.ts +13 -0
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.cjs +1 -0
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.d.cts +962 -0
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.d.ts +962 -0
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.js +639 -0
- package/node_modules/@flickfyi/core/dist/kowalski/clocks.d.ts +4 -0
- package/node_modules/@flickfyi/core/dist/kowalski/date-time.d.ts +22 -0
- package/node_modules/@flickfyi/core/dist/kowalski/details.d.ts +7 -0
- package/node_modules/@flickfyi/core/dist/kowalski/everyday.d.ts +8 -0
- package/node_modules/@flickfyi/core/dist/kowalski/format.d.ts +4 -0
- package/node_modules/@flickfyi/core/dist/kowalski/frame.d.ts +161 -0
- package/node_modules/@flickfyi/core/dist/kowalski/index.cjs +21 -0
- package/node_modules/@flickfyi/core/dist/kowalski/index.d.cts +8 -0
- package/node_modules/@flickfyi/core/dist/kowalski/index.d.ts +8 -0
- package/node_modules/@flickfyi/core/dist/kowalski/index.js +7496 -0
- package/node_modules/@flickfyi/core/dist/kowalski/productivity.d.ts +5 -0
- package/node_modules/@flickfyi/core/dist/kowalski/recipe.d.ts +8 -0
- package/node_modules/@flickfyi/core/dist/kowalski/tools.d.ts +7 -0
- package/node_modules/@flickfyi/core/dist/kowalski/use-clock.d.ts +6 -0
- package/node_modules/@flickfyi/core/dist/kowalski/use-configured-feature.d.ts +19 -0
- package/node_modules/@flickfyi/core/dist/kowalski/use-feature-store.d.ts +15 -0
- package/node_modules/@flickfyi/core/dist/kowalski.css +506 -0
- package/node_modules/@flickfyi/core/dist/molecules/field/field.d.ts +8 -0
- package/node_modules/@flickfyi/core/dist/molecules/index.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/molecules/index.d.cts +3 -0
- package/node_modules/@flickfyi/core/dist/molecules/index.d.ts +3 -0
- package/node_modules/@flickfyi/core/dist/molecules/index.js +88 -27
- package/node_modules/@flickfyi/core/dist/molecules/segmented/segmented.d.ts +10 -0
- package/node_modules/@flickfyi/core/dist/molecules/stepper/stepper.d.ts +10 -0
- package/node_modules/@flickfyi/core/dist/quantum/use-store.d.ts +7 -1
- package/node_modules/@flickfyi/core/dist/themes.css +2 -0
- package/node_modules/@flickfyi/core/examples/kowalski/bill-split/bill-split.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/bill-split/bill-split.tsx +17 -0
- package/node_modules/@flickfyi/core/examples/kowalski/bookmark/bookmark.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/bookmark/bookmark.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/budget/budget.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/budget/budget.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/calculator/calculator.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/calculator/calculator.tsx +24 -0
- package/node_modules/@flickfyi/core/examples/kowalski/checklist/checklist.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/checklist/checklist.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/color-palette/color-palette.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/color-palette/color-palette.tsx +22 -0
- package/node_modules/@flickfyi/core/examples/kowalski/contact/contact.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/contact/contact.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/countdown/countdown.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/countdown/countdown.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/event/event.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/event/event.tsx +24 -0
- package/node_modules/@flickfyi/core/examples/kowalski/expense/expense.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/expense/expense.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/goal/goal.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/goal/goal.tsx +24 -0
- package/node_modules/@flickfyi/core/examples/kowalski/habit/habit.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/habit/habit.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/ledger/ledger.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/ledger/ledger.tsx +25 -0
- package/node_modules/@flickfyi/core/examples/kowalski/note/note.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/note/note.tsx +22 -0
- package/node_modules/@flickfyi/core/examples/kowalski/poll/poll.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/poll/poll.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/random-picker/random-picker.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/random-picker/random-picker.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/rating/rating.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/rating/rating.tsx +19 -0
- package/node_modules/@flickfyi/core/examples/kowalski/recipe/recipe.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/recipe/recipe.tsx +120 -0
- package/node_modules/@flickfyi/core/examples/kowalski/reminder/reminder.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/reminder/reminder.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/rotation/rotation.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/rotation/rotation.tsx +27 -0
- package/node_modules/@flickfyi/core/examples/kowalski/scoreboard/scoreboard.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/scoreboard/scoreboard.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/shopping-list/shopping-list.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/shopping-list/shopping-list.tsx +27 -0
- package/node_modules/@flickfyi/core/examples/kowalski/task-board/task-board.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/task-board/task-board.tsx +27 -0
- package/node_modules/@flickfyi/core/examples/kowalski/theme.ts +3 -0
- package/node_modules/@flickfyi/core/examples/kowalski/time-zone/time-zone.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/time-zone/time-zone.tsx +22 -0
- package/node_modules/@flickfyi/core/examples/kowalski/timer/timer.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/timer/timer.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/trip/trip.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/trip/trip.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/unit-converter/unit-converter.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/unit-converter/unit-converter.tsx +24 -0
- package/node_modules/@flickfyi/core/examples/parrott/calculator/calculator.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/checklist/checklist.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/countdown/countdown.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/counter/counter.stories.tsx +1 -0
- package/node_modules/@flickfyi/core/examples/parrott/fortune/fortune.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/grid/grid.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/kale-smoothie/kale-smoothie.stories.tsx +1 -0
- package/node_modules/@flickfyi/core/examples/parrott/list/list.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/log/log.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/timed-task/timed-task.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/timer/timer.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/fixtures/native/host/project.yml +3 -0
- package/node_modules/@flickfyi/core/fixtures/native/src/catalog-features.tsx +88 -0
- package/node_modules/@flickfyi/core/package.json +35 -5
- package/node_modules/@flickfyi/core/package.tsgo.json +19 -1
- package/node_modules/@flickfyi/core/scripts/vite-globals.d.ts +2 -0
- package/node_modules/@flickfyi/core/src/generated-types.d.ts +1 -0
- package/node_modules/@flickfyi/core/src/kowalski/README.md +9 -0
- package/node_modules/@flickfyi/core/src/kowalski/calculations.ts +106 -0
- package/node_modules/@flickfyi/core/src/kowalski/calculator.ts +243 -0
- package/node_modules/@flickfyi/core/src/kowalski/catalog.ts +787 -0
- package/node_modules/@flickfyi/core/src/kowalski/clocks.tsx +464 -0
- package/node_modules/@flickfyi/core/src/kowalski/date-time.tsx +469 -0
- package/node_modules/@flickfyi/core/src/kowalski/details.tsx +1387 -0
- package/node_modules/@flickfyi/core/src/kowalski/everyday.tsx +652 -0
- package/node_modules/@flickfyi/core/src/kowalski/format.ts +48 -0
- package/node_modules/@flickfyi/core/src/kowalski/frame.tsx +351 -0
- package/node_modules/@flickfyi/core/src/kowalski/index.ts +23 -0
- package/node_modules/@flickfyi/core/src/kowalski/productivity.tsx +575 -0
- package/node_modules/@flickfyi/core/src/kowalski/recipe.tsx +555 -0
- package/node_modules/@flickfyi/core/src/kowalski/stories/composition.stories.tsx +47 -0
- package/node_modules/@flickfyi/core/src/kowalski/stories/composition.tsx +100 -0
- package/node_modules/@flickfyi/core/src/kowalski/tools.tsx +1213 -0
- package/node_modules/@flickfyi/core/src/kowalski/use-clock.ts +19 -0
- package/node_modules/@flickfyi/core/src/kowalski/use-configured-feature.ts +85 -0
- package/node_modules/@flickfyi/core/src/kowalski/use-feature-store.ts +119 -0
- package/node_modules/@flickfyi/core/src/molecules/field/field.tsx +34 -0
- package/node_modules/@flickfyi/core/src/molecules/index.ts +3 -0
- package/node_modules/@flickfyi/core/src/molecules/segmented/segmented.tsx +48 -0
- package/node_modules/@flickfyi/core/src/molecules/stepper/stepper.tsx +54 -0
- package/node_modules/@flickfyi/core/src/quantum/use-store.ts +41 -16
- package/node_modules/@flickfyi/core/tests/fly.test.ts +34 -7
- package/node_modules/@flickfyi/core/tests/kowalski-calculations.test.ts +60 -0
- package/node_modules/@flickfyi/core/tests/kowalski-calculator.test.ts +142 -0
- package/node_modules/@flickfyi/core/tests/kowalski-contracts.test.ts +223 -0
- package/node_modules/@flickfyi/core/tests/kowalski-date-time.test.tsx +462 -0
- package/node_modules/@flickfyi/core/tests/kowalski-features.test.tsx +2158 -0
- package/node_modules/@flickfyi/core/tests/kowalski-store.test.tsx +514 -0
- package/node_modules/@flickfyi/core/tests/preview-build.test.ts +1 -1
- package/node_modules/@flickfyi/core/tests/quantum-use-store.test.ts +53 -1
- package/node_modules/@flickfyi/core/tests/verify-tsgo-assets.test.ts +1 -1
- package/node_modules/@flickfyi/core/tsconfig.vite-dts.json +2 -1
- package/node_modules/@flickfyi/core/tsgo.bun.lock +111 -9
- package/node_modules/@flickfyi/core/tsgo.package.json +21 -3
- package/node_modules/@flickfyi/core/vite.config.ts +9 -5
- package/node_modules/@flickfyi/core/vitest.config.ts +1 -1
- package/node_modules/@flickfyi/http-message-sig/.turbo/turbo-build.log +7 -7
- package/node_modules/@flickfyi/identity/.turbo/turbo-build.log +8 -9
- package/node_modules/@flickfyi/lens/.turbo/turbo-build.log +7 -7
- package/node_modules/@flickfyi/photon/.turbo/turbo-build.log +10 -4
- package/node_modules/@flickfyi/photon/Sources/Photon/Components/Button.swift +29 -2
- package/node_modules/@flickfyi/photon/Sources/PhotonVersion/Resources/photon-version.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Components/ButtonHostTests.swift +26 -0
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-features.styles.json +1 -0
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-native.styles.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-scale.styles.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-theme.styles.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-typography.styles.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/stylex-calculator.styles.json +1 -1
- package/node_modules/@flickfyi/photon/dist/globals.d.ts +5 -0
- package/node_modules/@flickfyi/photon/dist/version.cjs +1 -1
- package/node_modules/@flickfyi/photon/dist/version.js +1 -1
- package/node_modules/@flickfyi/photon/generated/react-swiftui.d.ts +1 -0
- package/node_modules/@flickfyi/photon/package.json +1 -1
- package/node_modules/@flickfyi/photon/src/globals.d.ts +5 -0
- package/node_modules/@flickfyi/rwsdk-extensions/.turbo/turbo-build.log +7 -7
- package/node_modules/@formatjs/fast-memoize/LICENSE.md +9 -0
- package/node_modules/@formatjs/fast-memoize/README.md +3 -0
- package/node_modules/@formatjs/fast-memoize/index.d.ts +35 -0
- package/node_modules/@formatjs/fast-memoize/index.js +69 -0
- package/node_modules/@formatjs/fast-memoize/index.js.map +1 -0
- package/node_modules/@formatjs/fast-memoize/package.json +25 -0
- package/node_modules/@formatjs/icu-messageformat-parser/LICENSE.md +9 -0
- package/node_modules/@formatjs/icu-messageformat-parser/README.md +38 -0
- package/node_modules/@formatjs/icu-messageformat-parser/index.d.ts +393 -0
- package/node_modules/@formatjs/icu-messageformat-parser/index.js +2187 -0
- package/node_modules/@formatjs/icu-messageformat-parser/index.js.map +1 -0
- package/node_modules/@formatjs/icu-messageformat-parser/manipulator.d.ts +175 -0
- package/node_modules/@formatjs/icu-messageformat-parser/manipulator.js +209 -0
- package/node_modules/@formatjs/icu-messageformat-parser/manipulator.js.map +1 -0
- package/node_modules/@formatjs/icu-messageformat-parser/no-parser.d.ts +183 -0
- package/node_modules/@formatjs/icu-messageformat-parser/no-parser.js +162 -0
- package/node_modules/@formatjs/icu-messageformat-parser/no-parser.js.map +1 -0
- package/node_modules/@formatjs/icu-messageformat-parser/package.json +21 -0
- package/node_modules/@formatjs/icu-messageformat-parser/printer.d.ts +154 -0
- package/node_modules/@formatjs/icu-messageformat-parser/printer.js +224 -0
- package/node_modules/@formatjs/icu-messageformat-parser/printer.js.map +1 -0
- package/node_modules/@formatjs/icu-skeleton-parser/LICENSE.md +9 -0
- package/node_modules/@formatjs/icu-skeleton-parser/README.md +1 -0
- package/node_modules/@formatjs/icu-skeleton-parser/index.d.ts +67 -0
- package/node_modules/@formatjs/icu-skeleton-parser/index.js +380 -0
- package/node_modules/@formatjs/icu-skeleton-parser/index.js.map +1 -0
- package/node_modules/@formatjs/icu-skeleton-parser/package.json +15 -0
- package/node_modules/@formatjs/intl/LICENSE.md +9 -0
- package/node_modules/@formatjs/intl/README.md +3 -0
- package/node_modules/@formatjs/intl/index.d.ts +499 -0
- package/node_modules/@formatjs/intl/index.js +595 -0
- package/node_modules/@formatjs/intl/index.js.map +1 -0
- package/node_modules/@formatjs/intl/package.json +37 -0
- package/node_modules/decimal.js/LICENCE.md +23 -0
- package/node_modules/decimal.js/README.md +246 -0
- package/node_modules/decimal.js/decimal.d.ts +301 -0
- package/node_modules/decimal.js/decimal.js +4951 -0
- package/node_modules/decimal.js/decimal.mjs +4914 -0
- package/node_modules/decimal.js/package.json +55 -0
- package/node_modules/format-quantity/LICENSE +21 -0
- package/node_modules/format-quantity/README.md +181 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.d.ts +131 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.js +214 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.js.map +1 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.d.ts +131 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.js +2 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.js.map +1 -0
- package/node_modules/format-quantity/dist/cjs/index.d.ts +1 -0
- package/node_modules/format-quantity/dist/cjs/index.js +6 -0
- package/node_modules/format-quantity/dist/format-quantity.d.mts +131 -0
- package/node_modules/format-quantity/dist/format-quantity.legacy-esm.d.ts +131 -0
- package/node_modules/format-quantity/dist/format-quantity.legacy-esm.js +268 -0
- package/node_modules/format-quantity/dist/format-quantity.legacy-esm.js.map +1 -0
- package/node_modules/format-quantity/dist/format-quantity.mjs +208 -0
- package/node_modules/format-quantity/dist/format-quantity.mjs.map +1 -0
- package/node_modules/format-quantity/dist/format-quantity.production.d.mts +131 -0
- package/node_modules/format-quantity/dist/format-quantity.production.mjs +2 -0
- package/node_modules/format-quantity/dist/format-quantity.production.mjs.map +1 -0
- package/node_modules/format-quantity/dist/format-quantity.umd.min.js +3 -0
- package/node_modules/format-quantity/dist/format-quantity.umd.min.js.map +1 -0
- package/node_modules/format-quantity/package.json +81 -0
- package/node_modules/intl-messageformat/LICENSE.md +33 -0
- package/node_modules/intl-messageformat/README.md +3 -0
- package/node_modules/intl-messageformat/index.d.ts +177 -0
- package/node_modules/intl-messageformat/index.js +327 -0
- package/node_modules/intl-messageformat/index.js.map +1 -0
- package/node_modules/intl-messageformat/intl-messageformat.iife.js +2819 -0
- package/node_modules/intl-messageformat/package.json +40 -0
- package/node_modules/numeric-quantity/LICENSE +21 -0
- package/node_modules/numeric-quantity/README.md +306 -0
- package/node_modules/numeric-quantity/dist/cjs/index.d.ts +1 -0
- package/node_modules/numeric-quantity/dist/cjs/index.js +6 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.d.ts +293 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.js +579 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.js.map +1 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.d.ts +293 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.js +2 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.js.map +1 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.d.mts +293 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.iife.umd.min.js +2 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.iife.umd.min.js.map +1 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.d.ts +293 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.js +622 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.js.map +1 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.mjs +564 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.mjs.map +1 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.production.d.mts +293 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.production.mjs +2 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.production.mjs.map +1 -0
- package/node_modules/numeric-quantity/package.json +72 -0
- package/node_modules/validator/LICENSE +20 -0
- package/node_modules/validator/README.md +269 -0
- package/node_modules/validator/es/index.js +218 -0
- package/node_modules/validator/es/lib/alpha.js +151 -0
- package/node_modules/validator/es/lib/blacklist.js +5 -0
- package/node_modules/validator/es/lib/contains.js +15 -0
- package/node_modules/validator/es/lib/equals.js +5 -0
- package/node_modules/validator/es/lib/escape.js +5 -0
- package/node_modules/validator/es/lib/isAbaRouting.js +15 -0
- package/node_modules/validator/es/lib/isAfter.js +10 -0
- package/node_modules/validator/es/lib/isAlpha.js +23 -0
- package/node_modules/validator/es/lib/isAlphanumeric.js +23 -0
- package/node_modules/validator/es/lib/isAscii.js +10 -0
- package/node_modules/validator/es/lib/isBIC.js +16 -0
- package/node_modules/validator/es/lib/isBase32.js +15 -0
- package/node_modules/validator/es/lib/isBase58.js +8 -0
- package/node_modules/validator/es/lib/isBase64.js +23 -0
- package/node_modules/validator/es/lib/isBefore.js +10 -0
- package/node_modules/validator/es/lib/isBoolean.js +15 -0
- package/node_modules/validator/es/lib/isBtcAddress.js +7 -0
- package/node_modules/validator/es/lib/isByteLength.js +19 -0
- package/node_modules/validator/es/lib/isCreditCard.js +43 -0
- package/node_modules/validator/es/lib/isCurrency.js +74 -0
- package/node_modules/validator/es/lib/isDataURI.js +31 -0
- package/node_modules/validator/es/lib/isDate.js +93 -0
- package/node_modules/validator/es/lib/isDecimal.js +22 -0
- package/node_modules/validator/es/lib/isDivisibleBy.js +6 -0
- package/node_modules/validator/es/lib/isEAN.js +70 -0
- package/node_modules/validator/es/lib/isEmail.js +165 -0
- package/node_modules/validator/es/lib/isEmpty.js +10 -0
- package/node_modules/validator/es/lib/isEthereumAddress.js +6 -0
- package/node_modules/validator/es/lib/isFQDN.js +67 -0
- package/node_modules/validator/es/lib/isFloat.js +14 -0
- package/node_modules/validator/es/lib/isFullWidth.js +6 -0
- package/node_modules/validator/es/lib/isHSL.js +13 -0
- package/node_modules/validator/es/lib/isHalfWidth.js +6 -0
- package/node_modules/validator/es/lib/isHash.js +21 -0
- package/node_modules/validator/es/lib/isHexColor.js +13 -0
- package/node_modules/validator/es/lib/isHexadecimal.js +6 -0
- package/node_modules/validator/es/lib/isIBAN.js +171 -0
- package/node_modules/validator/es/lib/isIMEI.js +40 -0
- package/node_modules/validator/es/lib/isIP.js +58 -0
- package/node_modules/validator/es/lib/isIPRange.js +41 -0
- package/node_modules/validator/es/lib/isISBN.js +47 -0
- package/node_modules/validator/es/lib/isISIN.js +55 -0
- package/node_modules/validator/es/lib/isISO15924.js +9 -0
- package/node_modules/validator/es/lib/isISO31661Alpha2.js +21 -0
- package/node_modules/validator/es/lib/isISO31661Alpha3.js +20 -0
- package/node_modules/validator/es/lib/isISO31661Numeric.js +8 -0
- package/node_modules/validator/es/lib/isISO4217.js +9 -0
- package/node_modules/validator/es/lib/isISO6346.js +28 -0
- package/node_modules/validator/es/lib/isISO6391.js +6 -0
- package/node_modules/validator/es/lib/isISO8601.js +42 -0
- package/node_modules/validator/es/lib/isISRC.js +8 -0
- package/node_modules/validator/es/lib/isISSN.js +19 -0
- package/node_modules/validator/es/lib/isIdentityCard.js +407 -0
- package/node_modules/validator/es/lib/isIn.js +23 -0
- package/node_modules/validator/es/lib/isInt.js +19 -0
- package/node_modules/validator/es/lib/isJSON.js +26 -0
- package/node_modules/validator/es/lib/isJWT.js +15 -0
- package/node_modules/validator/es/lib/isLatLong.js +21 -0
- package/node_modules/validator/es/lib/isLength.js +27 -0
- package/node_modules/validator/es/lib/isLicensePlate.js +58 -0
- package/node_modules/validator/es/lib/isLocale.js +107 -0
- package/node_modules/validator/es/lib/isLowercase.js +5 -0
- package/node_modules/validator/es/lib/isLuhnNumber.js +25 -0
- package/node_modules/validator/es/lib/isMACAddress.js +36 -0
- package/node_modules/validator/es/lib/isMD5.js +6 -0
- package/node_modules/validator/es/lib/isMagnetURI.js +9 -0
- package/node_modules/validator/es/lib/isMailtoURI.js +75 -0
- package/node_modules/validator/es/lib/isMimeType.js +40 -0
- package/node_modules/validator/es/lib/isMobilePhone.js +212 -0
- package/node_modules/validator/es/lib/isMongoId.js +6 -0
- package/node_modules/validator/es/lib/isMultibyte.js +10 -0
- package/node_modules/validator/es/lib/isNumeric.js +10 -0
- package/node_modules/validator/es/lib/isOctal.js +6 -0
- package/node_modules/validator/es/lib/isPassportNumber.js +145 -0
- package/node_modules/validator/es/lib/isPort.js +8 -0
- package/node_modules/validator/es/lib/isPostalCode.js +100 -0
- package/node_modules/validator/es/lib/isRFC3339.js +21 -0
- package/node_modules/validator/es/lib/isRgbColor.js +34 -0
- package/node_modules/validator/es/lib/isSemVer.js +14 -0
- package/node_modules/validator/es/lib/isSlug.js +6 -0
- package/node_modules/validator/es/lib/isStrongPassword.js +90 -0
- package/node_modules/validator/es/lib/isSurrogatePair.js +6 -0
- package/node_modules/validator/es/lib/isTaxID.js +1407 -0
- package/node_modules/validator/es/lib/isTime.js +22 -0
- package/node_modules/validator/es/lib/isULID.js +5 -0
- package/node_modules/validator/es/lib/isURL.js +241 -0
- package/node_modules/validator/es/lib/isUUID.js +23 -0
- package/node_modules/validator/es/lib/isUppercase.js +5 -0
- package/node_modules/validator/es/lib/isVAT.js +264 -0
- package/node_modules/validator/es/lib/isVariableWidth.js +7 -0
- package/node_modules/validator/es/lib/isWhitelisted.js +10 -0
- package/node_modules/validator/es/lib/ltrim.js +7 -0
- package/node_modules/validator/es/lib/matches.js +8 -0
- package/node_modules/validator/es/lib/normalizeEmail.js +131 -0
- package/node_modules/validator/es/lib/rtrim.js +15 -0
- package/node_modules/validator/es/lib/stripLow.js +7 -0
- package/node_modules/validator/es/lib/toBoolean.js +8 -0
- package/node_modules/validator/es/lib/toDate.js +6 -0
- package/node_modules/validator/es/lib/toFloat.js +5 -0
- package/node_modules/validator/es/lib/toInt.js +5 -0
- package/node_modules/validator/es/lib/trim.js +5 -0
- package/node_modules/validator/es/lib/unescape.js +8 -0
- package/node_modules/validator/es/lib/util/algorithms.js +79 -0
- package/node_modules/validator/es/lib/util/assertString.js +4 -0
- package/node_modules/validator/es/lib/util/checkHost.js +12 -0
- package/node_modules/validator/es/lib/util/includesArray.js +6 -0
- package/node_modules/validator/es/lib/util/includesString.js +4 -0
- package/node_modules/validator/es/lib/util/merge.js +14 -0
- package/node_modules/validator/es/lib/util/multilineRegex.js +12 -0
- package/node_modules/validator/es/lib/util/nullUndefinedCheck.js +3 -0
- package/node_modules/validator/es/lib/util/toString.js +13 -0
- package/node_modules/validator/es/lib/util/typeOf.js +10 -0
- package/node_modules/validator/es/lib/whitelist.js +5 -0
- package/node_modules/validator/index.js +229 -0
- package/node_modules/validator/lib/alpha.js +157 -0
- package/node_modules/validator/lib/blacklist.js +14 -0
- package/node_modules/validator/lib/contains.js +24 -0
- package/node_modules/validator/lib/equals.js +14 -0
- package/node_modules/validator/lib/escape.js +14 -0
- package/node_modules/validator/lib/isAbaRouting.js +23 -0
- package/node_modules/validator/lib/isAfter.js +19 -0
- package/node_modules/validator/lib/isAlpha.js +31 -0
- package/node_modules/validator/lib/isAlphanumeric.js +31 -0
- package/node_modules/validator/lib/isAscii.js +18 -0
- package/node_modules/validator/lib/isBIC.js +24 -0
- package/node_modules/validator/lib/isBase32.js +24 -0
- package/node_modules/validator/lib/isBase58.js +16 -0
- package/node_modules/validator/lib/isBase64.js +32 -0
- package/node_modules/validator/lib/isBefore.js +19 -0
- package/node_modules/validator/lib/isBoolean.js +24 -0
- package/node_modules/validator/lib/isBtcAddress.js +16 -0
- package/node_modules/validator/lib/isByteLength.js +27 -0
- package/node_modules/validator/lib/isCreditCard.js +52 -0
- package/node_modules/validator/lib/isCurrency.js +83 -0
- package/node_modules/validator/lib/isDataURI.js +40 -0
- package/node_modules/validator/lib/isDate.js +102 -0
- package/node_modules/validator/lib/isDecimal.js +31 -0
- package/node_modules/validator/lib/isDivisibleBy.js +15 -0
- package/node_modules/validator/lib/isEAN.js +78 -0
- package/node_modules/validator/lib/isEmail.js +174 -0
- package/node_modules/validator/lib/isEmpty.js +19 -0
- package/node_modules/validator/lib/isEthereumAddress.js +15 -0
- package/node_modules/validator/lib/isFQDN.js +76 -0
- package/node_modules/validator/lib/isFloat.js +22 -0
- package/node_modules/validator/lib/isFullWidth.js +14 -0
- package/node_modules/validator/lib/isHSL.js +22 -0
- package/node_modules/validator/lib/isHalfWidth.js +14 -0
- package/node_modules/validator/lib/isHash.js +30 -0
- package/node_modules/validator/lib/isHexColor.js +22 -0
- package/node_modules/validator/lib/isHexadecimal.js +15 -0
- package/node_modules/validator/lib/isIBAN.js +178 -0
- package/node_modules/validator/lib/isIMEI.js +49 -0
- package/node_modules/validator/lib/isIP.js +67 -0
- package/node_modules/validator/lib/isIPRange.js +50 -0
- package/node_modules/validator/lib/isISBN.js +56 -0
- package/node_modules/validator/lib/isISIN.js +64 -0
- package/node_modules/validator/lib/isISO15924.js +16 -0
- package/node_modules/validator/lib/isISO31661Alpha2.js +28 -0
- package/node_modules/validator/lib/isISO31661Alpha3.js +28 -0
- package/node_modules/validator/lib/isISO31661Numeric.js +16 -0
- package/node_modules/validator/lib/isISO4217.js +16 -0
- package/node_modules/validator/lib/isISO6346.js +35 -0
- package/node_modules/validator/lib/isISO6391.js +15 -0
- package/node_modules/validator/lib/isISO8601.js +50 -0
- package/node_modules/validator/lib/isISRC.js +16 -0
- package/node_modules/validator/lib/isISSN.js +28 -0
- package/node_modules/validator/lib/isIdentityCard.js +416 -0
- package/node_modules/validator/lib/isIn.js +32 -0
- package/node_modules/validator/lib/isInt.js +28 -0
- package/node_modules/validator/lib/isJSON.js +35 -0
- package/node_modules/validator/lib/isJWT.js +24 -0
- package/node_modules/validator/lib/isLatLong.js +30 -0
- package/node_modules/validator/lib/isLength.js +35 -0
- package/node_modules/validator/lib/isLicensePlate.js +67 -0
- package/node_modules/validator/lib/isLocale.js +115 -0
- package/node_modules/validator/lib/isLowercase.js +14 -0
- package/node_modules/validator/lib/isLuhnNumber.js +34 -0
- package/node_modules/validator/lib/isMACAddress.js +45 -0
- package/node_modules/validator/lib/isMD5.js +15 -0
- package/node_modules/validator/lib/isMagnetURI.js +18 -0
- package/node_modules/validator/lib/isMailtoURI.js +84 -0
- package/node_modules/validator/lib/isMimeType.js +48 -0
- package/node_modules/validator/lib/isMobilePhone.js +219 -0
- package/node_modules/validator/lib/isMongoId.js +15 -0
- package/node_modules/validator/lib/isMultibyte.js +18 -0
- package/node_modules/validator/lib/isNumeric.js +19 -0
- package/node_modules/validator/lib/isOctal.js +15 -0
- package/node_modules/validator/lib/isPassportNumber.js +152 -0
- package/node_modules/validator/lib/isPort.js +17 -0
- package/node_modules/validator/lib/isPostalCode.js +107 -0
- package/node_modules/validator/lib/isRFC3339.js +29 -0
- package/node_modules/validator/lib/isRgbColor.js +42 -0
- package/node_modules/validator/lib/isSemVer.js +22 -0
- package/node_modules/validator/lib/isSlug.js +15 -0
- package/node_modules/validator/lib/isStrongPassword.js +99 -0
- package/node_modules/validator/lib/isSurrogatePair.js +15 -0
- package/node_modules/validator/lib/isTaxID.js +1417 -0
- package/node_modules/validator/lib/isTime.js +31 -0
- package/node_modules/validator/lib/isULID.js +14 -0
- package/node_modules/validator/lib/isURL.js +249 -0
- package/node_modules/validator/lib/isUUID.js +32 -0
- package/node_modules/validator/lib/isUppercase.js +14 -0
- package/node_modules/validator/lib/isVAT.js +274 -0
- package/node_modules/validator/lib/isVariableWidth.js +16 -0
- package/node_modules/validator/lib/isWhitelisted.js +19 -0
- package/node_modules/validator/lib/ltrim.js +16 -0
- package/node_modules/validator/lib/matches.js +17 -0
- package/node_modules/validator/lib/normalizeEmail.js +140 -0
- package/node_modules/validator/lib/rtrim.js +24 -0
- package/node_modules/validator/lib/stripLow.js +16 -0
- package/node_modules/validator/lib/toBoolean.js +17 -0
- package/node_modules/validator/lib/toDate.js +15 -0
- package/node_modules/validator/lib/toFloat.js +14 -0
- package/node_modules/validator/lib/toInt.js +14 -0
- package/node_modules/validator/lib/trim.js +14 -0
- package/node_modules/validator/lib/unescape.js +17 -0
- package/node_modules/validator/lib/util/algorithms.js +88 -0
- package/node_modules/validator/lib/util/assertString.js +12 -0
- package/node_modules/validator/lib/util/checkHost.js +20 -0
- package/node_modules/validator/lib/util/includesArray.js +14 -0
- package/node_modules/validator/lib/util/includesString.js +12 -0
- package/node_modules/validator/lib/util/merge.js +22 -0
- package/node_modules/validator/lib/util/multilineRegex.js +20 -0
- package/node_modules/validator/lib/util/nullUndefinedCheck.js +11 -0
- package/node_modules/validator/lib/util/toString.js +21 -0
- package/node_modules/validator/lib/util/typeOf.js +18 -0
- package/node_modules/validator/lib/whitelist.js +14 -0
- package/node_modules/validator/package.json +76 -0
- package/node_modules/validator/validator.js +5808 -0
- package/node_modules/validator/validator.min.js +23 -0
- package/package.json +3 -3
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
calculatorDisplay,
|
|
5
|
+
calculatorEquation,
|
|
6
|
+
type CalculatorKey,
|
|
7
|
+
calculatorKeyLabel,
|
|
8
|
+
initialCalculator,
|
|
9
|
+
pressCalculatorKey,
|
|
10
|
+
} from '~/kowalski/calculator'
|
|
11
|
+
import { kowalskiCatalog } from '~/kowalski/catalog'
|
|
12
|
+
|
|
13
|
+
describe('Kowalski calculator keypad', () => {
|
|
14
|
+
it.each([
|
|
15
|
+
['1234.00', '1,234.00'],
|
|
16
|
+
['1234.', '1,234.'],
|
|
17
|
+
['-0.0', '-0.0'],
|
|
18
|
+
['1e-10', '0.0000000001'],
|
|
19
|
+
['1e+12', '1E12'],
|
|
20
|
+
['1e-14', '1E-14'],
|
|
21
|
+
['Error', 'Error'],
|
|
22
|
+
])('formats %s as %s without changing the canonical entry', (entry, expected) => {
|
|
23
|
+
expect(calculatorDisplay(entry)).toBe(expected)
|
|
24
|
+
})
|
|
25
|
+
it('seeds the authored calculation and repeats its last operation', () => {
|
|
26
|
+
const initial = initialCalculator({ left: 24, operator: '*', right: 7 })
|
|
27
|
+
expect(initial.entry).toBe('168')
|
|
28
|
+
expect(calculatorEquation(initial)).toBe('24 × 7 =')
|
|
29
|
+
expect(pressCalculatorKey(initial, '=').entry).toBe('1176')
|
|
30
|
+
})
|
|
31
|
+
it('replaces a result with a fresh entry, keeps decimal drafts, and ignores a second decimal', () => {
|
|
32
|
+
const draft = enter('clear', '0', '0', '.', '0', '5', '.')
|
|
33
|
+
expect(draft.entry).toBe('0.05')
|
|
34
|
+
expect(enter('2', '+', '3', '=', '4', '.', '0').entry).toBe('4.0')
|
|
35
|
+
expect(enter('.', '1', '+', '.', '2', '=').entry).toBe('0.3')
|
|
36
|
+
})
|
|
37
|
+
it('chains operations left to right and replaces an operator before the next number', () => {
|
|
38
|
+
expect(enter('2', '+', '3', '*', '4', '=').entry).toBe('20')
|
|
39
|
+
expect(enter('8', '+', '-', '3', '=').entry).toBe('5')
|
|
40
|
+
expect(enter('2', '+', '=', '=').entry).toBe('6')
|
|
41
|
+
})
|
|
42
|
+
it('clears the current entry before clearing the full calculation', () => {
|
|
43
|
+
const partial = enter('8', '+', '3')
|
|
44
|
+
expect(calculatorKeyLabel(partial, 'clear')).toBe('C')
|
|
45
|
+
const cleared = pressCalculatorKey(partial, 'clear')
|
|
46
|
+
expect(cleared).toMatchObject({ entry: '0', left: 8, phase: 'right' })
|
|
47
|
+
expect(calculatorKeyLabel(cleared, 'clear')).toBe('AC')
|
|
48
|
+
expect(pressCalculatorKey(cleared, '=').entry).toBe('8')
|
|
49
|
+
expect(pressCalculatorKey(cleared, 'clear')).toMatchObject({
|
|
50
|
+
entry: '0',
|
|
51
|
+
left: 0,
|
|
52
|
+
phase: 'left',
|
|
53
|
+
right: 0,
|
|
54
|
+
})
|
|
55
|
+
})
|
|
56
|
+
it('negates an entry and applies contextual percentages', () => {
|
|
57
|
+
expect(enter('5', 'sign', '+', '2', '=').entry).toBe('-3')
|
|
58
|
+
expect(enter('2', '*', 'sign', '3', '=').entry).toBe('-6')
|
|
59
|
+
expect(enter('2', '0', '0', '+', '1', '0', '%', '=').entry).toBe('220')
|
|
60
|
+
expect(enter('2', '0', '0', '-', '1', '0', '%', '=').entry).toBe('180')
|
|
61
|
+
expect(enter('2', '0', '0', '*', '1', '0', '%', '=').entry).toBe('20')
|
|
62
|
+
expect(enter('2', '0', '0', '/', '1', '0', '%', '=').entry).toBe('2000')
|
|
63
|
+
expect(enter('5', '%').entry).toBe('0.05')
|
|
64
|
+
expect(enter('2', '0', '0', '+', '1', '0', '%', '5', '=').entry).toBe('205')
|
|
65
|
+
expect(enter('5', '/', '2', '=', 'sign', '7').entry).toBe('7')
|
|
66
|
+
expect(enter('0', '.', '0', '0', '0', '0', '0', '1', '%', '7').entry).toBe('7')
|
|
67
|
+
})
|
|
68
|
+
it('shows an error for division by zero and accepts a new calculation immediately', () => {
|
|
69
|
+
const error = enter('4', '/', '0', '=')
|
|
70
|
+
expect(error).toMatchObject({ entry: 'Error', phase: 'error' })
|
|
71
|
+
expect(calculatorEquation(error)).toBe('4 ÷ 0 =')
|
|
72
|
+
expect(pressCalculatorKey(error, '7')).toMatchObject({ entry: '7', phase: 'left' })
|
|
73
|
+
expect(pressCalculatorKey(error, 'clear')).toMatchObject({
|
|
74
|
+
entry: '0',
|
|
75
|
+
phase: 'left',
|
|
76
|
+
})
|
|
77
|
+
expect(initialCalculator({ left: 1e308, operator: '*', right: 1e308 }).entry).toBe(
|
|
78
|
+
'Error'
|
|
79
|
+
)
|
|
80
|
+
})
|
|
81
|
+
it('retains a pending decimal entry and repeated equals through schema serialization', () => {
|
|
82
|
+
const calculation = enter('1', '2', '+', '3', '.')
|
|
83
|
+
const reopened = kowalskiCatalog.calculator.storeSchema.parse(
|
|
84
|
+
JSON.parse(JSON.stringify({ calculation }))
|
|
85
|
+
).calculation
|
|
86
|
+
expect(reopened).toEqual(calculation)
|
|
87
|
+
expect(pressCalculatorKey(reopened, '5').entry).toBe('3.5')
|
|
88
|
+
expect(pressCalculatorKey(reopened, '=').entry).toBe('15')
|
|
89
|
+
expect(pressCalculatorKey(pressCalculatorKey(reopened, '='), '=').entry).toBe('18')
|
|
90
|
+
})
|
|
91
|
+
it('backspaces decimal and negative drafts without losing the pending calculation', () => {
|
|
92
|
+
expect(enter('1', '2', '.', '3', 'backspace').entry).toBe('12.')
|
|
93
|
+
expect(enter('1', '2', '.', 'backspace').entry).toBe('12')
|
|
94
|
+
expect(enter('5', 'sign', 'backspace').entry).toBe('0')
|
|
95
|
+
expect(enter('0', 'backspace').entry).toBe('0')
|
|
96
|
+
const calculation = enter('1', '2', '+', '3', '.', '5', 'backspace')
|
|
97
|
+
const reopened = kowalskiCatalog.calculator.storeSchema.parse(
|
|
98
|
+
JSON.parse(JSON.stringify({ calculation }))
|
|
99
|
+
).calculation
|
|
100
|
+
expect(reopened).toMatchObject({ entry: '3.', left: 12, phase: 'right' })
|
|
101
|
+
expect(calculatorKeyLabel(reopened, 'backspace')).toBe('⌫')
|
|
102
|
+
const result = pressCalculatorKey(pressCalculatorKey(reopened, '7'), '=')
|
|
103
|
+
expect(result.entry).toBe('15.7')
|
|
104
|
+
expect(pressCalculatorKey(result, '=').entry).toBe('19.4')
|
|
105
|
+
})
|
|
106
|
+
it('backspaces a pending operand to zero and clears completed or failed calculations', () => {
|
|
107
|
+
expect(enter('8', '+', 'backspace', '=').entry).toBe('8')
|
|
108
|
+
for (const calculation of [enter('8', '+', '2', '='), enter('4', '/', '0', '=')]) {
|
|
109
|
+
const cleared = pressCalculatorKey(calculation, 'backspace')
|
|
110
|
+
expect(cleared).toMatchObject({ entry: '0', left: 0, phase: 'left', right: 0 })
|
|
111
|
+
expect(pressCalculatorKey(cleared, '=')).toEqual(cleared)
|
|
112
|
+
expect(pressCalculatorKey(cleared, '7').entry).toBe('7')
|
|
113
|
+
}
|
|
114
|
+
})
|
|
115
|
+
it('rejects malformed persisted calculator entries before keypad evaluation', () => {
|
|
116
|
+
const schema = kowalskiCatalog.calculator.storeSchema
|
|
117
|
+
const calculation = initialCalculator({ left: 1, operator: '+', right: 2 })
|
|
118
|
+
for (const entry of ['Error', '1e999']) {
|
|
119
|
+
expect(schema.safeParse({ calculation: { ...calculation, entry } }).success).toBe(
|
|
120
|
+
false
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
expect(
|
|
124
|
+
schema.safeParse({ calculation: { ...calculation, phase: 'error' } }).success
|
|
125
|
+
).toBe(false)
|
|
126
|
+
})
|
|
127
|
+
it('caps typed entries while preserving small authored values', () => {
|
|
128
|
+
expect(
|
|
129
|
+
enter('1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '1', '2', '3').entry
|
|
130
|
+
).toBe('123456789012')
|
|
131
|
+
expect(initialCalculator({ left: 0.0001, operator: '+', right: 0 }).entry).toBe(
|
|
132
|
+
'0.0001'
|
|
133
|
+
)
|
|
134
|
+
})
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
function enter(...keys: CalculatorKey[]) {
|
|
138
|
+
return keys.reduce(
|
|
139
|
+
(state, key) => pressCalculatorKey(state, key),
|
|
140
|
+
pressCalculatorKey(initialCalculator({ left: 0, operator: '+', right: 0 }), 'clear')
|
|
141
|
+
)
|
|
142
|
+
}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import { z } from 'zod/v4'
|
|
3
|
+
|
|
4
|
+
import { kowalskiCatalog } from '~/kowalski/catalog'
|
|
5
|
+
|
|
6
|
+
describe('Kowalski component contracts', () => {
|
|
7
|
+
it('rejects unsupported and missing item IDs', () => {
|
|
8
|
+
expect(
|
|
9
|
+
kowalskiCatalog.checklist.props.safeParse({
|
|
10
|
+
items: [{ id: '__proto__', label: 'A' }],
|
|
11
|
+
title: 'Packing',
|
|
12
|
+
}).success
|
|
13
|
+
).toBe(false)
|
|
14
|
+
expect(
|
|
15
|
+
kowalskiCatalog.checklist.props.safeParse({
|
|
16
|
+
items: [{ id: 'item-1', label: 'A' }, { label: 'B' }],
|
|
17
|
+
title: 'Packing',
|
|
18
|
+
}).success
|
|
19
|
+
).toBe(false)
|
|
20
|
+
expect(
|
|
21
|
+
kowalskiCatalog.poll.props.safeParse({
|
|
22
|
+
options: [{ id: 'option-1', label: 'A' }, { label: 'B' }],
|
|
23
|
+
question: 'Lunch?',
|
|
24
|
+
}).success
|
|
25
|
+
).toBe(false)
|
|
26
|
+
})
|
|
27
|
+
it('defines the complete 27-feature collection with standard serializable stores', () => {
|
|
28
|
+
expect(Object.keys(kowalskiCatalog).toSorted()).toEqual([
|
|
29
|
+
'billSplit',
|
|
30
|
+
'bookmark',
|
|
31
|
+
'budget',
|
|
32
|
+
'calculator',
|
|
33
|
+
'checklist',
|
|
34
|
+
'colorPalette',
|
|
35
|
+
'contact',
|
|
36
|
+
'countdown',
|
|
37
|
+
'event',
|
|
38
|
+
'expense',
|
|
39
|
+
'goal',
|
|
40
|
+
'habit',
|
|
41
|
+
'ledger',
|
|
42
|
+
'note',
|
|
43
|
+
'poll',
|
|
44
|
+
'randomPicker',
|
|
45
|
+
'rating',
|
|
46
|
+
'recipe',
|
|
47
|
+
'reminder',
|
|
48
|
+
'rotation',
|
|
49
|
+
'scoreboard',
|
|
50
|
+
'shoppingList',
|
|
51
|
+
'taskBoard',
|
|
52
|
+
'timeZone',
|
|
53
|
+
'timer',
|
|
54
|
+
'trip',
|
|
55
|
+
'unitConverter',
|
|
56
|
+
])
|
|
57
|
+
for (const entry of Object.values(kowalskiCatalog)) {
|
|
58
|
+
const json = z.toJSONSchema(entry.storeSchema, { target: 'draft-7' })
|
|
59
|
+
const restored = z.fromJSONSchema(json)
|
|
60
|
+
const state = entry.storeSchema.parse({})
|
|
61
|
+
expect(restored.parse(state)).toEqual(state)
|
|
62
|
+
expect(JSON.parse(JSON.stringify(state))).toEqual(state)
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
it('uses default bindings unless an optional feature ID is supplied', () => {
|
|
67
|
+
const input = {
|
|
68
|
+
items: [
|
|
69
|
+
{ id: 'tent', label: 'Tent' },
|
|
70
|
+
{ id: 'tent-poles', label: 'Tent' },
|
|
71
|
+
],
|
|
72
|
+
title: 'Packing',
|
|
73
|
+
}
|
|
74
|
+
const props = kowalskiCatalog.checklist.props.parse(input)
|
|
75
|
+
expect(props.items).toEqual(input.items)
|
|
76
|
+
expect(props.id).toBeUndefined()
|
|
77
|
+
expect(props.revision).toBe(0)
|
|
78
|
+
expect(props.scope).toBe('private')
|
|
79
|
+
expect(
|
|
80
|
+
kowalskiCatalog.checklist.props.safeParse({
|
|
81
|
+
...input,
|
|
82
|
+
instanceId: 'caller-plumbing',
|
|
83
|
+
}).success
|
|
84
|
+
).toBe(false)
|
|
85
|
+
expect(
|
|
86
|
+
kowalskiCatalog.checklist.props.parse({
|
|
87
|
+
...input,
|
|
88
|
+
id: 'Packing2',
|
|
89
|
+
revision: 2,
|
|
90
|
+
scope: 'public',
|
|
91
|
+
})
|
|
92
|
+
).toMatchObject({ id: 'Packing2', revision: 2, scope: 'public' })
|
|
93
|
+
for (const id of ['', '2Packing', 'packing-list', 'packing list', '__proto__']) {
|
|
94
|
+
expect(kowalskiCatalog.checklist.props.safeParse({ ...input, id }).success).toBe(
|
|
95
|
+
false
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
for (const revision of [-1, 0.5]) {
|
|
99
|
+
expect(
|
|
100
|
+
kowalskiCatalog.checklist.props.safeParse({ ...input, revision }).success
|
|
101
|
+
).toBe(false)
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
it.each([
|
|
106
|
+
{ input: { people: 2, total: 10 }, schema: kowalskiCatalog.billSplit.props },
|
|
107
|
+
{ input: { amount: 10, title: 'Lunch' }, schema: kowalskiCatalog.expense.props },
|
|
108
|
+
])('defaults money to USD and accepts explicit currencies (%#)', ({ input, schema }) => {
|
|
109
|
+
expect(schema.parse(input).currency).toBe('USD')
|
|
110
|
+
expect(schema.parse({ ...input, currency: 'JPY' }).currency).toBe('JPY')
|
|
111
|
+
})
|
|
112
|
+
|
|
113
|
+
it('rejects incompatible unit conversions instead of rendering an invented answer', () => {
|
|
114
|
+
expect(
|
|
115
|
+
kowalskiCatalog.unitConverter.props.safeParse({
|
|
116
|
+
from: 'km',
|
|
117
|
+
to: 'kg',
|
|
118
|
+
value: 12,
|
|
119
|
+
}).success
|
|
120
|
+
).toBe(false)
|
|
121
|
+
expect(
|
|
122
|
+
kowalskiCatalog.unitConverter.props.safeParse({
|
|
123
|
+
from: 'km',
|
|
124
|
+
to: 'mi',
|
|
125
|
+
value: 12,
|
|
126
|
+
}).success
|
|
127
|
+
).toBe(true)
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
it('rejects unsafe links, non-finite amounts, reversed trips, and invalid instants', () => {
|
|
131
|
+
for (const url of [
|
|
132
|
+
'https://?',
|
|
133
|
+
'https://',
|
|
134
|
+
'javascript:alert(1)',
|
|
135
|
+
'https://999.999.999.999',
|
|
136
|
+
]) {
|
|
137
|
+
expect(
|
|
138
|
+
kowalskiCatalog.bookmark.props.safeParse({ title: 'Link', url }).success
|
|
139
|
+
).toBe(false)
|
|
140
|
+
expect(
|
|
141
|
+
kowalskiCatalog.bookmark.storeSchema.safeParse({ url: { value: url } }).success
|
|
142
|
+
).toBe(false)
|
|
143
|
+
}
|
|
144
|
+
expect(
|
|
145
|
+
kowalskiCatalog.bookmark.props.safeParse({
|
|
146
|
+
title: 'Run code',
|
|
147
|
+
url: 'javascript:alert(1)',
|
|
148
|
+
}).success
|
|
149
|
+
).toBe(false)
|
|
150
|
+
expect(
|
|
151
|
+
kowalskiCatalog.billSplit.props.safeParse({
|
|
152
|
+
currency: 'USD',
|
|
153
|
+
people: 2,
|
|
154
|
+
total: Infinity,
|
|
155
|
+
}).success
|
|
156
|
+
).toBe(false)
|
|
157
|
+
expect(
|
|
158
|
+
kowalskiCatalog.trip.props.safeParse({
|
|
159
|
+
destination: 'Rome',
|
|
160
|
+
endDate: '2026-10-20',
|
|
161
|
+
origin: 'Paris',
|
|
162
|
+
startDate: '2026-10-25',
|
|
163
|
+
}).success
|
|
164
|
+
).toBe(false)
|
|
165
|
+
expect(
|
|
166
|
+
kowalskiCatalog.countdown.props.safeParse({
|
|
167
|
+
target: 'tomorrow',
|
|
168
|
+
title: 'Launch',
|
|
169
|
+
}).success
|
|
170
|
+
).toBe(false)
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
it('validates durable values against the authored field constraints', () => {
|
|
174
|
+
expect(
|
|
175
|
+
kowalskiCatalog.unitConverter.storeSchema.safeParse({
|
|
176
|
+
from: { value: 'km' },
|
|
177
|
+
to: { value: 'kg' },
|
|
178
|
+
}).success
|
|
179
|
+
).toBe(false)
|
|
180
|
+
expect(
|
|
181
|
+
kowalskiCatalog.countdown.storeSchema.safeParse({ target: { value: 'tomorrow' } })
|
|
182
|
+
.success
|
|
183
|
+
).toBe(false)
|
|
184
|
+
expect(
|
|
185
|
+
kowalskiCatalog.colorPalette.storeSchema.safeParse({ color: { value: 'blueish' } })
|
|
186
|
+
.success
|
|
187
|
+
).toBe(false)
|
|
188
|
+
expect(
|
|
189
|
+
kowalskiCatalog.trip.storeSchema.safeParse({
|
|
190
|
+
endDate: { value: '2026-10-20' },
|
|
191
|
+
startDate: { value: '2026-10-25' },
|
|
192
|
+
}).success
|
|
193
|
+
).toBe(false)
|
|
194
|
+
})
|
|
195
|
+
|
|
196
|
+
it('bounds random choices and arithmetic without accepting executable expressions', () => {
|
|
197
|
+
expect(
|
|
198
|
+
kowalskiCatalog.randomPicker.props.safeParse({
|
|
199
|
+
maximum: 2,
|
|
200
|
+
minimum: 10,
|
|
201
|
+
mode: 'range',
|
|
202
|
+
}).success
|
|
203
|
+
).toBe(false)
|
|
204
|
+
expect(
|
|
205
|
+
kowalskiCatalog.randomPicker.props.safeParse({
|
|
206
|
+
mode: 'list',
|
|
207
|
+
options: [],
|
|
208
|
+
}).success
|
|
209
|
+
).toBe(false)
|
|
210
|
+
expect(
|
|
211
|
+
kowalskiCatalog.calculator.props.safeParse({
|
|
212
|
+
expression: 'globalThis.secret()',
|
|
213
|
+
}).success
|
|
214
|
+
).toBe(false)
|
|
215
|
+
expect(
|
|
216
|
+
kowalskiCatalog.calculator.props.safeParse({
|
|
217
|
+
left: 12,
|
|
218
|
+
operator: '*',
|
|
219
|
+
right: 7,
|
|
220
|
+
}).success
|
|
221
|
+
).toBe(true)
|
|
222
|
+
})
|
|
223
|
+
})
|