├── .changeset
└── config.json
├── .editorconfig
├── .github
├── ISSUE_TEMPLATE
│ ├── bug-report.yml
│ └── feature-request.yml
└── workflows
│ ├── codeql.yml
│ ├── format.yml
│ ├── release.yml
│ └── tests.yml
├── .gitignore
├── .gitpod.yml
├── .npmrc
├── .prettierignore
├── .prettierrc
├── .vscode
└── extensions.json
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── assets
├── badges
│ ├── stage-0.json
│ ├── stage-1.json
│ ├── stage-2.json
│ ├── stage-3.json
│ └── stage-4.json
├── banner.png
└── img
│ ├── foo.svg
│ ├── logo.svg
│ ├── npm-monochrome.svg
│ ├── pnpm-duplicate.svg
│ ├── pnpm-monochrome.svg
│ ├── solid-blocks-heading-0.svg
│ ├── solid-blocks-heading-1.svg
│ ├── solid-blocks-heading-2.svg
│ ├── solid-blocks-heading-left-block.svg
│ ├── solid-blocks-heading-mid-block-shadow.svg
│ ├── solid-blocks-heading-mid-block.svg
│ ├── solid-blocks-heading-right-block.svg
│ ├── solid-blocks-heading.svg
│ ├── solid-squares.webp
│ └── yarn-monochrome.svg
├── configs
└── vitest.config.ts
├── eslint.config.mjs
├── netlify.toml
├── package.json
├── packages
├── active-element
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── index.tsx
│ │ └── utils.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── analytics
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── ga.ts
│ │ └── index.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── audio
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── index.tsx
│ │ ├── sample1.mp3
│ │ ├── sample2.mp3
│ │ └── sample3.mp3
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── setup.ts
│ └── tsconfig.json
├── autofocus
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.tsx
│ └── tsconfig.json
├── bounds
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── broadcast-channel
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── hooks
│ │ │ └── useTrackPages.tsx
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── clipboard
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── img.png
│ │ ├── img2.png
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ ├── server.test.ts
│ │ └── setup.ts
│ └── tsconfig.json
├── connectivity
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ ├── server.test.ts
│ │ └── setup.ts
│ └── tsconfig.json
├── context
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.tsx
│ │ └── server.test.tsx
│ └── tsconfig.json
├── controlled-props
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.tsx
│ ├── test
│ │ └── testProps.test.tsx
│ └── tsconfig.json
├── cookies
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ └── tsconfig.json
├── cursor
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── App.tsx
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── date
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── index.tsx
│ │ ├── lib.tsx
│ │ └── utils.ts
│ ├── package.json
│ ├── src
│ │ ├── index.ts
│ │ ├── primitives.ts
│ │ ├── types.ts
│ │ ├── utils.ts
│ │ └── variables.ts
│ ├── test
│ │ ├── date-difference.test.ts
│ │ ├── date-now.test.ts
│ │ └── utils.test.ts
│ └── tsconfig.json
├── db-store
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── README.md
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── supabase-mock.ts
│ └── tsconfig.json
├── deep
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ ├── index.ts
│ │ ├── store-updates.ts
│ │ ├── track-deep.ts
│ │ └── track-store.ts
│ ├── test
│ │ ├── track.bench.ts
│ │ ├── track.test.ts
│ │ └── updates.test.ts
│ └── tsconfig.json
├── destructure
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── destructure.test.ts
│ └── tsconfig.json
├── devices
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ ├── server.test.ts
│ │ └── setup.ts
│ └── tsconfig.json
├── event-bus
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ ├── emitter.ts
│ │ ├── eventBus.ts
│ │ ├── eventHub.ts
│ │ ├── eventStack.ts
│ │ ├── index.ts
│ │ └── utils.ts
│ ├── test
│ │ ├── emitter.test.ts
│ │ ├── eventBus.test.ts
│ │ ├── eventHub.test.ts
│ │ ├── eventStack.test.ts
│ │ └── utils.test.ts
│ └── tsconfig.json
├── event-dispatcher
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── index.tsx
│ │ └── utils.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── event-listener
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── components.tsx
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ ├── callbackWrappers.ts
│ │ ├── components.ts
│ │ ├── eventListener.ts
│ │ ├── eventListenerMap.ts
│ │ ├── eventListenerStack.ts
│ │ ├── index.ts
│ │ └── types.ts
│ ├── test
│ │ ├── event-listener-map.test.ts
│ │ ├── event-listener.test.ts
│ │ └── setup.ts
│ └── tsconfig.json
├── event-props
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── fetch
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── cache.ts
│ │ ├── fetch.ts
│ │ ├── index.ts
│ │ ├── modifiers.ts
│ │ └── request.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── setup.ts
│ └── tsconfig.json
├── filesystem
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ ├── adapter-mocks.ts
│ │ ├── adapter-node.ts
│ │ ├── adapter-tauri.ts
│ │ ├── adapter-vfs.ts
│ │ ├── adapter-web.ts
│ │ ├── index.ts
│ │ ├── reactive.ts
│ │ ├── tools.ts
│ │ ├── types.ts
│ │ └── watcher-chokidar.ts
│ ├── test
│ │ ├── fsaccess-mock.ts
│ │ ├── index.test.ts
│ │ ├── server.test.ts
│ │ └── tauri-mock.ts
│ └── tsconfig.json
├── flux-store
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── components
│ │ │ ├── BoxesDemo.tsx
│ │ │ ├── CounterButton.tsx
│ │ │ ├── CounterControls.tsx
│ │ │ └── index.ts
│ │ ├── index.tsx
│ │ └── stores
│ │ │ ├── ages-store.ts
│ │ │ └── counter-store.ts
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.tsx
│ └── tsconfig.json
├── fullscreen
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ ├── server.test.ts
│ │ └── setup.ts
│ └── tsconfig.json
├── geolocation
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── client.tsx
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ ├── server.test.ts
│ │ └── setup.ts
│ └── tsconfig.json
├── gestures
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ ├── core.ts
│ │ ├── index.ts
│ │ ├── pan.ts
│ │ ├── pinch.ts
│ │ ├── rotate.ts
│ │ ├── swipe.ts
│ │ └── tap.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── graphql
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── codegen.yml
│ │ ├── gqlgen.ts
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── history
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── i18n
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── en.ts
│ │ ├── es.ts
│ │ ├── fr.ts
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ ├── server.test.ts
│ │ └── setup.tsx
│ └── tsconfig.json
├── idle
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ ├── createIdleTimer.ts
│ │ ├── index.ts
│ │ └── types.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── immutable
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── input-mask
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.tsx
│ └── tsconfig.json
├── intersection-observer
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── jsx-tokenizer
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.tsx
│ │ └── server.test.tsx
│ └── tsconfig.json
├── keyboard
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── keyed
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── entries.tsx
│ │ ├── index.tsx
│ │ ├── key.tsx
│ │ ├── mapEntries.tsx
│ │ └── setValues.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.tsx
│ └── tsconfig.json
├── lifecycle
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── list
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.bench.tsx
│ │ └── index.test.tsx
│ └── tsconfig.json
├── map
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── marker
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── masonry
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── media
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── index.tsx
│ │ └── style.css
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── memo
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── async.tsx
│ │ ├── cache.tsx
│ │ ├── grouped.tsx
│ │ ├── index.tsx
│ │ ├── lazy-suspense.tsx
│ │ ├── lazy.tsx
│ │ └── writable-page.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── async.test.ts
│ │ ├── cache.test.ts
│ │ ├── cachedDerivation.test.disabled.ts
│ │ ├── latest.test.ts
│ │ ├── lazy.test.ts
│ │ ├── pureReaction.test.ts
│ │ ├── reducer.test.ts
│ │ └── writable.test.ts
│ └── tsconfig.json
├── mouse
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── components.tsx
│ │ ├── index.tsx
│ │ └── utils.ts
│ ├── package.json
│ ├── src
│ │ ├── common.ts
│ │ ├── index.ts
│ │ ├── primitives.ts
│ │ └── types.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── mutable
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── dev.test.ts
│ │ ├── modifiers.test.ts
│ │ ├── mutable.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── mutation-observer
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── components.tsx
│ │ ├── index.tsx
│ │ └── utils.ts
│ ├── index.html
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── setup.ts
│ └── tsconfig.json
├── page-visibility
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── pagination
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── permission
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ ├── server.test.ts
│ │ └── setup.ts
│ └── tsconfig.json
├── platform
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── server.test.ts
│ └── tsconfig.json
├── pointer
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ ├── helpers.ts
│ │ ├── index.ts
│ │ └── types.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── presence
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── createPresence.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── promise
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── intex.test.ts
│ └── tsconfig.json
├── props
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ ├── combineProps.ts
│ │ ├── filterProps.ts
│ │ ├── index.ts
│ │ └── propTraps.ts
│ ├── test
│ │ ├── combineProps.test.ts
│ │ └── filterProps.test.ts
│ └── tsconfig.json
├── raf
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── index.tsx
│ │ └── raf.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── range
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ ├── common.ts
│ │ ├── index.ts
│ │ ├── indexRange.ts
│ │ ├── mapRange.ts
│ │ └── repeat.ts
│ ├── test
│ │ ├── indexRange.test.ts
│ │ ├── mapRange.test.ts
│ │ └── repeat.test.ts
│ └── tsconfig.json
├── refs
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ ├── mergeRefs.test.tsx
│ │ └── server.test.tsx
│ └── tsconfig.json
├── resize-observer
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── resource
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── rootless
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── root-pool.test.ts
│ └── tsconfig.json
├── scheduled
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── index.tsx
│ │ ├── reactive.tsx
│ │ └── timeline.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── create-scheduled.test.ts
│ │ ├── debounce.test.ts
│ │ ├── server.test.ts
│ │ └── throttle.test.ts
│ └── tsconfig.json
├── script-loader
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── scroll
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── selection
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.tsx
│ └── tsconfig.json
├── set
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── share
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ ├── index.ts
│ │ ├── networks.ts
│ │ ├── social-share.ts
│ │ └── web-share.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── signal-builders
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── array.ts
│ │ ├── convert.ts
│ │ ├── index.ts
│ │ ├── number.ts
│ │ ├── object.ts
│ │ ├── string.ts
│ │ └── update.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── spring
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── state-machine
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── static-store
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── storage
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ ├── cookies.ts
│ │ ├── index.ts
│ │ ├── persisted.ts
│ │ ├── tauri.ts
│ │ └── tools.ts
│ ├── tauri-storage
│ │ ├── .gitignore
│ │ ├── .vscode
│ │ │ └── extensions.json
│ │ ├── README.md
│ │ ├── index.html
│ │ ├── package-lock.json
│ │ ├── package.json
│ │ ├── src-tauri
│ │ │ ├── .gitignore
│ │ │ ├── Cargo.lock
│ │ │ ├── Cargo.toml
│ │ │ ├── build.rs
│ │ │ ├── capabilities
│ │ │ │ └── default.json
│ │ │ ├── icons
│ │ │ │ ├── 128x128.png
│ │ │ │ ├── 128x128@2x.png
│ │ │ │ ├── 32x32.png
│ │ │ │ ├── Square107x107Logo.png
│ │ │ │ ├── Square142x142Logo.png
│ │ │ │ ├── Square150x150Logo.png
│ │ │ │ ├── Square284x284Logo.png
│ │ │ │ ├── Square30x30Logo.png
│ │ │ │ ├── Square310x310Logo.png
│ │ │ │ ├── Square44x44Logo.png
│ │ │ │ ├── Square71x71Logo.png
│ │ │ │ ├── Square89x89Logo.png
│ │ │ │ ├── StoreLogo.png
│ │ │ │ ├── icon.icns
│ │ │ │ ├── icon.ico
│ │ │ │ └── icon.png
│ │ │ ├── src
│ │ │ │ └── main.rs
│ │ │ └── tauri.conf.json
│ │ ├── src
│ │ │ ├── App.tsx
│ │ │ ├── index.tsx
│ │ │ ├── styles.css
│ │ │ └── vite-env.d.ts
│ │ ├── tsconfig.json
│ │ ├── tsconfig.node.json
│ │ └── vite.config.ts
│ ├── test
│ │ ├── cookies.test.ts
│ │ ├── persisted.test.ts
│ │ ├── tauri.test.ts
│ │ └── tools.test.ts
│ └── tsconfig.json
├── stream
│ ├── CHANGELOG.md
│ ├── README.md
│ ├── demo
│ │ ├── index.html
│ │ ├── index.tsx
│ │ └── vite.config.ts
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ ├── server.test.ts
│ │ └── setup.ts
│ └── tsconfig.json
├── styles
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── timer
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── transition-group
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ ├── index.tsx
│ │ ├── list-page.tsx
│ │ └── switch-page.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── list-transition.test.ts
│ │ ├── server.test.ts
│ │ └── switch-transition.test.ts
│ └── tsconfig.json
├── trigger
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── tween
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ └── index.test.ts
│ └── tsconfig.json
├── upload
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ ├── createDropzone.ts
│ │ ├── createFileUploader.ts
│ │ ├── helpers.ts
│ │ ├── index.ts
│ │ └── types.ts
│ ├── test
│ │ └── index.test.tsx
│ └── tsconfig.json
├── utils
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── immutable
│ │ │ ├── array.ts
│ │ │ ├── copy.ts
│ │ │ ├── index.ts
│ │ │ ├── number.ts
│ │ │ ├── object.ts
│ │ │ ├── types.ts
│ │ │ └── update.ts
│ │ ├── index.ts
│ │ └── types.ts
│ ├── test
│ │ ├── immutable.test.ts
│ │ ├── index.test.ts
│ │ └── server.test.ts
│ └── tsconfig.json
├── virtual
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.tsx
│ ├── test
│ │ ├── index.test.tsx
│ │ └── server.test.tsx
│ └── tsconfig.json
├── websocket
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ │ └── index.tsx
│ ├── package.json
│ ├── src
│ │ └── index.ts
│ ├── test
│ │ ├── index.test.ts
│ │ └── setup.ts
│ └── tsconfig.json
└── workers
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── dev
│ └── index.tsx
│ ├── index.html
│ ├── package.json
│ ├── src
│ ├── index.ts
│ ├── types.d.ts
│ └── utils.ts
│ └── tsconfig.json
├── pnpm-lock.yaml
├── pnpm-workspace.yaml
├── scripts
├── build.ts
├── dev.ts
├── measure.ts
├── new-package.ts
├── update-readme.ts
├── update-tsconfigs.ts
└── utils
│ ├── calculate-bundlesize.ts
│ ├── get-modules-data.ts
│ ├── index.ts
│ └── utils.ts
├── site
├── .env
├── .gitignore
├── app.config.ts
├── package.json
├── postcss.config.cjs
├── public
│ ├── favicons
│ │ ├── android-chrome-192x192.png
│ │ ├── android-chrome-512x512.png
│ │ ├── apple-touch-icon.png
│ │ ├── browserconfig.xml
│ │ ├── favicon-16x16.png
│ │ ├── favicon-32x32.png
│ │ ├── favicon.ico
│ │ ├── icon-192x192.png
│ │ ├── icon-256x256.png
│ │ ├── icon-384x384.png
│ │ ├── icon-512x512.png
│ │ └── mstile-150x150.png
│ ├── fonts
│ │ └── Gordita
│ │ │ ├── Gordita-Black-Italic.otf
│ │ │ ├── Gordita-Black-Italic.woff
│ │ │ ├── Gordita-Black-Italic.woff2
│ │ │ ├── Gordita-Black.otf
│ │ │ ├── Gordita-Black.woff
│ │ │ ├── Gordita-Black.woff2
│ │ │ ├── Gordita-Bold-Italic.woff
│ │ │ ├── Gordita-Bold-italic.otf
│ │ │ ├── Gordita-Bold-italic.woff2
│ │ │ ├── Gordita-Bold.eot
│ │ │ ├── Gordita-Bold.otf
│ │ │ ├── Gordita-Bold.ttf
│ │ │ ├── Gordita-Bold.woff
│ │ │ ├── Gordita-Bold.woff2
│ │ │ ├── Gordita-Light-Italic.otf
│ │ │ ├── Gordita-Light-Italic.woff
│ │ │ ├── Gordita-Light-Italic.woff2
│ │ │ ├── Gordita-Light.otf
│ │ │ ├── Gordita-Light.woff
│ │ │ ├── Gordita-Light.woff2
│ │ │ ├── Gordita-Medium-Italic.otf
│ │ │ ├── Gordita-Medium-Italic.woff
│ │ │ ├── Gordita-Medium-Italic.woff2
│ │ │ ├── Gordita-Medium.eot
│ │ │ ├── Gordita-Medium.otf
│ │ │ ├── Gordita-Medium.ttf
│ │ │ ├── Gordita-Medium.woff
│ │ │ ├── Gordita-Medium.woff2
│ │ │ ├── Gordita-Regular-Italic.otf
│ │ │ ├── Gordita-Regular-Italic.woff
│ │ │ ├── Gordita-Regular-Italic.woff2
│ │ │ ├── Gordita-Regular.eot
│ │ │ ├── Gordita-Regular.otf
│ │ │ ├── Gordita-Regular.ttf
│ │ │ ├── Gordita-Regular.woff
│ │ │ ├── Gordita-Regular.woff2
│ │ │ ├── Gordita-Thin-Italic.otf
│ │ │ ├── Gordita-Thin-Italic.woff
│ │ │ ├── Gordita-Thin-Italic.woff2
│ │ │ ├── Gordita-Thin.eot
│ │ │ ├── Gordita-Thin.otf
│ │ │ ├── Gordita-Thin.ttf
│ │ │ ├── Gordita-Thin.woff
│ │ │ ├── Gordita-Thin.woff2
│ │ │ ├── Gordita-Ultra-Italic.otf
│ │ │ ├── Gordita-Ultra-Italic.woff
│ │ │ ├── Gordita-Ultra-Italic.woff2
│ │ │ ├── Gordita-Ultra.otf
│ │ │ ├── Gordita-Ultra.woff
│ │ │ └── Gordita-Ultra.woff2
│ ├── img
│ │ ├── solid-primitives-dark-logo.svg
│ │ ├── solid-primitives-logo.svg
│ │ ├── solid-primitives-stacked-dark-logo.svg
│ │ └── solid-primitives-stacked-logo.svg
│ └── og.jpeg
├── scripts
│ └── generate.ts
├── src
│ ├── api.ts
│ ├── app.scss
│ ├── app.tsx
│ ├── components
│ │ ├── BundleSizeModal
│ │ │ └── BundleSizeModal.tsx
│ │ ├── Footer
│ │ │ └── Footer.tsx
│ │ ├── Header
│ │ │ ├── Header.tsx
│ │ │ ├── NavMenu.tsx
│ │ │ └── ThemeBtn.tsx
│ │ ├── Icons
│ │ │ ├── HalfSun.tsx
│ │ │ ├── Hamburger.tsx
│ │ │ ├── NpmLogo.tsx
│ │ │ ├── NpmMonochrome.tsx
│ │ │ ├── NpmOppositeMonochrome.tsx
│ │ │ ├── PnpmLogo.tsx
│ │ │ ├── PnpmMonochrome.tsx
│ │ │ ├── SolidBlocksHeaderClusterDefs.tsx
│ │ │ ├── YarnLogo.tsx
│ │ │ └── YarnMonochrome.tsx
│ │ ├── Modal
│ │ │ └── SlideModal.tsx
│ │ ├── Primitives
│ │ │ ├── BundleSizeWrapper.tsx
│ │ │ ├── CodePrimitive.tsx
│ │ │ ├── InfoBar.tsx
│ │ │ ├── PrimitiveBtn.tsx
│ │ │ ├── PrimitiveBtnLineWrapper.tsx
│ │ │ ├── SizeBadge.tsx
│ │ │ ├── SizeUnitSpan.tsx
│ │ │ ├── StageBadge.tsx
│ │ │ └── VersionBadge.tsx
│ │ ├── Search
│ │ │ ├── CheckBox
│ │ │ │ ├── CheckBox.tsx
│ │ │ │ └── checkbox.module.scss
│ │ │ ├── ClientSearchModal.tsx
│ │ │ ├── Search.tsx
│ │ │ ├── SearchBtn.tsx
│ │ │ └── SearchModal.tsx
│ │ ├── Stage
│ │ │ └── Stage.tsx
│ │ ├── prose.tsx
│ │ └── table.tsx
│ ├── constants.ts
│ ├── entry-client.tsx
│ ├── entry-server.tsx
│ ├── env.d.ts
│ ├── hljs.scss
│ ├── primitives-page-main.module.scss
│ ├── primitives-page-main.scss
│ ├── primitives
│ │ ├── DocumentHydrationHelper.tsx
│ │ ├── client-only.ts
│ │ ├── createShortcut.ts
│ │ └── document-class.tsx
│ ├── routes
│ │ ├── [...404].tsx
│ │ ├── index.tsx
│ │ ├── package
│ │ │ └── [name]
│ │ │ │ ├── (package).tsx
│ │ │ │ └── components
│ │ │ │ ├── heading.tsx
│ │ │ │ ├── package-installation.tsx
│ │ │ │ ├── primitive-name-tooltip.client.tsx
│ │ │ │ └── primitive-name-tooltips.tsx
│ │ └── playground
│ │ │ ├── [name].tsx
│ │ │ └── playground.scss
│ ├── types.ts
│ └── utils.ts
├── tailwind.config.cjs
└── tsconfig.json
├── template
├── LICENSE
├── README.md
├── dev
│ └── index.tsx
├── package.json
├── src
│ └── index.ts
├── test
│ ├── index.test.ts
│ └── server.test.ts
└── tsconfig.json
└── tsconfig.json
/.changeset/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://unpkg.com/@changesets/config@2.0.0/schema.json",
3 | "changelog": "@changesets/cli/changelog",
4 | "commit": false,
5 | "fixed": [],
6 | "linked": [],
7 | "access": "public",
8 | "baseBranch": "main",
9 | "updateInternalDependencies": "patch",
10 | "ignore": ["site"]
11 | }
12 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 2
6 | end_of_line = LF
7 | charset = utf-8
8 | insert_final_newline = true
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature-request.yml:
--------------------------------------------------------------------------------
1 | name: "Feature Request"
2 | description: For feature requests and primitive proposals. Please search for existing issues first. Also see CONTRIBUTING.
3 | body:
4 | - type: markdown
5 | attributes:
6 | value: |
7 | Thank you for bringing your ideas here :pray:.
8 |
9 | The more information you fill in, the better the community can understand your idea.
10 | - type: textarea
11 | id: problem
12 | attributes:
13 | label: Describe The Problem To Be Solved
14 | description: Provide a clear and concise description of the challenge you are running into.
15 | validations:
16 | required: true
17 | - type: textarea
18 | id: solution
19 | attributes:
20 | label: Suggest A Solution
21 | description: |
22 | A concise description of your preferred solution. Things to address include:
23 | - Details of the technical implementation
24 | - Tradeoffs made in design decisions
25 | - Caveats and considerations for the future
26 | validations:
27 | required: true
28 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | name: Release
2 |
3 | on:
4 | push:
5 | branches: [main]
6 |
7 | concurrency: ${{ github.workflow }}-${{ github.ref }}
8 |
9 | jobs:
10 | release:
11 | runs-on: ubuntu-latest
12 | steps:
13 | - uses: actions/checkout@v4
14 |
15 | - uses: pnpm/action-setup@v4
16 |
17 | - name: Setup Node.js environment
18 | uses: actions/setup-node@v4
19 | with:
20 | node-version: 20
21 | cache: pnpm
22 |
23 | - name: Install Dependencies
24 | run: pnpm i
25 |
26 | - name: Create Release Pull Request or Publish to npm
27 | id: changesets
28 | uses: changesets/action@v1
29 | with:
30 | version: pnpm run version
31 | publish: pnpm run release
32 | env:
33 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
34 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 |
--------------------------------------------------------------------------------
/.github/workflows/tests.yml:
--------------------------------------------------------------------------------
1 | name: Build and Test
2 |
3 | on:
4 | push:
5 | branches: [main]
6 | pull_request:
7 | branches: [main]
8 |
9 | jobs:
10 | build-test:
11 | runs-on: ubuntu-latest
12 |
13 | steps:
14 | - uses: actions/checkout@v4
15 |
16 | - uses: pnpm/action-setup@v4
17 |
18 | - name: Setup Node.js environment
19 | uses: actions/setup-node@v4
20 | with:
21 | node-version: 20
22 | cache: pnpm
23 |
24 | - name: Install dependencies
25 | run: pnpm install
26 |
27 | - name: Build all packages
28 | run: pnpm build
29 |
30 | - name: Lint
31 | # Will run the step even if build step failed
32 | if: success() || failure()
33 | run: pnpm lint
34 |
35 | - name: Test all packages
36 | # Will run the step even if lint step failed
37 | if: success() || failure()
38 | run: pnpm test
39 |
--------------------------------------------------------------------------------
/.gitpod.yml:
--------------------------------------------------------------------------------
1 | tasks:
2 | - init: pnpm install && pnpm run build
3 | vscode:
4 | extensions: ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
5 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | strict-peer-dependencies=false
2 | auto-install-peers=true
3 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 |
2 | node_modules/
3 | dist/
4 | assets
5 |
6 | # TypeScript cache
7 | *.tsbuildinfo
8 |
9 | .vscode
10 |
11 | # Temporary folders
12 | tmp/
13 | temp/
14 | _temp_*
15 |
16 | _generated
17 |
18 | .netlify
19 | .vinxi
20 | .idea
21 |
22 | tsconfig.json
23 |
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "trailingComma": "all",
3 | "tabWidth": 2,
4 | "printWidth": 100,
5 | "semi": true,
6 | "singleQuote": false,
7 | "useTabs": false,
8 | "arrowParens": "avoid",
9 | "bracketSpacing": true,
10 | "endOfLine": "lf",
11 | "plugins": ["prettier-plugin-tailwindcss"]
12 | }
13 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "esbenp.prettier-vscode",
4 | "dbaeumer.vscode-eslint",
5 | "bradlc.vscode-tailwindcss"
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Solid Core Team
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/assets/badges/stage-0.json:
--------------------------------------------------------------------------------
1 | {
2 | "schemaVersion": 1,
3 | "label": "STAGE",
4 | "message": "0",
5 | "color": "#FA233E"
6 | }
7 |
--------------------------------------------------------------------------------
/assets/badges/stage-1.json:
--------------------------------------------------------------------------------
1 | {
2 | "schemaVersion": 1,
3 | "label": "STAGE",
4 | "message": "1",
5 | "color": "#FFA15C"
6 | }
7 |
--------------------------------------------------------------------------------
/assets/badges/stage-2.json:
--------------------------------------------------------------------------------
1 | {
2 | "schemaVersion": 1,
3 | "label": "STAGE",
4 | "message": "2",
5 | "color": "#E9DE47"
6 | }
7 |
--------------------------------------------------------------------------------
/assets/badges/stage-3.json:
--------------------------------------------------------------------------------
1 | {
2 | "schemaVersion": 1,
3 | "label": "STAGE",
4 | "message": "3",
5 | "color": "#12C3A2"
6 | }
7 |
--------------------------------------------------------------------------------
/assets/badges/stage-4.json:
--------------------------------------------------------------------------------
1 | {
2 | "schemaVersion": 1,
3 | "label": "STAGE",
4 | "message": "4",
5 | "color": "#2962FF"
6 | }
7 |
--------------------------------------------------------------------------------
/assets/banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs-community/solid-primitives/e8461ce312c510ac6d187992c3d0888bc67f32b9/assets/banner.png
--------------------------------------------------------------------------------
/assets/img/npm-monochrome.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/img/pnpm-duplicate.svg:
--------------------------------------------------------------------------------
1 |
15 |
--------------------------------------------------------------------------------
/assets/img/solid-blocks-heading-mid-block-shadow.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/img/solid-blocks-heading-mid-block.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/img/solid-squares.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs-community/solid-primitives/e8461ce312c510ac6d187992c3d0888bc67f32b9/assets/img/solid-squares.webp
--------------------------------------------------------------------------------
/assets/img/yarn-monochrome.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/netlify.toml:
--------------------------------------------------------------------------------
1 | [build]
2 | base = "/"
3 | publish = "site/dist"
4 | command = "pnpm build && pnpm -dir site run deploy"
5 |
--------------------------------------------------------------------------------
/packages/active-element/dev/utils.ts:
--------------------------------------------------------------------------------
1 | export const genNodeList = () =>
2 | Array.from({ length: 10 }, (_, id) => ({
3 | x: Math.random() * (window.innerWidth - 192),
4 | y: Math.random() * (window.innerHeight - 192),
5 | size: Math.random() + 0.15,
6 | id,
7 | }));
8 |
--------------------------------------------------------------------------------
/packages/active-element/test/server.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, test, expect, vi } from "vitest";
2 | import { makeActiveElementListener, createActiveElement, createFocusSignal } from "../src/index.js";
3 |
4 | describe("API doesn't break in SSR", () => {
5 | // check if the API doesn't throw when calling it in SSR
6 | test("makeActiveElementListener() - SSR", () => {
7 | const cb = vi.fn();
8 | expect(() => makeActiveElementListener(cb)).not.toThrow();
9 | expect(cb).not.toBeCalled();
10 | });
11 |
12 | test("createActiveElement() - SSR", () => {
13 | expect(() => createActiveElement()).not.toThrow();
14 | });
15 |
16 | test("createFocusSignal() - SSR", () => {
17 | const el = vi.fn();
18 | expect(() => createFocusSignal(el)).not.toThrow();
19 | expect(el).not.toBeCalled();
20 | });
21 | });
22 |
--------------------------------------------------------------------------------
/packages/active-element/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../event-listener"
11 | },
12 | {
13 | "path": "../utils"
14 | }
15 | ],
16 | "include": [
17 | "src"
18 | ]
19 | }
--------------------------------------------------------------------------------
/packages/analytics/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # @solid-primitives/analytics
2 |
3 | ## 0.2.0
4 |
5 | ### Minor Changes
6 |
7 | - ea09f71: Remove CJS support. The package is ESM only now.
8 |
9 | ## 0.1.6
10 |
11 | ### Patch Changes
12 |
13 | - d23dd74: Add type exports for cjs
14 |
15 | ## 0.1.5
16 |
17 | ### Patch Changes
18 |
19 | - 3fad3789: Revert from publishing separate server, development, and production builds that has to rely on export conditions
20 | to publishing a single build that can be used in any environment.
21 | Envs will be checked at with `isDev`and `isServer` consts exported by `"solid-js/web"` so it's still tree-shakeable.
22 |
23 | ## 0.1.4
24 |
25 | ### Patch Changes
26 |
27 | - 865d5ee9: Fix build. (remove keepNames option)
28 |
29 | ## 0.1.3
30 |
31 | ### Patch Changes
32 |
33 | - dd2d7d1c: Improve export conditions.
34 |
35 | ## 0.1.2
36 |
37 | ### Patch Changes
38 |
39 | - b662fe9f: Improve package export contidions for SSR (node, workers, deno)
40 |
41 | ## 0.1.1
42 |
43 | ### Patch Changes
44 |
45 | - 7ac41ed: Update to solid-js version 1.5
46 |
47 | ## Changelog up to version 0.1.0
48 |
49 | 0.0.100
50 |
--------------------------------------------------------------------------------
/packages/analytics/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Solid Primitives Working Group
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/packages/analytics/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | Name: analytics
3 | Stage: 0
4 | Package: "@solid-primitives/analytics"
5 | Primitives: createAnalytics
6 | Category: Utilities
7 | ---
8 |
9 |
10 |
11 |
12 |
13 | # @solid-primitives/analytics
14 |
15 | [](https://github.com/solidjs-community/solid-primitives#contribution-process)
16 |
17 | Creates a primitive for analytics management.
18 |
19 | ## How to use it
20 |
21 | ```ts
22 | const [running, start, stop] = createAnalytics(() => console.log('hi')));
23 | start();
24 | ```
25 |
26 | ## Demo
27 |
28 | You may view a working example here: https://codesandbox.io/s/solid-create-analytics?file=/src/index.tsx
29 |
30 | ## Changelog
31 |
32 | See [CHANGELOG.md](./CHANGELOG.md)
33 |
--------------------------------------------------------------------------------
/packages/analytics/src/index.ts:
--------------------------------------------------------------------------------
1 | export enum EventType {
2 | Pageview = "page",
3 | Event = "event",
4 | Social = "social",
5 | }
6 | export type TrackEventData = {
7 | category?: string;
8 | action?: string;
9 | label?: string;
10 | value?: string;
11 | location?: string;
12 | other?: object;
13 | };
14 | export type TrackSocialData = {
15 | network: string;
16 | action: string;
17 | socialtarget: string;
18 | };
19 | export type TrackPageview = {
20 | location?: string;
21 | other?: object;
22 | };
23 | export type TrackHandler = (
24 | type: EventType,
25 | data: TrackEventData | TrackSocialData | TrackPageview,
26 | ) => void;
27 |
28 | /**
29 | * Creates a method that support with analytics reporting.
30 | *
31 | * @param handlers A list of reporting handlers
32 | * @returns Returns a tracking a single tracking handler
33 | *
34 | */
35 | const createAnalytics = (handlers: Array): TrackHandler => {
36 | const track: TrackHandler = (type, data) => {
37 | for (const i in handlers) {
38 | handlers[i]!(type, data);
39 | }
40 | };
41 | return track;
42 | };
43 |
44 | export default createAnalytics;
45 |
--------------------------------------------------------------------------------
/packages/analytics/test/index.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, expect, it } from "vitest";
2 |
3 | import createAnalytics, { EventType } from "../src/index.js";
4 |
5 | describe("createPrimitiveTemplate", () => {
6 | it("track function calls all handlers with the event", () => {
7 | const called: any[][] = [];
8 | const handlers = [...new Array(5)].map(
9 | (_, i) =>
10 | (...args) =>
11 | (called[i] = args),
12 | );
13 | const track = createAnalytics(handlers);
14 | const eventData = {};
15 | track(EventType.Event, eventData);
16 | expect(called).toEqual(new Array(5).fill([EventType.Event, eventData]));
17 | });
18 | });
19 |
--------------------------------------------------------------------------------
/packages/analytics/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/audio/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Solid Primitives Working Group
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/packages/audio/dev/sample1.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs-community/solid-primitives/e8461ce312c510ac6d187992c3d0888bc67f32b9/packages/audio/dev/sample1.mp3
--------------------------------------------------------------------------------
/packages/audio/dev/sample2.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs-community/solid-primitives/e8461ce312c510ac6d187992c3d0888bc67f32b9/packages/audio/dev/sample2.mp3
--------------------------------------------------------------------------------
/packages/audio/dev/sample3.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs-community/solid-primitives/e8461ce312c510ac6d187992c3d0888bc67f32b9/packages/audio/dev/sample3.mp3
--------------------------------------------------------------------------------
/packages/audio/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../static-store"
11 | },
12 | {
13 | "path": "../utils"
14 | }
15 | ],
16 | "include": [
17 | "src"
18 | ]
19 | }
--------------------------------------------------------------------------------
/packages/autofocus/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/bounds/test/server.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, expect, it, vi } from "vitest";
2 | import { createElementBounds } from "../src/index.js";
3 |
4 | describe("createElementBounds", () => {
5 | it("is a noop on the server", () => {
6 | const el = vi.fn();
7 | const bounds = createElementBounds(el);
8 | expect(bounds).toEqual({
9 | top: null,
10 | left: null,
11 | bottom: null,
12 | right: null,
13 | width: null,
14 | height: null,
15 | });
16 | expect(el).not.toBeCalled();
17 | });
18 | });
19 |
--------------------------------------------------------------------------------
/packages/bounds/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../event-listener"
11 | },
12 | {
13 | "path": "../resize-observer"
14 | },
15 | {
16 | "path": "../static-store"
17 | },
18 | {
19 | "path": "../utils"
20 | }
21 | ],
22 | "include": [
23 | "src"
24 | ]
25 | }
--------------------------------------------------------------------------------
/packages/broadcast-channel/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # @solid-primitives/broadcast-channel
2 |
3 | ## 0.1.1
4 |
5 | ### Patch Changes
6 |
7 | - 53f08cc: fix: Move `"@solid-primitives/source"` export condition under import in package.json
8 | (Fixes #774, Fixes #749)
9 |
10 | ## 0.1.0
11 |
12 | ### Minor Changes
13 |
14 | - ea09f71: Remove CJS support. The package is ESM only now.
15 |
16 | ## 0.0.105
17 |
18 | ### Patch Changes
19 |
20 | - 74db287: Correct the "homepage" field in package.json
21 |
22 | ## 0.0.104
23 |
24 | ### Patch Changes
25 |
26 | - d23dd74: Add type exports for cjs
27 |
28 | ## 0.0.103
29 |
30 | ### Patch Changes
31 |
32 | - 3fad3789: Revert from publishing separate server, development, and production builds that has to rely on export conditions
33 | to publishing a single build that can be used in any environment.
34 | Envs will be checked at with `isDev`and `isServer` consts exported by `"solid-js/web"` so it's still tree-shakeable.
35 |
36 | ## 0.0.102
37 |
38 | ### Patch Changes
39 |
40 | - 865d5ee9: Fix build. (remove keepNames option)
41 |
42 | ## 0.0.101
43 |
44 | ### Patch Changes
45 |
46 | - dd2d7d1c: Improve export conditions.
47 |
--------------------------------------------------------------------------------
/packages/broadcast-channel/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/clipboard/dev/img.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs-community/solid-primitives/e8461ce312c510ac6d187992c3d0888bc67f32b9/packages/clipboard/dev/img.png
--------------------------------------------------------------------------------
/packages/clipboard/dev/img2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/solidjs-community/solid-primitives/e8461ce312c510ac6d187992c3d0888bc67f32b9/packages/clipboard/dev/img2.png
--------------------------------------------------------------------------------
/packages/clipboard/test/index.test.ts:
--------------------------------------------------------------------------------
1 | import "./setup";
2 | import { createComputed, createRoot } from "solid-js";
3 | import { createClipboard } from "../src/index.js";
4 | import { describe, expect, it } from "vitest";
5 |
6 | describe("createClipboard", () => {
7 | it("test initial read values", () =>
8 | createRoot(async () => {
9 | const [clipboard, refetch] = createClipboard();
10 | let i = 0;
11 |
12 | await new Promise(resolve => {
13 | createComputed(() => {
14 | const items = clipboard();
15 | if (i === 0) {
16 | expect(items).toHaveLength(0);
17 | queueMicrotask(() => refetch());
18 | } else {
19 | expect(items).toHaveLength(1);
20 | expect(items[0]!.text).toBe("InitialValue");
21 | resolve();
22 | }
23 | i++;
24 | });
25 | });
26 | }));
27 | });
28 |
--------------------------------------------------------------------------------
/packages/clipboard/test/server.test.ts:
--------------------------------------------------------------------------------
1 | import { createClipboard } from "../src/index.js";
2 | import { describe, expect, it } from "vitest";
3 |
4 | describe("API doesn't break in SSR", () => {
5 | it("createClipboard() - SSR", () => {
6 | const [clipboard, refetch, modify] = createClipboard();
7 | expect(clipboard()).toEqual([]);
8 | expect(refetch).toBeInstanceOf(Function);
9 | expect(modify).toBeInstanceOf(Function);
10 | });
11 | });
12 |
--------------------------------------------------------------------------------
/packages/clipboard/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/connectivity/dev/index.tsx:
--------------------------------------------------------------------------------
1 | import type { Component } from "solid-js";
2 |
3 | import { createConnectivitySignal } from "../src/index.js";
4 |
5 | const App: Component = () => {
6 | const onLine = createConnectivitySignal();
7 | return (
8 |
9 | You are currently: {onLine() ? online : offline} (try
10 | toggling your network state in dev tools!)
11 |
12 | );
13 | };
14 |
15 | export default App;
16 |
--------------------------------------------------------------------------------
/packages/connectivity/test/index.test.ts:
--------------------------------------------------------------------------------
1 | import { setOnline } from "./setup.js";
2 | import { describe, expect, it } from "vitest";
3 | import { createRoot } from "solid-js";
4 | import { makeConnectivityListener, createConnectivitySignal } from "../src/index.js";
5 |
6 | describe("makeConnectivityListener", () => {
7 | it("works", () =>
8 | createRoot(dispose => {
9 | let captured!: boolean;
10 | makeConnectivityListener(e => (captured = e));
11 | expect(captured, "0").toBe(undefined);
12 | setOnline(false);
13 | expect(captured, "1").toBe(false);
14 | setOnline(true);
15 | expect(captured, "2").toBe(true);
16 | dispose();
17 | }));
18 | });
19 |
20 | describe("createConnectivitySignal", () => {
21 | it("works", () =>
22 | createRoot(dispose => {
23 | const onLine = createConnectivitySignal();
24 | expect(onLine()).toBe(true);
25 | setOnline(false);
26 | expect(onLine()).toBe(false);
27 | setOnline(true);
28 | expect(onLine()).toBe(true);
29 | dispose();
30 | }));
31 | });
32 |
--------------------------------------------------------------------------------
/packages/connectivity/test/server.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, expect, vi, it } from "vitest";
2 | import { makeConnectivityListener, createConnectivitySignal } from "../src/index.js";
3 |
4 | describe("makeConnectivityListener", () => {
5 | it("works in server", () => {
6 | const cb = vi.fn();
7 | makeConnectivityListener(cb);
8 | expect(cb).not.toBeCalled();
9 | });
10 | });
11 |
12 | describe("createConnectivitySignal", () => {
13 | it("works in server", () => {
14 | const onLine = createConnectivitySignal();
15 | expect(onLine()).toBe(true);
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/packages/connectivity/test/setup.ts:
--------------------------------------------------------------------------------
1 | let online = true;
2 |
3 | export const setOnline = (value: boolean) => {
4 | online = value;
5 | window.dispatchEvent(new Event(value ? "online" : "offline"));
6 | };
7 |
8 | Object.defineProperty(navigator, "onLine", {
9 | get: () => online,
10 | });
11 |
--------------------------------------------------------------------------------
/packages/connectivity/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../event-listener"
11 | },
12 | {
13 | "path": "../rootless"
14 | },
15 | {
16 | "path": "../utils"
17 | }
18 | ],
19 | "include": [
20 | "src"
21 | ]
22 | }
--------------------------------------------------------------------------------
/packages/context/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/controlled-props/dev/index.tsx:
--------------------------------------------------------------------------------
1 | import { Component, createSignal, JSX } from "solid-js";
2 |
3 | import { createControlledProps } from "../src/index.js";
4 |
5 | const App: Component = () => {
6 | const [props, controls] = createControlledProps({
7 | bool: true,
8 | number: 0,
9 | string: "test",
10 | });
11 |
12 | return (
13 |
14 |
Props
15 |
16 | - bool: {props.bool() ? "true" : "false"}
17 | - number: {props.number()}
18 | - string: {props.string()}
19 |
20 |
Controls
21 | {controls}
22 |
23 | );
24 | };
25 |
26 | export default App;
27 |
--------------------------------------------------------------------------------
/packages/controlled-props/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/cookies/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # @solid-primitives/cookies
2 |
3 | ## 0.0.2
4 |
5 | ### Patch Changes
6 |
7 | - 53f08cc: fix: Move `"@solid-primitives/source"` export condition under import in package.json
8 | (Fixes #774, Fixes #749)
9 |
--------------------------------------------------------------------------------
/packages/cookies/dev/index.tsx:
--------------------------------------------------------------------------------
1 | import { Component } from "solid-js";
2 | import { createUserTheme } from "../src/index.js";
3 |
4 | const App: Component = () => {
5 | const [theme, setTheme] = createUserTheme();
6 | const increment = () => setTheme(theme() === "light" ? "dark" : "light");
7 | return (
8 |
9 |
10 |
11 |
Counter component
12 |
it's very important...
13 |
16 |
17 |
18 |
19 | );
20 | };
21 |
22 | export default App;
23 |
--------------------------------------------------------------------------------
/packages/cookies/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/cursor/dev/index.tsx:
--------------------------------------------------------------------------------
1 | import { App } from "./App.js";
2 |
3 | export default App;
4 |
--------------------------------------------------------------------------------
/packages/cursor/test/server.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, it, expect, vi } from "vitest";
2 | import { createBodyCursor, createElementCursor } from "../src/index.js";
3 |
4 | describe("createBodyCursor", () => {
5 | it("works in ssr", () => {
6 | const cb = vi.fn();
7 | createBodyCursor(cb);
8 | expect(cb).not.toBeCalled();
9 | });
10 | });
11 |
12 | describe("createElementCursor", () => {
13 | it("works in ssr", () => {
14 | const el = vi.fn();
15 | const cb = vi.fn();
16 | createElementCursor(el, cb);
17 | expect(cb).not.toBeCalled();
18 | expect(el).not.toBeCalled();
19 | });
20 | });
21 |
--------------------------------------------------------------------------------
/packages/cursor/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/date/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Solid Primitives Working Group
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/packages/date/dev/utils.ts:
--------------------------------------------------------------------------------
1 | export const flipVal = (val: number, min: number, max: number): number =>
2 | Math.abs(val * (Math.sign(val) || 1) - max) + min;
3 |
4 | export const pToVal = (p: number, zero: number, hundred: number): number =>
5 | p * (hundred - zero) + zero;
6 |
7 | export function valToP(value: number, min: number, max: number): number {
8 | if (min > max) {
9 | [min, max] = [max, min];
10 | value = flipVal(value, min, max);
11 | }
12 | return (value - min) / (max - min);
13 | }
14 |
15 | export const clamp = (value: number, min: number, max: number): number =>
16 | Math.min(Math.max(value, min), max);
17 |
--------------------------------------------------------------------------------
/packages/date/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./types.js";
2 | export * from "./variables.js";
3 | export * from "./utils.js";
4 | export * from "./primitives.js";
5 |
--------------------------------------------------------------------------------
/packages/date/test/utils.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, it, expect } from "vitest";
2 | import { getDate, getTime } from "../src/index.js";
3 |
4 | describe("getDate", () => {
5 | it("transforms init values to a date", () => {
6 | const inputString = "2020 1 11"; // 1578697200000
7 | const inputNumber = 1641408329089;
8 | const inputDate = new Date();
9 |
10 | expect(getDate(inputString)).toBeInstanceOf(Date);
11 | // assert.is(getDate(inputString).getTime(), 1578697200000);
12 | expect(getDate(inputNumber)).toBeInstanceOf(Date);
13 | expect(getDate(inputNumber).getTime()).toBe(1641408329089);
14 | expect(getDate(inputDate)).toBe(inputDate);
15 | });
16 | });
17 |
18 | describe("getTime", () => {
19 | it("transforms init values to a timestamp", () => {
20 | const inputString = "2020 1 11"; // 1578697200000
21 | const inputNumber = 1641408329089;
22 | const inputDate = new Date("2020 1 11");
23 |
24 | expect(typeof getTime(inputString)).toBe("number");
25 | expect(getTime(inputNumber)).toBe(1641408329089);
26 | expect(typeof getTime(inputDate)).toBe("number");
27 | });
28 | });
29 |
--------------------------------------------------------------------------------
/packages/date/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../memo"
11 | },
12 | {
13 | "path": "../timer"
14 | },
15 | {
16 | "path": "../utils"
17 | }
18 | ],
19 | "include": [
20 | "src"
21 | ]
22 | }
--------------------------------------------------------------------------------
/packages/db-store/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # @solid-primitives/db-store
2 |
3 | ## 1.1.2
4 |
5 | ### Patch Changes
6 |
7 | - 53f08cc: fix: Move `"@solid-primitives/source"` export condition under import in package.json
8 | (Fixes #774, Fixes #749)
9 | - Updated dependencies [53f08cc]
10 | - @solid-primitives/resource@0.4.2
11 |
12 | ## 1.1.1
13 |
14 | ### Patch Changes
15 |
16 | - Updated dependencies [9914bfc]
17 | - @solid-primitives/resource@0.4.1
18 |
19 | ## 1.1.0
20 |
21 | ### Minor Changes
22 |
23 | - 645a847: support schemas and default fields
24 |
25 | ## 1.0.0
26 |
27 | ### Major Changes
28 |
29 | - 4c9dad5: new package: db-store - a store transparently bound to a database
30 |
--------------------------------------------------------------------------------
/packages/db-store/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../resource"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/deep/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Solid Primitives Working Group
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/packages/deep/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./track-deep.js";
2 | export * from "./track-store.js";
3 | export * from "./store-updates.js";
4 |
--------------------------------------------------------------------------------
/packages/deep/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../memo"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/destructure/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/devices/test/server.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, test, expect } from "vitest";
2 | import {
3 | createAccelerometer,
4 | createCameras,
5 | createDevices,
6 | createGyroscope,
7 | createMicrophones,
8 | createSpeakers,
9 | } from "../src/index.js";
10 |
11 | describe("API doesn't break in SSR", () => {
12 | // check if the API doesn't throw when calling it in SSR
13 | test("createDevices() - SSR", () => {
14 | expect(createDevices()()).toEqual([]);
15 | });
16 |
17 | test("createMicrophones() - SSR", () => {
18 | expect(createMicrophones()()).toEqual([]);
19 | });
20 |
21 | test("createSpeakers() - SSR", () => {
22 | expect(createSpeakers()()).toEqual([]);
23 | });
24 |
25 | test("createCameras() - SSR", () => {
26 | expect(createCameras()()).toEqual([]);
27 | });
28 |
29 | test("createAccelerometer() - SSR", () => {
30 | expect(createAccelerometer()()).toEqual({ x: 0, y: 0, z: 0 });
31 | });
32 |
33 | test("createGyroscope() - SSR", () => {
34 | expect(createGyroscope()).toEqual({ alpha: 0, beta: 0, gamma: 0 });
35 | });
36 | });
37 |
--------------------------------------------------------------------------------
/packages/devices/test/setup.ts:
--------------------------------------------------------------------------------
1 | (window as any).__devices__ = [] as MediaDeviceInfo[];
2 |
3 | // (navigator.mediaDevices as any) = Object.assign(new EventTarget(), {
4 | // enumerateDevices: () => Promise.resolve((window as any).__devices__ as MediaDeviceInfo[])
5 | // });
6 |
7 | // needed to create a fake event target
8 | // because using EventTarget() resulted in weird error, when trying to use .dispatchEvent():
9 | // => "The "event" argument must be an instance of Event. Received an instance of Event"
10 | const listeners: (() => void)[] = [];
11 | (navigator.mediaDevices as any) = {
12 | enumerateDevices: () => Promise.resolve((window as any).__devices__ as MediaDeviceInfo[]),
13 | addEventListener: (ev: string, cb: () => void) => listeners.push(cb),
14 | removeEventListener: (ev: string, cb: () => void) => listeners.splice(listeners.indexOf(cb), 1),
15 | dispatchFakeEvent: () => listeners.forEach(cb => cb()),
16 | };
17 |
--------------------------------------------------------------------------------
/packages/devices/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/event-bus/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./eventBus.js";
2 | export * from "./eventHub.js";
3 | export * from "./eventStack.js";
4 | export * from "./emitter.js";
5 | export * from "./utils.js";
6 |
--------------------------------------------------------------------------------
/packages/event-bus/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/event-dispatcher/dev/utils.ts:
--------------------------------------------------------------------------------
1 | function makeDelay(ms?: number): Promise {
2 | return new Promise(resolve => setTimeout(() => resolve(true), ms ?? 500));
3 | }
4 |
5 | export function sendEmailDefault(data: FormData) {
6 | return makeDelay().then(
7 | () => `Your email was sent to ${data.get("to") || "no one"} with your default provider`,
8 | );
9 | }
10 |
11 | export function sendEmailAlternative(data: FormData) {
12 | return makeDelay().then(
13 | () => `Your email was sent to ${data.get("to") || "no one"} with an alternative provider`,
14 | );
15 | }
16 |
--------------------------------------------------------------------------------
/packages/event-dispatcher/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/event-listener/dev/components.tsx:
--------------------------------------------------------------------------------
1 | import { access, MaybeAccessor } from "@solid-primitives/utils";
2 | import { Component, For } from "solid-js";
3 |
4 | export const DisplayRecord: Component<{ record: Record> }> = props => (
5 |
6 | {k => (
7 |
8 | {k}:{" "}
9 | {() => {
10 | const val = access(props.record[k]);
11 | return typeof val === "number" ? parseInt(val as any) : String(val);
12 | }}
13 |
14 | )}
15 |
16 | );
17 |
--------------------------------------------------------------------------------
/packages/event-listener/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./eventListener.js";
2 | export * from "./eventListenerMap.js";
3 | export * from "./components.js";
4 | export * from "./eventListenerStack.js";
5 | export * from "./callbackWrappers.js";
6 | export * from "./types.js";
7 |
--------------------------------------------------------------------------------
/packages/event-listener/test/setup.ts:
--------------------------------------------------------------------------------
1 | export const event_target = new EventTarget();
2 |
3 | const globalListeners: Record void>> = {};
4 |
5 | // @ts-ignore
6 | event_target.addEventListener = (name: string, callback: (e: Event) => void, o: any) => {
7 | if (!globalListeners[name]) globalListeners[name] = new Set();
8 | // @ts-ignore
9 | globalListeners[name].add(callback);
10 | };
11 | // @ts-ignore
12 | event_target.removeEventListener = (name: string, callback: (e: Event) => void, o: any) => {
13 | if (!globalListeners[name]) return;
14 | // @ts-ignore
15 | globalListeners[name].delete(callback);
16 | };
17 |
18 | export const dispatchFakeEvent = (name: string, event: Event) => {
19 | // @ts-ignore
20 | if (!globalListeners[name]) return;
21 | // @ts-ignore
22 | [...globalListeners[name]].forEach(fn => fn(event));
23 | };
24 |
--------------------------------------------------------------------------------
/packages/event-listener/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/event-props/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/fetch/src/index.ts:
--------------------------------------------------------------------------------
1 | export { createFetch, type FetchReturn, type FetchOptions, type RequestContext } from "./fetch.js";
2 | export {
3 | withAbort,
4 | withAggregation,
5 | withCatchAll,
6 | withTimeout,
7 | withRetry,
8 | withRefetchEvent,
9 | wrapFetcher,
10 | wrapResource,
11 | } from "./modifiers.js";
12 | export { withCache, withRefetchOnExpiry, withCacheStorage, serializeRequest } from "./cache.js";
13 | export { fetchRequest } from "./request.js";
14 |
--------------------------------------------------------------------------------
/packages/fetch/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/filesystem/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./adapter-mocks.js";
2 | export * from "./adapter-node.js";
3 | export * from "./adapter-tauri.js";
4 | export * from "./adapter-web.js";
5 | export * from "./adapter-vfs.js";
6 | export * from "./reactive.js";
7 | export * from "./tools.js";
8 | export * from "./types.js";
9 | export * from "./watcher-chokidar.js";
10 |
--------------------------------------------------------------------------------
/packages/filesystem/src/watcher-chokidar.ts:
--------------------------------------------------------------------------------
1 | import { Operation, Watcher } from "./types.js";
2 |
3 | export const makeChokidarWatcher = (basePath: string = "/"): Watcher => {
4 | let subscriber: ((operation: Operation, path: string) => void) | undefined;
5 |
6 | import("chokidar")
7 | .then(chokidar =>
8 | chokidar
9 | .watch(`${basePath}${basePath.endsWith("/") ? "" : "/"}**/*`, { persistent: true })
10 | .on("change", path => subscriber?.("writeFile", path))
11 | .on("add", path => subscriber?.("writeFile", path))
12 | .on("addDir", path => subscriber?.("mkdir", path))
13 | .on("unlink", path => subscriber?.("rm", path))
14 | .on("unlinkDir", path => subscriber?.("rm", path)),
15 | )
16 | // eslint-disable-next-line no-console
17 | .catch(e => console.warn(e));
18 |
19 | return fn => {
20 | subscriber = fn;
21 | };
22 | };
23 |
--------------------------------------------------------------------------------
/packages/filesystem/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/flux-store/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # @solid-primitives/flux-store
2 |
3 | ## 0.1.1
4 |
5 | ### Patch Changes
6 |
7 | - 53f08cc: fix: Move `"@solid-primitives/source"` export condition under import in package.json
8 | (Fixes #774, Fixes #749)
9 |
10 | ## 0.1.0
11 |
12 | ### Minor Changes
13 |
14 | - ea09f71: Remove CJS support. The package is ESM only now.
15 |
16 | ## 0.0.4
17 |
18 | ### Patch Changes
19 |
20 | - 74db287: Correct the "homepage" field in package.json
21 |
22 | ## 0.0.3
23 |
24 | ### Patch Changes
25 |
26 | - d23dd74: Add type exports for cjs
27 |
28 | ## 0.0.2
29 |
30 | ### Patch Changes
31 |
32 | - 3fad3789: Revert from publishing separate server, development, and production builds that has to rely on export conditions
33 | to publishing a single build that can be used in any environment.
34 | Envs will be checked at with `isDev`and `isServer` consts exported by `"solid-js/web"` so it's still tree-shakeable.
35 |
36 | ## 0.0.100
37 |
38 | - Initial commit and [**PR**](https://github.com/solidjs-community/solid-primitives/pull/327).
39 |
--------------------------------------------------------------------------------
/packages/flux-store/dev/components/CounterControls.tsx:
--------------------------------------------------------------------------------
1 | import type { ParentComponent, ComponentProps } from "solid-js";
2 | import { IncreaseButton, DecreaseButton, ResetButton } from "./CounterButton.js";
3 |
4 | export const CounterControls: ParentComponent> = props => (
5 | <>
6 |
14 |
15 |
16 |
17 |
18 | >
19 | );
20 |
21 | export default CounterControls;
22 |
--------------------------------------------------------------------------------
/packages/flux-store/dev/components/index.ts:
--------------------------------------------------------------------------------
1 | export { BoxesDemo } from "./BoxesDemo.js";
2 | export { CounterControls } from "./CounterControls.js";
3 | export { CounterButton, IncreaseButton, DecreaseButton, ResetButton } from "./CounterButton.js";
4 |
--------------------------------------------------------------------------------
/packages/flux-store/dev/stores/ages-store.ts:
--------------------------------------------------------------------------------
1 | import { createFluxStoreFactory } from "../../src/index.js";
2 |
3 | const agesFluxFactory = createFluxStoreFactory(
4 | {
5 | age: 0,
6 | mana: 100,
7 | name: "unknown",
8 | },
9 | {
10 | getters: state => ({
11 | days: () => state.age * 365,
12 | yearsOld: () => `${state.age} years old`,
13 | isWizard: () => state.mana > 100 || state.age >= 50,
14 | }),
15 | actions: (setState, state) => ({
16 | birthday: () => setState("age", state.age + 1),
17 | }),
18 | },
19 | );
20 |
21 | export type Person = ReturnType;
22 |
23 | export const aliceAge: Person = agesFluxFactory(init => ({ ...init, age: 45, name: "Alice" }));
24 | export const bobAge: Person = agesFluxFactory({ age: 40, mana: 200, name: "Bob" });
25 | export const tomAge: Person = agesFluxFactory(init => ({ ...init, age: 35, name: "Tom" }));
26 |
27 | export const getPeople: () => Person[] = () => [aliceAge, bobAge, tomAge];
28 | export const getWizards: () => Person[] = () =>
29 | getPeople().filter(person => person.getters.isWizard());
30 |
--------------------------------------------------------------------------------
/packages/flux-store/dev/stores/counter-store.ts:
--------------------------------------------------------------------------------
1 | import { createFluxStore } from "../../src/index.js";
2 |
3 | export type CounterState = {
4 | id?: string;
5 | value: number;
6 | initialValue: number;
7 | };
8 |
9 | export const counterStore = createFluxStore(
10 | {
11 | value: 0,
12 | initialValue: 0,
13 | } as CounterState,
14 | {
15 | getters: state => ({
16 | toString: () => `${state.id && "-"}(${state.value})`,
17 | isZero: () => state.value === 0,
18 | isNegative: () => state.value < 0,
19 | isPositive: () => state.value >= 0,
20 | get: () => state.value,
21 | }),
22 | actions: setState => ({
23 | setState,
24 | updateId: (newId: string) => setState("id", newId),
25 | resetCount: (overrideValue?: number) =>
26 | setState(proxy => ({ ...proxy, value: overrideValue ?? proxy.initialValue })),
27 | }),
28 | },
29 | );
30 |
31 | export type CounterGetters = typeof counterStore.getters;
32 | export type CounterActions = typeof counterStore.actions;
33 |
--------------------------------------------------------------------------------
/packages/flux-store/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/fullscreen/test/server.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, test, expect } from "vitest";
2 | import { createFullscreen } from "../src/index.js";
3 |
4 | describe("API doesn't break in SSR", () => {
5 | // check if the API doesn't throw when calling it in SSR
6 | test("createFullScreen() - SSR", () => {
7 | expect(createFullscreen(undefined, () => false)()).toEqual(false);
8 | });
9 | });
10 |
--------------------------------------------------------------------------------
/packages/fullscreen/test/setup.ts:
--------------------------------------------------------------------------------
1 | export const setup_state = {
2 | current_el: undefined as HTMLElement | undefined,
3 | current_options: undefined as FullscreenOptions | undefined,
4 | };
5 |
6 | HTMLElement.prototype.requestFullscreen = function (
7 | this: HTMLElement,
8 | options?: FullscreenOptions,
9 | ) {
10 | setup_state.current_el = this;
11 | setup_state.current_options = options;
12 | document.dispatchEvent(new Event("fullscreenchange"));
13 | return Promise.resolve();
14 | };
15 |
16 | Object.defineProperty(document, "fullscreenElement", {
17 | value: setup_state.current_el,
18 | writable: false,
19 | });
20 |
21 | Object.defineProperty(document, "exitFullscreen", {
22 | value: () => {
23 | setup_state.current_el = undefined;
24 | },
25 | writable: false,
26 | });
27 |
--------------------------------------------------------------------------------
/packages/fullscreen/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/geolocation/dev/index.tsx:
--------------------------------------------------------------------------------
1 | import { Component, Suspense, createSignal, lazy, onMount } from "solid-js";
2 |
3 | const Client = lazy(() => import("./client.jsx"));
4 |
5 | const App: Component = () => {
6 | const [mounted, setMounted] = createSignal(false);
7 | onMount(() => setMounted(true));
8 |
9 | return {mounted() && };
10 | };
11 |
12 | export default App;
13 |
--------------------------------------------------------------------------------
/packages/geolocation/test/server.test.ts:
--------------------------------------------------------------------------------
1 | import { createGeolocation, createGeolocationWatcher } from "../src/index.js";
2 | import { describe, expect, it } from "vitest";
3 |
4 | describe("API doesn't break in SSR", () => {
5 | it("createGeolocation() - SSR", () => {
6 | const [location, refetch] = createGeolocation();
7 | expect(location()).toBe(undefined);
8 | expect(location.loading).toBe(true);
9 | expect(location.error).toBe(undefined);
10 | expect(refetch).toBeInstanceOf(Function);
11 | });
12 |
13 | it("createGeolocationWatcher() - SSR", () => {
14 | expect(createGeolocationWatcher(true)).toEqual({ location: null, error: null });
15 | });
16 | });
17 |
--------------------------------------------------------------------------------
/packages/geolocation/test/setup.ts:
--------------------------------------------------------------------------------
1 | export const mockCoordinates = {
2 | latitude: 43.65107,
3 | longitude: -79.347015,
4 | };
5 |
6 | Object.defineProperty(global.navigator, "geolocation", {
7 | value: {
8 | clearWatch: () => {},
9 | getCurrentPosition(
10 | successCallback: PositionCallback,
11 | errorCallback?: PositionErrorCallback | null,
12 | options?: PositionOptions,
13 | ) {
14 | successCallback({ coords: mockCoordinates } as GeolocationPosition);
15 | },
16 | watchPosition(
17 | successCallback: PositionCallback,
18 | errorCallback?: PositionErrorCallback | null,
19 | options?: PositionOptions,
20 | ) {
21 | successCallback({ coords: mockCoordinates } as GeolocationPosition);
22 | },
23 | },
24 | });
25 |
--------------------------------------------------------------------------------
/packages/geolocation/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../static-store"
11 | },
12 | {
13 | "path": "../utils"
14 | }
15 | ],
16 | "include": [
17 | "src"
18 | ]
19 | }
--------------------------------------------------------------------------------
/packages/gestures/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # @solid-primitives/gestures
6 |
7 | [](https://github.com/solidjs-community/solid-primitives#contribution-process)
8 |
9 | Helpful directives to react to user gestures.
10 |
11 | `pan` -
12 | `pinch` -
13 | `rotate` -
14 | `swipe` -
15 | `tap` -
16 |
17 | ## Changelog
18 |
19 | See [CHANGELOG.md](./CHANGELOG.md)
20 |
21 | ## Contributors
22 |
23 | Ported from the amazing work by at https://github.com/Rezi/svelte-gestures.
24 |
--------------------------------------------------------------------------------
/packages/gestures/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./core.js";
2 | export * from "./pinch.js";
3 | export * from "./pan.js";
4 | export * from "./rotate.js";
5 | export * from "./swipe.js";
6 | export * from "./tap.js";
7 |
--------------------------------------------------------------------------------
/packages/gestures/src/pan.ts:
--------------------------------------------------------------------------------
1 | import { registerPointerListener } from "./core.js";
2 | import type { PointerCallback } from "./core.js";
3 |
4 | type Props = {
5 | callback: (position: { x: number; y: number }) => any;
6 | };
7 |
8 | declare module "solid-js" {
9 | namespace JSX {
10 | interface HTMLAttributes extends AriaAttributes, DOMAttributes {
11 | ["use:pan"]?: Props;
12 | }
13 | }
14 | }
15 |
16 | export const pan = (node: HTMLElement, props: () => Props) => {
17 | const moveCallback: PointerCallback = (activeEvents, event) => {
18 | if (activeEvents.length === 1) {
19 | const rect = node.getBoundingClientRect();
20 | const x = Math.round(event.x - rect.left);
21 | const y = Math.round(event.y - rect.top);
22 | if (x >= 0 && y >= 0 && x <= rect.width && y <= rect.height) {
23 | props().callback({ x, y });
24 | }
25 | }
26 | };
27 |
28 | registerPointerListener(node, undefined, moveCallback);
29 | };
30 |
--------------------------------------------------------------------------------
/packages/gestures/test/index.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, it } from "vitest";
2 |
3 | describe("gestures", () => {
4 | it.todo("write tests");
5 | });
6 |
--------------------------------------------------------------------------------
/packages/gestures/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/graphql/dev/codegen.yml:
--------------------------------------------------------------------------------
1 | schema: https://countries.trevorblades.com/
2 | documents: "./dev/**/*.{ts,tsx,graphql}"
3 | generates:
4 | ./dev/gqlgen.ts:
5 | plugins:
6 | - typescript
7 | - typescript-operations
8 | - typed-document-node
9 |
--------------------------------------------------------------------------------
/packages/graphql/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/history/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/i18n/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Solid Primitives Working Group
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/packages/i18n/dev/en.ts:
--------------------------------------------------------------------------------
1 | import * as i18n from "../src/index.js";
2 |
3 | export const dict = {
4 | hello: i18n.template<{ name: string }>("hello {{ name }}, how are you?"),
5 | goodbye: ({ name }: { name: string }) => `goodbye ${name}`,
6 | food: {
7 | meat: "meat",
8 | },
9 | };
10 |
--------------------------------------------------------------------------------
/packages/i18n/dev/es.ts:
--------------------------------------------------------------------------------
1 | import type { RawDictionary } from "./index.jsx";
2 |
3 | export const dict: RawDictionary = {
4 | hello: "hola {{ name }}, como usted?" as any,
5 | goodbye: ({ name }: { name: string }) => `adios ${name}`,
6 | food: {
7 | meat: "carne",
8 | },
9 | };
10 |
--------------------------------------------------------------------------------
/packages/i18n/dev/fr.ts:
--------------------------------------------------------------------------------
1 | import type { RawDictionary } from "./index.jsx";
2 |
3 | export const dict: RawDictionary = {
4 | hello: "bonjour {{ name }}, comment vas-tu ?" as any,
5 | goodbye: ({ name }: { name: string }) => `au revoir ${name}`,
6 | food: {
7 | meat: "viande",
8 | },
9 | };
10 |
--------------------------------------------------------------------------------
/packages/i18n/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/idle/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Solid Primitives Working Group
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/packages/idle/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./createIdleTimer.js";
2 | export * from "./types.js";
3 |
--------------------------------------------------------------------------------
/packages/idle/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/immutable/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../keyed"
11 | },
12 | {
13 | "path": "../utils"
14 | }
15 | ],
16 | "include": [
17 | "src"
18 | ]
19 | }
--------------------------------------------------------------------------------
/packages/input-mask/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/intersection-observer/test/server.test.ts:
--------------------------------------------------------------------------------
1 | import {
2 | makeIntersectionObserver,
3 | createIntersectionObserver,
4 | createViewportObserver,
5 | createVisibilityObserver,
6 | } from "../src/index.js";
7 | import { describe, test, expect, vi } from "vitest";
8 |
9 | describe("API works in SSR", () => {
10 | test("makeIntersectionObserver() - SSR", () => {
11 | expect(() => makeIntersectionObserver([], () => {})).not.toThrow();
12 | });
13 |
14 | test("createIntersectionObserver() - SSR", () => {
15 | const el = vi.fn(() => []);
16 | const cb = vi.fn(() => {});
17 | expect(() => createIntersectionObserver(el, cb)).not.toThrow();
18 | expect(el).not.toBeCalled();
19 | expect(cb).not.toBeCalled();
20 | });
21 |
22 | test("createViewportObserver() - SSR", () => {
23 | expect(() => createViewportObserver()).not.toThrow();
24 | });
25 |
26 | test("createVisibilityObserver() - SSR", () => {
27 | expect(() => createVisibilityObserver()).not.toThrow();
28 | });
29 | });
30 |
--------------------------------------------------------------------------------
/packages/intersection-observer/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/jsx-tokenizer/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/keyboard/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../event-listener"
11 | },
12 | {
13 | "path": "../rootless"
14 | },
15 | {
16 | "path": "../utils"
17 | }
18 | ],
19 | "include": [
20 | "src"
21 | ]
22 | }
--------------------------------------------------------------------------------
/packages/keyed/dev/index.tsx:
--------------------------------------------------------------------------------
1 | import { Component } from "solid-js";
2 |
3 | import Key from "./key.js";
4 | import Entries from "./entries.js";
5 | import MapEntries from "./mapEntries.js";
6 | import SetValues from "./setValues.js";
7 |
8 | const App: Component = () => {
9 | return (
10 |
11 |
12 |
Key
13 |
14 |
15 |
16 |
Entries
17 |
18 |
19 |
20 |
MapEntries
21 |
22 |
23 |
24 |
SetValues
25 |
26 |
27 |
28 | );
29 | };
30 | export default App;
31 |
--------------------------------------------------------------------------------
/packages/keyed/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/lifecycle/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # @solid-primitives/lifecycle
2 |
3 | ## 0.1.1
4 |
5 | ### Patch Changes
6 |
7 | - 53f08cc: fix: Move `"@solid-primitives/source"` export condition under import in package.json
8 | (Fixes #774, Fixes #749)
9 |
10 | ## 0.1.0
11 |
12 | ### Minor Changes
13 |
14 | - ea09f71: Remove CJS support. The package is ESM only now.
15 |
16 | ## 0.0.102
17 |
18 | ### Patch Changes
19 |
20 | - 74db287: Correct the "homepage" field in package.json
21 |
22 | ## 0.0.101
23 |
24 | ### Patch Changes
25 |
26 | - d23dd74: Add type exports for cjs
27 |
--------------------------------------------------------------------------------
/packages/lifecycle/dev/index.tsx:
--------------------------------------------------------------------------------
1 | import { children, createSignal, JSX, onMount } from "solid-js";
2 |
3 | import { onElementConnect } from "../src/index.js";
4 |
5 | function Button() {
6 | const [count, setCount] = createSignal(1);
7 | const increment = () => setCount(count() + 1);
8 |
9 | let ref!: HTMLButtonElement;
10 |
11 | onMount(() => {
12 | console.log("onMount", ref.isConnected);
13 |
14 | onElementConnect(ref, () => {
15 | console.log("onConnect", ref.isConnected);
16 | });
17 | });
18 |
19 | return (
20 |
23 | );
24 | }
25 |
26 | function App() {
27 | const r = children(() => );
28 | const [s, set] = createSignal();
29 | setTimeout(() => set(() => r as any as JSX.Element), 1000);
30 | return <>{s()}>;
31 | }
32 |
33 | export default App;
34 |
--------------------------------------------------------------------------------
/packages/lifecycle/test/index.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, test, expect } from "vitest";
2 | import { createEffect, createRoot } from "solid-js";
3 | import { createIsMounted, isHydrated } from "../src/index.js";
4 |
5 | describe("createIsMounted", () => {
6 | test("createIsMounted", () => {
7 | createRoot(dispose => {
8 | const isMounted = createIsMounted();
9 | expect(isMounted()).toBe(false);
10 |
11 | createEffect(() => {
12 | expect(isMounted()).toBe(true);
13 | dispose();
14 | });
15 | });
16 |
17 | expect(createIsMounted()()).toBe(true);
18 | });
19 | });
20 |
21 | describe("isHydrated", () => {
22 | test("isHydrated", () => {
23 | expect(isHydrated()).toBe(true);
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/packages/lifecycle/test/server.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, test, expect } from "vitest";
2 | import { createRoot } from "solid-js";
3 | import { createIsMounted, isHydrated } from "../src/index.js";
4 | import { renderToString } from "solid-js/web";
5 |
6 | describe("createIsMounted", () => {
7 | test("createIsMounted", () => {
8 | createRoot(dispose => {
9 | const isMounted = createIsMounted();
10 | expect(isMounted()).toBe(false);
11 | dispose();
12 | });
13 |
14 | expect(createIsMounted()()).toBe(false);
15 | });
16 | });
17 |
18 | describe("isHydrated", () => {
19 | test("isHydrated", () => {
20 | expect(isHydrated()).toBe(false);
21 |
22 | createRoot(dispose => {
23 | expect(isHydrated()).toBe(false);
24 | dispose();
25 | });
26 |
27 | renderToString(() => {
28 | expect(isHydrated()).toBe(false);
29 | return "";
30 | });
31 | });
32 | });
33 |
--------------------------------------------------------------------------------
/packages/lifecycle/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/list/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # @solid-primitives/list
2 |
3 | ## 0.1.2
4 |
5 | ### Patch Changes
6 |
7 | - 2f06d07: Fix for `` "unused" signal returning wrong values when read only after changes. (#791)
8 |
9 | ## 0.1.1
10 |
11 | ### Patch Changes
12 |
13 | - 53f08cc: fix: Move `"@solid-primitives/source"` export condition under import in package.json
14 | (Fixes #774, Fixes #749)
15 |
16 | ## 0.1.0
17 |
18 | ### Minor Changes
19 |
20 | - ea09f71: Remove CJS support. The package is ESM only now.
21 |
22 | ## 0.0.101
23 |
24 | ### Patch Changes
25 |
26 | - 1ea2a09: Use isDev const from solid-js/web instead if a string
27 |
28 | ## 0.0.100
29 |
30 | Initial release of the package.
31 |
--------------------------------------------------------------------------------
/packages/list/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Solid Primitives Working Group
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/packages/list/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/map/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Solid Primitives Working Group
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/packages/map/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../trigger"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/marker/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # @solid-primitives/marker
2 |
3 | ## 0.2.1
4 |
5 | ### Patch Changes
6 |
7 | - 53f08cc: fix: Move `"@solid-primitives/source"` export condition under import in package.json
8 | (Fixes #774, Fixes #749)
9 |
10 | ## 0.2.0
11 |
12 | ### Minor Changes
13 |
14 | - ea09f71: Remove CJS support. The package is ESM only now.
15 |
16 | ## 0.1.0
17 |
18 | ### Minor Changes
19 |
20 | - a1f602d: fix memory leak
21 |
22 | ## 0.0.3
23 |
24 | ### Patch Changes
25 |
26 | - 74db287: Correct the "homepage" field in package.json
27 |
28 | ## 0.0.2
29 |
30 | ### Patch Changes
31 |
32 | - d23dd74: Add type exports for cjs
33 |
--------------------------------------------------------------------------------
/packages/marker/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/masonry/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/media/dev/style.css:
--------------------------------------------------------------------------------
1 | div > * {
2 | box-sizing: border-box;
3 | margin: 0;
4 | }
5 |
6 | .text-tiny {
7 | font-size: 0.75rem;
8 | }
9 |
10 | .text-small {
11 | font-size: 1rem;
12 | }
13 |
14 | .text-base {
15 | font-size: 1.25rem;
16 | }
17 |
18 | .text-huge {
19 | font-size: 2rem;
20 | }
21 |
22 | .flex {
23 | display: flex;
24 | }
25 |
26 | .flex-column {
27 | flex-direction: column;
28 | }
29 |
30 | .flex-row {
31 | flex-direction: row;
32 | }
33 |
--------------------------------------------------------------------------------
/packages/media/test/server.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, it, expect } from "vitest";
2 | import { createMediaQuery } from "../src/index.js";
3 |
4 | describe("createMediaQuery", () => {
5 | it("should return false on the server", () => {
6 | expect(createMediaQuery("(max-width: 767px)")()).toBe(false);
7 | });
8 |
9 | it("can override the server fallback", () => {
10 | expect(createMediaQuery("(max-width: 767px)", true)()).toBe(true);
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/packages/media/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../event-listener"
11 | },
12 | {
13 | "path": "../rootless"
14 | },
15 | {
16 | "path": "../static-store"
17 | },
18 | {
19 | "path": "../utils"
20 | }
21 | ],
22 | "include": [
23 | "src"
24 | ]
25 | }
--------------------------------------------------------------------------------
/packages/memo/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Solid Primitives Working Group
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/packages/memo/dev/async.tsx:
--------------------------------------------------------------------------------
1 | import { createAsyncMemo } from "../src/index.js";
2 | import { Component, createSignal } from "solid-js";
3 |
4 | const Async: Component = () => {
5 | const [id, setId] = createSignal(1);
6 |
7 | const memo = createAsyncMemo(async prev => {
8 | try {
9 | const res = await fetch(`https://swapi.dev/api/people/${id()}/`);
10 | const data: { name: string | undefined } = await res.json();
11 | return data.name || prev;
12 | } catch (error) {
13 | return prev;
14 | }
15 | });
16 |
17 | return (
18 | <>
19 | ID: {id()}
20 |
23 | {memo() + ""}
24 | >
25 | );
26 | };
27 |
28 | export default Async;
29 |
--------------------------------------------------------------------------------
/packages/memo/dev/writable-page.tsx:
--------------------------------------------------------------------------------
1 | import { batch, createEffect, createSignal } from "solid-js";
2 | import { createWritableMemo } from "../src/index.js";
3 |
4 | export default function Cache() {
5 | const [source, setSource] = createSignal(1);
6 | const [memo, setMemo] = createWritableMemo(p => (source(), ++p), -2);
7 | const [memo2, setMemo2] = createWritableMemo(source, -2);
8 |
9 | batch(() => {
10 | setSource(2);
11 | console.log(2, source(), memo2());
12 | });
13 |
14 | batch(() => {
15 | setMemo2(-3);
16 | console.log(-3, memo2());
17 | });
18 |
19 | return (
20 | <>
21 | Signal:
22 |
25 | Setter:
26 |
29 | Result: {memo()}
30 | >
31 | );
32 | }
33 |
--------------------------------------------------------------------------------
/packages/memo/test/reducer.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, test, expect } from "vitest";
2 | import { createRoot } from "solid-js";
3 | import { createReducer } from "../src/index.js";
4 |
5 | describe("createReducer", () => {
6 | test("reducer works", () =>
7 | createRoot(dispose => {
8 | const initialValue = 1;
9 | const numberOfDoubles = 3;
10 |
11 | const [counter, doubleCounter] = createReducer(counter => counter * 2, initialValue);
12 |
13 | let expectedCounter = initialValue;
14 |
15 | for (let i = 0; i < numberOfDoubles; i++) {
16 | doubleCounter();
17 | expectedCounter *= 2;
18 | }
19 |
20 | expect(counter()).toEqual(expectedCounter);
21 |
22 | dispose();
23 | }));
24 | });
25 |
--------------------------------------------------------------------------------
/packages/memo/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../scheduled"
11 | },
12 | {
13 | "path": "../utils"
14 | }
15 | ],
16 | "include": [
17 | "src"
18 | ]
19 | }
--------------------------------------------------------------------------------
/packages/mouse/dev/components.tsx:
--------------------------------------------------------------------------------
1 | import { access, MaybeAccessor } from "@solid-primitives/utils";
2 | import { Component, For } from "solid-js";
3 |
4 | export const DisplayRecord: Component<{ record: Record> }> = props => (
5 |
6 | {k => (
7 |
8 | {k}:{" "}
9 | {() => {
10 | const val = access(props.record[k]);
11 | return typeof val === "number" ? parseInt(val as any) : String(val);
12 | }}
13 |
14 | )}
15 |
16 | );
17 |
--------------------------------------------------------------------------------
/packages/mouse/dev/utils.ts:
--------------------------------------------------------------------------------
1 | export const lerp = (current: number, goal: number, p: number): number =>
2 | (1 - p) * current + p * goal;
3 |
--------------------------------------------------------------------------------
/packages/mouse/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./types.js";
2 | export {
3 | makeMousePositionListener,
4 | makeMouseInsideListener,
5 | getPositionToElement,
6 | getPositionToScreen,
7 | getPositionInElement,
8 | } from "./common.js";
9 | export * from "./primitives.js";
10 |
--------------------------------------------------------------------------------
/packages/mouse/src/types.ts:
--------------------------------------------------------------------------------
1 | import { Position } from "@solid-primitives/utils";
2 |
3 | export type MouseSourceType = "mouse" | "touch" | null;
4 |
5 | export type MousePosition = Position & { sourceType: MouseSourceType };
6 | export type MousePositionInside = MousePosition & { isInside: boolean };
7 |
8 | export interface PositionRelativeToElement extends Position {
9 | top: number;
10 | left: number;
11 | width: number;
12 | height: number;
13 | isInside: boolean;
14 | }
15 |
16 | export interface UseTouchOptions {
17 | /**
18 | * Listen to touch events. If enabled, position will be updated on `touchstart` event.
19 | * @default true
20 | */
21 | touch?: boolean;
22 | }
23 | export interface FollowTouchOptions {
24 | /**
25 | * If enabled, position will be updated on `touchmove` event.
26 | * @default true
27 | */
28 | followTouch?: boolean;
29 | }
30 |
--------------------------------------------------------------------------------
/packages/mouse/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../event-listener"
11 | },
12 | {
13 | "path": "../rootless"
14 | },
15 | {
16 | "path": "../static-store"
17 | },
18 | {
19 | "path": "../utils"
20 | }
21 | ],
22 | "include": [
23 | "src"
24 | ]
25 | }
--------------------------------------------------------------------------------
/packages/mutable/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # @solid-primitives/mutable
2 |
3 | ## 1.1.1
4 |
5 | ### Patch Changes
6 |
7 | - 53f08cc: fix: Move `"@solid-primitives/source"` export condition under import in package.json
8 | (Fixes #774, Fixes #749)
9 |
10 | ## 1.1.0
11 |
12 | ### Minor Changes
13 |
14 | - ea09f71: Remove CJS support. The package is ESM only now.
15 |
16 | ## 1.0.2
17 |
18 | ### Patch Changes
19 |
20 | - 74db287: Correct the "homepage" field in package.json
21 |
22 | ## 1.0.1
23 |
24 | ### Patch Changes
25 |
26 | - d23dd74: Add type exports for cjs
27 |
--------------------------------------------------------------------------------
/packages/mutable/test/dev.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, test, expect, vi } from "vitest";
2 | import { DEV, unwrap } from "solid-js/store";
3 | import { createMutable } from "../src/index.js";
4 |
5 | describe("Dev features", () => {
6 | test("OnStoreNodeUpdate Hook", () => {
7 | const cb = vi.fn();
8 | DEV!.hooks.onStoreNodeUpdate = cb;
9 |
10 | const store = createMutable({ firstName: "John", lastName: "Smith", inner: { foo: 1 } });
11 | expect(cb).toHaveBeenCalledTimes(0);
12 |
13 | store.firstName = "Matt";
14 | expect(cb).toHaveBeenCalledTimes(1);
15 | expect(cb).toHaveBeenCalledWith(unwrap(store), "firstName", "Matt", "John");
16 |
17 | store.inner.foo = 2;
18 | expect(cb).toHaveBeenCalledTimes(2);
19 | expect(cb).toHaveBeenCalledWith(unwrap(store.inner), "foo", 2, 1);
20 | });
21 | });
22 |
--------------------------------------------------------------------------------
/packages/mutable/test/server.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, test, expect } from "vitest";
2 | import { createMutable } from "../src/index.js";
3 |
4 | describe("createPrimitiveTemplate", () => {
5 | test("doesn't break in SSR", () => {
6 | const mutable = createMutable({ value: 0 });
7 | expect(mutable.value).toBe(0);
8 |
9 | mutable.value = 1;
10 | expect(mutable.value).toBe(1);
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/packages/mutable/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/mutation-observer/dev/utils.ts:
--------------------------------------------------------------------------------
1 | export const updateItem = (array: readonly T[], index: number, fn: (item: T) => T): T[] => {
2 | const copy = array.slice();
3 | const newItem = fn(array[index]);
4 | copy.splice(index, 1, newItem);
5 | return copy;
6 | };
7 |
8 | export const toggleItems = (array: readonly boolean[], toggle: number[]): boolean[] => {
9 | if (!toggle.length) return array as boolean[];
10 | const copy = array.slice();
11 | toggle.forEach(i => (copy[i] = !copy[i]));
12 | return copy;
13 | };
14 |
--------------------------------------------------------------------------------
/packages/mutation-observer/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Solid App
9 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/packages/mutation-observer/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/page-visibility/test/index.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, expect, it } from "vitest";
2 | import { createRoot } from "solid-js";
3 | import { createPageVisibility } from "../src/index.js";
4 |
5 | describe("createPageVisibility", () => {
6 | it("observes visibilitychange events", () =>
7 | createRoot(dispose => {
8 | let doc_visibility = "prerender";
9 | Object.defineProperty(document, "visibilityState", {
10 | get() {
11 | return doc_visibility;
12 | },
13 | });
14 |
15 | const visibility = createPageVisibility();
16 | expect(visibility()).toBe(false);
17 |
18 | doc_visibility = "visible";
19 | document.dispatchEvent(new Event("visibilitychange"));
20 | expect(visibility()).toBe(true);
21 |
22 | doc_visibility = "hidden";
23 | document.dispatchEvent(new Event("visibilitychange"));
24 | expect(visibility()).toBe(false);
25 |
26 | dispose();
27 |
28 | doc_visibility = "visible";
29 | document.dispatchEvent(new Event("visibilitychange"));
30 | expect(visibility()).toBe(false);
31 | }));
32 | });
33 |
--------------------------------------------------------------------------------
/packages/page-visibility/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../event-listener"
11 | },
12 | {
13 | "path": "../rootless"
14 | },
15 | {
16 | "path": "../utils"
17 | }
18 | ],
19 | "include": [
20 | "src"
21 | ]
22 | }
--------------------------------------------------------------------------------
/packages/pagination/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/permission/test/server.test.ts:
--------------------------------------------------------------------------------
1 | import { describe, test, expect } from "vitest";
2 | import { createPermission } from "../src/index.js";
3 |
4 | describe("createPermission", () => {
5 | test("doesn't break in SSR", () => {
6 | expect(createPermission("camera")()).toBe("unknown");
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/packages/permission/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/platform/dev/index.tsx:
--------------------------------------------------------------------------------
1 | import { Component } from "solid-js";
2 |
3 | import * as platform from "../src/index.js";
4 |
5 | const App: Component = () => {
6 | return (
7 |
8 |
9 |
Platform:
10 |
11 | {Object.entries(platform).map(([name, value]) => (
12 | -
13 |
17 |
18 | ))}
19 |
20 |
21 |
22 | );
23 | };
24 |
25 | export default App;
26 |
--------------------------------------------------------------------------------
/packages/platform/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [],
9 | "include": [
10 | "src"
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/pointer/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../event-listener"
11 | },
12 | {
13 | "path": "../rootless"
14 | },
15 | {
16 | "path": "../utils"
17 | }
18 | ],
19 | "include": [
20 | "src"
21 | ]
22 | }
--------------------------------------------------------------------------------
/packages/presence/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/promise/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/props/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./propTraps.js";
2 | export * from "./filterProps.js";
3 | export * from "./combineProps.js";
4 |
--------------------------------------------------------------------------------
/packages/props/src/propTraps.ts:
--------------------------------------------------------------------------------
1 | /*
2 | The propTraps object coles from solid-js repository:
3 | https://github.com/solidjs/solid/blob/main/packages/solid/src/render/component.ts
4 | */
5 |
6 | import { $PROXY } from "solid-js";
7 |
8 | function trueFn() {
9 | return true;
10 | }
11 |
12 | export const propTraps: ProxyHandler<{
13 | get: (k: string | number | symbol) => any;
14 | has: (k: string | number | symbol) => boolean;
15 | keys: () => string[];
16 | }> = {
17 | get(_, property, receiver) {
18 | if (property === $PROXY) return receiver;
19 | return _.get(property);
20 | },
21 | has(_, property) {
22 | return _.has(property);
23 | },
24 | set: trueFn,
25 | deleteProperty: trueFn,
26 | getOwnPropertyDescriptor(_, property) {
27 | return {
28 | configurable: true,
29 | enumerable: true,
30 | get() {
31 | return _.get(property);
32 | },
33 | set: trueFn,
34 | deleteProperty: trueFn,
35 | };
36 | },
37 | ownKeys(_) {
38 | return _.keys();
39 | },
40 | };
41 |
--------------------------------------------------------------------------------
/packages/props/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/raf/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Solid Primitives Working Group
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/packages/raf/dev/index.tsx:
--------------------------------------------------------------------------------
1 | import { Component, createSignal, Show, createEffect } from "solid-js";
2 |
3 | import RAF from "./raf.js";
4 |
5 | const App: Component = () => {
6 | return (
7 |
8 |
Target FPS Dev Test
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 | );
26 | };
27 |
28 | export default App;
29 |
--------------------------------------------------------------------------------
/packages/raf/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/range/src/common.ts:
--------------------------------------------------------------------------------
1 | import type { MaybeAccessor, MaybeAccessorValue } from "@solid-primitives/utils";
2 | import type { Accessor } from "solid-js";
3 |
4 | export type RangeProps =
5 | | { start?: number; to: number; step?: number }
6 | | [start: MaybeAccessor, to: MaybeAccessor, step?: MaybeAccessor];
7 |
8 | export const { abs, sign, min, ceil, floor } = Math;
9 |
10 | export const accessor = >(a: Accessor) =>
11 | (typeof a() === "function" ? a() : a.bind(void 0)) as Accessor>;
12 |
13 | export const toFunction =
14 | (a: Accessor T)>) =>
15 | (...args: A) => {
16 | const v = a();
17 | return typeof v === "function" ? (v as any)(...args) : v;
18 | };
19 |
--------------------------------------------------------------------------------
/packages/range/src/index.ts:
--------------------------------------------------------------------------------
1 | export { type RangeProps } from "./common.js";
2 | export * from "./repeat.js";
3 | export * from "./mapRange.js";
4 | export * from "./indexRange.js";
5 |
--------------------------------------------------------------------------------
/packages/range/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "composite": true,
5 | "outDir": "dist",
6 | "rootDir": "src"
7 | },
8 | "references": [
9 | {
10 | "path": "../utils"
11 | }
12 | ],
13 | "include": [
14 | "src"
15 | ]
16 | }
--------------------------------------------------------------------------------
/packages/refs/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Solid Primitives Working Group
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/packages/refs/dev/index.tsx:
--------------------------------------------------------------------------------
1 | import { Rerun } from "../../keyed/src/index.js";
2 | import { Component, createSignal } from "solid-js";
3 | import { Transition } from "solid-transition-group";
4 |
5 | const App: Component = () => {
6 | const [count, setCount] = createSignal(0);
7 |
8 | return (
9 | <>
10 |
11 | {
13 | el.animate([{ opacity: 0 }, { opacity: 1 }], {
14 | duration: 600,
15 | }).finished.then(done);
16 | }}
17 | onExit={(el, done) => {
18 | el.animate([{ opacity: 1 }, { opacity: 0 }], {
19 | duration: 600,
20 | }).finished.then(done);
21 | }}
22 | mode="outin"
23 | >
24 |
25 |
28 |
29 |
30 |
31 | >
32 | );
33 | };
34 | export default App;
35 |
--------------------------------------------------------------------------------
/packages/refs/test/mergeRefs.test.tsx:
--------------------------------------------------------------------------------
1 | import { describe, test, expect } from "vitest";
2 | import { createRoot, onMount } from "solid-js";
3 | import { mergeRefs, RefProps } from "../src/index.js";
4 |
5 | describe("mergeRefs", () => {
6 | test("passes ref to props and local var", () =>
7 | createRoot(dispose => {
8 | let local!: HTMLButtonElement;
9 | let forwared!: HTMLButtonElement;
10 |
11 | const Button = (props: RefProps) => {
12 | return